Breaking: Riemann Hypothesis Proof Code Slashed by 99.5%! Only 76,000 Lines Left

Jay, reporting from QbitAI (Non-Hutong) | WeChat Official Account QbitAI
Just now, the 17.4-million-line Riemann Hypothesis proof that stunned the entire internet 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;
The new version, by contrast, only needs an ordinary machine with 12 cores and 24GB of RAM, and with the existing Mathlib cache, it can be built from scratch in 1 to 2 hours.
However, the author also emphasized that the proof has currently only passed machine verification; no mathematician has read through it in full, and there is no accompanying mathematical paper.
Hello everyone, over the past few days I've been sprinting alongside 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 to about 76,000 lines.

The person behind this move is Luke Sernau, an Anthropic researcher; this streamlining was completed by him, his colleagues, and Claude together.
No Hope for Slimming Down
A few days ago, mathematician Levent Alpöge, working with Anthropic's AI model Claude, released a 17.4-million-line Lean formalization proof of the Riemann Hypothesis (RH) and the Generalized Riemann Hypothesis (GRH), roughly 7 times the size of Lean's official math library (Mathlib), which stunned the entire mathematics and AI community.
But the problem was that this vast, arcane proof had over 175,000 files, only one of which contained comments.
The community's first reaction was to try to understand and verify it. A GitHub project called rh-trim was quickly set up, with the goal of checking, mapping, and shrinking this enormous 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 at most it could reduce the code volume by about 8%, and this reduced version never managed to compile successfully.
At one point it seemed hopeless—code cleanup alone simply couldn't get it done.
But now, the eye of the storm—Anthropic—has stepped in personally to refactor this mountain of code.
Slashing the Riemann Hypothesis
Just as hundreds of contributors in the community were toiling away cleaning up Claude's mess, grh-lean burst onto the scene.
It thoroughly 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 counting comments, 113,000 lines total), spread across 792 files.
If roughly converted according to the original 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 less than 1,300 pages is now within reach.
The entire proof process uses no sorry (the placeholder in Lean representing 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 the Lean code and documentation for this project were written by Claude (AI), with the human researchers and Anthropic colleagues mainly providing direction and suggestions.
Incredible—the proof and the digestion of it were all devoured whole by A➗ 😭.

The most frustrated are those developers who were trying to streamline the proof at home with AI. 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. And then Anthropic beat me to it.
Why? Because I can't use Claude, so I can only make do with a bit of 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 fast. And the Anthropic engineers, with massive quotas, fast mode, and the freedom 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 fast.
And the Anthropic engineers, with massive quotas, fast mode, and the freedom to spin up sub-Agents at will, beat me to it.

The outside spent so much time and resources, only to make tiny bit-by-bit reductions each time; while your A➗ only needs to approve a budget expenditure...
It's worth noting 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 formalization proof text—the most important one on the Riemann Hypothesis to date.
Methodology Exposed
So, how exactly was it compressed from 17.4 million lines to 76,000 lines?
Faced with 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 all the definitions, I obtained a long, flattened proof, looked for places in it that could be simplified, and then rolled them back up, which worked quite well. In this way, I could simplify across module boundaries. However, some parts really required 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 all the definitions, I obtained a long, flattened proof, looked for places in it that could be simplified, and then rolled them back up, which worked quite well.
In this way, I could simplify across module boundaries. However, some parts really required completely different new arguments, such as completely eliminating the parts related to the Vandiver conjecture.

Simply put, it's "flatten first, match-and-eliminate across boundaries, 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 only prune file by file, both AI and humans get their view 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, achieving cross-boundary merging and simplification, and finally re-abstracting and re-encapsulating.
Beyond that, there was "taking shortcuts" on the mathematical path.
As Sernau mentioned with "eliminating Vandiver," for some overly cumbersome or roundabout mathematical sub-steps in the original, the new version directly switched to completely different new argument approaches, 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 effort, Luke Sernau, is a researcher at Anthropic.

Public records show that before joining Anthropic, Sernau served 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, and that open-source models will iterate at extremely fast speeds and lower costs, ultimately catching up to or even surpassing large closed-source models in capability.
Sernau studied mathematics as an undergraduate at the University of Notre Dame.
After graduation, he worked at Facebook (Meta) for four years (2014–2018), during which he led Facebook's 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 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 formally joined Anthropic.
Article title: Just now, the Riemann Hypothesis proof code was slashed by 99.5%! Only 76,000 lines left
Body: Now, he has also delivered an important piece of work from his time at A Company——
Reducing 17.4 million lines of impenetrable text to 76,000 lines, and pairing it with a clear 300,000-line version with guided annotations.
The ball has been kicked back to the feet of human mathematicians.
(ps: Hmm, maybe Teacher Deng Yu can try reading it now 👀)

- Just drop in a story! Directly produce a 15-minute AI short film, even your second uncle at home can do it 2026-11-25
- Just now, the startup project of the DeepSeek V1 author is revealed: open-source Agent 2026-11-21
- Nvidia and AMD team up to invest for the first time! Genesis completes Series A funding, valued at over 23 billion 2026-11-18
- Multimodal "source god"! MiniMax open-sources SOTA image generation model, native 4K, two mao per image 2026-11-12