The recent proof of the Riemann hypothesis came with a striking statistic: it is 17 million lines of Lean. Beyond the philosophical questions raised by a proof longer than any human could comprehend, a simpler question remains: is that as large as it sounds? To find out, the author gathered collections of Lean proofs online and charted their lengths. All charts use a log x-axis, which makes 17 million lines look much closer to one million and 100,000 than it really is.
The first collection comes from Mathlib, which maintains a list of famous proofs. There are over 1,000 entries, but only 259 have Lean associated with them. These are all human-generated, and none come close to 17 million lines.
The second source is Reservoir, which indexes every published Lean package. Of these, 938 have Lean code on GitHub, and this dataset includes AI-assisted proofs. A few are over 16 million lines. The largest, at 88 million lines, appears to be an AI-built proof still in progress. Another, at 36 million lines, links the LMFDB database to Mathlib, but about 98% of it is generated by scripts checking database numbers one by one, leaving a hand-written portion closer to 500,000 lines.
The most notable example is a complete proof of Fermat's Last Theorem, published on GitHub in September, at 27 million lines. Its README states the Lean sources were produced by AI agents building on human-written open-source Lean, including the human-led FLT project, which is about 60,000 lines and still in progress. The AI version is roughly 450 times longer. So yes, 17 million lines is a lot.
Source: Hacker News · Summarized by HeadlinesBriefing