Riemann proof in Lean shrinks to 76,000 lines

The Lean proof of the Riemann Hypothesis that Levent Alpöge released with Claude has been rewritten in a much shorter form. The original ran to about 17 million lines. The new version comes in two editions, and the smaller one has about 76,000 lines of code. Its author says it was made “in collaboration with my colleagues at Anthropic, and Claude”. The project’s own notes say Claude wrote the Lean text.
The repository on GitHub appeared on Wednesday. It is upfront about its status: the proof has passed machine checks only, no mathematician has read it through, and no paper comes with it.
How it came to this
The Riemann Hypothesis dates from 1859. It says prime numbers follow a precise pattern along the number line rather than falling at random. On November 20 Alpöge, a mathematician at Anthropic, said he had proved it working with Claude. He released the proof as code in Lean, a language in which a computer checks every step of an argument. The next day Lean FRO and the Mathlib Initiative, the groups behind Lean and its main maths library, announced an independent verification, the Guardian reported.
The problem was size. The original was spread over 175,187 files, far too much for any person to read. Mathematician Youness Lamzouri told IBM that checking the computer proof was only the beginning. Before mathematicians broadly accept it, he said, they need to understand how it works, and that could take months or even years.
What the new version is
It proves the same results as the original: the Riemann Hypothesis and its generalised version for Dirichlet L-functions, a wider family of functions of the same kind. It uses only Lean’s three standard axioms, the basic assumptions every Lean proof builds on. The readable edition is about 300,000 lines of code and comes with a guide for where to start. The compact edition holds the same five theorems in about 76,000 lines. Building either one yourself takes one to two hours on a machine with 12 cores and 24 GB of memory.
Our analysis
What we checked
On November 26 we went through both editions. We counted their lines, compared their files with the original and searched the code.
The figures on the repository’s front page, which our short post repeated, count only lines of code. With comments and blank lines, the readable edition is 477,124 lines and the compact one 112,827. We compared like with like, using a third party’s count of the original. On that basis the compact edition is about 204 times shorter and the readable one about 52 times.
The compact edition is not the one to read. Its own notes say the proofs “are written to be short, not to be easy to read.” The Lean community’s cleanup project switched to the readable edition within two hours of the last update.
The file that states what is being proved is identical, byte for byte, in both editions and in the third party’s preserved copy of the original. So the shorter proof proves exactly the same claims. A text search found none of the usual shortcuts that let a proof skip steps, though a text search is not a full check by Lean. One caveat for anyone repeating the checks: the 24 GB covers the build only. The project’s notes say its deeper re-check needs 64 GB and a few hours.
What is still open
The project’s notes say these checks “show that Lean accepts the proof of the stated theorems.” Whether people understand the proof is a separate question. Even the readable edition is about 300,000 lines of code, and so far no mathematician has read it all the way through.
Up next
ClaudeClaude Codeanalysis
Claude Code’s compaction keeps the plan, drops the work
When Claude Code compacts a session, its summary keeps 77% of decisions but just 0.2% of the commands that ran, the deja-vu author found across 58 transcripts on one machine. After a compaction, has your agent ever forgotten the exact command that worked?
Related stories
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

