Hawker News

What mathematicians should know about the Lean Theorem Prover: reliability & AI

terrytao.wordpress.com

115 pointsby matt_d22 comments

chr15m[10 comments hidden]
Will we ever see a soundness bug in the lean kernel again?

To a software developer the question seems insane. There were bugs in the past, of course there will be more.

When we see those bugs, what will it mean for AI lean proofs? Can we trust them?

This whole thing boils down to trust.

We can trust human verifications highly because of community and reputation and human proof-of-work. Humans sometimes lie about math results but it's rare because of this. They make mistakes and those mistakes are discovered by communities who are themselves largely trustworthy because of this.

LLMs don't care about reputation. They hallucinate and fabricate often. In harnesses they literally try to cheat and bend rules, which is a disaster for knowledge that is encoded in rules. So we have to rely on proof checkers.

The problem is, how trustworthy are proof checkers? Are there bugs? And is the underlying theory itself free of paradoxes and unknowables and mathematical "bugs" that can be exploited? Imagine a human mathematician hell bent on deceiving other mathematicians - would we trust their breakthroughs, even with a verifier?

Because of these properties, the final backstop has to be humans, and rooted in the community and proof-of-work based human trust system. At the moment people are trusting the tools too much.

Prediction: bugs will be found by humans using AI tools that call into question the Navier-Stokes proof.

jhanschoo[3 comments hidden]
> The problem is, how trustworthy are proof checkers? Are there bugs? And is the underlying theory itself free of paradoxes and unknowables and mathematical "bugs" that can be exploited? Imagine a human mathematician hell bent on deceiving other mathematicians - would we trust their breakthroughs, even with a verifier?

---

> Autumn of verified Lean kernels

Have you read this section (and immediately following sections) in the article? It seems that it partly addresses your thoughts. Perhaps you should comment replying to it.

chr15m[2 comments hidden]
> Autumn of verified Lean kernels

Above my pay grade, but it sounds like some kind of super cool self-hosted recursive lean-checker-in-lean.

I notice there are a bunch of caveats in that part of the article. If you were an LLM strongly RL'ed to give humans the result they're asking for, using recursion bugs to satisfy the goal would probably be something you would try.

I'm by no means an expert but I do think the old adage "great claims require great evidence" still applies, and a healthy dose of scepticism and epistemic humility is warranted.

jhanschoo[hidden]
What do you mean by a "recursion bug"? The terminology does not occur in the article so it seems to be a term that means something to you that is not very clear to me.
plesiv[3 comments hidden]
The existence of an undiscovered soundness bug doesn't make everything proven in Lean illicit. The proof would have to exploit the bug. People build houses on sound foundations even though the tectonic situation under them might not be sound.

> Because of these properties, the final backstop has to be humans...

The post has clearly stated that the work on Lean's underlying metatheory is not done, and requires more work. It's not inconceivable that computer formal verification could reach the trustworthiness of math itself.

chr15m[hidden]
> The existence of an undiscovered soundness bug doesn't make everything proven in Lean illicit. The proof would have to exploit the bug.

Yes, correct. The proofs would have to be checked to make sure they don't exploit the bug.

> computer formal verification could reach the trustworthiness of math itself.

Yes, it could. I don't think that is currently the case.

omnicognate[hidden]
> not inconceivable that computer formal verification could reach the trustworthiness of math itself

Not entirely sure what you mean by this, but every interpretation I can think of is AFAIK (I am not a mathematician) indeed inconceivable by Gödel's incompleteness theorem. As the article says the only thing it's mathematically possible for us to get out of formal verification is a proof of consistency relative to (i.e. assuming the soundness of) some other system. As far as formal verification of "math itself" is concerned it's turtles all the way down.

Edit: Oh, do you mean that we could come to trust formal verification as much as we trust (well established) maths generally? That's a different speculation entirely and not an objective or well specicified one. There are plenty of people on this site who already trust a Lean proof more than a traditional one, without understanding either.

carodgers[2 comments hidden]
You might be interested in the con leche project. A subset of the Lean theorem prover which was sufficient to prove the entire contents of Lean mathlib has been proven consistent.
chr15m[hidden]
It seems like very important work and was discussed in the article with some caveats.

