{"slug": "yes-17m-lines-of-lean-is-a-lot", "title": "Yes, 17m lines of Lean is a lot", "summary": "A 17-million-line Lean proof of the Riemann hypothesis is large but not unprecedented, according to an analysis of Lean packages indexed on Reservoir, the Lean language's package registry. Of the 938 Reservoir packages with Lean code on GitHub, the largest is Qiuzhen-CFSG/CFSG at 88 million lines, an apparently AI-built proof still in progress, followed by CBirkbeck/LeanBridge at 36 million lines — roughly 98% script-generated, with about 500,000 hand-written lines — and Anthropic's anthropics/fermats-last-theorem at 27 million lines, a complete Fermat's Last Theorem proof whose README says its Lean sources were produced by AI agents building on human-written open-source Lean, including Kevin Buzzard's roughly 60,000-line ImperialCollegeLondon/FLT project. By contrast, of the more than 1,000 famous theorems tracked in Mathlib, only 259 have associated Lean proofs, all human-generated and far shorter than 17 million lines.", "body_md": "# Yes, 17m lines of Lean is a lot\n\nThe recent proof of the Riemann hypothesis came with a statistic attached: the proof is 17 million lines of Lean. Beyond the philosophical questions of what it means to have a proof longer than any human could comprehend, I’m left with a simpler question: is that as large as it sounds?\n\nTo investigate, I hunted for collections of Lean proofs online. I found two and charted the lengths of their proofs.\n\n(All charts have a log x axis, which makes 17m lines look a lot closer to 1m and 100k than it really is.)\n\n## Famous theorems in Mathlib\n\nMathlib maintains a collection of famous proofs. There are over 1k but only 259 have Lean associated, which I chart here.\n\nThese are all human generated, and as we can see, they come nowhere close to 17m.\n\n## Every Lean package on Reservoir\n\n[Reservoir](https://reservoir.lean-lang.org) indexes every published Lean package, 938 of which have Lean code on GitHub. This one has a lot more data, including AI assisted proofs. We even have a few that are over 16m!:\n\n1. **88m: [Qiuzhen-CFSG/CFSG](https://github.com/Qiuzhen-CFSG/CFSG)** this appears to be an AI built proof that is still a work in progress.\n2. **36m: [CBirkbeck/LeanBridge](https://github.com/CBirkbeck/LeanBridge)** , a project linking the[LMFDB](https://www.lmfdb.org) database of number theory objects to Mathlib. This isn’t really a proof: about 98% of its Lean is files generated by scripts that check the database’s numbers one by one. The hand-written part is closer to 500k lines.\n3. **27m: [anthropics/fermats-last-theorem](https://github.com/anthropics/fermats-last-theorem)** is another Anthropic special: a complete proof of Fermat’s Last Theorem, published on GitHub in September. Its README says “the Lean sources were produced by AI agents building on human-written open-source Lean”, including the[human FLT project](https://github.com/ImperialCollegeLondon/FLT) led by Kevin Buzzard, which is about 60k lines and still in progress. The AI version is roughly 450 times longer.\n\nSo yes, 17m lines is a lot.", "url": "https://wpnews.pro/news/yes-17m-lines-of-lean-is-a-lot", "canonical_source": "https://micjm.com/blog/yes-17m-lines-of-lean-is-a-lot/", "published_at": "2026-11-23 04:57:01+00:00", "updated_at": "2026-11-23 05:11:30.702880+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-research", "machine-learning"], "entities": ["Lean", "Mathlib", "Reservoir", "Qiuzhen-CFSG/CFSG", "CBirkbeck/LeanBridge", "Anthropic", "anthropics/fermats-last-theorem", "Kevin Buzzard"], "also_reported_by": [], "takeaway": "Among 938 Reservoir Lean packages with GitHub code, the largest proofs run to 88 million lines (Qiuzhen-CFSG/CFSG) and 27 million lines (Anthropic's Fermat's Last Theorem proof, about 450 times the roughly 60,000-line human FLT project), while only 259 of Mathlib's 1,000-plus famous theorems have Le", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/yes-17m-lines-of-lean-is-a-lot", "markdown": "https://wpnews.pro/news/yes-17m-lines-of-lean-is-a-lot.md", "text": "https://wpnews.pro/news/yes-17m-lines-of-lean-is-a-lot.txt", "jsonld": "https://wpnews.pro/news/yes-17m-lines-of-lean-is-a-lot.jsonld"}}