A 17-Million-Line Lean Proof Is Far Beyond Anything Humans Have Written
Yes, 17M lines of Lean is a lot
A Riemann hypothesis proof reportedly spans 17 million lines of Lean. To see whether that's really huge, the author charted 259 famous theorems in Mathlib, which mostly fall between 100k and 1.2m lines, and all 938 Lean packages on Reservoir, whose median is about 4k lines. Only three packages exceed 17m, and two of those are AI-generated or script-generated. So yes, it's a lot.
Its README says "the Lean sources were produced by AI agents building on human-written open-source Lean", including the human FLT project led by Kevin Buzzard, which is about 60k lines and still in progress. The AI version is roughly 450 times longer.
- dmos62
What are peoples' takes on why LLMs struggle to write things in a human-readable way? I've watched Astra and the like write PR descriptions that are middle-school level: as if it struggles to distinguish what it knows (having read the code, having done the debugging) and what someone who hasn't read the code and hasn't participated in the debugging (his target audience) knows. It'll make references to parts of the solution, or of the problem being solved, without contextualizing it, making the references useless, serving only to add confusion to the text.
Terence Tao's take was that LLMs don't understand what is trivial (in a proof, for example) and what is interesting and novel: it gives everything equal weight, or, in Tao's paraphrased words, the LLM will talk at length about something trivial and then write only a single sentence about something novel.
I wonder what peoples' intuition about this is.
- _flag
There seem to be a lot comments in this thread about how the amount of lines of code is indicative of the proof's incomprehensibility, or suggesting that codegolfing would help make it easier to understand. This is a misunderstanding.
Lean is roughly analogous to compiled math. Just like your complier might turn a few simple statements in a high-level language into thousands of assembly instructions, the process of formalising a natural language mathematical proof can turn sentences into thousands of lines of code. One does not try to understand this code, but instead tries to understand the argument using mathematical language and higher-level abstractions that are specifically designed for this purpose. And such "decompilations" of the Lean are currently being written by mathematicians, and already provide significant understanding to experts who understand the language (eg. [1]).
- betterunix2
Yes, but the more important question is this: can we understand Lean itself, and if so does it matter how well we understand the GRH proof that Lean verifies?
Most mathematicians cannot claim they understand every proof of every theorem they rely on in their own work as it is, and there is a lot of value in knowing that GRH actually is true (this is assumed in many proofs across several different fields of math).
- adgjlsfhk1
It's down to 13m https://rh-shrink.github.io/. Decent chance it hits 11m by tomorrow
- lukaslalinsky
When I read about the proof over the weekend, I had a strange feeling afterwards. Having LLM write millions and millions line of any code feels... alien. No human is ever going to review that. It's easy to hide secondary information in that amount of text. I could imagine many sci-fi scenarios how things could go bad, if this was executable code, not a proof.
- FinnLobsien
There's a short story by Ted Chiang called "The Evolution of Human Science" (originally published as "Catching Crumbs From the Table" where superintelligent machines have taken over scientific research. Their research is so complex no human could understand it.
So in the story, human scientists relegated to interpreting metahuman science.
It sounds like we're in the early stages of something similar, where AI creates fundamentally different results from human approaches that are for us to interpret. I can't imagine what happens when AIs discover research problems that other AIs then solve.
- laser
If you were to print it out it’s hundreds of thousands of pages or hundreds of thick textbooks. If Masullo’s proof works the fact it’s hundreds of times less verbose will really capture the current state of affairs more generally with these models. They can get the job done but have yet to fully understand elegance.
- chorsestudios
Does the raw count of lean code lines shed any light on how impressive Andrew Wiles' proof of Fermat's Last Theorem was? The proof itself was 129 pages but I'm not sure how much perspective that alone provides regarding the difficulty of the problem.
- Arch485
I read somewhere (I believe on HN) that one of the reasons the GRH proof is so long, is because the LLM had to convert several existing proofs into Lean because the Lean code for them did not exist yet.
Assuming that is true, is it then possible that this proof does not exploit a bug in Lean (many people are saying it may), but one of the "sub-proofs" that the GRH proof relies on is incorrect, leading to an overall incorrect result?
- looneysquash
I don't know Lean. But one trick to make anything smaller is to find a way to not count some of it.
Usually that means extracting some pieces of it into libraries. I would think for proofs, that would mean replacing parts of it with references to existing proofs.
I see people saying this result is useless because no one can understand it.
But there's a lot of humans interested in this. They'll end up refactoring it into something manageable.
Maybe no one human will understand all of it. But maybe humans will understand the high level. And different humans will collectively understand all of the subproofs.