Is 17m lines of Lean a lot? Comparison with other Lean proofs
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
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.
Links from the post and discussion
- Link from a comment claiming the proof is down to 13m lines rh-shrink.github.io
Sources
-
micjm.com
Yes, 17M lines of Lean is a lot
-
KRGeekNews KO
그렇다, Lean 코드 1,700만 줄은 정말 많다




