r/programming • • 11d ago

“…and the proof is checked in Lean”

https://xenaproject.wordpress.com/2026/11/12/and-the-proof-is-checked-in-lean/
363 Upvotes

14 comments sorted by

268

u/apnorton 11d ago

It's worth pointing out because people outside of math circles may not know this: the post author is Kevin Buzzard, who is probably one of the leading (if not the leading) world authorities on Lean/proof assistant usage in mathematics.

I remember watching his MSR talk The Future of Mathematics pretty much when it came out 7 years ago; he's been advocating proof assistant usage for a long time now, and isn't merely someone riding the AI hype cycle.

171

u/IamfromSpace 11d ago

> Question 1. Does the Lean statement match the informal statement?

Exactly the first question. Yes, it’s very likely it proved the statement. But is that what you meant? Is the statement even worth anything? This is not a skill most programmers have developed. I’ve also frequently found that LLM lean proofs need exactly the guidance here.

> 38 [papers] have the property that the Lean code does not even state, let alone prove, the main theorem of the paper.

😳 I have seen this though, that the LLM is sometimes not taking the problem actually head on and thinking about how to work directly on the statement of interest.

38

u/red75prime 11d ago

the Lean code does not even state, let alone prove, the main theorem of the paper.

LLMs go like mathematicians: an informal proof first, then an attempt at formalization. The author says:

my impression is that OpenAI decided to go live when some of the formalizations were incomplete, so just dumped what they had.

47

u/Madsy9 11d ago

If that sentence is followed by:

  • ..where I painstakingly wrote the theorem- and lemma definitions myself
  • ..and I have decent experience with writing proofs and formalizing proofs

Then it is probably correct. If not, then the statement deserves way more scrutiny. In the case of LLMs being used both for writing the proof and doing the proof formalization process, note that autoformalization is one of the hardest problems we know of.

7

u/badpotato 10d ago edited 10d ago

I'm not claiming to be an expert in Lean.. but just asking if the Navier–Stokes equation could be proven by something else than Lean since it seem it could be possible with:

-Coq / Rocq
-Isabelle/HOL
-HOL Light
-Mizar
-PVS

So why aren't they trying to prove with something else than lean if there could be some doubt about it?

Furthermore, according to this video, the lean code could use some factoring considering there is about 60% of unused code.

12

u/somebodddy 10d ago

Is the problem with Lean itself? Aren't these limitations of proof assistant languages in general?

7

u/badpotato 10d ago

I believe it would at least diminish the concern about:

Question 4: does the code exploit a bug in Lean’s official kernel?

This can happen. There was a soundness bug in Lean’s kernel which was fixed four hours after it was discovered, and a subsequent review of Lean’s code base by OpenAI found several more, all of which were fixed before they were announced publicly. There may in theory be more soundness bugs in Lean’s kernel. However, this does not matter.

Why not? Because Lean now has many kernels, created by users, written in many different languages, and at least one of which is formally verified to have no bugs, right down to the assembly level. If you want to make absolutely sure that there is no reward-hacking then again there is a one-line answer: lake comparator --paranoid. A malicious piece of code exploiting an as-yet-undiscovered bug in Lean’s official kernel will not pass this test unless it exploits as-yet-undiscovered bugs in many independent systems all at once. For example this webpage from the Lean kernel arena demonstrates that OpenAI’s resolution of the Navier–Stokes problem is accepted by multiple kernels as well as Lean’s official kernel. https://xenaproject.wordpress.com/2026/11/12/and-the-proof-is-checked-in-lean/

2

u/edgmnt_net 10d ago

Then the Isabelle/HOL proof might use some other exploit and you're still wondering whether it's equivalent to the Lean proof. For similar reasons, writing an app for Windows and another one for Linux won't make the app any more secure or bug-free.

1

u/badpotato 10d ago

We are talking about proving theorem here. If the current lean code attempt to use about "x numbers of theorems", then we would see the same number of theorem from one language to an another. It would be very hard to exploit a bug on multiple language with the same "set of theorem" as codebase. Especially if you add a third, a fourth language and so on. For instance, any weird behaviour from one implementation to an another would be easier to spot and would reduce the risk fooling the proof checker.

Sure, each would have their own specific implementation but I would expect the core logic to be very similar from one implementation to an another. As human it could also help to better understand some part of the code with other implementation as well if one language offer more comforting feature, etc.

2

u/edgmnt_net 10d ago

You're assuming the formalization looks about the same or is somehow trivial to count in terms of "number of theorems" across different theorem provers. That's likely very wrong. Dependently-typed languages are quite distinct from logic or symbol manipulation languages. Even among dependently-typed languages there are more or less subtle differences that may result in signficantly different ways to abstract and prove things at scale.

It is also unknown if multiple separate attempts at doing it with LLMs in the same language yield largely similar results. They might not.

It is absolutely non-trivial to check the formalization and it's the main bottleneck. There's no truly clean separation of "implementation details". There's no headline theorem that's easy to inspect on its own. Propositions stated like "all primes larger than..." depend on a definition of primes and a definition of numbers that you can't handwave away.

1

u/badpotato 10d ago edited 9d ago

I mean at the end of the day these language are a subset of math. Any of those language have that in common. If one language has it's own way to handle a specific feature, surely an another language could emulate the same behaviour or with a similar approach even if it require much more code for it.

One implementation could be high level while the other would be rather low level but both would be equivalent. If a specific theorem or topic doesn't translate well from on language to an another, it could be a clue for something requiring more investigation, etc.

At the end of the day, these languages are just tool for mathematician. If a LLM invented something as innovative as a new way to do integral for instance .. the human reading that, may have some unraveling to do anyway, so might as well see how it go in an another language.

-47

u/totheendandbackagain 11d ago

A developer blog on wordpress? Maybe it's containerised and updated with gitops?

24

u/Doub1eAA 11d ago

Free tier is managed and updated by Wordpress

1

u/robert_7524 1d ago

The theorem gets a kernel check; the blog gets managed updates. A surprisingly tidy division of proof obligations.