Anthropic Slashes Riemann Hypothesis Proof Code by 99.5%
Anthropic researcher Luke Sernau and colleagues, working with Claude, refactored the previously 17.4-million-line Lean formalization of the Riemann Hypothesis down to roughly 76,000 lines, a 99.56% reduction, alongside a 300,000-line annotated reading version. The new build completes in one to two hours on an ordinary 12-core, 24GB machine, versus 21 hours on high-end AWS hardware for the original. The proof has only passed machine verification so far, with no full human mathematician review or accompanying paper.
Full Report
Contents4 sections
Jay reporting from 凹非寺 Quantum Bit | WeChat Official Account QbitAI
Only 76,000 lines left!!
Just now, the sensational 17.4 million-line proof of the Riemann Hypothesis that took the internet by storm has undergone an epic slimming-down.
The code volume has been 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;
whereas the new version 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.
We're saved, we're saved!!
But then I looked at the repository author—
However, the author also emphasized that this proof has only passed machine verification, has not yet been fully read through by mathematicians, and has no accompanying mathematical paper.
Why is it A➗ again???
Hello everyone, over the past few days I've been sprinting at full speed with several colleagues at Anthropic to develop this streamlined version of the 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**,** and this streamlining was completed by him + colleagues + Claude 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 Lean formal proof of the Riemann Hypothesis (RH) and the Generalized Riemann Hypothesis (GRH), a scale equivalent to 7 times the official Lean mathematical library (Mathlib), which stunned the entire mathematics and AI community.
But the problem was that this enormous, tome-like proof had over 175,000 files, of which only one file 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 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 the "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 trimmed version never successfully compiled.
At one point despair set in—code cleanup alone simply couldn't finish the job.
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 performed a thorough rewrite and refactor of Alpöge's original proof, and released two versions at once.
- Readable version (grh/)
With a clearer structure, extensive human-readable documentation and navigation guides, about 300,000 lines of code (477,000 lines in total), spread across 801 files.
- Compact version (grh-compact/)
Written specifically for minimal code volume, with only about 76,000 lines of pure code (about 95,000 non-blank lines counting comments, 113,000 lines in total), spread across 792 files.
What does 76,000 lines mean?
If we roughly convert 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 under 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 cross-verified using the official verification tool Comparator (v4.35.0) as well as multiple independent checkers such as nanoda, con-leche, and con-ron—all passed smoothly.
According to the project README, all 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—both the proof and the digestion were completely devoured by A➗ 😭.

The most frustrated are undoubtedly those developers who were trying to streamline the proof at home using AI. A netizen named jychang poured out his grievances in the comments:
I had 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, so I could only make do with 6.2 Sol 😭.
I did it entirely with GPT-6.2 Sol, using the $100 ChatGPT plan, with just 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.

Alas, quite helpless.
The outside world spent so much time and resources, only able to achieve tiny incremental reductions each time; whereas your A➗ just needs to approve a budget expenditure...
It's worth mentioning that, unlike Alpöge's original version which had 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.
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 reveal too much about the specific method, but I achieved good results by unrolling all the definitions to obtain a very long, flattened proof, looking for places within it that could be simplified, and then rolling them back up. In this way, I was able to simplify across module boundaries. However, some parts genuinely required completely new arguments, such as completely eliminating the parts related to the Vandiver conjecture.

Simply put, it's "flatten first, cross-boundary match-and-eliminate, then re-encapsulate", plus "local replacement".
In the original 170,000-plus files, a large number of theorems and definitions were nested layer upon layer across different modules. If one merely pruned file by file, both AI and humans would have their view blocked by module boundaries.
The method adopted by Sernau and Claude 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 was "taking shortcuts" on the mathematical path.
As Sernau mentioned with "eliminating Vandiver," for some overly cumbersome or roundabout mathematical substeps in the original version, 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 simplification effort, Luke Sernau, is a researcher at Anthropic.

Public information shows 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 with or even surpassing large closed-source models in capability.
Sernau studied in the Department of Mathematics at the University of Notre Dame as an undergraduate.
After graduation, 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 one month later officially joined Anthropic.
Now, he has also delivered an important piece of work at Anthropic —
reducing 17.4 million lines of impenetrable text to 76,000 lines, accompanied by a clear 300,000-line version with guided annotations.
The ball has been kicked back to the feet of human mathematicians.