Archtin
All articles
AI ResearchMathematicsFormal Verification16 min read

Claude and the Riemann Hypothesis: How a 17-Million-Line Lean Proof Was Built and Verified

On 20 November 2026 Anthropic mathematician Levent Alpöge released a Lean proof of the Riemann Hypothesis built with Claude. A technical guide to the problem, the proof strategy, the Lean verification and what it means for engineers.

On 20 November 2026, Levent Alpöge — a mathematician at Anthropic — posted a four-page note saying he had, "working with Claude, discovered a proof of the Riemann Hypothesis." Alongside it he released about 17 million lines of Lean 4 code that formally prove not only the classical Riemann Hypothesis (RH) but the Generalized Riemann Hypothesis for Dirichlet L-functions. Within a day, the Lean FRO and the Mathlib Initiative certified that the statement and the proof are correct. This article explains what was proved, how the argument is shaped, how a machine-checked proof is verified, and why it matters to anyone who builds software.

TL;DR
RH (1859) says every non-trivial zero of the zeta function lies on the line Re(s) = ½. A human–AI collaboration produced a Lean proof in about six weeks. Machine checkers accept it and the theorem proved matches Mathlib's official statement — so it's very likely correct. What nobody has yet is a short human-readable explanation of why it works.

What happened, day by day

Date (2026)Event
~Early OctAlpöge and a non-public Claude model begin the final push; he says it took about six weeks
Sun 15 NovAlpöge messages CEO Dario Amodei asking how to announce a Lean-compilable proof
Thu 19 NovAnthropic lists on the US stock market — timing Alpöge himself called 'horrible'
Fri 20 NovFour-page remark and 17M-line Lean library released; Ravi Vakil (Stanford) posts a separate, human-written claimed proof the same day
Sat 21 NovLean FRO + Mathlib Initiative: 'full confidence… both the statement and the proof are correct'
22–24 Nov200+ people collaborate on a cleaned-up repository; first human-readable roadmaps and explainers appear

Alpöge also said the method extends to the Extended Riemann Hypothesis "with more time" and released separate advances on fluid-dynamics problems. The human-readable text version of the proof has not been released; Alpöge called his AI-generated draft a "travesty of slop."

The Riemann Hypothesis, technically

For Re(s) > 1, the Riemann zeta function is a sum over integers that Euler showed equals a product over primes:

ζ(s) = Σ_{n≥1} 1/n^s = Π_{p prime} 1/(1 − p^(−s))      (Re s > 1)
The Euler product: zeta 'knows' every prime

Riemann extended ζ(s) to the whole complex plane (except a pole at s = 1). It vanishes at s = −2, −4, −6, … — the "trivial zeros". Every other zero lies in the critical strip 0 < Re(s) < 1. RH claims they all lie exactly on the critical line Re(s) = ½. More than 1013 zeros had been checked numerically; none was ever off the line, but no finite check can prove infinitely many cases.

Critical strip: 0 < Re(s) < 1Re(s) = ½01-2-4trivial zeros-6½ + 14.13i½ + 21.02i½ + 25.01i½ + 30.42i½ + 32.94i½ + 37.59i½ + 40.92i½ + 43.33i½ + 48.01iRH claim:every non-trivial zerosits exactly on thedashed line
Animation: the first nine non-trivial zeros, each at ½ + t·i. RH says the dashed line holds them all.

You can reproduce those numbers yourself:

from mpmath import mp, zetazero, zeta
mp.dps = 20
for k in range(1, 6):
    rho = zetazero(k)          # k-th zero on the critical line
    print(k, rho, abs(zeta(rho)))
# 1 (0.5 + 14.134725141734693790j) 1.2e-20
# 2 (0.5 + 21.022039638771554993j) ...
Computing zeta zeros with mpmath

And this is the exact statement that was proved, as it lives in Mathlib:

def RiemannHypothesis : Prop :=
  ∀ (s : ℂ) (_ : riemannZeta s = 0)
    (_ : ¬∃ n : ℕ, s = -2 * (n + 1)) (_ : s ≠ 1),
    s.re = 1 / 2
