▲ | Tiberium 3 days ago | |||||||||||||||||||||||||||||||||||||||||||
I've worked with Claude Code/Codex, and they're amazing, but I have a question. I have never worked with tools such as Lean, but if an LLM writes a proof with Lean, how can one be sure that the code itself (in the proof) is correct? Or is Lean so strict that this is unlikely to happen? | ||||||||||||||||||||||||||||||||||||||||||||
▲ | enricozb 3 days ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||
If it compiles, it typechecks. If it typechecks, the proof is correct. This is a consequence of the Curry-Howard correspondence [0]. From a pure mathematician's standpoint, the content of a proof is kind of (waving big hands here) irrelevant. It's more that the existence of a proof implies the theorem is true, and thus can be used to prove other theorems. Because of this "proof-irrelevance", a great foil to an LLM's propensity to hallucinate is something like Lean. In Lean, and in theorem provers oriented towards classical mathematics, the statement of the theorem being proved is what matters most. And due to Curry-Howard, the statement is equivalent to the signature/declaration of the function, which is what the human ought to verify, while Lean will verify the body. [0]: https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon.... | ||||||||||||||||||||||||||||||||||||||||||||
|