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

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

The rewrite makes the formal argument easier to check on modest hardware. The original, released by mathematician Levent Alpöge in collaboration with Claude, spanned a reported 17.4 million lines across 175,188 files and took 21 hours to compile on a high-spec AWS machine. The team reports that the rewrite builds in one to two hours on a 12-core machine with 24 GB of memory, provided Lean’s Mathlib library is already cached.

A compact edition and one for readers

The grh-lean project offers two editions under the Apache 2.0 license. According to its README, Claude wrote all the Lean code and documentation, while the researchers provided direction and suggestions.

  • grh/ is organized for readers, with documentation and navigation guides. Its 801 files contain about 300,000 lines of code, or 477,000 lines in total.
  • grh-compact/ prioritizes brevity. Its 792 files contain about 76,000 lines of code, about 95,000 nonblank lines when comments are counted, and 113,000 lines in total.

Why removing unused code wasn’t enough

An earlier community project, rh-trim, tried removing code that the final theorem did not depend on. That cut the original by only about 8%, and the trimmed version did not compile. Much of the original code supplied mathematical tools that the final argument still needed.

Sernau described a different approach: expand definitions to expose proof steps that were spread across modules, simplify those steps together, then package them back into definitions. Some reductions required a different mathematical argument altogether. One replacement, he said, eliminated the portion involving Vandiver’s conjecture.

The team reported that the rewrite contains no sorry placeholders for unfinished proofs and uses only three standard Lean axioms: propext, Classical.choice and Quot.sound. It also reported replaying every module with Lean’s kernel and passing checks with Comparator v4.35.0 and the independent checkers nanoda, con-leche and con-ron. Those checks concern the argument as encoded in Lean. The documented edition gives mathematicians a shorter route to reviewing what was encoded and how the argument works.