Yes, 17M lines of Lean is a lot micjm.com · 171 points · 209 comments · HN threa...

@best30

Yes, 17M lines of Lean is a lot micjm.com · 171 points · 209 comments · HN thread

TL;DR The article checks how big 17 million lines of Lean is by comparing it with two collections of Lean proofs. Human-written famous theorems in Mathlib top out far below 17M lines, while AI-generated Lean projects on Reservoir reach 27M to 88M lines, so the Riemann proof is large but not unique in size. The comments mostly discuss why LLM output is verbose and hard to read, with a substantial side debate on whether an unreadable machine-checked proof counts as understanding.

  • Mathlib's 259 famous theorems with Lean code are all human-written and nowhere near 17M lines.
  • Reservoir indexes 938 Lean packages on GitHub; several exceed 16M lines, mostly AI-generated.
  • Largest examples: CFSG at 88M (AI-built, work in progress), LeanBridge at 36M (about 98% script-generated), and an AI-built Fermat's Last Theorem proof at 27M lines versus about 60k for the human FLT project.
  • The article notes log-scale charts make 17M look closer to 1M than it is, and concludes that 17M lines is indeed a lot.
  • Commenters later reported the Riemann repository's line count changing (down to 13M, then up to 18.8M) after refactoring and import changes.

Discussion The thread spreads well beyond the article's line counts. The biggest cluster asks why LLMs write verbose, context-poor prose and code, with commenters blaming training rewards, missing theory of mind, and the curse of knowledge. A second strand asks whether a 17M-line proof that no human can read is meaningful, since Lean's kernel checks it but understanding is missing. Many comments are joking or skeptical about AI hype and labor displacement, and a few share practical tools and repository links. The mood is curious and mixed, with more skepticism than enthusiasm about the proof's usefulness.

  • LLMs lack a model of what the reader knows (many): Commenters say models give trivial and novel points equal weight and refer to undefined terms from earlier in the context. Several say the fix is to tell the model the audience, or to use a blind reviewer agent to flag unclear terms.
  • Verbosity comes from training rewards and evaluation (some): Some argue reinforcement training and scripted evals reward long output, and that models are trained to write for other LLMs rather than people. Others counter that cost, not profit, makes verbose output unattractive to providers.
  • Lean's kernel makes the proof trustworthy despite size (some): Several commenters say the proof is valid because the Lean kernel checks every step and multiple independent checkers agree. The size problem is about human understanding, not correctness.
  • A proof nobody understands is not real understanding (some): Skeptics argue that math exists to explain why something is true, and a 17M-line proof gives verification without insight. Others reply that a valid proof is still valuable and may yield new techniques.
  • Length reflects the lack of refactoring, not difficulty (some): Commenters note the proof contains dead code, repeated reproofs and inlined Mathlib results, so its size may shrink with refactoring. Wiles' 129-page FLT proof is cited as a comparison point, with caveats that line counts measure little.
  • AI labor displacement framing is villainous (a few): A minority argues AI companies have promised to replace mathematicians and other workers, and that hiring experts would be the better outcome. Others push back that AI is meant to be a power tool.

Links from the comments

#Lean #LLMs #formalVerification #riemannHypothesis #mathlib #aiWriting