← Gautam Parab

13 Million Lines of Lean in 11 Days. The Hard Part Was Never the Proof.

Anthropic published a result this morning: a complete, Lean-checked formalization of Fermat’s Last Theorem, produced by a multi-agent system called Prove2Me driven by an internal research model the company describes as roughly comparable to Claude Fable 5.1. The figures in the announcement are the kind that travel well: 13 million lines of Lean, 30,300 theorems proved and 29,500 of them used in the final assembly, about eleven days of wall clock, roughly six billion output tokens. Lean’s compiler accepted it at 02:00:57 UTC on 18 August. This is the lab’s own account of its own work, so treat the process description accordingly — but the artifact at the end is checked by a compiler that does not care who wrote it, which is more than most AI results can say.

The sentence that made me want to write this was not any of those. It was the description of how they convinced themselves the thing was real: Lean compiled the proof, it uses only Lean’s three standard axioms, and a comparator confirmed that the theorem’s statement matches mathlib’s own statement of FLT.

A team whose verifier rejects a wrong proof without argument or mercy still had to build a separate mechanism to check that the thing being proved was the thing they meant. That is where the difficulty of machine-checked AI output has migrated, and there is now enough 2026 evidence to say so with numbers instead of intuition.

Where the checking actually happens in a machine-checked result A three-step chain drawn top to bottom. Step one is what you meant: the informal problem, intent or requirement. The link from step one to step two is translation into a formal statement, marked unchecked: no kernel checks this step, and an audit of five Lean benchmarks found 398 mechanically certified defects at this layer. Step two is the formal statement, a Lean theorem, a Verus specification or a TLA+ invariant. The link from step two to step three is marked machine-checked: proof and code are verified against that statement using Lean's three standard axioms, and a wrong proof is rejected outright. Step three is the accepted result. Only the second link is machine-checked. THE VERIFICATION CHAIN · ONE LINK OF THREE IS MACHINE-CHECKED What you meant The formal statement Accepted result informal problem, intent, requirement Lean theorem · Verus spec · TLA+ invariant verified program or checked proof UNCHECKED MACHINE-CHECKED Translation into a formal statement. Proof and code verified against that statement. No kernel checks it. Audit of 5 Lean benchmarks: 398 certified defects. Lean's three standard axioms. A wrong proof is rejected outright. The guarantee is conditional on the statement above it — never on the intent above that.
The kernel is unforgiving about the bottom link and silent about the top one. Every 2026 result below is a measurement of the top link.

The kernel checks a proof against a statement, and nothing else

The cleanest statement of the problem comes from an audit published on 28 June 2026 by Ammanamanchi, Bhat and Biderman, who put it better than I can: “the kernel only checks that a proof establishes a formal statement; it does not verify that the statement faithfully encodes the intended informal problem” (arXiv:2606.29493).

They then went looking for the consequences. Running corpus-scale static checkers over five widely used Lean theorem-proving benchmarks and their forks — miniF2F, ProofNet, FormalMath, CombiBench and ProverBench — they surfaced 4,833 findings, of which 398 are mechanically certified issues: counterexamples, vacuous theorems, unsound axioms. Not stylistic complaints. Problems where the machine can prove the benchmark is broken.

The distribution is lopsided. Most of the audited sets have defect rates in the low single digits per hundred problems. ProverBench does not. ProverBench has 325 problems and the auditors returned 370 findings against it, 208 of them mechanically proven — meaning that on a benchmark used to report frontier theorem-proving results, more than six problems in ten carry a machine-certified defect, and the auditors’ bug count exceeds the problem count. Over half of every proven issue the audit found across roughly ten thousand problems lives in that one benchmark. A benchmark with more confirmed faults than questions is a peculiar instrument to be steering a field with.