Mathlib's definition — the theorem Alpöge's library proves

Why primes care about zeros

The prime number theorem says π(x), the number of primes up to x, is approximately Li(x) = ∫₂ˣ dt / log t. Riemann's explicit formula shows the error is a sum of waves, one per zero ρ, each of size about xRe ρ. If every Re ρ = ½, the error is as small as it can be:

RH  ⇔  π(x) = Li(x) + O(√x · log x)
x = 100π(x) — actual prime count (staircase)Li(x) — smooth prediction (dashed)shaded band ≈ √x·log x: the error RH allows
Animation: the prime staircase π(x) tracks Li(x) and stays inside a √x-sized band — the 'optimal control' RH guarantees.
  • Cryptography: Miller's deterministic primality test and many complexity bounds assume GRH. Those results are now unconditional — though practical RSA and elliptic-curve security doesn't change.
  • Algorithms: bounds on the smallest quadratic non-residue, class-group computations and some factoring analyses become proven rather than conditional.
  • Mathematics: thousands of papers begin "Assuming RH…". Their conclusions now stand on their own.

The shape of the proof

Alpöge's note says the argument is "a descendant of Stepanov's". In 1969 Stepanov gave an elementary proof of RH for curves over finite fields using an auxiliary polynomial that vanishes to high multiplicity. Over the integers, there is no Frobenius map and no obvious notion of multiplicity — Alpöge compares it to "differentiating whole numbers". The new idea, per the note, is a Fourier-analytic substitute for that multiplicity.

Stepanov (function fields, 1969)Frobenius map x → x^qAuxiliary polynomial vanishesto high multiplicity at pointsDegree bound ⇒ few points⇒ RH for curves over 𝔽qAlpöge–Claude (integers, 2026)Primes inert in a CM fieldTheta periods forced to behighly divisible ('multiplicity')Slope inequality ⇒ size bound⇒ RH for ζ(s) and GRHanalogy
The core analogy: the finite-field method is transplanted to the integers.

