For engineers and developers: how the proof is checked
The proof is software, and checking it is a software-assurance problem. This page treats it that way: the codebase, the trusted computing base, and how to reproduce the checks.
TL;DR
- The proof is about 17 million lines of Lean 4 (175,187 modules) that depend only on Mathlib.
- It was checked by Lean's kernel and by several independent kernels; the five main theorems use only Lean's three standard axioms.
- A separate challenge file, written using only Mathlib, confirms the theorems state exactly the Riemann Hypothesis and GRH for Dirichlet L-functions.
- You can reproduce the fastest checks yourself; the steps are below.
The codebase
| Item | Value |
|---|---|
| Distribution | lean.tar.gz in 14 archive parts from alpo.ge (listed in footnote 1 of remark.pdf); 239,275,554 bytes; sha256 9631b4f0…49c7fc. Mirror: Deicyde/riemann-hypothesis |
| Size | About 17 million lines (community statement); 175,187 Lean modules (MIT) |
| Toolchain | leanprover/lean4:v4.33.1; Mathlib pinned to commit 0df444a3 (tag v4.33.1). This is the proof's own toolchain. Some checking tools below (the full lake comparator run and the bundled checkers) were run with Lean v4.36.0; that is a different, later toolchain for the tools, not a different version of the proof. |
| Dependencies | Mathlib only. "The codebase depends directly only on Mathlib." (community statement) |
| Libraries (lakefile) | BuildAid, CompanionTheory, Development, Formalism, GroundTheory, GroundTheoryFields, Lemmata, PositivityTheory, ReciprocityTheory, Supplements, Main |
| Options | autoImplicit = false, maxHeartbeats = 4000000 (20× the default), --tstack=400000 |
The entry point: Main.lean
import Statements
import Supplements.Kernels.MainTheoremsAll
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
RiemannHypothesis is Mathlib's definition (Mathlib/NumberTheory/LSeries/RiemannZeta.lean). The other four types are defined in the project's Statements.lean, so a reviewer can't trust them as written. That is why the community wrote a separate challenge file that restates all five theorems using only Mathlib, and compared the two mechanically.
The trust model in one diagram
- Elaborator (large, untrusted): turns source code and tactics into proof terms. Bugs here can't create false proofs, because its output is re-checked.
- Export:
lean4exportwrites every declaration as plain data (NDJSON). The solution export is 61.6 GB unpacked. It is "inert": no project code runs when it is checked. - Kernels (small, trusted): type-check every declaration in the export against the rules of Lean's type theory. Several independent implementations were used.
- Comparator: confirms that the theorem names in the solution have exactly the types in the challenge file, and that only allowed axioms are used.
The checks that were run
From Andrew Sutherland's verification page at MIT (as of its update at 04:35 UTC on 22 Nov 2026; the page says it "will be updated as the remaining checks finish"):
| Check | Kind | Result |
|---|---|---|
| All 175,187 modules compile (Lean v4.33.1, Mathlib v4.33.1) | Build | pass, zero errors |
#print axioms for the five theorems | Audit | propext, Classical.choice, Quot.sound only |
| No axioms declared outside Lean core | Audit | pass (15 axioms in the environment, all in Init) |
| Mathlib files identical to the official cache | Audit | pass (8,322 Mathlib and 378 dependency .olean files, byte for byte) |
Independent sandboxed lake build Main (no network, read-only source) | Rebuild | pass; its export is byte-identical to the published one |
leanchecker kernel replay of every module | Lean's own kernel (not independent) | 175,187 of 175,187, zero rejections |
| nanoda (Rust kernel) on the full export | Independent, full export | accepts (27 min 42 s on 80 threads) |
| con-leche master on the full export | Independent, full export | accepts 1,468,418 declarations in --verified mode |
con-leche --compare and con-ron --compare, challenge against solution | Independent, full export + statement match | all five theorems "justified by the solution" (con-ron: 1,468,418 solution declarations accepted in --verified mode) |
| lean4lean on every compiled module | Independent, compiled modules (not the export) | 175,187 of 175,187 (five needed a raised step limit on decide +kernel computations) |
Lean default and paranoid kernels on the export; full lake comparator on the main proof | Lean's own kernel + judge | not finished at that update (statement comparison and axiom check already passed); see Status for the latest. The completed lake comparator run listed at 04:16:52 UTC is for the Robin1984 sanity check only. |
The community statement adds that con-leche and con-ron "come with a formal proof, relative to set theory, that they cannot accept a false proof".
A sanity check that avoids Mathlib's zeta definition
The proof was also combined with an independent formalisation of Robin's and Lagarias's criteria (kimihiro64/Robin1984). This yields two unconditional statements about the divisor sum \(\sigma(n)\), which don't mention zeta at all. Both passed the same checks:
theorem robin_inequality :
∀ n : ℕ, 5040 < n →
((ArithmeticFunction.sigma 1 n : ℕ) : ℝ) <
Real.exp Real.eulerMascheroniConstant * (n : ℝ) * Real.log (Real.log (n : ℝ))
$$\sigma(n)\lt e^{\gamma}\,n\ln\ln n\quad\text{for all } n\gt 5040.$$
Our own spot checks
- Shortcut scan over all 175,187 source files: 0
sorry, 0admit, 0axiomdeclarations, 0opaque, 0@[implemented_by]/@[extern], 0native_decide, 0unsafe, 0ofReduceBool, and no kernel-skipping options. The 5run_cmds only edit Lean's library-suggestion deny list. - Partial build on an 8-vCPU machine: 1,056 modules compiled with 0 errors before we stopped it. A full build would take an estimated 40–45 hours on that hardware. We did not run the full build ourselves; we rely on the published checks above.
- Proof map: we traced the chain from
Main.leanthrough 40 key declarations and confirmed each name, file and line against the source. See the proof map.
Reproduce the fastest check yourself
From the MIT page. Check the sizes and hashes before you start:
| Item | Size | sha256 |
|---|---|---|
solution.ndjson.zst (download) | 7.7 GB (7,699,933,588 bytes) | 61a8938ad5f5e57397c1c0e3b954916af546d9004ade01c3555744a681b05381 |
solution.ndjson (unpacked) | 61,570,595,788 bytes | 5ea74b912147c5c93cc2b6d70cc727cf908df2f62ac6a20480a3fa02f6be244e |
challenge.ndjson.zst (download) | 47 MB | see the page's SHA256SUMS |
challenge.ndjson (unpacked) | 350,862,970 bytes | bd484ac9886a96f26b1d9a7a59ebd45b7a70d102c015d4f31f9302bbdd6ab2b9 |
con-leche, branch compare | commit | 5dc36dc15b7bee891a02406b78a8ac816a47baad |
con-leche, master (plain check) | commit | cd2eceab2e9b10404c663b468639c8aa99d0d1f2 |
con-ron, master | commit | 3f22699b8fd370f97fa9a784f7df7c5decf8e100 |
Machine: Lean v4.36.0 (the comparator tooling's version; the proof itself builds with v4.33.1). con-leche needs about 50 GB of RAM and took under four minutes on 64 threads; the full lake comparator needs roughly 100 GB of RAM and 70 GB of disk. Full commit hashes are from GitHub; the MIT page gives the short forms.
zstd -d --long=30 solution.ndjson.zst # --long=30 is required
zstd -d --long=27 challenge.ndjson.zst
sha256sum solution.ndjson challenge.ndjson # compare with the published hashes
git clone https://github.com/leanprover/con-leche && cd con-leche
git checkout 5dc36dc15b7bee891a02406b78a8ac816a47baad # branch compare; use cd2eceab2e9b10404c663b468639c8aa99d0d1f2 (master) for the plain check
lake build con-leche
.lake/build/bin/con-leche --compare challenge.ndjson solution.ndjson
The expected hashes are in the table above.
How this site is checked
This explainer has its own public CI (GitHub Actions runs). It checks the explainer, not the proof. Each push and pull request runs numeric fixtures (zeta against mpmath values, π(x) up to 106) and a Playwright suite against a local static server: KaTeX errors, console errors, internal links and anchors, the interactive activities, and layout at 17 viewports. After a deploy to main, a smoke job runs against the live Pages URL, and a weekly job checks external links. Details are on the Sources page.
Caveats engineers will care about
- A public challenge says the geometry predicate
anyGeometry(fun _ _ _ => True) is on the proof path. It is (8 steps belowriemannHypothesis); it is not a soundness gap, but the geometric step carries no logical weight. See Challenges and responses and proof-map steps 36–38. - The original build ran unsandboxed and invoked
leandirectly rather than throughlake build. A later sandboxedlake buildreproduced the export byte for byte, so the kernel checks apply to it. .oleanhashes depend on the build directory, and one module (…/RankPointCounts/LocModel.olean) compiles non-deterministically. Compare file by file, not by the manifest hash.- Older con-leche/con-ron binaries bundled with Lean v4.36.0 declined (exit 2, not a rejection) because of one reflexive inductive type. The master builds accept.
- Mathlib's own definitions are part of what you trust. The MIT page says a passing check "relies on those kernels and on Mathlib's definitions being what they are intended to be".
Want the mathematical strategy behind the code, with which Lean definitions match which steps? See How the argument works.
Reading the code
The proof map shows each step's real Lean statement and file path. The outer layers (RhOfRight.lean, CritLine.lean, Imprimitive.lean, TopWin.lean) are short and readable. The deep layers are large, machine-generated in style, and hard to read.