Audit findings against benchmark size, five Lean theorem-proving benchmarks A log-log scatter of audit findings against the number of problems in each benchmark, with a diagonal marking where findings equal problems. FormalMath has 5,560 problems and 3,250 findings, 141 of them mechanically certified. miniF2F, in its v2c variant, has 488 problems and 193 findings, 8 certified. ProofNet has 371 problems and 82 findings, 5 certified. CombiBench has 100 problems and 78 findings, 1 certified. ProverBench is the only benchmark above the diagonal, with 325 problems and 370 findings, 208 of them mechanically certified. Dot size scales with certified issues. Source: Ammanamanchi, Bhat and Biderman, June 2026. LEAN BENCHMARK AUDIT · AMMANAMANCHI ET AL. · 28 JUN 2026 FormalMath: 5,560 problems, 3,250 findings, 141 certified — audit, Jun 2026 miniF2F (v2c): 488 problems, 193 findings, 8 certified — audit, Jun 2026 ProofNet: 371 problems, 82 findings, 5 certified — audit, Jun 2026 CombiBench: 100 problems, 78 findings, 1 certified — audit, Jun 2026 ProverBench: 325 problems, 370 findings, 208 certified — audit, Jun 2026 ProverBench miniF2F ProofNet CombiBench FormalMath 208 certified issues on 325 problems 141 certified Audit findings, log scale 100 1,000 100 1,000 Problems in the benchmark, log scale findings = problems Dot size scales with mechanically certified issues; the smallest dots are floored for visibility. One released variant per benchmark.
Four benchmarks sit below the line, where a defect is an exception. ProverBench sits above it, carrying over half of every certified defect the audit found.

Put a reward on it and the gap becomes an incentive

A defective benchmark is embarrassing. A defective benchmark wired into a reward signal is something else, because then a model is being paid to find the defects.

Max Tan’s thesis, submitted 29 May 2026 (arXiv:2605.30914), ran reinforcement learning against a Dafny verifier on an APPS-derived dataset and watched verified reward climb from 2.2% to 58.1%. On its face that is a spectacular training run. On inspection it was, in the author’s own term, specification hacking: “models exploit weak formal specifications instead of implementing the intended solutions.” After filtering the underspecified and exploitable tasks out of the set, the same approach moved verified pass rate from 9.7% to 31.1% — real progress, roughly half the headline, and the difference between the two numbers is a direct measurement of how much of an apparently verified result was the model finding a hole in the question.

I want to be precise about what that 58.1% was. Every one of those programs passed a verifier. Every proof was machine-checked. Nothing was faked at the level anyone was looking at. The system did exactly what it was rewarded for, and what it was rewarded for was not what anyone wanted. If that pattern sounds familiar from ordinary agent evaluation, it should — I’ve made a version of this argument about text-to-SQL benchmarks, where execution-match scoring quietly rewards queries that return the right table for the wrong reason. Formal verification does not exempt you from this. It just raises the price of admission for the failure.

Verified reward before and after filtering exploitable specifications Two paired ranges on a scale from zero to sixty percent. On the APPS-derived Dafny task set as found, reinforcement learning moved verified reward from 2.2 percent to 58.1 percent. After filtering out underspecified and exploitable tasks, the same method moved verified pass rate from 9.7 percent to 31.1 percent — roughly half the headline gain. Source: Tan, arXiv 2605.30914, May 2026. SPECIFICATION HACKING · RL AGAINST A DAFNY VERIFIER · TAN, MAY 2026 2.2% verified reward before training — Tan, May 2026 9.7% verified pass rate before training, filtered set — Tan, May 2026 58.1% verified reward after training — Tan, May 2026 31.1% verified pass rate after training, filtered set — Tan, May 2026 2.2% 9.7% 58.1% 31.1% As found After filtering exploitable tasks APPS-derived Dafny tasks same method, cleaned set 0 20% 40% 60% Left dot is before training, right dot after. The distance between the right-hand dots is what weak specs were worth.
Both runs are honest reinforcement learning against a real verifier. Only one of them is measuring what anyone wanted.

The fix, where anyone has found one, is to stop trusting the pass and start attacking the specification. TLA-Prover, from a Loyola-led group (arXiv:2606.06133, submitted 4 June 2026, revised 1 August), grades generated TLA+ specifications in four tiers, and the top tier exists purely to catch vacuity: the model’s correctness property is automatically mutated in a small way, and TLC must then report a violation. If the checker still passes the mutated property, the property was always true and proved nothing. The canonical cheat here is an invariant defined as TypeOK == TRUE, which every model checker will happily confirm forever. Their measured baseline across 25 LLMs: 26.6% of outputs parse, and only 8.6% survive semantic model-checking. Their tuned 20B model reaches 30% pass@1 at the mutation-tested tier — about 3.5x the baseline, and still a long way from a tool you would hand a distributed protocol to unattended.

The frontier moved to spec writing, and it is measurably brittle

