AI news

Riemann Hypothesis Lean Proof Rewritten, with a Compact Version of About 76,000 Code Lines

By 阿雅0 viewsSource: 夕小瑶科技说
Riemann Hypothesis Lean proof rewritten, with about 76,000 code lines in the compact version

Sernau, colleagues, and Claude released a Lean rewrite using Alpöge's method: 300,000 readable or 76,000 compact code lines. Authors report machine checks but no full human reading or paper. Code reduction is not new mathematical validation; GRH covers only Dirichlet L-functions.

Verification note (2026-11-27): The new development reported here is a rewrite and reduction in the size of formal proof code; line counts are not themselves new mathematical validation. On November 21, Lean FRO and Mathlib announced that they had certified the statement and proof of the Riemann Hypothesis in Alpöge's original version. Sernau's rewrite repository separately reports its own machine checks and explicitly states that no mathematician has read the whole proof and no accompanying paper exists. The original certification cannot automatically be treated as the same certification of the new version. The repository's generalized Riemann hypothesis covers Dirichlet L-functions, not all L-functions. The compact version's approximately 76,000 lines refer to code lines; it separately lists about 95,000 nonblank lines including comments and about 113,000 total lines. The readable version has about 300,000 code lines and 477,000 total lines. These different counting conventions cannot be directly equated with mathematical complexity, readability, or correctness.

The original Lean proof, approximately 17.4 million lines long, has been rewritten. The compact version contains about 76,000 code lines, or about 113,000 lines including blank lines and comments.

Remember the Riemann Hypothesis proof that left the mathematics community stunned last week? It has been rewritten.

This morning, Anthropic researcher Luke Sernau released new versions on GitHub. The shortest contains just 76,000 lines of code.

Article illustration

Link: https://github.com/lsernau/grh-lean

Sernau's repository is called grh-lean and contains two versions.

Readable version: About 300,000 lines of code across 801 files, with a guide, table of contents, and glossary, written for people who want to read it.

Compact version: About 76,000 lines of code across 792 files. The author writes in the documentation that this version prioritizes brevity alone and will not be easy to read.

Interestingly, Levent Alpöge and Claude jointly released a formal proof of about 17.4 million lines last week; this week, Luke Sernau, colleagues, and Claude have collaborated on a shorter rewrite.

17.4 million lines that nobody can get through

To understand how much of a headache this proof is, we need to go back a week.

On November 20, Anthropic mathematician Levent Alpöge announced that he and Claude had spent about six weeks proving the Riemann Hypothesis, which had stood unresolved for 167 years.

What they delivered then was not a paper, but Lean code.

Lean is a language and system for formalizing mathematical proofs, checking them under specified axioms and library dependencies. Determining whether the target conjecture has been proved also requires checking the theorem statement, axiom dependencies, and proof verification; successful compilation alone is not enough.

On November 21, a joint statement by Lean FRO and Mathlib confirmed that the Riemann Hypothesis statement and proof in Alpöge's original version were correct. That statement is not an item-by-item certification of the later rewrite.

Article illustration

But 175,000 files and 17.4 million lines are simply enormous.

That is seven times the size of Lean's entire mathematics library. In all that material, there is just one comment written for human readers.

Even Terence Tao said after looking at it that digesting it would take time.

Machines can check it from beginning to end; humans cannot even work out where to start reading.

So the community decided to try making the files smaller first.

Over a hundred people spent five days cutting it down

Entrepreneur Rohan Arun split the original into modules and used a GitHub bot to assign them, with contributors fixing whichever parts they claimed. More than a hundred contributors soon joined.

On the very first day, they removed over 11,000 files that were not referenced at all.

But by November 25, the code in the Lean community's public repository was still only about 24% smaller than the original.

Another project, rh-trim, went further, using a program to delete material automatically.

Article illustration

It first mapped the proof and found that the argument that actually completes it accounted for only 6.6%; the rest was tool-building. A single step alone accounted for 38% of all the code.

Then the deletions began: remove a batch, compile, inspect the errors, restore anything removed by mistake, and delete again.

Thirty-eight hours, 71 rounds.

Even the best round still had 17 errors.

The error count never reached zero. Even if the cleanup succeeded completely, it would reduce the total by only about 8% at most.

Even mathematician Alpöge himself could no longer brush it off.

On November 24, he posted a long admission on X: there was clearly a great deal of junk in the code, and the criticism was reasonable. He should have cleaned it up before release, but doing so had proved much harder than expected.

Article illustration

Anthropic researcher Luke Sernau took a different route: rewriting

Rather than touching the original 170,000 files, Luke Sernau worked with Claude and several Anthropic colleagues to rewrite the proof from scratch.

The overall approach follows Alpöge's method, but many steps use different arguments, and even the background material carried over from the original was rewritten.

He offered only a broad outline of how they did this in the Lean community's discussion forum.

Article illustration

First, expand all the nested definitions into one very long, flat proof.

Look along that long chain for places that can be combined or simplified.

Then fold it back into definitions.

This brings together duplications that were previously separated across several files and hidden from one another, allowing them to be handled together.

In some places, even that was not enough, and an entirely new argument was needed. According to reports, a large section involving mathematics related to Vandiver was removed in the rewrite. This does not mean the original proof used Vandiver's conjecture as an unproved additional premise; the specific dependencies still need to be checked against the axiom list and proof code.

However, Sernau states clearly on the repository's homepage that the proof has passed only machine checks: no mathematician has read it in full, and there is no paper.

Will it be down to one page next week?

The news quickly spread across X.

Mathematician Robin Houston joked in a post that, at this rate, it would be down to a single page next week.

Article illustration

Consider this past week: AI wrote the proof, AI compressed it, and machines ran the checks.

Which raises a question.

Suppose one day it really is compressed to a single page, every step is correct, and machines accept it, yet nobody can explain why it works.

Would that count as humanity having proved the Riemann Hypothesis?

References

[1] Alpöge's personal statement: https://alpo.ge/remark.pdf

[2] rh-trim:https://github.com/keithadler/rh-trim

This article is from Xi Xiaoyao Tech Talk, by A Ya.

Related topics

After reading

Join the AINRK community

Read how to join the community and connect with people working in AI.

Community information (opens in a new tab)