Early community reading guides (Yan Ru Pei's roadmap, Robin Zhang's preliminary note and Michael Rubinstein's AI-assisted explainer) describe the argument as a chain of reductions:

Theta-kernel periodsforced to be highly divisibleat primes inert in a CM fieldstep 1Averaged slope inequalityBost-style size boundcaps how big they can bestep 2≈ √x chain of theta liftsbetween unitary groupssupplies 'multiplicity'step 3Square-root boundon twisted von MangoldtRiesz meansstep 4Windowed Landau theorembound ⇒ no zerosright of Re(s) = ½step 5Output: zero-free half-planes Re(s) > ½ + ε for every ε — that is RH (and GRH for Dirichlet L-functions)Reading from early community roadmaps; experts are still checking each step
Animation: the chain of reductions from divisibility to zero-free regions.
  1. Forced divisibility. Integral periods of theta kernels, taken at primes inert in an abelian CM field, must be divisible by large powers — this plays the role of Frobenius.
  2. Size control. An averaged Bost-type slope inequality says those same quantities can't be too large. Divisible-but-small forces strong constraints.
  3. Multiplicity. A chain of roughly √x theta lifts between totally definite unitary groups provides the missing "vanishing to high order".
  4. Analytic bound. Together they give a one-sided square-root bound G(x) ≪ x1/2+ε on smoothed, character-twisted prime-power sums, on windows [Y, Y3/2].
  5. Zero-free region. A windowed version of Landau's theorem turns such bounds into "no zeros with Re(s) > ½", which is RH.
Heavy machinery
Experts on the Lean Zulip noted the cohomology bound uses Galois representations attached to automorphic representations of GLn over CM fields, base change, Jacquet–Shalika, Clozel's purity, Deligne–Ribet and more. Rubinstein's draft lists 195 published results that the Lean development takes as inputs.

What Claude actually did

This was not "type a prompt, get a proof." Alpöge says he planned for this problem since his student days and learned every tool he thought might be relevant. His account:

  • He identified a toy setting where two very different ideas could be combined.
  • He guided the work to the real setting analogous to that toy case.
  • From there Claude "far outpaced" him: in his words it "flew, and danced, and sparkled near that finish line," producing tens of surprising steps.
  • Claude also wrote most of the formalization — the part that turns an idea into 17 million machine-checked lines.

Mathematicians quoted by Science News stress the human side: Claude was trained on centuries of human mathematics, and the direction came from an expert. Zhang's note focuses on tracing credit to the many mathematicians whose work the proof uses.

How Lean verifies a proof

Lean is a programming language where types are statements and programs are proofs (the Curry–Howard correspondence). If a term type-checks against the type RiemannHypothesis, it is a proof. Tactics and automation can be huge and messy; what you trust is the kernel — a small type checker that re-checks every elaborated term.

theorem add_comm' (a b : ℕ) : a + b = b + a := by
  omega            -- tactic generates a proof term

#print axioms add_comm'   -- run this on any theorem
-- expected: [propext, Classical.choice, Quot.sound]
-- no 'sorry', no custom axioms
A toy Lean proof: the type is the claim, the term is the evidence

Three things can still go wrong: the statement could be mis-formalized, the proof could smuggle in extra axioms (or sorry), or the checker could have a bug. The verification below targets each one.

How the community checked it

The Lean FRO and Mathlib Initiative laid out four criteria, all reported satisfied:

Mathlib statementRiemannHypothesis : Propvetted by expertsBuild the library17M lines, ~175k filesreproducible exportStatement comparisoncomparator + con-lechesame theorem? yesIndependent kernelsLean kernel + 3rd-partycheckers re-verifyTrust the small kernel, not the 17 million linesAll four criteria were reported satisfied by the Lean FRO and Mathlib Initiative on 21 Nov 2026
Animation: the four verification gates, lighting up in turn.
RiskCheck that addresses it
Wrong statementUses Mathlib's existing RiemannHypothesis, written and reviewed before this proof existed
Doesn't buildDozens of people rebuilt it independently and got the same raw proof export
Proves something subtly differentA separate file imports only Mathlib; two tools (comparator, con-leche --compare) confirm the theorems match exactly
Checker bugExport re-checked by Lean's kernel, con-leche, con-ron and third-party checkers in other languages
≈81% standard background formalizedother≈5% core argument ↑17.4M lines of Lean, by folder (Pei's roadmap estimate)
Most of the code formalizes known mathematics; only a small slice is the new argument.

Proven, but not yet understood

WIRED called the proof "alien." It's larger than some operating systems, Alpöge admits it is "full of garbage", and the full build needs serious compute. Mathematicians want a proof to explain, not only to certify. So the community repository aims to make the code accessible (faster, modular builds), readable (Mathlib-quality style while keeping the logic) and properly referenced. Separately, Ravi Vakil's human-written claimed proof from the same day is still under review and is not verified.

Lessons for software engineers

ObservationWhat it means for your work
Verification scaled, understanding didn'tAI can produce correct artifacts faster than people can review them. Invest in checkers, not only in reviewers.
Trust a tiny kernelSame idea as a small, audited core with property tests: make what you trust small and everything else checkable.
Specs are the real attack surfaceThe hardest question was 'is this the right statement?' — the same as 'does the test assert the right thing?'
Independent re-implementationMultiple checkers in different languages is N-version programming for correctness.
Expert + model beats either aloneAlpöge supplied direction and taste; Claude supplied speed and breadth. Same pattern as agentic coding.
Readable code still mattersA 17M-line correct proof is still not useful to people until it's refactored — like legacy code that 'works'.

If you want to dig into verification-style thinking in systems, see how Google tests AI agents in a fake internet and cybersecurity in the AI era.

Open questions

  • Can the argument be compressed into a paper human experts can referee line by line?
  • Does it really extend to the Extended RH and to automorphic L-functions in general?
  • How will the Clay Millennium Prize treat a proof whose primary form is machine-checked code?

Sources and further reading

Keep reading

Suggested next articles based on this one.

Design it, don't just read it.

Practise LLD and system design problems with structured rubrics and AI feedback.

Start practising free