Functorial Academy · Zero to the frontier
Zero to Riemann Zeros
Learn Lean and the proof of the Riemann Hypothesis.

On 20 November 2026 a proof of the Riemann Hypothesis was published as 175,187 Lean files, and Lean's kernel accepted it. This course takes you from no Lean at all to reading that proof's final theorem and compiling it yourself. You learn Lean by proving things, then the mathematics the statement is made of: primes, infinite sums, complex numbers, the zeta function and its zeros, and the Dirichlet L-functions the proof also covers. Then you learn what it means that a machine checked it, walk through how the proof is organized, and prove its last steps yourself. Every answer you type is checked by real Lean with Mathlib.
- 18 units
- 223 exercises
- Checked by real Lean 4
- Free
The path
For people who are comfortable with college mathematics (calculus, a first proof or two) and have never used Lean. No complex analysis or number theory is assumed.
- Lean checks your work. Ask Lean what things are, compute with it, define functions and prove your first theorems. By the end you know what it means for Lean to accept a proof, which is what the whole course, and the published proof of the Riemann Hypothesis, rests on.
- Propositions and proofs. Prove statements built from and, or, not, implies and iff, one tactic at a time, and see that a proof is a term you can write directly. The Riemann Hypothesis is a chain of implications, so this is the grammar it is written in.
- For all, there exists. Prove and use statements about every number and about some number, and negate them correctly. The Riemann Hypothesis begins "for every complex number s" and excludes the trivial zeros with "there is no n", so after this unit you can read its outer shape.
- Calculating. Rewrite with an equation, chain steps with
calc, and letring,norm_num,linarithand their relatives do the algebra. Every fact about ζ you prove later ends in a calculation like these. - The number tower. ℕ, ℤ, ℚ, ℝ and ℂ are different types, and Lean moves between them with casts. You learn why the
1 / 2in the Riemann Hypothesis is one half and not zero, what the↑nin-2 * (↑n + 1)is, and how to prove formulas for finite sums by induction. - Primes. Divisibility, primes, Euclid's proof that they never run out, unique factorization, and the prime-counting function π(x). The destination line never mentions a prime, yet primes are the reason anyone cares about it: this unit poses the question the rest of the course answers.
- Infinite sums. Read and use Mathlib's infinite sums: limits,
HasSum,Summableand∑'. The zeta function starts life as the sum 1 + 1/2^s + 1/3^s + ..., so this is whereriemannZetabegins. - Complex numbers. Compute with ℂ in Lean: real and imaginary parts, the norm,
expand complex powers. You will see that onlys.redecides where the zeta series converges: the first sign that the real part is the coordinate that matters, the one the destination'ss.re = 1 / 2is about. - Complex functions. Read
DifferentiableAt ℂ,AnalyticAtand the identity theorem, and see why a complex-differentiable function is determined by its values near one point. That is what makesriemannZetaon all of ℂ one well-defined function and not a choice. - The zeta function. Meet
riemannZeta, the function the Riemann Hypothesis is about. You will use the series that defines it where it converges, Euler's product over the primes, and prove that it has no zeros to the right of the lines.re = 1. - Beyond the half-plane. Follow
riemannZetaout of the half-plane where its series converges: the pole at 1, the functional equation, and the trivial zeros at -2, -4, -6, ... . By the end you can say why every other zero lies in the strip0 < s.re < 1, which is where the Riemann Hypothesis lives. - The hypothesis. Read the Riemann Hypothesis in Lean token by token, write it yourself, and prove that the obvious simpler version is false. Then check that the statement the published proof proves is the same proposition as Mathlib's, and use it.
- Why the primes care. Turn ζ into a sum over prime powers with the von Mangoldt function, see why the real parts of the zeros decide how evenly the primes are spread, and compute with the divisor sum σ that gives the Riemann Hypothesis a face with no ζ in it.
- Characters and L-functions. Learn arithmetic mod N, Dirichlet characters and their L-functions, and use them to read, token by token, the other three theorems the published proof establishes: the Riemann Hypothesis for every Dirichlet L-function.
- What it means for Lean to check it. Learn what Lean's kernel checks and what it takes on trust: the three axioms,
sorry, the challenge file, independent kernels and Mathlib's definitions. Then read the proof'sMain.lean, five theorems in five lines, and know exactly what its acceptance does and does not tell you. - The shape of the proof. Follow the five theorems of
Main.leandown to the single statement they all come from, and see how the 175,187 files are arranged around it. This is the map you need before you open any lemma of the proof. - Inside the proof. Take apart real lemmas from the proof and prove them again yourself, against plain Mathlib: why an Euler factor never vanishes, why a Gamma factor never vanishes, and how the functional equation moves a zero from
sto1 - s. These are the gears that turn the deep theorem into the Riemann Hypothesis. - The last mile. Prove, against plain Mathlib, the proof's own deduction of the Riemann Hypothesis from its deep theorem: the functional equation sends a zero left of the line to a zero right of it, where there are none. Then you are ready to compile the real thing.