Weekly

News about Lean, the theorem prover and programming language.

Lean core, page 4

Lean releases, the compiler, tactics, Lake, Verso, libraries, kernels, and checkers. 170 items, newest first.

Lean core

Sebastian Graf adds frame inference and contract syntax to Lean's vcgen

Merged pull requests extend vcgen, described as a verification condition generator over the Std.Internal.Do metatheory, with automatic frame inference and with loop invariants and def contracts (require and ensures clauses) that vcgen discharges automatically. A showcase repository collects imperative Lean programs verified with one 'vcgen ... with finish'.

Checked against: lean4#14389lean4#14195sgraf812/vcgen-showcaseleanprover/lean4

Lean core

Leo de Moura adds grind hom attributes to replace ToInt typeclasses

Leo de Moura merged pull requests adding a [grind homo] attribute, since renamed [grind hom] and [grind hom_pred], and migrated the standard library to them. The new approach will replace the ToInt typeclasses used in grind. Andres Erbsen has already successfully tried and prototyped it.

Checked against: lean4#14446lean4#14468

Lean core

Leo de Moura merges grind discharger support for Sym.simp and three fixes

Leo de Moura merged pull requests letting grind discharge hypotheses in conditional Sym.simp theorems, preventing grind timeouts on definitional equality checks for match-expression conditions, fixing a canonicalizer bug that made grind miss valid contradictions, and fixing grind dropping E-matching theorems from custom grind attributes.

Checked against: lean4#14425lean4#14444lean4#14439lean4#14426

Lean core

lean4web enables deflate compression for large websocket messages

A merged pull request by Jason (@jcreedcmu) enables per-message deflate compression for messages larger than 16MB in the websocket server behind lean4web, aiming to improve responsiveness of live.lean-lang.org. Full completions with Mathlib imported produce 20-40MB jsonrpc responses, which compress by a factor of 8-9x.

Checked against: lean4web#133

Lean core

Lean v4.32.0 makes the new do elaborator the default

Lean v4.32.0 adds the do← marker for effect forwarding and cuts import Mathlib time by about 10% through a DiscrTree insertion fix. Lake's linting framework gains option-based control and module linters, and an experimental incremental-compilation mode lands behind CLI flags.

Checked against: v4.32.0 release noteslean4 v4.32.0

Lean core

Sebastian Ullrich merges editor whitespace fix and deterministic kernel recursion limit

Lean now reuses tactic results when only whitespace after a tactic changes, so progress is kept when preparing to type the next tactic. The kernel's deep recursion error is now bounded by the maxRecDepth option instead of the physical stack size, which is a breaking change that may require explicit maxRecDepth bumps.

Checked against: lean4#13956lean4#11958

Lean core

Paul Reichert fixes slowdown caused by Lean's stricter transparency default

A merged Lean pull request by Paul Reichert makes whnfMatcher use the WHNF cache at sub-default transparency. It fixes a performance regression from #13895, merged on 2026-07-06, which enabled backward.isDefEq.respectTransparency.types by default as a breaking change that gives users more control over what is unfolded.

Checked against: lean4#14323lean4#13895

Lean core

Kim Morrison releases first packages of Hex, a computational algebra library

The first Hex packages provide dense matrices, row reduction, Gram-Schmidt, and a verified implementation of the LLL lattice basis reduction algorithm, plus a version that delegates computation to the C library fplll while verifying a certificate. Specifications are written first, then AIs implement code and proofs, and a blog post runs the Coppersmith attack on RSA.

Checked against: kim-em.github.iokim-em/hex

Lean core

Kim Morrison releases sos, a sum-of-squares tactic for Lean

The sos tactic is a sum-of-squares decision procedure for nonlinear real arithmetic, closely following John Harrison's HOL Light implementation. It calls the CSDP semidefinite programming library and rebuilds a fully certified result in Lean. Kim Morrison calls it a prototype and notes that frontier models have become very good at Lean metaprogramming.

Checked against: kim-em.github.ioLinkedIn post

Lean core

Joachim Breitner adds automatic try? suggestions to Lean at common proof sites

A merged pull request by Joachim Breitner makes Lean suggest try? output for empty by blocks, unsolved goals, and sorry tactics, gated by three options that default to off. It replaces the tactic.tryOnEmptyBy option from an earlier pull request with a different implementation.

Checked against: lean4#13830

Lean core

Wojciech Różowski opens Lean pull requests for stateful linters and unusedVariables hint

A now-closed pull request adds stateful linters: command linters that thread state from one command to the next, so a linter can accumulate information across a file. A merged pull request adds a hint to the unusedVariables linter, suggesting to rename the unreferenced name with an underscore.

Checked against: lean4#14225lean4#14259

Lean core

Sebastian Graf renames mvcgen' to vcgen and adds frame support

Sebastian Graf merged pull requests renaming the experimental Sym-based mvcgen' tactic to vcgen, speeding up its matching, and adding a frames clause. A new @[frameproc] attribute lets a program type register how it frames a resource, so cost budgets, separation-logic footprints, and trace invariants frame through the same mechanism.

Checked against: lean4#14195lean4#14146lean4#14167lean4#14134

Lean core

Lean 4 moves deferred docstring checks onto the linter framework

A merged pull request by David Thrane Christiansen adapts Lean's deferred docstring check mechanism to use the linter mechanism, replacing custom CI setup with an interface akin to environment linters and governed by the option linter.doc.deferred. In a breaking change, custom Verso docstring elements now use a two-constructor type.

Checked against: lean4#14206

Lean core

Sebastian Graf ports mvcgen' to Std.Internal.Do and extends it to embedded languages

Sebastian Graf merged a port of the experimental mvcgen' tactic to the new Std.Internal.Do meta theory, where loop invariants no longer restate the exceptional postcondition. A follow-up extracts a WP type class from WPMonad, enabling verification of deeply embedded languages, tested on an IMP language whose WP instance has no accompanying WPMonad.

Checked against: lean4#14080lean4#14015

Lean core

Sebastian Ullrich speeds up Lean's test suite with shared header snapshots

A merged pull request lets about 389 elab tests that use import Lean reuse one pre-built snapshot, cutting CPU time by 26.0% (2222 s to 1645 s), with CI test wall-clock speedups of about 10-40% depending on platform. Related pull requests speed up .olean and snapshot serialization, one cutting snapshot save time by about 28%.

Checked against: lean4#14077lean4#14109lean4#14122

Lean core

Henrik Böving adds cost metrics for grind's e-matching graph

A merged Lean pull request by Henrik Böving adds optional diagnostics, enabled via grind.ematch.diagnostics, that flag instances with many direct follow-up children and instances that participated in a large, transitive closure of follow-up instances. The metric is based on the cost heuristic of smt-scope, and thresholds are configurable.

Checked against: lean4#14118

Lean core

Henrik Böving makes Lean's get_task_state_core thread safe

A merged pull request by Henrik Böving changes the m_imp field of lean_task to an atomic. get_task_state_core read m_imp to check whether a task had finished before taking the mutex, so that memory access was undefined behavior (UB).

Checked against: lean4#14108

More news