Does It Compile? The Riemann Hypothesis in Lean

An independent build and axiom check of the Alpöge–Claude formalization

github.com/JGalego/riemann · Run of 21–22 November 2026 · Page last updated 22 November 2026

On 20 November 2026, Levent Alpöge announced a proof of the Riemann Hypothesis found together with Claude, along with a Lean 4 formalization. This page reports an independent build of that formalization on AWS: all 175,187 project modules compiled from source, and the main theorems use no axioms beyond Lean's standard three. Mathlib came from its prebuilt cache; the caveats describe the limits of this run. All logs, scripts and hashes are below, so you can check the claims against the evidence, or run the build yourself.

Blog: Did Claude Prove the Riemann Hypothesis? Let's Ask a Spot Instance · Markdown source

Domain coloring of the completed zeta function ξ(s): one spinning pinwheel per zero, all on the critical line
The completed zeta function ξ(s) over 0 ≤ Im(s) ≤ 60, colored by phase. Each pinwheel is a zero of ζ, and every one shown sits on Re(s) = ½.

Summary

The archive from alpo.ge was checked against its published hash, built with lake build (175,187 modules, 0 errors), and the five main theorems were checked with #print axioms. Everything that was run passed. Checks that this run did not do are listed too, with pointers to others who have done them.

CheckResultDetail
Archive integrity ✓ pass sha256 of the merged lean.tar.gz matches 9631b4f0…49c7fc. Hashes of all 14 parts are under Downloads.
Full build ✓ pass All 175,187 modules built with 0 errors (460,321 warnings, mostly linter suggestions) in 21 h 19 m. build.log.gz
Axioms ✓ pass All five main theorems depend only on Lean's standard axioms (propext, Classical.choice, Quot.sound): no sorry, no added axioms. axioms.log
Statement is Mathlib's ✓ by inspection riemannHypothesis proves Mathlib's own RiemannHypothesis, not a local definition. Main.lean
Comparator check – not run here Done by the Lean community: leanprover-community/riemann-hypothesis.
Kernel replay with independent checkers – not run here Done by Andrew Sutherland: math.mit.edu/~drew/grh.
Human-readable write-up … pending The author describes the announcement as a rough timeline; a full write-up is still to come.

What was verified

The five theorems in Main.lean:

theorem riemannHypothesis : RiemannHypothesis := rhOfAll
theorem riemannZeta_eq_zero_re : RiemannZetaZerosOnLine := rhOfAll
theorem LFunction_ne_zero_of_half_lt_re : DirichletLNonvanishingRightOfHalf := allChi
theorem LFunction_eq_zero_re : DirichletLZerosOnLine := claimAll.2.1
theorem LFunction_eq_zero_re_of_isPrimitive : PrimitiveDirichletLZerosOnLine := critAll

1. The Riemann Hypothesis, as defined in Mathlib (Mathlib/NumberTheory/LSeries/RiemannZeta.lean):

def RiemannHypothesis : Prop :=
  ∀ (s : ℂ) (_ : riemannZeta s = 0) (_ : ¬∃ n : ℕ, s = -2 * (n + 1)) (_ : s ≠ 1), s.re = 1 / 2

2–5. The same for ζ and for Dirichlet L-functions, defined in the project's Statements.lean:

def RiemannZetaZerosOnLine : Prop :=
  ∀ s : ℂ, riemannZeta s = 0 → (¬∃ n : ℕ, s = -2 * ((n : ℂ) + 1)) → s ≠ 1 → s.re = 1 / 2

def DirichletLNonvanishingRightOfHalf : Prop :=
  ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ),
    1 / 2 < s.re → (χ ≠ 1 ∨ s ≠ 1) → DirichletCharacter.LFunction χ s ≠ 0

def DirichletLZerosOnLine : Prop :=
  ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ),
    0 < s.re → s.re < 1 → DirichletCharacter.LFunction χ s = 0 → s.re = 1 / 2

def PrimitiveDirichletLZerosOnLine : Prop :=
  ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N), χ.IsPrimitive →
    ∀ s : ℂ, 0 < s.re → s.re < 1 → DirichletCharacter.LFunction χ s = 0 → s.re = 1 / 2

Scope. "GRH" here means the Generalized Riemann Hypothesis for Dirichlet L-functions only, not for L-functions of number fields or automorphic forms in general. Statements 2–5 use the project's own definitions, which build on Mathlib's riemannZeta and DirichletCharacter.LFunction; statement 1 uses Mathlib's definition directly.

