Skip to content
Upstream main on GitHub

Column · Field notes ·

How to Contribute to the Lean Riemann Hypothesis Proof

This independent field manual shows where to start reading the proof and how to prepare a focused upstream pull request. On November 25, 2026 (UTC), leanprover-community/riemann-hypothesis moved the readable grh-lean edition to the root of main. This edition began with 803 Lean source files and about 300,000 lines of code. The e063a92 snapshot has 802 source files. The earlier Alpöge edition lives on the alpoge branch.

  1. The first trap: shorter source can produce a larger kernel proof
  2. How to prepare a focused pull request
  3. Where this site measured the most room
  4. Trace the proof in six stops across seven Lean files
  5. Where the earlier Alpöge proof went

For lsernau/grh-lean@72fead10 on Lean v4.35.0, Andrew Sutherland’s MIT verification record lists default and paranoid Lean kernel checks plus nanoda, lean4lean, con-leche, and con-ron. The five theorems use only Lean’s three standard axioms, and exports from two machines matched byte for byte. One readable-edition lean4lean run was stopped for memory, and the other passed. For upstream changes, the lake build workflow runs for PRs to main, merge groups, and pushes to main.

1. The first trap: shorter source can produce a larger kernel proof

If your instinct is to compress proofs by packing lines with semicolons or replacing explicit have steps with grind, simp_all, and aesop, stop and look at what happened when MIT exported both versions of grh-lean:

Edition Code lines Kernel export Cold build
grh/ readable (basis of main) 299,902 4.49 GB (−13.3%) 32m 12s
grh-compact/ line-packed 76,149 (−74.6%) 5.17 GB (+15.3%) 33m 32s

Rule of thumb for PRs: delete dead declarations, inline redundant single-caller wrappers, and offload general lemmas to TauCeti or Mathlib. Keep intermediate steps readable and measure the resulting kernel export. Source line counts alone cannot predict the size of the elaborated proof.

2. How to prepare a focused pull request

Start with the smallest build that covers your change. CI checks the full project.

  1. Leave the challenge files alone. For PRs to main, the challenge workflow protects Challenge.lean, comparator.json, and src/Statements.lean. It also restricts build configuration changes. Proof cleanup usually belongs in src/Lib/ or src/New/.
  2. Check open PRs before touching a module. The repository merges quickly and two people editing the same file will collide on rebase.
  3. Build the module you edited and an immediate downstream caller. A module change can trigger dependent rebuilds. Start near the leaves when the same change can be made there.
  4. Verify zero sorry and standard axioms. Never introduce set_option maxHeartbeats or set_option backward.* to make a shortened proof pass; the goal is to remove those flags, not add them.
  5. Keep each PR small and single-purpose. Explain the reason for the change and include the checks you ran.
# 1. Check active open PRs to avoid file collisions
gh pr list --repo leanprover-community/riemann-hypothesis --state open --limit 30

# 2. Build only the single module you changed
lake build New.Reduction.ShortAndEnough

# 3. Confirm no sorry or custom axioms crept in
lake env lean scripts/PrintAxioms.lean

3. Where this site measured the most room

The figures in this section are this site’s own measurements, not upstream’s. They come from a kernel-cone dissection of main@e063a92 (802 files, 49,821 active kernel-cone constants out of 64,358 total constants) and point at four places where cleanup work has the most material to work with.

Track Measured at e063a92 Where to start
Single-caller flattening
Helper lemmas used in only one place (in_degree = 1)
149,521 L
49.9% of code
Highest density in New/Congruences (70.3%, 15,670 L), New/Spanning (63.0%, 24,520 L), New/Determinant (66%, 9,065 L), and New/UpperBound (60%, 13,055 L).
TauCeti offloading
General lemmas moved out of Lib/
585 decls
487 theorems
TauCetiProject/TauCeti was added in PR #5635, yet the e063a92 baseline had 0 imports. Start in Lib/Adelic, Lib/General, Lib/Analytic, and Lib/DiscreteSeries.
Bibliography linking
No Lean tactic work required
127 / 228
33 high-priority
127 entries in REFERENCES.md are not yet linked to the Lean declarations that formalize them. A track for mathematicians reading the proof.
Hygiene & dead code
Options, bare imports, unused decls
See the tracker Check set_option backward.* flags, maxHeartbeats overrides, and bare import Mathlib lines. The e063a92 audit identified 442 declarations outside the Main cone (3,643 lines).

4. Trace the proof in six stops across seven Lean files

Every symbol below is verified directly against the grh-lean kernel environment (main@e063a92). If you want to trace how the proof reaches riemannHypothesis without reading 300,000 lines, follow these declarations in order:

  1. New.Data.enough_forms src/New/Reduction/ShortAndEnough.lean

    Combines short-form height upper bounds (New/UpperBound) with the Poisson-summation spanning sieve (New/Spanning) to construct enough short integral automorphic forms.

  2. New.Data.integral_forms_long src/New/Determinant/Twist/LongForms.lean

    Combines first-order congruences (New/Congruences), single-step lifts (New/OneLift), and the Gram-determinant product formula (New/Determinant) to force any large integral family to be long.

  3. New.star_inequality src/New/Reduction/MainInequality.lean

    Pinches the upper and lower covolume bounds against each other so the main height term cancels, isolating a prime-remainder estimate.

  4. New.Data.primeRemainder_le  →  New.LFunction_ne_zero_of_primeRemainder_le src/New/Reduction/OneSidedBound.lean  ·  src/New/Reduction/Zeros/Criterion.lean

    Converts the star inequality into a one-sided Landau bound on prime remainders and rules out zeros of Dirichlet L-functions in the half-plane Re(s) > 1/2.

  5. New.grh  →  New.zeta_zeros_on_line, New.zeros_on_line src/New/Main.lean

    Reflects the zero-free right half-plane across s ↔ 1 − s via the functional equation.

  6. riemannHypothesis, riemannZeta_eq_zero_re, LFunction_eq_zero_re src/Main.lean

    Top-level declarations (no Main namespace) matching Mathlib’s canonical RiemannHypothesis statement with [propext, Classical.choice, Quot.sound] only.

5. Where the earlier Alpöge proof went

Levent Alpöge’s original 175,187-file formalization and the community’s cleanup down to 58,947 files (Batch 23, commit 756a70250) are preserved intact on branch alpoge. Historical shrinkage charts live on rh-shrink.github.io. On this site, the people behind that work are listed under Contributors, and the day-by-day record is on the timeline.

Back to this column’s place on the timeline 한국어 기여 가이드