A community-led effort to clean up and maintain a Lean formalization of the 2026 proof of the Riemann Hypothesis and of GRH for Dirichlet L-functions.
The purpose of this repo is to create an artifact that is:
- accessible: we want to improve build performance and modularity to enable researchers to feasibly engage with the proof even without access to massive amounts of compute.
- readable: we want to improve code quality while preserving the "logic" of the proof, aspirationally to Mathlib levels. This includes lemma organization, formatting and idiomatic style, eliminating linter warnings, slop-free documentation, and more.
- integrated with the community: we would like to add bibliographic references to prior work where appropriate, and rely on existing formalization projects when possible.
Please note: we are not looking for:
- complete overhauls that follow a substantially different proof path
- claims about your own machine's builds / comparator run
- adding files which are not necessary for the Riemann Hypothesis proof
This work is taking place on the main branch. The original branch preserves the first publicly-released version of the proof retrieved on 2026-11-20 from https://alpo.ge/remark.pdf.
If you want to open the original proof without compiling it, use
riemann-hypothesis-original.
It keeps the published Lean source unchanged and provides a prebuilt cache for it.
src/Main.lean proves the following theorems:
| Theorem | Statement |
|---|---|
riemannHypothesis |
Mathlib's RiemannHypothesis |
riemannZeta_eq_zero_re |
the same statement as riemannHypothesis, spelled out: every zero of ζ other than −2, −4, −6, … has Re s = 1/2 |
LFunction_ne_zero_of_half_lt_re |
L(χ, s) ≠ 0 for Re s > 1/2, for every modulus and every Dirichlet character, except the trivial character at s = 1 |
LFunction_eq_zero_re |
every zero of L(χ, s) with 0 < Re s < 1 has Re s = 1/2 |
LFunction_eq_zero_re_of_isPrimitive |
the special case of LFunction_eq_zero_re for primitive characters |
src/Challenge.lean states the same five with sorry in place of the
proofs, in a file that imports only Mathlib. Comparator checks that Main.lean proves exactly
those statements, that it uses no axioms other than propext, Quot.sound and
Classical.choice, and that Lean's kernel and nanoda both accept the proof.
A full build takes hours, so you should use the cache:
lake exe cache get
lake build --no-buildA full build makes Lean check every proof on your machine. The cache downloads files that were compiled elsewhere, so you can read and edit the project within minutes, but Lean does not re-check them.
Take a fresh clone on a Linux machine with bubblewrap installed and run:
MATHLIB_CACHE_GET_URL=https://cache.mathlib.org/mathlib4 lake exe mathlib/cache get
lake comparatorThe first command fetches Mathlib's compiled files and nothing of ours. Don't use
lake exe cache get here, because that also downloads our prebuilt copy of the submission. The
second reads comparator.json, builds Challenge and Main in a sandbox with no network, and
makes the checks described under Theorem Statements.
Compiling the submission runs its code, so you may want to do it in a VM or your own sandbox. To do that, fetch Mathlib's cache as above, then run the check in three steps:
export LEAN_ABORT_ON_PANIC=1 # as Comparator does
export LAKE_ARTIFACT_CACHE=false # compile everything; read nothing from a Lake cache
# in a clone where the submission has not been compiled
lake build Challenge
lake env leanexport Challenge -- $(cat export-targets.txt) > challenge.export
# wherever you build the submission
lake build Main
lake env leanexport Main -- $(cat export-targets.txt) > solution.export
# from an empty directory, with the same Lean release and comparator.json from the first clone
lake comparator --config comparator.json \
--challenge-from-export challenge.export --solution-from-export solution.exportTo lend a Linux machine with plenty of memory and disk, see
CI-RUNNERS.md. The CI scripts are in scripts/ and
tools/ci_native/.
The submission belongs to its author and was published without a license. It is mirrored here
so that it can be checked. Commit 40e56bab is the unmodified copy.
The declarations in comparator/ that are copied from
formal-conjectures are copyright The Formal
Conjectures Authors, under the Apache License 2.0.
The files that hold them carry the notice.