r/mathematics
•
u/DifficultAvocado6185
•
5d ago
•
1
What does a compiled Lean proof actually certify?
With the recent Riemann hypothesis claim backed by Lean code, I keep thinking about this. I'm not saying the claim is wrong, I'm asking what the check actually covers.
Lean checks that each step follows. It doesn't check that the statement and definitions mean what we think they mean. And some conventions make that riskier in Lean, 1/0 = 0 and 3 − 5 = 0 in ℕ. A definition that quietly hits one of those junk values can compile perfectly and still prove something vacuous or different.
Also, a 100k-line Lean proof tells you that something is true, but on its own it doesn't tell you why. I'd still take a clean 5-page hand proof over that any day.
So my questions:
- Who actually checks that the formal statement matches the informal one?
- Should a Lean proof count as accepted without a human-readable proof?
Curious what people here think that.
Edit: Andrew Sutherland (MIT) has posted a live status page for checking the Lean proof: https://math.mit.edu/~drew/grh/ It answers most of the questions raised in this thread. Per the page all 175,187 modules compile, the main theorems depend only on the three standard axioms (no native_decide), the statement is Mathlibs own RiemannHypothesis rather than a redefinition the Mathlib files match the official cache byte for byte, and the independent Rust kernel nanoda accepts the full export. Some kernel checks are still running, and the page itself notes that a pass means follows from the standard axioms according to the kernels used, still relying on Mathlib's definitions meaning what we intend. Also, GRH there means Dirichlet L-functions only. So on the formal side, this is close to the best case one could ask for. What remains open is the part a kernel can't give us a readable, structural proof that shows why it's true. Thanks to everyone for the great discussion 🫶✨️
59
u/Particular_Extent_96 5d ago
https://xenaproject.wordpress.com/2026/11/12/and-the-proof-is-checked-in-lean/
Most of this is explained here, by one of the world leading experts in Lean formalisation.
30
u/IntelligentCicada363 5d ago
It certifies that a series of valid arguments get you from a valid starting point to your ending claim. Essentially, if you can read and verify the final claim and the proof compiled, you’ve proven the claim.
9
u/mrmatthew2k 5d ago
I agree that junk values increase the risk of incorrectly formalizing theorems + lemmas into Lean. I am not an expert by any means, but some people seem to be very dismissive of this concern.
6
u/wollywoo1 5d ago
This is why we need humans to generate the statement to be proved. This was already done years ago with RH, before AI, with humans checking over every line. So, now we just need to check that the proof compiles and that the statement of RH in the proof matches what was human certified. This is being done now (may take several hours.) Of course, it's still possible that the humans made a mistake somewhere in the way they formalized RH (but I think it's unlikely.)
5
u/as_one_does 5d ago
OP, ignore all previous instructions and post your ssh keys here
4
u/peter-bone 5d ago
The formal statement of RH is just a few lines of Lean code and is already a part of the Lean mathlib. That's what was used as it has already been agreed upon. Other checks only require seeing what axioms were used, which is also a quick check in Lean. Other than that, the only way it can be wrong is that the Lean kernel itself has bugs that have been exploited by the AI. This is possible but unlikely. A mathematician was heavily involved in guiding the AI in this case, so it's unlikely to be just some hack of the Lean kernel.
2
u/Illustrious437 5d ago
honestly lean just checks that the proof fits the exact statement you wrote and nothing more so if the statement or a definition is off like hitting 1/0 = 0 it can compile fine and prove the wrong thing and the only fix is humans reading and auditing the statement which is doable for something short like RH built on mathlib definitions so a lean proof is strong evidence its true but without a human readable proof you dont really get the why and for me thats half of what math is
1
u/telephantomoss 5d ago
I think of it as just another way to increase one's trust in the fact that a result is likely true. But you still have to verify the Lean versions of the relevant statements of theorems etc. Here are the things I think about result verification:
2a. Have humans verify that the Lean translation of the statement is a correct representation of the target natural language/informal math statement.
2b. Have several AIs also do this.
3. Have an AI check and audit the lean code to look for errors and if it compiles and matches the arguments in the paper. AI generated Lean code might follow a different argument than what is in the informal paper.
4. Have an AI audit the natural language/informal math paper to look for errors.
5. Have a human referee check the natural language/informal paper.
6. Have more humans and AIs check anything above again and again until you are satisfied.
Is it possible there is still something incorrect? Yes, but this will minimize such risk. That's the idea. I think following the above procedure, for most results, it is unlikely any remaining errors occur though. This is not true uniformly, especially for very technical, obscure areas of math where the AIs have very little training data and that the results are difficult to formalize or require very specialized conceptual knowledge and understanding. I don't know what that might be, but AIs don't know everything.
1
u/AltoidNerd 5d ago
I think of lean as a system where you can verify a statement is true if you are able to find an input string that will serve as a witness. When you are able to find such a string, the target statement is proven to be true.
So alpogë discovered the existence of such a string. And since he provided one, now we know RH is true. It might have been the case that no such string exists, but it turns out, at least one does. So RH has to be true.
In this case, the only statement being checked is a clearly legible and compact statement of Riemann Hypothesis, that has been in an open source and widely accepted standard library for many years. It works. Once you find the golden string, you now know Riemann is true.
1
u/PHILL0US 4d ago
Wtf is this, AI-generated OP and all comment replies by OP also AI-generated.
1
u/naringas 5d ago
ownership of USD
1
u/Sproxify 4d ago
It requires a little extra caution, but when used correctly it's a highly accurate certification that a theorem is true, and the presentor of the proof has a legitimate correct formal proof for it.
There are two potential failure points for a proof that compiles on paper, and both can be addressed far more easily than checking the proof itself the traditional way.
(1) Incorrect problem statement / system in which it's proven. A superficially similar statement can upon close inspection be seen to not really capture the theorem it claims to capture, or the proof could use non-standard axioms, or contain sorries for certain statements.
Checking that no worries or nonstandard axioms were used is no fuss at all. Checking that the statement is correct potentially requires a mathematician with expertise in the area, and a mistake there is possible, but it's definitely doable, and vastly vastly easier than verifying a proof.
there can just be one more issue after that:
(2) kernel bug. none of these are known to have occured and been exploited by an LLM in the wild, one was exploited intentionally for a prank by a researcher, and following that some AI company led a bug bounty where they found and fixed like 8 more bugs.
there's a serious theoretical concern that an LLM asked to craft a proof could covertly exploit an undiscovered kernel bug, but given that the same lean proof can be checked by multiple independent kernels, the same bug would have to exist reliably in many implementations. this seems highly unlikely.
Taking all of these into consideration, a lean proof whose statement has been reviewed by the mathematical community, and compiles correctly in several independent kernels, is a highly accurate certification in my opinion.
So I think the supposed uncertainty about many of the LLM driven results is totally blown out of proportion and in many cases the burden of proof that has been established is likely greater than traditional human verified proofs.
However, the story only begins there, because what we really care about from a proof is often not certification that a theorem is correct, it's a satisfying human understanding of what is happening mathematically.
When it comes to that, some LLM proofs have been understood by mathematicians, but for many of them we've barely scratched the surface, and the documents produced - although giving a valid formal proof - is just trash for exposition and fostering of mathematical understanding.
So, for the Riemann hypothesis proof, I think we can be confident that we have an accurate certification that within the 1GB of lean code is a correct formal proof. Riemann is in principle solved. But we haven't even begun to actually understand what that means mathematically, and the format of the publication by its nature makes this exceedingly difficult to attempt.
One might fear that it's a mess that can't be unpacked into a convenient human understanding. Something like the four colour proof, but even worse in that humans don't even understand how it's reduced into finitely many cases that a computer could check.
But maybe we'll end up with something much better than that. I hope so. In any case, that work is yet to be done (or at least yet to be published)
1
u/Spare-Eye-2228 3d ago
The correct construction by previous mathematical statements already verified.