Maybe I am being too skeptical about something I don't understand very well, but I'm not completely convinced it means no more kernel bugs will be found.

What does it mean for con leche if further lean kernel bugs are found? What if the bugs affect con leche's correctness itself?

cjfd[hidden]
Sure, we are likely to see soundness bugs in the current lean kernel again. And in other proof assistants too. Regarding the correctness of proofs this is not the biggest worry, in my opinion, though. Both sides of attempting to get faulty proofs in and of strengthening the kernel to keep them out have AI on their side. If AI advances more and becomes smarter it can be used on both sides. And the defending side has the easier task here. I am not sure about the Navier-Stokes proof but in general it sounds highly unlikely that many well-known theorems turn out false.

The bigger worry are question that Terrence Tao is also talking about. I.e., is the proven theorem actually the theorem we are interested in? Are basic definitions of the field stated correctly? That kind of question. There is also still parts of proof assistants that are not the kernel and that can be abused. E.g., abuse the pretty printer/parser to make something look different from what it actually is. Introducing an axiom while typographically hiding that one was added. If I remember correctly I saw an example of the latter thing in the Coq (now Rocq) theorem prover many years ago. I forgot how it precisely went or where I read that.

laichzeit0[hidden]
> Coq (renamed Rocq last year)

This is lamentable.

dr_pyser[hidden]
MacBook reverse screen
JonChesterfield[7 comments hidden]
> Autoformalization has become a practical reality in 2026

Uh, _maybe_. I've been translating papers into lean for the last week and the correlation between the formalized result and the papers is extremely poor. The cycle seems to be "have a go at the paper, it's a bit hard, prove something different, proclaim success". It's still faster than doing it all by hand but paper in -> lean out in no way ensures a correspondence between the two.

gus_massa[5 comments hidden]
> prove something different

I'm not sure but do you mean "prove the final end result using a [¿slightly?] different path"?

Retric[2 comments hidden]
No, prove something else could mean proving something very trivial thus making the proof meaningless on its own.

IE a proof can be true, rigorous, and not at all what was asked for.

cwillu[hidden]
It's possible, but less likely when the problem definition is coming from a common library rather than being redefined for any particular proof.
btilly[hidden]
Think of it this way. A math paper is pseudocode that has never been run. A Lean formalization is a running program. (It really is.)

In the process of formalizing, you find bugs, you find gaps, you find ways to fill those in. Maybe you rewrite part of the proof. Maybe you didn't quite wind up with the same result. Perhaps your theorem has some new conditions or something.

Was the original paper true? Maybe. But that isn't what you verified. What you verified is almost surely true though. So you take the win, and move on.

Jaxan[hidden]
They mean a different statement, a different theorem. You have to understand that translating a theorem written in English text to lean code is also a non trivial step.
tomkeen[hidden]
When independent reviewers compared the paper's text to the generated Lean formalization, they found that whenever the AI hit a wall, it quietly altered the statement like bumping a bound requiring 4 orders of derivatives up to 5 orders, or shifting sign indices (+1 vs -1) so the proof checker would accept the code.

The Lean kernel did its job verifying that the compiled code was logically consistent, but the code wasn't proving what the English paper claimed.

rramadass[2 comments hidden]
The article already mentions the paper, Sets in Types, Types in Sets by Benjamin Werner which maps between Set/Type theories.

Another related and more approachable paper on the evolution of Type Theory and its relation to Set/Category theories is Types, Sets and Categories by John Bell.

Finally also see, Typed Lambda Calculus / Calculus of Constructions by Helmut Brandl for an excellent book-length but concise overview of CoC/CIC.

IMO, the above is required reading to understand theorem provers and proof assistants. In particular, Brandl's work is a must-read.

solomonb[hidden]
And if you want to see worked examples elaboration of dependent types then the `elaboration-zoo` is a great thing to look at:

https://github.com/AndrasKovacs/elaboration-zoo

I've also got an incomplete project that aims to present a more expanded set of implementations then the elaboration zoo: https://github.com/solomon-b/lambda-calculus-hs