NewsCrawler.org

Is 17m lines of Lean a lot? Comparison with other Lean proofs

Histogram of 259 famous theorems in Mathlib by the Lean lines they depend on: nearly all fall between 100k and 1.2m lines, below the 2.4m lines of all of Mathlib and far below the claimed Riemann proof at 17m
Histogram of 938 Lean packages on Reservoir by estimated lines: the median package is about 4k lines, all of Mathlib is 2.4m, and only three packages (88m, 36m and 27m) are larger than the claimed Riemann proof at 17m
Image: micjm.com

The recent proof of the Riemann hypothesis came with a statistic: 17m lines of Lean. To check how large that is, the author collected two sets of Lean proofs and charted their lengths on a log scale, which makes 17m lines look closer to 1m and 100k than it really is.

Mathlib[1] keeps a collection of famous theorems. Of its over 1k entries, 259 have Lean code, all are human-written, and none come close to 17m lines. Reservoir[2] indexes every published Lean package. 938 of them have Lean code on GitHub, this set includes AI-assisted proofs, and a few are over 16m lines.

The largest ones are an 88m-line AI-built proof of CFSG that is still a work in progress, and LeanBridge at 36m lines, which links the LMFDB[3] database to Mathlib. About 98% of LeanBridge is generated by scripts, and its hand-written part is about 500k lines. The third is a complete proof of Fermat's Last Theorem at 27m lines in anthropics/fermats-last-theorem. Its README says AI agents built the Lean sources on human-written open source Lean, including Kevin Buzzard's human FLT project of about 60k lines, so the AI version is roughly 450 times longer. The author concludes that 17m lines is a lot.

Repository Lean github.com

Stars: 22,665Forks: 5,443License: Apache-2.0Updated:

Read the original micjm.comDiscussion

Discussion

Commenters say the line count alone says little about difficulty, for example Andrew Wiles' Fermat proof was 129 pages, and one notes Anthropic said it wrote 13m lines while this count shows 27m. One comment claims the Riemann proof is down to 13m lines. Others ask why a Lean proof is accepted as fact at all, and one suggests using AI to find shared structure across the 17m lines.

Sources

Published: First seen: Читать по-русски

Open as a page