A Lean formalization of the Riemann hypothesis and the generalized Riemann hypothesis has been cut from roughly 17.4 million lines to about 76,000 lines of code. Anthropic researcher Luke Sernau said he worked with colleagues and Claude on the rewrite over the past several days. The resulting grh-lean project includes both a compact edition and a more readable one.

The original proof contained more than 175,000 files and took about 21 hours to compile on a high-end AWS machine. With Mathlib already cached, the new version can be built from scratch in one to two hours on a standard machine with 12 CPU cores and 24 GB of memory.
Automated cleanup made little progress
A few days earlier, mathematician Levent Alpöge and Anthropic’s Claude released Lean formalizations of the Riemann hypothesis (RH) and the generalized Riemann hypothesis (GRH). The original package was about 17.4 million lines, roughly seven times the size of Lean’s official mathematical library, Mathlib. More than 175,000 files made up the project, and only one contained comments.
The community set out to understand and inspect the proof. A GitHub project called rh-trim was created to map its structure and find ways to reduce it. Several independent kernels accepted the full proof, including Tenet, written in C#; nanoda, written in Rust; and tenet-jvm, written in Java. Their analysis found that the final argument accounts for only 6.6% of the total. The rest builds tools needed for the proof, including substantial mathematical theory not previously available in Mathlib.

Attempts to remove dead code—definitions not referenced by the final theorem—produced a reduction of only about 8% at most. The trimmed version also never compiled successfully. Removing unused code by following references was not enough to make the proof manageable.
Two editions, for reading and compactness
Anthropic’s grh-lean project rewrites and restructures Alpöge’s original proof, with two editions aimed at different needs.
- Readable edition (grh/): About 300,000 lines of code and 477,000 lines in total, across 801 files. It includes extensive human-readable documentation and navigation guides.
- Compact edition (grh-compact/): About 76,000 lines of pure code. The nonblank-line count, including comments, is about 95,000, while the total is 113,000 lines across 792 files.
The source article offers a rough comparison: if the original’s 14.7 million lines correspond to 250,000 pages of paper, the compact edition would amount to a human-readable mathematical argument of fewer than 1,300 pages. It is an estimate based on that stated ratio.

The proof contains no sorry placeholders, Lean’s marker for an unfinished proof. It relies only on three standard Lean axioms: propext, Classical.choice and Quot.sound. After compilation, the team replayed every module with Lean’s own kernel. It also used the official Comparator verification tool, version 4.35.0, and independent checkers including nanoda, con-leche and con-ron. The checks all passed.
According to the project README, Claude wrote all of the Lean code and documentation. Human researchers and Anthropic colleagues mainly supplied direction and suggestions. The source account says more than 100 community contributors had been working on attempts to simplify the original proof.
A developer says Anthropic got there first
In the comments, a user identified as jychang said they had completed about 70% of their own proof, amounting to 35,000 lines of Lean, before Anthropic released its work. The user said they had used GPT-6.2 Sol through a $100 ChatGPT plan and ran a single agent. They did not use subagents because those would consume too much of their weekly allowance.

Jychang contrasted that setup with Anthropic engineers’ access to large usage allowances, fast mode and the ability to run subagents. The source account also notes that outside developers had spent considerable time and resources on the project, while automated trimming had yielded only limited reductions.
Flatten definitions, simplify across modules, then rebuild abstractions
Sernau did not disclose the full process, but described its central technique: unfold definitions to create a long, flattened proof, identify places where it can be simplified, and then fold the material back into abstractions. That approach can expose simplifications across module boundaries.
In the original package, many theorems and definitions were nested across separate modules. Trimming files one at a time left that structure in place. Once the definitions were unfolded into a longer chain of reasoning, redundant steps spread across files became easier to see and combine. The team then simplified the chain and packaged it into abstractions again.

Some sections required a different mathematical route rather than structural cleanup. Sernau said the new proof eliminated the material related to Vandiver’s conjecture. Other lengthy or indirect subarguments were replaced with new arguments, while some background material was carried over from the original and rewritten.
The proof has not yet had a full mathematical review
Unlike Alpöge’s original release, which did not include a license, grh-lean is open source under the Apache 2.0 license. The community is free to use, modify and distribute the formalized proof text.
The project’s authors also set out an important limitation: the proof has passed machine verification, but no mathematician has yet read it in full, and there is no accompanying mathematical paper. Passing machine checks is not the same as a complete review by mathematicians.

Luke Sernau’s career
Luke Sernau, who led the reduction, is a researcher at Anthropic. Before joining the company, he worked at Google and Google DeepMind as a senior software engineer and researcher. He also wrote the 2023 Google internal document “We Have No Moat, And Neither Does OpenAI.” The document argued that the open-source community was the real competitive force, and that open models would iterate faster and at lower cost before catching up with, or surpassing, large closed models.
Sernau studied mathematics as an undergraduate at the University of Notre Dame. After graduating, he spent four years at Facebook, now Meta, from 2014 to 2018. During that period, he led Facebook’s Seattle internship program and conducted more than 200 technical interviews. He later founded the programmer education organization BetterEngineering.org.
In 2019, Sernau joined Google as a senior software engineer. From 2024, he worked at Google DeepMind as a Staff Researcher, leading several AI research teams whose work included scaling laws for large models. He left Google in August 2025 and joined Anthropic the following month.

The release contains a compact proof of about 76,000 lines and a readable edition of roughly 300,000 lines with guides for readers. The project is available at https://github.com/lsernau/grh-lean.
Source: MarsBit. The original article was bylined Jay and identified as dispatched from Aofeisi, QbitAI.


