A guide to the Lean proof

The Riemann
Hypothesis, explained.

Follow Levent Alpöge’s Lean proof from the distribution of primes to a single line in the complex plane.

Released November 20, 2026 · Developed with Claude
Complex planeζ(s) = 0
Complex plane with ten zeta zeros at real part one half0102030405000.25½0.751Im(s)Re(s)Re(s) = ½
First 10 positive ordinatesZero 1 of 10
Select a point to inspect a zeta zero.
The argument

How the proof works

Start with the statement, turn it into a problem about prime powers, and follow the estimate that brings the zeros back into view.

Step 1 / 6

What has to line up?

The zeta function takes a complex number and returns a complex number. A zero is an input where the output vanishes. The Riemann hypothesis says that every nontrivial zero sits on the same vertical line, halfway across the critical strip.

ζ(ρ) = 0, ρ nontrivial ⟹ Re(ρ) = ½
Why can a one-sided bound rule out zeros?

When ζ has a zero, its logarithmic derivative ζ′/ζ has a pole there. The Mellin transform of G has the same poles away from the points where the explicit correction terms matter. If G(x) ≤ Cx^θ eventually, the transform of the eventually nonnegative function Cx^θ − G(x) must have a real singularity at its convergence boundary. The transform has no real singularities above θ, so it converges throughout Re(s) > θ. Thus it cannot have a pole arising from a zero in that half-plane.

The proof only has the bound on long windows. It uses high derivatives of the transform to concentrate the integral inside those windows and obtain the corresponding exclusion. Read the window argument in Rubinstein §II.1 →

Where does the main inequality come from?

A model example is an injective integral matrix T of size r whose entries are divisible by pᵉ. Its nonzero determinant is divisible by pᵉʳ, while the absolute determinant is at most ‖T‖ʳ for the Euclidean operator norm. Comparing the two gives e log p ≤ log ‖T‖. The real proof upgrades this comparison to lattices with controlled indices and norms, then combines information across primes.

The technical work includes theta kernels for local divisibility, inner-product and covolume estimates for size, and rank and denominator controls for the maps. Rubinstein’s exposition works through parts of these estimates and cites the Lean development for others. Read Rubinstein §II.6 and Part III →

What changes for Dirichlet L-functions?

The formal result proves nonvanishing for Re(s) > ½ for every Dirichlet character of positive modulus, except the pole case. The functional equation for primitive characters and the reduction from imprimitive to primitive characters put every zero inside the critical strip on the line. The modulus-one character recovers ζ. See all five checked statements →

Interactive experiments

Test the ideas yourself

Inspect the geometry, compute the prime-power remainder, and see where the square-root scale comes from.

Complex zeros

One line, two sides.

The horizontal coordinate is the real part. Toggle the imagined counterexample to see how an off-line zero would force a partner across the line.

The purple points are numerical samples of positive ordinates. About zeta zeros →

Complex planeζ(s) = 0
Complex plane with ten zeta zeros at real part one half0102030405000.25½0.751Im(s)Re(s)Re(s) = ½
First 10 positive ordinatesZero 1 of 10
Smoothed prime count

Look at what’s left.

At each cutoff x, add (x/n − 1) log p for each prime power n = pʰ ≤ x. Subtract x log x − (1 + γ)x to obtain G(x), with γ the Euler–Mascheroni constant.

The plot computes finite sums from actual prime powers. The x-axis is logarithmic. See the explicit formula →

Prime-power remainder
-0.0500.050.10.150.2G(x) / √x1001,00010,000100,000
Weighted sum S(x)76,333
Remainder G(x)1.75
G(x) / √x0.0175
Competing errors

Find the balance.

Increasing m shrinks x/m and grows m. This simplified model shows why choosing m near √x keeps both terms at the square-root scale.

The full estimate also tracks character sums and losses absorbed by x^ε. See the balancing step →

Model error budgetx = 1,000,000
1001,00010,000Errorm
x / m3,162.28
m316.23
Total3,478.51
The formal statement

Read the Lean

Select each line of the expanded Mathlib proposition to see how it translates into ordinary mathematical language.

Mathlib · Lean 4
Line 1 of 6

Give the proposition a name

Prop is Lean’s type of propositions. Mathlib names the statement RiemannHypothesis so a theorem can refer to the exact definition.

Read the Mathlib definition →
Trace the last three declarations in the archive
  1. riemannHypothesis → is the exported theorem. Its proof term is rhOfAll.
  2. rhOfAll → applies Formalism.VW.rh_of_every to allChi, taking the general nonvanishing result back to ζ.
  3. UpperTheory.FinalTheorems.everyCharacter → supplies allChi, the right-half-plane nonvanishing theorem for Dirichlet characters.

What was checked

Reviewers compared the exported theorem against a statement importing only Mathlib. Lean’s kernel and independent checkers accepted the proof. The reported axiom dependencies are Lean’s standard propext, Classical.choice, and Quot.sound.

Read the verification logs →

Follow the formal argument

The archive exports five theorems. The independent proof atlas traces the path from arithmetic inputs through prime-window bounds and Dirichlet nonvanishing to the final statements, with links to Lean bridge files.

Explore the checked Lean bridges →