How to Verify an AI-Generated Math Proof With Lean 4
The Short Answer
A Lean file is evidence, not a verdict. To verify an AI-generated proof you need to establish three independent facts: the project builds cleanly, the formal statement is the theorem the paper claims, and no non-standard axioms were smuggled in. Each takes a different check. Skipping any one of them is how a headline gets ahead of the mathematics — which is exactly what happened in the first 24 hours of OpenAI’s Navier-Stokes announcement on September 8, 2026, when the repository’s own metadata still read “review status: self-assessed.”
Step 1: Build With the Pinned Toolchain
Every serious Lean project ships a lean-toolchain file. Use it.
# elan manages Lean versions; it reads lean-toolchain automatically
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
git clone <repo> && cd <repo>
lake exe cache get # pulls prebuilt Mathlib oleans if the project depends on Mathlib
lake build
As of September 2026 the current stable release is Lean v4.33.1 (v4.34.0 is at rc2). Do not “upgrade” a project to check it — you want to reproduce the authors’ build, not a different one. Large formalizations (the Navier-Stokes project runs to a 166-page paper’s worth of lemmas) can take hours; a build that fails part-way is a result in itself.
Completion criterion: lake build exits 0 with no warnings about sorry.
Step 2: Confirm There Is No sorry — Anywhere
sorry is Lean’s placeholder for “trust me.” A project can build green with sorry in it; Lean only warns.
grep -rn "sorry" --include="*.lean" . | grep -v "^./.lake"
Then, for the main theorem, ask Lean directly:
#print axioms MainTheorem.finite_time_blowup
Expected output for classical mathematics: propext, Quot.sound, Classical.choice. If you see sorryAx or any custom axiom, the proof depends on something unproved. Lean’s reference documentation on axioms explains why additional axioms can make a proof vacuous.
Completion criterion: #print axioms on every headline theorem lists only the three standard axioms.
Step 3: Check the Statement Matches the Paper
This is the step people skip, and it is the one that matters most for model-written proofs. A model can prove a weaker statement that shares a name with the strong one — a bounded domain instead of ℝ³, a forcing term that is allowed to be singular, an inequality with the wrong direction.
The 2026 practice, used by both OpenAI’s NavierStokesAndEuler repository and the Buckmaster–Alpöge fluid_lean project, is to keep the statement in a separate file from the proof and run a comparator that checks the proved term has the intended type. Open the statement file and read it against the paper’s theorem line by line:
- Are the hypotheses the same? (Smooth initial data, smooth compactly-supported force, positive viscosity.)
- Is the conclusion the same? (Velocity unbounded at finite time and energy bounded throughout.)
- Are the definitions standard Mathlib ones or project-local redefinitions? Project-local definitions of “smooth” or “solution” deserve a second reading.
Completion criterion: a domain expert signs off that the Lean statement is the paper’s theorem, not a neighbour of it.
Step 4: Reproduce Independently
“A formalization is available,” “an independent checker reproduced it,” and “experts confirmed the statement matches” are three different pieces of evidence. Only the second and third count as verification. Run the build on a machine the authors do not control, and publish the hash of the commit you checked.
Step 5: Separate Correctness From Credit
Verification answers “is this proof right?” It says nothing about who deserves credit or where the ideas came from — the provenance dispute over OpenAI’s Navier-Stokes result is orthogonal to whether the Lean build passes. Report them separately.
Why This Matters More in 2026
Models are now producing proofs at a scale humans cannot read. OpenAI’s swarm used ~130 billion output tokens on Navier-Stokes; nobody is going to referee that by hand. Lean is the only reviewer that scales — but only if you run all five steps.