Riemann Hypothesis AI Proof Code Cut by 99.5%: Only 76,000 Lines Left, and It's Anthropic Again

Only 76,000 lines left!! Just now, the viral 17.4-million-line Riemann Hypothesis proof has undergone an epic slimming down. The code volume was slashed by 99.56%.
The original proof's 175,188 files would take a full 21 hours to compile on a high-spec AWS machine;
while the new version only needs an ordinary machine with 12 cores and 24GB of memory, and with the existing Mathlib cache, it can be built from scratch in 1 to 2 hours.
Then I looked at the repository author — why is it A➗ again???
Hello everyone, over the past few days I've been sprinting with several Anthropic colleagues to develop a streamlined version of this proof. We've successfully reduced its length by about two orders of magnitude, from roughly 15 million lines down to about 76,000 lines.

The person behind this is Luke Sernau, an Anthropic researcher; this streamlining was completed by him + colleagues + Claude working together.
No Hope for Slimming Down
A few days ago, mathematician Levent Alpöge, in collaboration with Anthropic's AI model Claude, released a 17.4-million-line formal proof in Lean of the Riemann Hypothesis (RH) and the Generalized Riemann Hypothesis (GRH), equivalent to 7 times the size of Lean's official math library (Mathlib), shocking the entire math and AI community.
But the problem is that this enormous, arcane proof has over 175,000 files, of which only one contains comments.
The community's first reaction was to try to understand and verify it. A GitHub project called rh-trim was quickly established, with the goal of checking, mapping, and shrinking this massive proof.
The results showed that multiple independent kernels — Tenet written in C#, nanoda written in Rust, and tenet-jvm written in Java — all successfully accepted the entire proof, and further analysis revealed its internal structure:
The vast majority is foundational work. The final argument only requires 6.6% of the entire proof. The rest is building the tools it needs, many of which are mature mathematical theories that the Lean math library never had.
However, when the community tried to "slim it down," they ran into difficulties. After using automated tools to delete all "dead code" not referenced by the final theorem, the rh-trim project found that it could reduce the code volume by at most about 8%, and this reduced version never successfully compiled.
At one point despair set in — code cleanup alone simply couldn't finish the job.
But now, the center of the storm — Anthropic — has stepped in personally to refactor this mountain of code.
Slashing the Riemann Hypothesis
Just as hundreds of community contributors were toiling away to clean up Claude's mess, grh-lean burst onto the scene.
It completely rewrote and restructured Alpöge's original proof, and released two versions at once.
With a clearer structure, extensive human-readable documentation and navigation guides, about 300,000 lines of code (477,000 lines total), spread across 801 files.
- Compact version (grh-compact/)
Written for the shortest code volume, with only about 76,000 lines of pure code (about 95,000 non-blank lines including comments, 113,000 lines total), spread across 792 files.
If roughly converted using the original's ratio of "14.7 million lines corresponding to a 250,000-page paper," the 76,000-line compact version means a human-readable mathematical argument of under 1,300 pages is now within reach.
The entire proof process uses no sorry (Lean's placeholder for an incomplete proof), and relies only on Lean's three most standard axioms: propext, Classical.choice, and Quot.sound.
After compilation, the team not only replayed all modules with Lean's own kernel, but also used the official verification tool Comparator (v4.35.0) as well as multiple independent checkers such as nanoda, con-leche, and con-ron for cross-verification, all of which passed smoothly.

According to the project README, all Lean code and documentation for this project were written by Claude (AI), with human researchers and Anthropic colleagues mainly providing direction and suggestions.
Amazing — the proof and its digestion were both devoured whole by A➗ 😭.

The most frustrated are those developers who were trying to streamline the proof with AI at home. A netizen named jychang poured out his grievances in the comments:
I've already completed about 70% of the proof, currently at 35,000 lines of Lean code. Then Anthropic beat me to it.
Why? Because I can't use Claude, I can only make do with 6.2 Sol 😭.
I did it entirely with GPT-6.2 Sol, using the $100 ChatGPT plan, with only one Agent and no sub-Agents, because sub-Agents eat up the weekly quota too much. And Anthropic engineers, with massive quotas, fast mode, and the ability to spin up sub-Agents at will, beat me to it.
I did it entirely with GPT-6.2 Sol, using the $100 ChatGPT plan, with only one Agent and no sub-Agents, because sub-Agents eat up the weekly quota too much.
And Anthropic engineers, with massive quotas, fast mode, and the ability to spin up sub-Agents at will, beat me to it.

The outside spent so much time and resources, only achieving tiny bits of reduction progress each time; while your A➗ just needs to approve a budget expenditure...
It's worth mentioning that, unlike Alpöge's original version which provided no license, grh-lean is open-sourced under the Apache 2.0 license.
This means the community can now freely use, modify, and distribute this formal proof text — the most important one on the Riemann Hypothesis to date.
However, the author also specifically emphasized that this proof has only passed machine verification so far; no mathematician has read through it entirely, and there is no accompanying mathematical paper.
Methodology Exposed
So, how exactly was it compressed from 17.4 million lines to 76,000 lines?
Facing the community's curiosity, author Luke Sernau briefly revealed the trick:
Unfortunately I can't disclose too much about the specific method, but by unrolling definitions to get a long, flattened proof, finding places within it that could be simplified, and then rolling them back up, I achieved good results. This way, I could simplify across module boundaries. However, some parts did require completely different new arguments, such as completely eliminating the parts related to the Vandiver conjecture.
Unfortunately I can't disclose too much about the specific method, but by unrolling definitions to get a long, flattened proof, finding places within it that could be simplified, and then rolling them back up, I achieved good results.
This way, I could simplify across module boundaries. However, some parts did require completely different new arguments, such as completely eliminating the parts related to the Vandiver conjecture.

Simply put, it's "flatten first, cross-boundary elimination, then re-encapsulate," plus "local blood transfusion."
In the original's 170,000-plus files, a large number of theorems and definitions were nested layer upon layer across different modules. If you just trim file by file, both AI and humans get their vision blocked by module boundaries.
The method Sernau and Claude adopted was to first unroll all these layer-wrapped definitions into a long, flat derivation chain, exposing redundant steps that were originally separated by several files, enabling cross-boundary merging and simplification, and finally re-abstracting and encapsulating them.
Beyond that, there's "taking shortcuts" on the mathematical path.
As Sernau mentioned with "eliminating Vandiver," for some overly tedious or roundabout mathematical sub-steps in the original, the new version directly switched to completely different new argument methods, and much of the background material was thoroughly rewritten after being ported over from the original.
Who Is Luke Sernau?
The leader of this epic streamlining work, Luke Sernau, is a researcher at Anthropic.

Public records show that before joining Anthropic, Sernau worked as a senior software engineer and researcher at Google and Google DeepMind.
Interestingly, he is the author of the famous 2023 Google internal leak document "We Have No Moat, And Neither Does OpenAI."
In that document, Sernau pointed out that the real competition comes from the open-source community: open-source models will iterate at extremely fast speeds and lower costs, eventually catching up with or even surpassing large closed-source models in capability.
Sernau studied mathematics as an undergraduate at the University of Notre Dame.
After graduating, he worked at Facebook (Meta) for four years (2014–2018), during which he led the Facebook Seattle internship program and conducted over 200 technical interviews, and subsequently founded the programmer education organization BetterEngineering.org.

In 2019, Sernau joined Google as a senior software engineer, and starting in 2024 he served as a Staff Researcher at Google DeepMind, leading multiple AI research teams, with research spanning large-model Scaling Laws.
In August 2025, Sernau left Google, and a month later he officially joined Anthropic.
Now, he has also delivered an important piece of work of his at Anthropic — trimming a 17.4-million-line impenetrable tome down to 76,000 lines, and accompanying it with a clear 300,000-line annotated version.
The ball has been kicked back to human mathematicians.
(ps: Hmm, maybe Professor Deng Yu could try reading it now 👀)

GitHub: https://github.com/lsernau/grh-lean
This article is from the WeChat public account: 量子位 (ID: QbitAI), original title "Just now, the Riemann Hypothesis proof code was slashed by 99.5%! Only 76,000 lines left"
Advertising statement: External redirect links contained in this article (including but not limited to hyperlinks, QR codes, passcodes, etc.) are used to convey more information and save selection time; the results are for reference only, and all articles on IT之家 containing external links include this statement.
Related Articles
- "The largest IPO in human history" fell below its offering price less than a week after listing, with Anthropic dropping below the $83 offering price
- "Godfather of AI" Yann LeCun lashes out at Anthropic CEO Amodei: hyping AI danger theories is just a way to give himself control
- Anthropic launches the Siren honeypot system: baiting AI agents into triggering out-of-bounds behavior, finding that the new Claude still attempts jailbreak escapes in 21–32% of sandbox scenarios
- Anthropic launches a new desktop feature: letting Claude-generated content turn into standalone software with one click, supporting Apple macOS and Windows PC
- Sharp reversal after a surge, Anthropic falls below the $83 IPO offering price in pre-market trading
- Anthropic CEO Amodei's idea from ten years ago revealed: video games might solve the AI unemployment problem