Formal Proofs Are the Stress Test LLM Reasoning Cannot Fake
Informal reasoning is easy to fake. A model can write a plausible-looking proof with a wrong step in the middle, and nobody notices until an expert checks every line. Formal reasoning removes that escape. A proof written in Lean, the proof assistant, either compiles or it does not. There is no partial credit and no vibes.
That is why formal proofs are the stress test for LLM reasoning. The model cannot hand-wave past a hard step. The checker is a machine, and the machine is not impressed by fluent prose. If the model cannot prove a theorem, it does not understand the theorem. That is a cleaner signal than any benchmark score.
The hard part is not writing the proof. It is finding the right lemmas. A proof assistant's library holds thousands of theorems, and the one you need is buried in there. Premise selection is the job of finding it. A hammer automates the tedious steps: premise selection, translation to external automatic theorem provers, and proof reconstruction, all in one tool.
The workflow is straightforward. You state a goal in Lean. The hammer's premise selector ranks candidate lemmas from the library. The selected premises go to an automatic theorem prover, which tries to close the goal. If it succeeds, the hammer reconstructs a proof that Lean itself can check. The human never touches the tedious steps. They state the goal and check the result.
LeanHammer is the first end-to-end domain-general hammer for Lean. Its premise selector, LeanPremise, is a neural system trained specifically for hammer use in dependent type theory. It also adapts to user-specific contexts, so it can recommend premises from libraries outside its training data, and lemmas the user defined locally. With comprehensive evaluations, LeanPremise enables LeanHammer to solve 21 percent more goals than existing premise selectors, and it generalises well across domains.
The number matters less than what it shows. Neural retrieval and symbolic reasoning are meeting in the middle. The neural model finds the right lemma. The symbolic checker verifies the proof. Neither half works alone. The model without the checker hallucinates. The checker without the model cannot search a library of thousands of lemmas.
The practical lesson is about evaluation. If you want to know whether a model can reason, do not ask it to write an essay about reasoning. Ask it to prove something a machine can check. Formal verification is the only benchmark where the model cannot bluff. That is why it is becoming the standard stress test for the next generation of reasoning models. The models that survive this test are the ones worth trusting with real work.
The practical lesson is about evaluation. If you want to know whether a model can reason, do not ask it to write an essay about reasoning. Ask it to prove something a machine can check. Formal verification is the only benchmark where the model cannot bluff. That is why it is becoming the standard stress test for the next generation of reasoning models.
Goals solved, indexed (existing selectors = 100)Data from the sources listed below.
Try this
Clone LeanHammer and read how premise selection is wired into the proof loop.
bashgit clone https://github.com/JOSHCLUNE/LeanHammer
To feel what machine-checked proof is like, install Lean and check a tiny proof. Save this as proof.lean.
leantheorem two_plus_two : 2 + 2 = 4 := by rfl
Then install the Lean toolchain and check it.
bashcurl https://elan.lean-lang.org -sSf | sh lean proof.lean
If the command prints nothing, the proof checks. Change the 4 to a 5 and run it again. The checker will reject it. That rejection, instant and certain, is the whole point of formal reasoning.
If you want to write and read proofs like this yourself, our free course Lean 4: Proofs a Computer Can Check teaches Lean from zero.