The axiom check (CheckAxioms.lean) and its output:

'riemannHypothesis' depends on axioms: [propext, Classical.choice, Quot.sound]
'riemannZeta_eq_zero_re' depends on axioms: [propext, Classical.choice, Quot.sound]
'LFunction_ne_zero_of_half_lt_re' depends on axioms: [propext, Classical.choice, Quot.sound]
'LFunction_eq_zero_re' depends on axioms: [propext, Classical.choice, Quot.sound]
'LFunction_eq_zero_re_of_isPrimitive' depends on axioms: [propext, Classical.choice, Quot.sound]

How the proof works

This is a plain-language sketch, drawn from the top of the Lean code and from the announcement. The first two steps can be read straight off the code. The third follows the announcement, which the author describes as a rough timeline rather than a write-up, so treat it as a map, not an explanation. For a more detailed tour, see the guide to its architecture.

The path of ζ(½ + it) winding through the origin at each nontrivial zero, with each zero lighting up on the critical line
The path of ζ(½ + it) for 0 ≤ t ≤ 52. Every time it passes through 0, there is a zero of ζ on the critical line. The Riemann Hypothesis says all the nontrivial zeros are there.

1. Only the right half needs checking. The zeros of ζ are mirror-symmetric about the line Re(s) = ½: a zero to the left of the line would have a twin to the right. So "every zero is on the line" is the same as "there are no zeros to the right of it". RhOfRight.lean proves this in about 60 lines from ζ's functional equation, which goes back to Riemann's 1859 paper (English translation) and is Mathlib's riemannZeta_one_sub (used here). CritLine.lean does the same for Dirichlet L-functions (Mathlib's DirichletCharacter.LFunction), using their functional equation completedLFunction_one_sub (used here). ζ is the simplest Dirichlet L-function, the character mod 1 (LFunction_modOne_eq), so the Riemann Hypothesis drops out as a special case of the generalized one (rh_of_every).

Watch step 1 being proved

These animations replay the Lean proofs of step 1 tactic by tactic, made with animate-lean-proofs: the header shows the tactic being run, and below it the goals split, grow and close. Each frame comes from replaying the proof against the verified build.

rh_of_right (1 min 32 s, 7 MB): the Riemann Hypothesis follows once there are no zeros to the right of the line. Watch each have add a hypothesis and the case split on Re(s) against ½.
critLine (32 s, 3 MB): the same reduction for Dirichlet L-functions.
gammaFactor_ne_zero (12 s, 0.5 MB).
rh_of_every (4 s, 0.2 MB): the Riemann Hypothesis as a special case.

Videos are 720p re-encodes, and nothing downloads until you press play. They show the same tactics as the Lean source linked above, which remains the text version.

2. Everything else proves one statement. The remaining ~175,000 files prove EveryCharacter: no Dirichlet L-function has a zero with real part greater than ½. That is the Generalized Riemann Hypothesis, and it is where the new mathematics lives. The main theorems in Main.lean cover ζ, every Dirichlet L-function and the primitive ones, with the statements spelled out in Statements.lean.

3. The idea: borrow a trick from finite fields. The finite-field analogue of the Riemann Hypothesis is part of the Weil conjectures, proved by Weil for curves (see his 1949 paper) and by Deligne in general. Stepanov found an elementary proof for curves (see Bombieri's Bourbaki exposé and Schmidt's book). He builds an auxiliary polynomial that vanishes to high order at every point being counted, and that multiplicity forces the count to be close to its expected value. Whole numbers have no notion of vanishing to high order ("something like differentiating whole numbers", as the announcement puts it).

The new ingredient is to fake multiplicity with chains of theta lifts (see Howe and Rallis). These carry automorphic forms from one unitary group to a larger one, step by step. In Lean, a chain is the inductive IsIterLift, where each step integrates against a theta kernel. Each lift plays the role of one more order of vanishing. For a sum over primes up to X, weighted by the von Mangoldt function, the chain is about √X lifts long.

A positivity argument built on the Guinand–Weil explicit formula (Guinand 1948) then turns this into "no zeros to the right of ½". The explicit formula for Dirichlet characters appears in Lean as norm_psi0_add_zsum_le.

The full argument also uses:

Lean names don't map one-to-one onto these ideas, so Lean links are given only where a file clearly matches.

