Weekly

News about Lean, the theorem prover and programming language.

Lean core

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

Lean core

Marc Huisinga merges an extensible auto-formatter into Lean

The formatter supports all stable core syntax, deliberately departs from common Lean style in places, and works only through the language server (for example, 'Format Document' in VS Code). Its rules are unstable, and Marc Huisinga recommends it mainly for new code pending Lake integration; diffs from formatting core, Mathlib, Cslib and Physlib are available.

Image: diffshub.com

Checked against: leanprover.zulipchat.comdiffshub.com

Lean core

Joachim Breitner removes large elimination for recursive Prop inductives from Lean's kernel

The merged pull request, part of the Lean Kernel Renovation, restricts recursors such as Acc.rec to motives in Prop, while Eq and And keep large elimination. The goal is a kernel that never has to look at a proof term, which would let tools like external checkers drop proof subterms after typechecking.

Checked against: lean4#13851

Lean core

Henrik Böving adds epr tactic for EPR, a first-order logic fragment

Merged into Lean as #16468, the tactic uses a BitVec encoding combined with bv_decide and performs about level with Z3 on the TPTP EPR benchmark set. On verification conditions from Veil, a protocol verifier, it solves 769 (97%) of the 792 that lie fully within EPR and 1,082 (71%) of all 1,512.

Checked against: lean4#16468

Lean core

Leo de Moura makes equation lemmas keep haves instead of inlining them

Keeping them avoids duplicating their values and preserves the join points that do notation introduces, which vcgen +jp needs to produce 2 verification conditions instead of 2ⁿ⁺¹ for n sequential ifs. Sebastian Graf added @[vcgen_rintro], an attribute that tells vcgen how to destructure a binder while it introduces the binders of a goal.

Checked against: lean4#16208lean4#16235lean4#16291

Lean core

Julia Himmel reimplements Lean's IO.Process.spawn using libuv

The merged pull request fixes a number of bugs on all platforms and makes spawning much faster in processes that use a lot of memory. In a breaking change, spawn now throws an error if the command cannot be started; previously, on POSIX platforms, spawn succeeded and the child exited with code 255.

Checked against: lean4#16418

Lean core

Lean's CI now builds and tests Lean Beam on every Linux run

Lean Beam (leanprover/lean-beam) lets AI agents try commands and tactics in a file's context without changing its source. Sebastian Ullrich's pull request #16447 makes PRs that break Lean Beam's build or tests fail before reaching a nightly, and unstamped PR toolchains now bundle it like releases do.

Checked against: leanprover/lean-beamlean4#16447

Lean core

Naoya Yamashita releases leanfran, connecting Lean with Rust, Python, TypeScript and Clojure

The tool compiles Lean functions to those languages, with proofs checked by Lean during generation and erased from the executable code; in reverse, it translates supported host-language functions to Lean for checking against Lean specifications. Its backends are tested against Lean's native C backend but have not been proved correct in Lean.

LeanとRust・Python・TypeScript・Clojureを双方向につなぐleanfranを作った
Image: s.conao3.com

Checked against: conao3/lean-leanfrans.conao3.comleanprover.zulipchat.com

Lean core

Naoya Yamashita's leanassay checks whether Lean theorems pin down implementations

Its #assay f command breaks f in many small ways and reports broken versions that satisfy every theorem about f but change what f returns on an input meeting a theorem's hypotheses. The Apache-2.0 package for Lean 4.35.0 does not need the proofs, so it also works on theorems that are still sorry.

Checked against: conao3/lean-leanassay

Lean core

Lean 4 repository has 10,056 GitHub stars

The leanprover/lean4 repository, home of the Lean 4 programming language and theorem prover, has 10,056 stars on GitHub. The repository was created in April 2018, and GitHub lists its language as Lean.

Checked against: leanprover/lean4

Lean core

Mac Malone lets Lake packages declare their own cache services

Services are specified in a cache_service TOML table or Lean DSL declaration and can be used via lake cache get --service. A new downloadCacheService package option sets the service Lake uses by default for lake cache get of the package and, when the artifact cache is enabled, for on-demand downloads during builds.

Checked against: lean4#16302lean4#16351

Lean core

Sebastian Ullrich speeds up deriving Repr, BEq, and Hashable on mutual blocks

