Proofs and programs
Draft
As this page loaded it checked a proof of Euclid's theorem, that above every number there is a prime. It read 13,265 lines exported from Lean 4, a proof assistant (a program that checks a formal proof step by step as it is built), found 311 declarations in them, and accepted each in turn, the theorem last. The program that ran is a kernel, the small core of a prover that alone decides what counts as proved: this one is written in plain JavaScript, implements Lean's logic directly, and checks Lean's own declarations starting from an empty environment.
chart the 311 declarations under Euclid's theorem, in the order of the export, a bar to a declaration;
height: the steps the page's kernel took to compute its type (logarithmic; at most 824)
258 of Lean's core library ↑ ▂▅▃▇▂▃▅▂▃▇▅▂▃▂▅▃▂▇▃▂▅▃▂▃▅▂▇▃▅▂▃▇▂▅▃▂▃▅▂▇▃ ▂▃▅ ▃▂▅ ▂▃
───────────────────────────────────────────────────────────────────────────────────
53 of the development ↓ ▃▅▂ ▂▇▃▅ ▅▇▃ ▂▅ ▅▃ ▎
1 Nat 311 Euclid.exists_prime_gt
source theorem exists_prime_gt (n : Nat) : ∃ p, n < p ∧ Prime p
checked 13,265 lines of the export read; 311 declarations (365 constants) accepted, starting from an
empty environment, in 33,829 steps of the kernel; axioms under the theorem: none
corrupt line 13,250, one index lowered by one (10531 to 10530): the term now needs n! + 1 itself
to be prime, where it had the least factor of n! + 1
refused at declaration 311, Euclid.exists_prime_gt: application type mismatch;
the 310 declarations before it stand
context the same kernel, run over Lean's whole core library, accepted all 196,546 declarations (recorded)
(the live figure needs JavaScript; a Worker loads about 0.9 MB of data and 0.2 MB of code)
The 311 declarations spell out everything that the theorem and its proof mention, down to the natural numbers, equality, and "there exists". Nearly every declaration, whether a definition or a theorem, pairs a term (an expression) with its claimed type (the kind of thing the expression represents, or the proposition it proves); checking one means computing the term's actual type by a short list of rules and verifying that it matches the claimed type. The final declaration is Euclid's theorem itself: its type is the statement ∀ (n : Nat), ∃ p, n < p ∧ Euclid.Prime p, its term is the proof, and no declaration beneath it is an axiom.
Two things about that run are the subject of this series. The first is that it can be done: a proof is a concrete object, a term that one program writes to a file and another judges by a calculation short enough to finish while a page loads. The second is what the verdict covers. The kernel established that every term has the type its declaration states. It did not establish that the type says what Euclid proved: whether Euclid.Prime actually means prime is not a question a kernel can ask, and has to be settled by a human reader inspecting the two lines that define Euclid.Prime and the definitions they rest on.
Corrupt the exported file by lowering a single index by one, so that the proof treats \(n! + 1\) itself as prime instead of taking its least prime factor (the classic slip in retelling Euclid's argument), and the kernel halts at the theorem and reports the exact mismatch. Of the 6,330 such changes that can be made under the theorem, the kernel refuses 6,286, and each of the 44 it accepts leaves another valid term of the exact same type.
The same act, at another scale, stands behind what was claimed for the Riemann hypothesis in November 2026. On 20 November Levent Alpöge posted a remark of four pages. "I believe I have, working with Claude, discovered a proof" of the hypothesis, it says, and "I decided to only present Lean": the proof came in one form, a library in Lean of 175,187 files and 17,374,215 lines, according to the verification page maintained by Andrew Sutherland.L. Alpöge, untitled remark, alpo.ge/remark.pdf, 20 November 2026. A. Sutherland, "Verification files for the Lean proof of the Riemann Hypothesis", math.mit.edu/~drew/grh, as last updated on 27 November 2026. The remark also claims the generalized Riemann hypothesis; in the statements that were checked that means Dirichlet L-functions, all moduli and all characters. The next day the Lean Focused Research Organization (FRO), which develops Lean, and the Mathlib Initiative, named for Lean's library of mathematics, published a joint statement giving their verdict:
We have full confidence that Alpöge's proof of the Riemann Hypothesis is correct, and we congratulate him on this achievement.
—Lean FRO and Mathlib Initiative, "Lean verification of the Riemann Hypothesis" (2026). Joint statement on the Lean community blog, 21 November 2026, its second paragraph, whole; the first says what had been released the day before.
Their rationale rests on four questions that Kevin Buzzard had posed nine days earlier for evaluating any claim that a theorem is correct simply because it was checked in Lean. Buzzard opened that post by contrasting two opposite reactions:
Last month’s theorem dump by OpenAI consisted of 722 mathematics papers, around 45% of which came with some Lean code. Three of the (non-Leanified) papers have since been retracted because of a sign error. Some people might say “well, the papers that come with Lean code are definitely correct because that’s how Lean works”. Others might say “well Lean had a soundness bug and could well have more, and AIs will reward hack, so Lean verification doesn’t tell us much at all”. The truth, unsurprisingly, is more subtle, and this post is an attempt to explain it.
—Kevin Buzzard, "…and the proof is checked in Lean" (2026). Xena project blog, 12 November 2026, first paragraph of the introduction. To reward hack is to pass a test without doing what the test was meant to show.
Buzzard asked four things, and the joint statement answered each in turn (Section 13.7 quotes both in full). First, does the Lean statement actually express the informal mathematical statement? Here the statement comes directly from Mathlib, where specialists had already vetted it. Second, does the code compile? Dozens of people reported that it did, each build reproducing the same exported file. Third, does the code prove that exact theorem as stated rather than something weaker? Two comparison tools matched the proved theorem against a separate file that isolates the statement. Fourth, could the proof exploit a bug in Lean's kernel? Several other checkers accepted the same exported proof, an inert text file out of reach of the proof's own code.
wire 1 source ─── 2 build ─── 3 export ─── 4 kernels ─── 5 comparator ─── 6 the statement
what was Lean runs inert text each computes is it the theorem read by a person:
written the code every type asked for? no program checks it
readable edition, as reported
803 files, 477,124 lines · 9,852 jobs, 32 min 12 s · 4,485,867,644 bytes, 216,571 declarations ·
5 kernels accept · 5 theorems match a challenge of 52,173 declarations · 16 lines, 4 definitions
original archive, as reported
175,187 files, 17,374,215 lines · 183,903 jobs, 52 h 12 min · 61,570,595,788 bytes,
1,468,418 declarations · 5 kernels accept · 5 theorems, challenge of 51,692 declarations · 16 lines
Euclid's theorem, recorded for this series
1 file, 237 lines · lean: exit code 0 · 702,412 bytes, 311 declarations · 8 kernels accept:
5 only replay, 3 also hold the axioms to a list · a stand-in written here: 4 of 4 checks pass
(lake comparator: not run, no sandbox tool) · 16 lines
checking lean, lake build ●──● trusts all that ran
leanchecker on compiled files ○╌╌● "not an external verifier"
lake check ●──●──●──● export, kernels, three axioms
lake comparator ●──●──●──●──● and it is the theorem asked for
a person ● reads the statement
(the live figure needs JavaScript and loads about 0.27 MB of data)
The phrase "checked in Lean" therefore covers at least three distinct procedures, each trusting different components. A plain build that succeeds trusts everything that ran during compilation, including custom programs inside the proof project itself. Replaying the compiled files that a build leaves on disk still trusts how those files were produced, and in Lean 4.35.0 the documentation for that replay tool warns that it is "not an external verifier". In the third and strictest procedure, the build runs inside a sandbox (a restricted environment), writes out an inert text export containing nothing executable, passes that export to standalone kernels for replay, and uses a comparator to verify that the proved theorem matches a separate, trusted statement file from the permitted axioms alone. Only the third procedure ties a theorem securely to an isolated statement. Programs carry out every link in that chain except the last: judging whether the formal statement captures the intended theorem remains the reader's job.
Verifying one artifact says nothing about another. The joint statement of 21 November concerns the archive of 20 November, as do an early critique of the proof and an audit addressing part of that critique (Section 13.7).The critique, a manuscript by J. L. Nielsen dated 20 November 2026, was not found for this series and is known here only as the audit quotes it: it denies that the formalization contains a proof of the hypothesis, among other reasons because a predicate meant to express a geometric condition is defined as True. The audit is E. Schiller, "Does a Trivially True Predicate Invalidate a Kernel-Checked Proof? An Independent Build and Dependency Audit of the Alpöge Lean Archive for the Riemann Hypothesis", arXiv 2611.37492, 27 November 2026, a preprint that is not peer-reviewed: it confirms the observation about the predicate, holds that such constructions "do not, by themselves, invalidate a theorem accepted by a sound verification chain", and says of itself that it "is not a certification of the claimed proof". This series examines a single later version: the readable edition, published on 25 November as a shorter rewriting that proves the exact same five statements, word for word, over a later Mathlib. It spans 803 files and 477,124 lines (299,902 of them code, where the original archive has 15,531,759) and comes with a reading guide and an index.The folder grh/ of github.com/lsernau/grh-lean, one commit, 72fead1, of 25 November 2026, on Lean 4.35.0 and Mathlib at commit 56a0058. It describes itself as "a shorter rewriting of Levent Alpöge's Lean proof" in which "many steps are proved by other arguments", and says that its Lean text and its documents were written by Claude (Section 12.5 quotes the sentence). Counts and checks: A. Sutherland, "Verification files for the shorter Lean proof of RH and of GRH for Dirichlet L-functions", math.mit.edu/~drew/shortgrh, as last updated on 27 November 2026; counted again as text for this series, the files give the same numbers. Code means lines that are neither blank nor comment. Every excerpt, count, and diagram of the proof in these pages comes directly from the source text of that readable edition; for other editions, these pages report only what named documents state at the dates given. Its published checks are those listed by its authors and those on a second verification page of Sutherland's, where it was built in a sandbox, its export was accepted by Lean's kernel and four other checkers (five opinions on one file, not five separate witnesses), and the comparator matched all five statements, the last run ending on 25 November at 21:47 in New York. The repository's own front page states plainly where this leaves matters: "The proof has passed machine checks only, listed in each folder's README. No mathematician has read it through, and no paper comes with it."The front page of github.com/lsernau/grh-lean, which holds this edition and a compact one, under "Status", as read on 1 December 2026.
The argument. The series explains how mechanical proof checking works, and what it leaves open, in five steps that each build on the one before. First, a proof can be represented as a concrete computational object. Computation itself distills to rewriting terms by one substitution rule (Section 1), while types filter out nonsensical terms and force evaluation to halt (Section 2). Meanwhile, logic represents a proof as a finite tree of inference steps whose redundant detours can be removed (Section 3). Those two subjects turn out to be the same: a proposition is a type, a proof is a program of that type, and simplifying a proof is running the program (Section 4). Second, a single typed language can state ordinary mathematics. Simple types cannot mention values like numbers, so none of them can state Euclid's theorem; once types may depend on values, "for all" becomes a function type and "there exists" becomes a type of pairs (Section 5). Lean's core logic is such a language, built from twelve kinds of term and a short list of rules applied by the kernel (Section 6), with three axioms supplying the classical reasoning of everyday mathematics (Section 7). Third, nobody writes raw kernel terms by hand. Because the kernel's language requires every implicit detail to be spelled out, and because the kernel checks every finished term from scratch, complex programs can construct those terms on a user's behalf. Lean is also a programming language written in itself (Section 8): what a mathematician writes becomes a kernel term through untrusted programs, namely an elaborator that fills in omitted details (Section 9) and tactics that search for a proof term to hand to the kernel (Section 10), working over a library that builds real numbers, limits, and the zeta function from those same foundational rules (Section 11). Search is untrusted because checking is trusted. Fourth, "checked in Lean" names an explicit chain of trust: the statement and every definition beneath it, the permitted axioms, the kernel, the exported proof, and the machine environment that built and checked it, while excluding every program that searched for the proof. Producing formal proofs at scale (Section 12) and certifying them against tampering (Section 13) are engineering disciplines, applied in November 2026 to a claimed proof of the Riemann hypothesis, 17 million lines long. Fifth, a certificate is not an explanation. Even when every link holds, the kernel confirms only that a term has a stated type; recovering what the theorem means, why it holds, and what ideas drive the proof remains human work carried out with still-young tools (Section 14).
A formal proof is a program whose type is the theorem. A small trusted checker computes that type, and everything else, the language, the tactics, whoever or whatever wrote seventeen million lines, has to be believed only as far as the checker and the statement go.
The argument of the series in five stepsleft to right, a step to a cell; under each name, the Sections that make the step
1a proof can be an object Sections 1 to 4
Terms rewrite by one rule, types make them halt, proofs are trees: a proposition is a type, and a proof is a program of that type.
5one language states mathematics Sections 5 to 7
Types may mention values. Lean's logic: twelve kinds of term, a short list of rules, a small kernel that applies them, three axioms.
8nobody writes kernel terms Sections 8 to 11
An elaborator, tactics and a library turn a line of mathematics into a term. Search is untrusted, checking is trusted.
12a chain of trust with named links Sections 12 and 13
The statement, the definitions under it, the axioms, the kernel, the export, the machine that built it: each link can be audited.
14a certificate is not an explanation
The kernel says that a term has a type. What the theorem means and why it is true, people rebuild from the artifact.
green: the step at which the claims of November 2026 are judged
What is being replaced, and why now. Historically, mathematics has relied on human readers rather than programs to accept a theorem: confidence grows out of a social process, and the reliability of the literature rests on mathematicians thinking critically about ideas rather than checking formal symbol manipulations.De Millo, Lipton and Perlis, "Social processes and proofs of theorems and programs", Communications of the ACM 22(5), 1979, p. 271: "it is a social process that determines whether mathematicians feel confident about a theorem". Thurston, "On proof and progress in mathematics", Bulletin of the AMS 30(2), 1994, Section 4: reliability "does not primarily come from mathematicians formally checking formal arguments; it comes from mathematicians thinking carefully and critically about mathematical ideas". That arrangement strains whenever a proof outgrows what its readers can inspect in full. The four-color theorem was proved in 1976 with a computer search through about a billion cases, and the 1998 proof of the Kepler conjecture appeared in print in 2006 without complete certification from its referees.Gonthier, "A computer-checked proof of the four colour theorem", report, Microsoft Research Cambridge, Section 1: the search "covered, quite literally, a billion cases". Hales and 21 others, "A formal proof of the Kepler conjecture", Forum of Mathematics, Pi 5, 2017 (arXiv 1501.02155), Section 1.
An alternative arrangement dates from around 1967, when N. G. de Bruijn began Automath, a formal language in which mathematics is written out completely enough for checking to be mechanical. Out of Automath came a design principle now called the de Bruijn criterion: whatever a proof assistant accepts should be checkable again by a small program written apart from it.The name and the formulation are from H. Barendregt and F. Wiedijk, "The challenge of computer mathematics", Philosophical Transactions of the Royal Society A 363, 2005, Section 3; p. 12 of the preprint. Section 13.8 quotes the passage. On Automath: the Automath Archive, About Automath, Eindhoven University of Technology. Satisfying that criterion requires two things, both demonstrated by the run that opened this page: proofs must exist as concrete objects that can be exported, and the program that checks them must be small enough for a skeptic to read through and rewrite from scratch.
lanes 112 dated events in four lanes on one axis of time, 1879 to 2026; a mark to an event
1875 1900 1925 1950 1975 2000 2025
logic and foundations 24 ▪ ▪▪ ▪▪▪▪▪ ▪▪▪▪▪▪▪▪▪▪▪ ▪▪ ▪ ▪▪ ▪ ▪
lambda calculus and type theory 28 ▪ ▪▪▪▪▪▪▪▪ ▪ ▪▪ ▪▪▪▪▪▪▪▪▪▪ ▪▪▪▪▪▪▪▪ ▪
provers and libraries 25 ▪ ▪▪ ▪▪ ▪▪▪ ▪ ▪ ▪▪▪▪▪▪▪▪▪▪▪▪
theorems checked by machine 35 ○ ○○○ ●●●●○●○ ●●●●●●●●●●
○ computed or found by machine, from 1976 ● formally checked, from 2005
of the 35, 21 are dated 2020 or later and 13 fall in 2026
enlarged 2020 to 2026, and under it 10 November to 2 December 2026:
12 Nov four questions for any claim "checked in Lean" · 20 Nov the original archive ·
21 Nov full confidence · 25 Nov the readable edition · 27 Nov all checks reported finished
(the live figure needs JavaScript and loads about 0.08 MB of data)
For decades, formal verification came long after discovery: the four-color theorem was formally checked in 2005, and the Kepler conjecture in 2014. Since 2020 the record of machine-checked theorems has accelerated as three developments converged. First came a prover with a unified library that working mathematicians embraced: Lean began in 2013, and Mathlib holds 2,340,927 lines at the commit underlying the readable edition. Second, frontier research began to be formalized on request: between December 2020 and July 2022, contributors checked a theorem of Clausen and Scholze about whose proof Scholze had expressed "some small lingering doubts". Third, automated systems learned to write Lean: starting in October 2025, provers built by two companies filled open lemmas in a formal proof on sphere packing, and in September 2026 a model was reported to have formalized Fermat's Last Theorem in over 13.4 million lines across 11 days.In order: the mathlib community, "The Lean mathematical library", CPP 2020 (arXiv 1910.09336), Section 1.1, and a count of Mathlib's text made for this series; Scholze, "Liquid tensor experiment", Xena project blog, 5 December 2020, and the Lean community blog of 15 July 2022; Birkbeck, Hariharan and Lee, "The Sphere Packing Project, post 1: the story", Lean community blog, 2 March 2026; Buzzard, "FLT: Anthropic has beaten me to it", Xena project blog, 4 September 2026, who compiled the code and ran the comparator on it. Section 12 tests this third development on a small scale in one run of one model: working from Lean's core library alone (the library that ships with Lean), the model first wrote its own statements for twelve theorems from Wiedijk's benchmark list of 100 and produced Lean-accepted proofs of 11, ending with the law of quadratic reciprocity, in 1,136 lines; the twelfth, Fermat's Last Theorem, it did not attempt.F. Wiedijk, "Formalizing 100 theorems", cs.ru.nl/~freek/100, as read on 1 December 2026: a list of 100 theorems on which provers are compared by how many each has formalized. The earlier history on that timeline is told separately on this site in The painted rock and is not retold here.
The series. The five steps span 14 Sections, each led by interactive figures that run in the browser, and nearly all ending in Lean itself with code to run and Lean 4.35.0's exact output. By the end you should be able to do three things with a formal proof: produce one in Lean 4, state precisely what a check of it establishes and what it trusts, and read through one that came with no human exposition. Those three skills occupy Sections 12 to 14; the 11 Sections before them build what they need.
- Lambda calculus. Proofs will be represented as terms, and a kernel checks them by rewriting: three kinds of term and one substitution rule suffice for all computation, including terms that never halt.
- Types. Theorems will be represented as types, and type checking must end: simple types guarantee termination, at a sharp and measurable cost in expressive power.
- Proofs as objects. Formal logic represents a proof as a finite tree of inference steps, and simplifying away its detours guarantees consistency.
- Curry-Howard. Proof trees and typed terms have the exact same structure: checking a proof is computing a type, and simplifying a proof is running a program.
- Dependent types. Allowing types to mention values turns a language for typing programs into a language capable of stating all of mathematics.
- The kernel. Where Sections 1 to 5 lead: Lean's core logic in full, and the small program that enforces its rules.
- Axioms and classical mathematics. Constructive logic alone stops short of ordinary mathematics: what each of Lean's three axioms states, enables, and costs.
- Programming in Lean. Lean as the programming language in which its own tools are written: two evaluators, monads, and programs that build proofs.
- The elaborator. How concise mathematical text becomes an explicit kernel term through metavariable holes, unification, coercions, and type classes.
- Tactics and automation. Untrusted programs that search for proofs: what
simp,omega,decide, and custom tactics hand to the kernel. - Mathlib. How the real numbers, limits, and the zeta function are built from scratch, and how to audit a formal statement, the one link no program checks.
- Producing. The chain of trust from the author's side: writing statements first, iterating with the checker, and scaling to proofs of millions of lines.
- Certifying. The same chain from the auditor's side: every way a Lean file can appear to prove a theorem while cheating, and the gate that blocks each exploit.
- Understanding. What a certificate leaves unsaid: reading a formal proof that nobody explained, a reading list, and how these examples were built.
The statement, read once. One link in the verification chain falls to the human reader, and the verification page for the readable edition points directly to what must be inspected: checking whether the formal statements express what the two hypotheses are understood to mean comes down to reading the edition's file of statements alongside three definitions in Mathlib, riemannZeta, DirichletCharacter.LFunction, and RiemannHypothesis.A. Sutherland, "Verification files for the shorter Lean proof of RH and of GRH for Dirichlet L-functions", math.mit.edu/~drew/shortgrh, under "Caveats", second paragraph, on the page as last updated on 27 November 2026; Section 14.1 quotes the passage. The Lean reference says the same of the tool, in its chapter "Validating a Lean Proof": "Lean can establish that a statement has been proven, but not whether it is the intended statement."
The first of the edition's five target theorems is theorem riemannHypothesis : RiemannHypothesis, pairing a theorem name before the colon with its type after the colon. That type is the mathematical statement, taken directly from Mathlib rather than defined by the proof's authors. Below are the theorem header as the edition states it and Mathlib's definition, in their own source lines (Section 12.3 examines the edition's theorem file, and Section 11.5 the underlying Mathlib definition).
theorem theorem riemannHypothesis : RiemannHypothesis := by
sorry (the readable edition of the proof, Challenge.lean, lines 7 to 8;
the file states it with sorry, the proof is in another file)
statement def RiemannHypothesis : Prop :=
∀ (s : ℂ) (_ : riemannZeta s = 0) (_ : ¬∃ n : ℕ, s = -2 * (n + 1)) (_ : s ≠ 1), s.re = 1 / 2
(Mathlib/NumberTheory/LSeries/RiemannZeta.lean, lines 185 to 186)
unfolded each definition into the definitions its text names, a level at a time
level new at this level so far: definitions lines
1 RiemannHypothesis 1 5
2 riemannZeta Complex Nat 4 39
3 HurwitzZeta.hurwitzZetaEven Real 6 50
4 5 more, among them CauSeq.Completion.Cauchy and Rat 11 87
5 10 more, among them Complex.Gamma, Real.pi and Int 21 193
6 10 more 31 258
7 8 more, among them mellin 39 295
8 4 more 43 333
43 definitions in 24 files; the file of the first imports 4,889 modules
(the live figure needs JavaScript and loads about 0.15 MB of data)
In Mathlib, RiemannHypothesis has type Prop, meaning it is a proposition; its docstring speaks the Curry-Howard language of Section 4, where proving a proposition means constructing a term of that type. Read as a type, the body of RiemannHypothesis is a function type taking four inputs: a complex number s, a proof that riemannZeta s = 0, a proof that s is not of the form \(-2(n+1)\) for any natural number \(n\), and a proof that s ≠ 1. Because those last three inputs are proofs whose names are never referenced later, Lean writes underscores for their names and prints such unnamed proof arguments back as implication arrows. Given all four inputs, the function returns a proof that s.re, the real part of s, equals \(1/2\). In ordinary mathematical notation, every \(s \in \mathbb{C}\) with \(\zeta(s) = 0\), \(s \notin \{-2, -4, -6, \dots\}\), and \(s \neq 1\) satisfies \(\operatorname{Re} s = \tfrac12\).
A careful auditor checks three subtleties in those two lines. First, Lean's natural numbers ℕ begin at 0, so writing -2 * (n + 1) rather than -2 * n is essential to exclude -2, -4, -6, ... without accidentally excluding 0; Buzzard's 12 November post opens with a two-line statement that looks like Fermat's Last Theorem until a 0 edge case spoils it, illustrating that a misstated theorem compiles just as cleanly as an intended one. Second, every function in Lean is total and returns some value at every input (Section 7): Mathlib assigns riemannZeta a conventional value even at its pole \(s = 1\), and the explicit hypothesis s ≠ 1 keeps that artificial value out of the theorem.Sutherland's page of checks for the archive, on the same definition: the condition is there "because Mathlib assigns ζ a conventional value at its pole". Third, riemannZeta cannot be defined solely by the Dirichlet series \(\sum n^{-s}\), which converges only for \(\operatorname{Re} s > 1\); in this version of Mathlib it is defined as hurwitzZetaEven 0 via the Mellin transform of a theta kernel, ensuring that the statement speaks about the analytically continued function across all of \(\mathbb{C}\) (Section 11).
Unfolded name by name, RiemannHypothesis rests on 43 explicit definitions spanning 333 lines of source, and that counts only names written visibly in the text. Behind the scenes, Lean also supplies algebraic structures and silent type conversions through instances and coercions (Section 9): printed with every implicit argument made explicit, the two-line definition expands to 19 lines. At the opposite extreme, the file containing RiemannHypothesis imports 4,889 modules totaling 1,576,420 lines, far more than the definition itself touches. Between those two numbers sits the exact dependency footprint published for the five target statements: 52,173 declarations in their exported challenge file.Both from Sutherland's page for the shorter proof: the export of the file that states the five theorems, and a file linked from the page that prints the statements as Lean 4.35.0 elaborates them. The top-level statement fits on two lines, while the mathematical tower beneath it spans tens of thousands of declarations.
How to read the figures. Everything these pages report Lean doing was run in Lean 4.35.0, the exact version underlying the readable edition: outputs, error messages, and traces appear as Lean printed them, with sizes and times recorded on a 16-core server. Meanwhile, the theoretical calculi run live in the browser on your own input: figures reduce terms, infer types, normalize proofs, eliminate cuts, find countermodels, and derive paradoxes. The kernel that ran as this page loaded is about 3,600 lines of JavaScript across five files, comments included. It is a separate implementation in another language, written with the reference manual at hand as a port of Lean's C++ kernel. In a recorded run it accepted all 196,546 declarations of Lean's core library, and across 4,400 declarations mutated by one or two small changes each it matched the verdict of Lean's own kernel every time, showing that the port tracks Lean's implementation faithfully rather than offering a second opinion on the method the two share. Mathlib was not built for these pages: what they show of it is its source text, read and counted. Every figure states which numbers were computed live in the page, which were recorded, which were counted from text, and which come from published sources; in every figure, green highlights the active focus. Recording these runs also surfaced an unexpected quirk in Lean 4.35.0: the command that lists the axioms under a theorem can omit some when the theorem is imported from another module. Across the 89,360 theorems of the core library, its reported list is shorter than what a direct walk of the exported terms finds on 80 theorems, and never longer (Section 7; an open issue, leanprover/lean4#15226, describes the cause).
Notation. Lambda terms are \(M, N, P\) and variables \(x, y, z\); \(\lambda x.\, M\) is an abstraction, \(M\,N\) an application, associated to the left, and \(M[x := N]\) the substitution of \(N\) for \(x\) in \(M\). One step of reduction is \(M \to_\beta N\), many steps \(M \twoheadrightarrow_\beta N\), and conversion \(=_\beta\). Types are \(A, B, C\), with base types \(o\) or named; the function type \(A \to B\) associates to the right; a context is \(\Gamma = x_1 : A_1, \dots, x_n : A_n\), and a judgment \(\Gamma \vdash M : A\) says that in it \(M\) has type \(A\). Formulas are also \(A, B\), built with \(\to, \land, \lor, \bot\), and \(\lnot A\) is \(A \to \bot\); a sequent is \(\Gamma \vdash A\), with one conclusion, or \(\Gamma \vdash \Delta\) in the classical calculus. Dependent types are \(\Pi (x : A).\, B\) and \(\Sigma (x : A).\, B\) in mathematics and, as Lean writes them, (x : A) → B or ∀ x : A, B, and (x : A) × B or ∃ x : A, B. Universes, the types of types, are Lean's: Prop, Type, Type u, Sort u. Definitional equality, the one a kernel decides by computing, is \(\equiv\); propositional equality, the one that is proved, is \(=\), in Lean Eq. That \(A\) and \(B\) stand for types and for formulas alike is the subject of Section 4.
Four words for what is known are kept apart. Proved is said of a theorem, with the system it is about: that every typed term halts is a theorem about the calculi of Section 2, not about Lean. Checked is said of a term: a kernel computed its type and found the type stated, which says nothing about what the type means. Recorded is what Lean 4.35.0, or a program named beside it, did when run for this series. Reported is what a named source says at a date; where sources disagree, both are named.
(General disclaimers apply.) Nothing here vouches for the proof of the Riemann hypothesis, or speaks against it: what these pages say of it is what named sources reported at the dates given, and the sidenotes say where each was read. The code in these pages explains how a proof is checked. Its kernel has not been audited, it is no certified checker, and no claim should rest on its verdict. Versions, checks and counts are as of 1 December 2026.