On November 20, Levent Alpöge posted a Lean library that claims a proof of the Riemann Hypothesis. It runs to about 17 million lines across some 175,000 files, and his note says he did the work with Claude.

The next day, the Lean and Mathlib communities published a joint statement saying they have "full confidence" the proof is correct.

Nobody read the 17 million lines. Nobody had to. How they got away with that is the most useful thing I've read this year about trusting code you didn't write.

"It compiles" was never the claim

The community statement hit #2 on Hacker News with 1,165 points, and it's short. It doesn't rest on "the build passed." It points to four questions from a Xena Project post written nine days earlier, and says all four are answered:

  1. Does the formal statement say what mathematicians mean by the theorem?
  2. Does the code compile?
  3. Does the code prove exactly that statement, using only the standard axioms?
  4. Could the proof be riding on a bug in Lean's kernel?

Most of us would stop at question 2. The other three are where the work went.

The only file you have to read

The community mirror lives at leanprover-community/riemann-hypothesis. Its first commit is the source exactly as published. Eleven minutes later, someone added src/Challenge.lean. It's 27 lines, it imports only Mathlib, and it states the five claimed theorems with sorry where each proof would go. An excerpt:

import Mathlib def DirichletLNonvanishingRightOfHalf : Prop := ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ), 1 / 2 < s.re → (χ ≠ 1 ∨ s ≠ 1) → DirichletCharacter.LFunction χ s ≠ 0 /-- The headline claim, stated with Mathlib's definition only. -/ theorem riemannHypothesis : RiemannHypothesis := by sorry 

RiemannHypothesis there is Mathlib's own definition, written by people who had no stake in this proof. That file is the spec. The 17 million lines are an untrusted implementation, and a tool called lake comparator checks that the proof's theorems match the challenge's statements exactly and that nothing beyond propext, Quot.sound and Classical.choice was assumed.

Why the spec gets this much care: the Xena post shows a Fermat's Last Theorem statement that compiles fine and is trivially false, because Lean's naturals include 0 and 0³ + 0³ = 0³. A wrong spec can still compile. A proof of a wrong spec is worthless, however long it is.

To be fair to the title, 27 lines isn't everything you trust. Those lines lean on Mathlib's definitions of zeta and L-functions. For one related inequality, the verifiers counted the declarations its meaning depends on: 1,801.

Building the proof means running it

Here's the part that will feel familiar to anyone who has audited a dependency. Building a Lean project runs code. Elaboration, the step that turns source into kernel terms, can execute metaprograms. On HN, TwoFx (who works at the Lean FRO) laid out the fix: elaborate the challenge and the solution separately, export both to a plain data format, and let the checkers read only that.

The repo's README spells out the sequence. Export the challenge in a clean clone. Build the submission in a sandbox with no network. Export it there too. Only the export file leaves.

Andrew Sutherland at MIT runs a verification page with every log and hash. A separate sandboxed rebuild produced an export identical to the published one, byte for byte: 61,570,595,788 bytes.

The compiled files told a smaller story. 175,186 of 175,187 matched. The odd one out differed by 38 bytes: the name of a bound variable inside an equation lemma that Lean generates on first use. Two theorems in that file both asked for it, Lean elaborates theorem bodies in parallel, and whichever got there first named the variable. Compiled single-threaded, the module came out the same six times in six. Lean fixed the underlying race in v4.36.0, and the lemma isn't in the export, so no check is affected. Anyone who has chased a flaky build will recognize that bug, and it's oddly comforting to see it turn up next to a proof of RH.

Five checkers, written separately

Question 4 is the kernel. Lean had a soundness bug earlier this year (the Xena post mentions it), so trusting one checker isn't enough. As of Sunday, the MIT page listed these results:

checker language result Lean kernel C++ all 175,187 modules replayed, zero rejections nanoda Rust accepts the full export, 27 min 42 s on 80 threads lean4lean Lean 175,187 of 175,187 modules pass con-leche Lean 1,468,418 declarations, 3 min 15 s on 64 threads con-ron Rust accepts, 7 min 6 s on 64 threads 

con-leche is the interesting one. It ships with a Lean proof that it can't accept a proof of False, relative to a set-theory model. Its README says Claude implemented it and proved it consistent, under close supervision from a Lean FRO engineer. So AI wrote the checker too. The difference is that the checker carries a proof about itself.

Not everything had finished. Lean's own kernel, run single-threaded on the 62 GB export, had been going since November 20 with no verdict yet. It had already accepted every module from the compiled files.

What you can read or run today

I didn't build or check anything. This was a read: the repo through the GitHub API, the MIT page, the handbook, both HN threads.

  • The spec and the top of the proof. src/Challenge.lean and src/Main.lean in the mirror. Main.lean is five theorems, each a few lines, calling into the rest.
  • The handbook. The Riemann Proof Handbook (Show HN, 81 points) writes the Lean code out as math, in PDF and EPUB. Volume 2 opens with "The proof in one page": the top of the proof is four steps, and the last one uses only Mathlib and the functional equation of zeta. That last step is classical, and short enough to check over coffee.
  • The check itself, if you have the hardware. The fastest independent route on the MIT page is con-leche. It needs Lean v4.36.0 and about 50 GB of RAM:
git clone https://github.com/leanprover/con-leche && cd con-leche git checkout compare lake build con-leche .lake/build/bin/con-leche --compare challenge.ndjson solution.ndjson 

You also need the two exports from that page. The solution is 7.7 GB compressed and unpacks to 61.6 GB.

A few rough edges. The handbook's front matter still says nobody has built the project in full, which was already out of date when it hit HN, and commenters said so. It also says AI agents drafted most of the text and that it isn't a check of the math. Much of the Show HN thread argued about its prose. And the mirror's build cache holds files built by volunteers from unreviewed pull requests. The README says plainly not to treat it as a check.

The lesson isn't about math

Look at the shape. A short spec, written and reviewed by people. An enormous implementation nobody reads. A sandboxed build that emits an inert artifact. Several independent checkers, one of them proved unable to accept a false proof.

We already have rough versions of each: types and tests, CI sandboxes, reproducible builds. What we don't have, for most code, is a checker that proves an implementation meets its spec. Our specs are mostly tests, and tests check examples, not every input.

As agents write more of the code, the scarce skill becomes writing the 27 lines. Reading the 17 million was never going to scale anyway.

If an agent handed you a million lines tomorrow, what's your Challenge.lean: the one short file you'd actually read before you trusted the rest?