The build statistics reflect that structure. Of about 4,000 hours of summed module compile time, 58% went to abelian variety and CM theory (Development/AbelianVarietyTheory), 15% to automorphic arithmetic, including the theta correspondence (Development/AutomorphicArithmetic), and 8% to the automorphic spectrum (Development/AutomorphicSpectrum). The slowest single module, at 22 minutes, is a theta-correspondence file about Siegel–Eisenstein series (see also the Siegel–Weil formula and Weil 1965).

Build statistics

The build ran on a c6a.48xlarge spot instance (192 vCPU, 384 GiB) in eu-west-1 from 21 Nov 19:07 UTC to 22 Nov 16:26 UTC, with no spot interruptions during the build. Summed module compile time was 4,009.2 hours, sampled memory peaked at 33.1 GB, and the build wrote 94.6 GB of .olean files. The metrics estimate $80.57 for spot compute and the data volume through the 22 Nov 18:09 UTC snapshot, including setup and time after compilation. This is not a final AWS bill and excludes root-volume charges and costs outside that recorded window.

Modules built over time

Cumulative count in 5-minute buckets, from timeseries.csv. Hover for per-bucket detail.

Where the compile time went

These hours sum per-module elapsed compilation times, not measured CPU usage. Modules build in parallel.

Part of the libraryModulesCompile-hoursShare
Development.AbelianVarietyTheory99,1872,328.558.1%
Development.AutomorphicArithmetic18,431614.015.3%
Development.AutomorphicSpectrum15,147306.67.6%
Development.WeilBound7,051161.54.0%
GroundTheory.HeightsAndTheta6,410111.22.8%
Formalism.LocalToGlobal5,50197.62.4%
Formalism.PeriodIntegrals4,35068.31.7%
Formalism.SharpRestriction3,09350.41.3%
ReciprocityTheory.ReductiveGroups2,79943.01.1%
Formalism.HermitianCurvature1,92232.00.8%
Everything else11,296196.14.9%
Total175,1874,009.2

The slowest modules, all theta-correspondence or abelian-variety files:

ModuleCompile time
…ThetaPairLifts.ThirdPlaceSeries.SiegelEisensteinSecondTermHypotheses22 m 23 s
…ThetaCorrespondence.FockModels.EveryCharacterE17 m 15 s
…IwasawaDecomposition.ChartTiedLevelChain14 m 43 s
…InertiaEigenvalues.LanglandsQuotientOfSpehTypeProductIsL14 m 33 s
…DivisorProofs.OpenFirstParametersOfPrintsUEStatement13 m 59 s

Per-module data for all 175,187 modules is in modules.csv.gz, and charts of CPU, memory, I/O and cost are in report.html.

Terminal dashboard showing build progress, busy cores and cost on the c6a.48xlarge
The live dashboard (aws/tui.py) that tracked the build.

Downloads

Source archive

The formalization as published at alpo.ge: 14 parts that concatenate to lean.tar.gz (239,275,554 bytes). Compare your downloads with these hashes.

FileBytessha256
lean.tar.gz (merged)239,275,5549631b4f020199e580ba86178cb56c6e9b09f690c2369a80dc4334aa93f49c7fc
lean.tar.gz.part0118,000,00086974b1c242ca7b6748f3299df4fc64ee0f6e06c776ac964fb64888101a3de77
lean.tar.gz.part0218,000,0001c2a2477354a9dfa97ff1ce54861e96ed885bd456fffbaaabc2028314a229c42
lean.tar.gz.part0318,000,0001465a23b1b579a881e24e5ffaf7c4c3727af28ea24741f1ec80e1d67947530a3
lean.tar.gz.part0418,000,0003929e327eecb4e2c5c7cae30e104e6a4a52fa6b82d28325bcda8e9da1c86893b
lean.tar.gz.part0518,000,000f25d7e80f7c4ad6d674aa18b323ca760f848857c8755501c149317c38a66c75d
lean.tar.gz.part0618,000,000a8c651a68327811b37dce3cca8eda5e0b2102fa227c0d395cbb7553e4dd69939
lean.tar.gz.part0718,000,00065c7e502a9b236a0f68d9e0aa6e089d4c09b9fc7a0960a149384063ccbe5e869
lean.tar.gz.part0818,000,00071b027ad6e4179c3a50ce72921e3fec0a2dd751ec7472ac2c644ad145a50ec7e
lean.tar.gz.part0918,000,00047718977ebaa8613f1647e93134479780db9320c5fa911463fd312a6257b796f
lean.tar.gz.part1018,000,0001d85ece78e0779cec26b0cce29c6462d9f90180e56d78120b152df101715240b
lean.tar.gz.part1118,000,000cf83a159d1a9540012229c376562587dd966da10cd657cbcef53acfd03232448
lean.tar.gz.part1218,000,0001aa5415bd2db83b2689afeeb946419303b3c4f599ae790ad74d38465f768b502
lean.tar.gz.part1318,000,0002de4edbce8ebdbfd0b94bc89bab518c7294209f408ec5b14a7be9e4832d9da81
lean.tar.gz.part145,275,55453f8ea43a9b5dcab97b84a52f3ac2848711c844a5420a4c56418093bacb3c6f6

