The Riemann Hypothesis in Lean

The Magnificent Age of Research

The Riemann
Hypothesis

Posed in 1859. Here it stands as a theorem in a Lean 4 project of 175,187 modules and 17.4 million lines, every one of them reachable from a single statement.

src/Main.lean
theorem riemannHypothesis : RiemannHypothesis := rhOfAll

Every dot is one module: 175,187 in all, placed by its import depth below Main, the glowing point, and colored by library. The chain runs 203 modules deep. Move the pointer to turn it.

  1. 1859Riemann states the hypothesis in his memoir on the number of primes below a given magnitude.
  2. 1900Hilbert includes it in the eighth of his twenty-three problems.
  3. 2000The Clay Mathematics Institute names it a Millennium Prize Problem.
  4. 2026Levent Alpöge publishes this Lean 4 project, whose main theorem is Mathlib's RiemannHypothesis.

Lean project by Levent Alpöge, published at alpo.ge. Repository: math-ai-org/riemann-hypothesis-proof. Every number on this page is computed from the source files.

Key figures

Loading…

The main theorems

src/Main.lean proves five statements. RiemannHypothesis is Mathlib's own definition; the other four are defined in src/Statements.lean, which imports only Mathlib.

TheoremStatement
riemannHypothesisRiemannHypothesis, as defined in Mathlib.
riemannZeta_eq_zero_reEvery zero of the Riemann zeta function, other than the trivial zeros −2(n+1) and the point s = 1, has real part 1/2.
LFunction_ne_zero_of_half_lt_reFor every Dirichlet character χ, L(χ, s) ≠ 0 whenever Re s > 1/2, except at the pole χ = 1, s = 1.
LFunction_eq_zero_reEvery zero of a Dirichlet L-function in the strip 0 < Re s < 1 has real part 1/2.
LFunction_eq_zero_re_of_isPrimitiveThe same statement for primitive Dirichlet characters.
Show src/Statements.lean
Show src/Main.lean

Where the code is

Each bar is a folder under src/. Click a bar to open it; the path above the chart takes you back up.

How the libraries import one another

Rows import from columns. Each tower counts import lines from modules in the row's library to modules in the column's library; the diagonal counts imports within a library. Height and color are on a log scale.

Table view

How deep the imports go

A module's depth is the length of the longest import path from Main down to it. Every module in the project is reachable from Main, so this chart covers all of them. Each library is its own ridge; heights use a square-root scale so the smaller libraries stay visible.

Table view

The longest import chain

The longest path of imports below Main, one block per module, colored by library. Hover or focus a block to see the module.

    Import explorer

    Start at Main and follow its imports. Modules up to 10 levels below Main can be opened; deeper modules are listed with their size and number of imports.

    Loading the explorer data (2 MB)…

    The most imported modules

    Modules imported by the largest number of other modules in the project.

    What it uses from Mathlib

    Mathlib modules imported by name

    The specific Mathlib files that project modules import most often, beyond import Mathlib.

    Escape hatches

    Keywords that would leave a proof incomplete or let code bypass Lean's kernel check, counted across all source files, comments included.

    KeywordWhat it doesLines found

    This is a text search of the sources. The definitive check is to build the project and ask Lean which axioms the main theorem uses: lake exe cache get && lake build, then #print axioms riemannHypothesis, which for a complete proof lists only propext, Classical.choice and Quot.sound.

    The Magnificent Age of Research

    A proof you can rebuild.

    A question from 1859 now sits in a repository anyone can clone. Its main theorem is one line; beneath it lie 818,755 theorems and lemmas that a machine can check one by one, with no referee's judgment in the loop. Run the build, then ask Lean which axioms the result rests on.

    lake exe cache get && lake build
    #print axioms riemannHypothesis