Anthropic team trims a claimed Riemann hypothesis proof to 76,000 lines of Lean code

Anthropic researcher Luke Sernau and colleagues used Claude to rewrite a claimed formal proof of the Riemann hypothesis and its generalized form. The compact edition contains about 76,000 lines of Lean code. Sernau said the rewrite had passed machine checks, but as of November 26, 2026, no mathematician had read it in full and there was no accompanying mathematics paper.

The rewrite makes the formal argument easier to build and inspect. The original, produced by mathematician Levent Alpöge with Claude, spanned a reported 17.4 million lines across 175,188 files and took 21 hours to compile on a high-end AWS machine. With Lean’s Mathlib library already cached, the team reports that the rewrite can be built in one to two hours on a 12-core machine with 24 GB of memory.

Two editions for different readers

The grh-lean project offers a documented edition, grh/, with navigation guides and about 300,000 lines of code across 801 files, or 477,000 lines in total. The compact edition, grh-compact/, prioritizes brevity: its 792 files contain about 76,000 lines of code, about 95,000 nonblank lines including comments, and 113,000 lines in total.

According to the project README, Claude wrote all the Lean code and documentation, while the human team provided direction and suggestions. The rewrite is available under the Apache 2.0 license; Alpöge’s initial release did not specify a license.

Why deleting unused code wasn’t enough

An earlier community effort, rh-trim, tried removing code that the final theorem did not reference. That cut the original by at most about 8%, and the trimmed version did not compile.

Sernau described a different approach: he expanded nested definitions into a long, flat argument so that steps normally separated by module boundaries could be simplified together. He then grouped the simplified steps back into reusable definitions. Some reductions required a different mathematical argument, including one that eliminated the portion involving the Vandiver conjecture.

The team reports that the rewrite contains no sorry placeholders for unfinished proofs and relies only on three standard Lean axioms: propext, Classical.choice and Quot.sound. It says it replayed every module with Lean’s kernel and cross-checked the result with Comparator v4.35.0 and independent checkers including nanoda, con-leche and con-ron. Those checks concern the argument as encoded in Lean; they are distinct from a mathematician reviewing the formal statements and reasoning in full.