Verification run

From the verification-2026-11-22 release. SHA256SUMS lists every file.

FileSizeWhat it issha256
STATUS3 Bfinal status written by verify.sh (ok)dc51b8c96c2d745df3bd5590d990230a482fd247123599548e0632fdbf97fc22
axioms.log435 B#print axioms output2c7b168860c39a4b4afd417a327bbbd8a2a0615372655c5d4bd329fb06e7f3d5
CheckAxioms.lean212 Bthe axiom check22670ef4959d77534f6a1356ceff360cd16283160bb2d3b684214f7a904e99fb
verify.sh4.1 kBthe script that ran35db07bc238598c2c7b6004fad4ff061c23b61e9545151ff95f342c455757ede
build.log.gz13.4 MBLake build log: every module, compile time, warningscf4ba8f69feac42f90855b5a6d497cc7d6f22f935089e3e2cbae2d9ecc4d2151
verify.out.gz13.4 MBfull output of verify.shaea7c81c3172d047eccc0b96b705ff19f042e1e0ee4a72e141f9ba4c7d1758cb
modules.csv.gz4.1 MBone row per module: finish time, compile time, .olean size, warnings286656209c62d460ba4501909820d489ed759d4f58ff1f75964ea90d829cf1b0
timeseries.csv23.8 kB5-minute buckets: modules, cores, memory, I/O, cost1fc5092e9c3b6cf698742e828fa989d6871a1ffa416d9c955262a0f6dc5d12c5
report.html2.1 MBcharts and tables of the above749d8a697a9203001c6513362994cc289e9e9cc510c73607b6a421bd2cfeda19
raw-metrics.tar.gz5.0 MBsysstat history, CloudWatch metrics, spot prices, .olean listingea83b72552462d33339d7f2411dd74a375c0baf29bd512a830a3193c76598961

Check it yourself

Check the archive (about 240 MB, a few minutes):

git clone https://github.com/JGalego/riemann && cd riemann
./fetch_merge.sh                      # download, merge and unpack into ./lean
sha256sum download/lean.tar.gz        # expect 9631b4f0…49c7fc

Build from scratch and check the axioms. This needs many cores and about 1.5 TB of disk; on 192 vCPUs it took 21 hours:

WORK=$HOME/riemann-work \
EXPECTED_SHA256=9631b4f020199e580ba86178cb56c6e9b09f690c2369a80dc4334aa93f49c7fc \
bash verify.sh                        # writes $WORK/STATUS, build.log, axioms.log

Or run it on an EC2 spot instance that resumes after interruptions:

aws/launch.sh          # launch (or resume) the instance
aws/watch.sh           # relaunch after interruptions, fetch logs, clean up when done
python3 aws/tui.py     # live dashboard

See the README for prerequisites and details.

Provenance

ItemValue
Source archivelean.tar.gz from alpo.ge, sha256 9631b4f020199e580ba86178cb56c6e9b09f690c2369a80dc4334aa93f49c7fc
Lean4.33.1, commit 819816b2e0a3bf405af45ae5c7af2491d8f5bee6 (x86_64-unknown-linux-gnu, Release)
Lake5.0.0-src+819816b
Mathlibcommit 0df444a360eaa60ab8c11dca51a86af692955474, prebuilt oleans from lake exe cache get
Machinec6a.48xlarge (192 vCPU, 384 GiB), eu-west-1c, spot at $3.19–3.22/h
Build2026-11-21 19:07 UTC to 2026-11-22 16:26 UTC (76,763 s)
Axiom check2026-11-22 16:26:48 to 16:27:59 UTC
Output1.2 TB build directory, 94.6 GB of .olean files; 460,321 warnings, 0 errors
Scriptverify.sh, sha256 35db07bc238598c2c7b6004fad4ff061c23b61e9545151ff95f342c455757ede

Caveats

References

More news, videos and discussion are collected in the README.