Anthropic Compresses 17-Million-Line Riemann Proof to 76,000 Lines Using Claude
Luke Sernau's grh-lean cuts Alpöge's machine-generated GRH proof to laptop-buildable scale

Six days after MIT mathematician Levent Alpöge published a machine-verified proof of the Generalized Riemann Hypothesis spanning 17.4 million lines of Lean code, Anthropic researcher Luke Sernau has compressed the same proof to approximately 76,000 lines — a 99.56% reduction that transforms a cloud-only artifact requiring specialized hardware into something any developer can build on a standard laptop in under two hours.
The compressed proof, released November 25 as the open-source repository lsernau/grh-lean under an Apache 2.0 license, represents the first time Alpöge's GRH verification has been accessible to individual researchers. Where the original required roughly 21 hours on a high-specification AWS instance, the compact edition builds in one to two hours on a machine with 12 cores and 24 GB of RAM with Mathlib's build cache pre-downloaded.
The release is not a mathematical simplification. The compressed proof makes the same claims as Alpöge's original, depends on the same three standard Lean axioms — propext, Classical.choice, and Quot.sound — and has been independently verified by four separate Lean kernel implementations: Comparator v4.35.0, nanoda, con-leche, and con-ron. What changed is the engineering: Claude rewrote hundreds of thousands of nested abstractions into a flatter, more efficient structure, eliminating redundancies that were invisible at module boundaries and cutting entire sub-proofs that turned out to be unnecessary for the core GRH claim.
Read more: Anthropic's Claude produces first complete computer-checked proof of Fermat's Last Theorem
How Sernau's "Unrolling and Rerolling" Method Actually Works
Alpöge's original proof was generated through an extended collaboration with Claude and resulted in a repository of 175,187 Lean files totaling 239 MB. That scale was partly inherent to the mathematics and partly a consequence of how AI systems generate Lean proofs: Claude produces valid but verbose code, with redundant intermediate lemmas, repeated definitions across modules, and sub-proofs that satisfy the verifier without minimizing line count.
Sernau's compression methodology begins with what he describes as "unrolling" — systematically expanding every nested definition across module boundaries until the entire proof exists as a long, flat, unabstracted sequence of logical steps. This flat form is expensive to read, but it makes cross-module redundancies visible in a way the original layered structure cannot. Steps that appeared distinct across different files often resolve to the same underlying logical operation once every abstraction is removed.
The second phase, "rerolling," re-abstracts the flattened proof into a clean modular structure — but now organized around the actual logical dependencies revealed by unrolling rather than the development-time structure Alpöge and Claude happened to build. The result is a proof that remains logically identical to the original while eliminating the accumulated structural overhead.
One significant deletion made the compression possible: Vandiver's conjecture, which had been part of Alpöge's proof machinery, turned out to be unnecessary for the core GRH claim and was eliminated entirely. Finding such redundancy required the kind of global view of a proof that is only possible once the full architecture has been flattened.
The grh-lean repository ships two editions: grh/, a readable edition at approximately 300,000 lines suitable for researchers who want to follow the proof logic; and grh-compact/, the condensed edition at approximately 76,000 lines of Lean code (112,827 non-blank lines including comments and structure), optimized for fast compilation.
Why Automated Tools Failed Where Claude Succeeded
Before grh-lean appeared, the community had already attempted compression. The rh-trim project applied dead-code elimination — automated tools that identify lemmas never referenced elsewhere — and achieved only approximately 8% reduction. The trimmed version still failed to compile.
Dead-code elimination removes genuinely unused material but cannot identify cases where two lemmas perform equivalent logical work under different names, or where an entire sub-proof strategy could be replaced with a shorter path. Those compressions require understanding the proof's logical structure, which is precisely what Sernau's unrolling methodology surfaces.
A parallel community effort underscores the gap. Developer jychang independently began compressing Alpöge's proof using GPT-4 and reported approximately 70% completion toward a 35,000-line target using a standard ChatGPT subscription — but had not finished when grh-lean was released. AI-assisted proof compression is tractable with consumer tools; Anthropic's resources and architectural understanding completed it in days.
The grh-lean README is explicit: "All Lean code was written by Claude." Sernau and other humans provided direction and made architectural decisions, but every definition, lemma, and tactic invocation came from the model.
Verification, Axioms, and the Sorry-Free Guarantee
The grh-lean README's statement "This project is sorry free" carries real significance. In Lean, the sorry tactic is a placeholder that allows a proof to compile even when the underlying logical step has not been completed — a proof containing sorry is logically incomplete regardless of whether the verifier accepts it. Combined with the axiom audit showing dependence only on Lean's three standard axioms, grh-lean provides maximum transparency about what assumptions underlie the GRH verification.
Four independent Lean kernel implementations confirmed the proof's axiom chain: Comparator v4.35.0 (Lean's standard tool), plus nanoda, con-leche, and con-ron — three independently written kernels not affiliated with Anthropic. Four separate codebases agreeing on the axiom audit means the result does not depend on any single implementation's correctness.
The README nonetheless includes an honest caveat: "These proofs have only been machine checked. No mathematician has read them through. There is no paper." Machine verification confirms logical correctness under the stated axioms; it does not constitute the human mathematical understanding that would accompany a Millennium Prize claim. That gap remains open.
A New Research Discipline: Proof Compression at Scale
The LeanLean October benchmark, published November 6 by researchers at ETH Zurich's SRI Lab, formalizes proof compression as a measurable AI task — three weeks before grh-lean appeared. GPT-6.1 Sol leads the benchmark at 50.45%, with Claude Opus 5.5 close behind at 47.34%. The paper cites Anthropic's earlier Fermat's Last Theorem formalization — approximately 13 million lines of Lean, produced in September 2026 — as a motivating example of how inflated AI-generated proofs can become.
The ProofOptimizer research group documents a 16× inflation ratio between AI-generated Lean code and informal mathematical counterparts — a characteristic of how models currently optimize for correctness rather than compactness. The pattern points toward a two-phase workflow: use AI to generate a large, verified proof, then use AI again to compress it. The grh-lean project is the first large-scale demonstration that the second phase is tractable for a Millennium Prize-class proof.
Apache 2.0 and What Opens Up
The Apache 2.0 license on grh-lean (Copyright 2026 Anthropic, PBC) matters practically. Alpöge's original proof had no open-source license, which limited what researchers and engineers could legally build on top of it. Apache 2.0 allows anyone to use, modify, and redistribute the proof code, including for commercial purposes.
Cryptography researchers are among the most direct beneficiaries. The GRH has been used as an assumption in cryptographic primality testing algorithms for decades — including tests used in widely deployed implementations. A verified proof removes GRH from the category of unproven assumption, though the gap between machine-checked Lean and published, peer-reviewed mathematics means the broader cryptography community is unlikely to treat this as fully settled for some time.
The day after grh-lean's release, the community project nasqret/riemann-rev published an independent reading guide tracing the GRH proof's route with links into the Lean archive. Machine-generated rather than hand-written by mathematicians, it represents a first attempt to close the gap between the verified artifact and something a human can follow.
Read more: Terence Tao warns AI proof abundance is severing mathematics from human understanding
What Remains Unresolved
The compression achievement does not answer the question of whether Alpöge's underlying proof strategy is correct at the level mathematicians care about. Machine verification guarantees logical validity given the axioms, but not that the axioms model what mathematicians mean by "the Generalized Riemann Hypothesis," nor that the proof strategy is free of subtle formalization choices that might not survive expert scrutiny.
The Clay Mathematics Institute's $1 million Millennium Prize for a RH proof requires publication in a peer-reviewed journal followed by a two-year community review period. Neither Alpöge's original nor Sernau's compressed version has yet been submitted to that process.
The route from grh-lean to that prize runs through human mathematics — through researchers who can read the proof strategy, evaluate the formalization choices, and produce a companion paper explaining what the Lean code actually encodes. The nasqret reading guide is a step toward that, and grh-lean makes the starting point accessible enough that more researchers can join the effort. Whether the mathematics holds up to that scrutiny will determine whether the compression project is a footnote or a turning point.
What is already established: Anthropic's approach to proof compression — treating a 17.4-million-line mathematical artifact as a software engineering problem — produced a result in days that the broader community could not reach with automated tools in the time since Alpöge's proof was published. The laptop-buildable, openly licensed, sorry-free result is now available for anyone to inspect, challenge, or extend.



