Claude Rewrites Its Own Riemann Proof Down 99% — and Outsiders Verify It in Lean
Anthropic's Sernau and colleagues used Claude to shrink a 17.4M-line Riemann Lean proof to about 76K lines, independently re-verified in Lean by MIT and Waterloo.
The first AI-assisted proof of the Riemann hypothesis was never going to be small. When Anthropic’s Levent Alpöge published it in Lean, the artifact ran to roughly 17.4 million lines of formal code — verified by machine, but effectively unreadable by any human. Days later, colleagues at Anthropic showed that the same model that helped produce it could also compress it by more than 99%, and that independent outsiders could re-run the check in a build the repository README itself estimates at one to two hours on 12 cores.
On Wednesday, Anthropic employee Luke Sernau published two shorter versions of the proof on GitHub, developed over just a few days with colleagues and Claude. According to heise’s report, an independent analysis puts the compact edition at about 113,000 lines including comments and blank lines — more than 99% below the original — while an edition optimized for readability comes to about 477,000 lines. Sernau’s own repository README gives leaner figures — about 76,000 lines for grh-compact and about 300,000 for the readable grh edition — though it does not state how it counts lines. The repository is a Lean 4 proof of the Riemann Hypothesis and of the Generalized Riemann Hypothesis for Dirichlet L-functions, built on Mathlib and using only the standard axioms propext, Classical.choice and Quot.sound; the README describes grh-compact as containing “the same five theorems” as the readable edition.

Not cleanup — re-derivation
The most consequential detail is what the shrink actually was. As Sernau explained in the Lean community forum, per heise, the revision went beyond deleting dead code: simpler proofs were found for numerous intermediate mathematical results, which means many of the arguments are new. Claude wrote both the Lean code and the accompanying explanations, per Sernau’s documentation. This is the distinction between a formatter and a refactorer that re-derives lemmas — the difference an operator would feel if an agent shrank a legacy service by replacing its internals, not just deleting commented blocks.
The verification story matters just as much as the shrink. MIT mathematician Andrew Sutherland independently machine-checked both editions in Lean, and Michael Rubinstein of the University of Waterloo separately verified the compact edition. The repo’s build instructions are concrete: Lean v4.35.0, Mathlib at commit 56a00585, then lake exe cache get, lake build and lake env lean scripts/PrintAxioms.lean — one to two hours on 12 cores with 24 GB of RAM. The check is reproducible on a workstation, though it still trusts the Lean kernel, Mathlib and the stated axioms.

What it means for agent-assisted engineering
Automater tracked the original proof and its certification by the Lean and Mathlib communities; this follow-up is a different kind of milestone. It demonstrates an agent pipeline that can take an enormous machine-checked artifact, find genuinely shorter mathematical arguments inside it, and produce two independently verified replacements within days. The honest caveats come from the repository itself: the proof has passed machine checks only, no mathematician has read it through, and no paper accompanies it. Machine verification confirms the same claims as the original; it does not confirm that the new intermediate arguments are illuminating.
That is exactly why the community’s next move is reading, not proving. heise also reports that the Lean community, which had already begun cleaning the original code, is now using Sernau’s readable edition as its working basis; that a collaborative project announced on Terence Tao’s blog aims to produce a human-understandable proof; that Rubinstein used Claude, Codex and Gemini to draft a 265-page (still incomplete) write-up in conventional mathematical language from the original proof; and that Bartosz Naskrecki published an AI-assisted draft covering the entire compact edition, with human expert review still pending.
The bottleneck has inverted, as Naskrecki put it: it is no longer producing the formal proof, but reading it. That is the same inversion Sourcegraph’s 2026 Big Code Report found across industry codebases — AI writes the code, and human understanding becomes the scarce resource.
Why the numbers disagree
One practical note for anyone citing this work: the README’s roughly 76,000-line figure for grh-compact and heise’s roughly 113,000-line figure plainly differ, and so do the 300,000 and 477,000 figures for the readable edition. What the sources establish is that heise’s count explicitly includes comments and blank lines, while the README does not state its counting method. Either way, the direction is the same: a 17.4-million-line artifact became something a persistent human could plausibly work through.
Scott Aaronson’s framing is the right scale for what happened here: not a one-off solution, but a sudden improvement in resolution — van Leeuwenhoek pointing a microscope at pondwater. For teams running agent fleets, the transferable lesson is that verification-backed compaction is now a demonstrated agent capability. If an agent’s output is machine-checkable — a Lean proof, a test suite, a formal spec — the agent can be let loose on shrinking it, and a checker will tell you whether the small version still meets the pinned target statements, provided those statements are fixed and checked independently, as Sutherland and Rubinstein did here. A test suite that merely passes does not by itself prove the same theorem.