Lean now derives these classes once per mutual block, generating the auxiliary functions once for the whole block instead of once per type. This removes quadratic elaboration cost: deriving Repr on every type of a 76-type mutual block went from 309 seconds and 10.2 GB to 62 seconds and 1.3 GB.

Checked against: lean4#16339

Lean core

Lean v4.36.0 released with type class resolution caching across commands

The cross-command cache cuts type class resolution time on the standard library build by about 14% (Mathlib gains 0.2% overall). Other changes fix many grind bugs and several quadratic slowdowns (on a file with 4,000 definition/theorem pairs, elaboration time drops from 99 s to 32 s), and let def contracts state exception postconditions.

Checked against: v4.36.0 release noteslean4 v4.36.0

Lean core

Sebastian Graf lets Lean's vcgen tactic discharge frame conditions with frameproc theorems

The vcgen tactic now discharges the frame condition of each framed call with a theorem named by a @[frameproc], for example one for a separation logic, so the frame condition no longer becomes a verification condition. Sebastian Graf also added the @[vcgen_simp] attribute, which collects Sym.simp theorems for vcgen.

Checked against: lean4#16093lean4#15955

Lean core

Harsh Gupta's Lean 4 submission ranks first in the $12 server challenge

Harsh Gupta announced on X that the ranking is now official, with the submission serving more users than Rust, C, or handwritten assembly. The post credits the challenge's creator with explaining how Lean 4 lets developers create software more optimized than handwritten C.

Image: x.com/hargup13

Checked against: @hargup13 on X

Lean core

Leo de Moura speeds up kernel checking of lia and grind proofs

Lean's lia (cutsat) now shares proofs across grind case splits, for up to 2.8x faster elaboration and up to 200x faster kernel checking on goals with many case splits. Kernel-friendly certificates for lia, grind's ring solver, simp +arith and grind linarith followed; the ring certificates cut kernel instructions by 51.5% across 40 benchmark files.

Checked against: lean4#15905lean4#15911lean4#15943lean4#15981lean4#15983

Lean core

Sebastian Graf merged vcgen +jp, which verifies code after a split once

Without +jp, vcgen copies the code after an if or a match into every branch, so the number of copies doubles with each consecutive split. With +jp, VC generation grows linearly with the number of splits, and the shared code is verified under a hypothesis stating what each branch knows at its end.

Checked against: lean4#14398

Lean core

Leo de Moura makes grind failure messages short by default

Pull request #15906 made diagnostics opt-in via +verbose, so failures showed only the remaining goal and a hint; collecting and printing diagnostics took about 38% of the time spent on easy failing lia goals. Pull request #16073 shortened the failure message further, naming the invoked tactic, such as lia, without printing the goal.

Checked against: lean4#15906lean4#16073

Lean core

Mac Malone opens Lake pull request to reduce build-store contention

The pending change (#15805) has Lake first fetch transitive artifacts from a single build-store snapshot, falling back to the real build store only when an artifact is missing. Mac Malone also opened #16083 to benchmark Lake's module setup computation, which experiments show is a significant scalability chokepoint in projects with thousands of modules.

Checked against: lean4#15805lean4#16083

Lean core

cedar-policy publishes lean-parser-generator, which generates validated LR(1) parsers in Lean

The tool turns an LR(1) grammar in a .lig file into a compiled Lean parser, plus certificates that Lean checks to prove the parser agrees with a generated dependent specification. It follows the a-posteriori validation architecture also used by Menhir's verified back end, so the automaton construction and code generator need not be trusted.

Checked against: cedar-policy/lean-parser-generator

Lean core

Joachim Breitner releases con-agua, a Lean checker with verified x86 assembly

Written by AI under Joachim Breitner's supervision, con-agua is an x86 assembly port of the external Lean checker con-leche and requires the Kraken x86 semantics to be correct in place of the Lean compiler and runtime. A 5MB assembly file and a 200-line main.c, plus one data file, are all it needs.

Checked against: leanprover/con-agualeanprover.zulipchat.com

Lean core

Leo de Moura adds three lia changes that avoid large case splits

The pull requests, merged October 20 and 21, add dynamic variable reordering before large Cooper splits (case splits with as many cases as a variable's coefficient), exact elimination of equations without unit coefficients, and divisibility normalization. Chains of such equations from / and % definitions no longer yield Cooper splits with thousands of cases.

Checked against: lean4#15835lean4#15838lean4#15827

More news