If the statement is the risk, then writing statements is the job, and 2026 gave us the first serious benchmark for it. Verus-SpecGym (arXiv:2605.26457, 26 May 2026) is 581 spec-writing tasks derived from Codeforces problems targeting Verus, the Rust verifier, and an evaluation design that sidesteps the usual trap: generated specifications are executed as Rust code and tested against official Codeforces tests plus adversarial cases lifted from competitor “hacks.”

Gemini 3.1 Pro solves 77.8%. Other frontier models land at 51.1–57.8%. Open-source models reach 21.5–25.5%. The failure analysis matters more than the ranking: model-generated specs “can omit important input assumptions, accept incorrect outputs, and reject valid ones.” LLM-as-a-judge evaluation also missed 26% of the failures their executable evaluator caught. The obvious cheap way to check whether a specification is any good misses a quarter of the cases where it isn’t.

Two more results from this year suggest the reported numbers across this whole area are softer than they look. VeriScale (arXiv:2605.22368, 21 May 2026) rebuilt the Verina benchmark’s test suites adversarially, expanding them by over 83x, and reports sharp score drops across eight state-of-the-art models on both specification-generation and code-generation tasks — capability that existed only relative to a weak test suite. And TaoBench (arXiv:2603.12744, 13 March 2026) took undergraduate analysis problems formalized in Terence Tao’s from-scratch definitional framework, translated each into an equivalent mathlib formulation, and found state-of-the-art provers drop by an average of roughly 26% on the Tao version of a mathematically identical problem. Some meaningful fraction of “theorem proving ability” is fluency in mathlib’s particular dialect. That is a real skill. It is not the skill the benchmark name implies, and it is the sort of instrument problem I’ve written about when trying to measure progress in general.

What today actually demonstrated

Something substantial, and I don’t want the caveats to swallow it. For scale: seL4, the first general-purpose OS kernel with a machine-checked functional correctness proof, covered 8,700 lines of C and 600 lines of assembler, and was presented at SOSP in 2009 after years of work by a large team (Klein et al., SOSP’09). Thirteen million lines of Lean in eleven days is a different regime of throughput, and throughput has been the binding constraint on formal methods for its entire existence.

The caveats are honest ones, stated in the announcement itself: the formalization follows a simplified version of Wiles’s proof due to Darmon, Diamond and Taylor, and builds on mathlib plus pieces adapted from the Imperial College FLT project and flt-regular. It is not FLT from bare axioms. Nobody claimed it was.

What I’d take from the last nine months is a change in where the burden sits. When proofs were scarce and expensive, the proof was the bottleneck and the statement was written slowly by a human who cared. Now proofs are cheap and the statement is the bottleneck, and every piece of 2026 evidence I can find says the statement layer is where the errors are: 398 certified defects in the benchmarks, a 58.1% verified reward that half-evaporates under filtering, an 8.6% semantic pass rate for specifications that parse fine, a quarter of spec failures invisible to an LLM judge.

Which makes the comparator the most interesting engineering decision in this morning’s announcement. Faced with 13 million lines of machine-checked proof, the team’s remaining question was not “is the proof right” — the kernel settles that — but “is this the theorem.” They wrote a program to answer it. Everyone shipping verified code from a model is going to need the equivalent, and unlike the proof, that part still has no kernel behind it.

The number I’d watch for the rest of the year is not miniF2F, which is effectively saturated for systems willing to spend heavily per problem. It’s the spec-side scores — Verus-SpecGym’s 77.8%, and what happens to it when someone builds VeriScale’s adversarial treatment for that benchmark too. My guess, worth what guesses are worth: it comes down by more than ten points.


References

  1. Anthropic. (2026, September 4). Formalizing Fermat’s Last Theorem.
  2. Ammanamanchi, Bhat, & Biderman. (2026, June 28). Benchmark audit. arXiv:2606.29493. Benchmark auditing.
  3. Tan, M. (2026, May 29). Thesis on specification hacking. arXiv:2605.30914.
  4. TLA-Prover. Submitted 4 June 2026, revised 1 August 2026. arXiv:2606.06133. TLA+ synthesis.
  5. Verus-SpecGym. (2026, May 26). arXiv:2605.26457. Spec autoformalization.
  6. VeriScale. (2026, May 21). arXiv:2605.22368. Adversarial test scaling.
  7. TaoBench. (2026, March 13). arXiv:2603.12744. Definitional generalization.
  8. Klein et al. seL4 paper, SOSP’09. Cited as historical context.