Hacker News new | ask | show | jobs
by CodeCompost 7 days ago
I'm an ignorant human but can anybody explain to me how LEAN is accepted as proof? I'm not trying to undermine it or knock it down but everybody seems to accept a LEAN proof as fact. Why is that?
4 comments

Lean has a bunch of rules about what a proof can deduce from earlier statements.

For example if you have already managed to prove the statement P → Q ("P implies Q" i.e. whenever P is true we then also know that Q is true), and then you manage to prove the statement P, then you can use those two statements to prove Q. Lean knows that P → Q plus P proves Q ("modus ponens").

As another example, if you have P or Q, and you prove P is false, then Q follows. (e.g. x is odd or even, then you prove it's not odd, therefore it's even.)

To accept the proof you don't need to look at all the millions of lines of proof, because Lean checks that they all follow correctly from earlier statements. You just need to accept three things:

* Lean's inference rules (like the one above)

* Axioms (e.g. definitions of numbers)

* The statement of the theorem in Lean symbols

These are all hugely shorter than the theorem's proof.

But how do you know Lean itself is entirely bug free, and/or a 17M line monstrosity doesn't produce some latent bug?

I understand that you can break a big problem down into many smaller ones that are easy to prove, but I still get the sense that there's a lot of well, religious faith involved in the combination of Lean itself and these massive proofs. Because at the end of the day no human can comprehend what Claude produced and we just have to take it all at face value.

There is a Lean checker called con-leche whose implementation is formally verified. The 17M GRH proof has passed con-leche verification.

Con-leche (and it's proof) are themselves implemented in Lean so there is some recursion here, and therefore some possible sources of bugs:

- The proof of con-leche could be invalid. This is unlikely considering the proof has been checked by multiple other Lean implementations. But at least the proof of con-leche is easier to check by hand than the 17M monster GRH proof...

- The Lean runtime might have a bug that affects the execution of con-leche in such a way that it falsely accepts an invalid proof. Also unlikely considering:

a. con-leche tries to use a small subset of the entire Lean runtime that is more well-tested

b. There is a port of con-leche to assembly named con-agua that has been formally verified (again using Lean) on a mathematical model of an x64 CPU

c. There are ports of con-leche to other runtimes (e.g. Rust) and those ports return the same result as con-leche on the GRH proof

You don't, but it has been verified using multiple independently written implementations. So maybe they all share the same defect that invalidates the proof, but it's believed to be rather unlikely.
It works very similar to a type checker actually. I tried to explain it here by comparing with TypeScript:

https://gruhn.me/blog/2026-08-29/

It doesn't works similar to a type checker. It is a type checker
Thanks for this :-)
Lean is a computer language and proof system that codifies what a proof is: you give it a series of axioms and of logic rules, and then it will tell you if a theorem and a proof abides by those rules or not.

So then we can formalize our classical logic and number systems in Lean (the systems that are used by most mathematicians) and present it with the theorem and its proof, and IF THERE IS NO BUG in the (relatively simple) Lean core, it should mean that we have a high degree of confidence the proof is true (in practice: we almost know the proof is true, except if the system is "inconsistent", but that would have much broader implications on mathematics)

I mean, this is the entire point of lean. It’s designed to allow expressing proofs in a way that can be machine checked, ensuring there are no holes in the logic. People are convinced that it does so (and it has been so proven in other tools, I believe).
Does something being logically confirmed, automatically validates proof?
It shows that the results follow from the axioms, assuming the axioms are consistent. That's basically as good as it gets for a mathematical proof.
Well it shows the results follow from the axioms regardless of whether they're consistent.
Sure, but if they are not consistent you can prove anything.