Riemann Hypothesis and GRH: Top-Level Proof Spine
GitHub repository Repository GUIDE.md src/Main.lean src/Statements.lean
Explore all 7 src/New proof pillars (285 pillar files; full 8-page atlas covers 305 unique files, 9,102 traced declarations, 11,778 unique interactive steps)
Formal-group Frobenius congruences, integral vacuum theta series, and sharp p-adic jet valuations.
Feeds p-adic divisibility gains into Upper Bound (Theorem A) and One Lift (Theorem C) →Definite theta kernels, iterated seesaw identity, local p-adic divisibility, and archimedean lift size.
Supplies Theorem A (short lifts and small p-adic index) to Hub →Second-moment unfolding, Bessel periods, global sieve main term, Siegel lemma, and two-frame bounds.
Supplies Theorem B (few translates span the target) to Hub →Exchange and one-square identities, determinant factorization along chains, auxiliary forms, and Theorem C.
Supplies Theorem C (integral_forms_long) to Hub →Comparison operators, orthogonality to false lifts, Hecke L-value norms, and single-lift volume height.
Bounds each single-lift factor in Determinant (Theorem C) →Ribet-type first-order congruences, attached Galois representations, crystalline lifting, and anticyclotomic Selmer bounds.
Supplies regular families of m-fold twists to Determinant (Theorem C) →Steep parameters, stationary positions, Gaussian decay, and period localization for discrete series.
Supplies archimedean discrete-series localization to Spanning (Theorem B) and Determinant (Theorem C) →General mathematical prerequisites in src/Lib/ (algebraic number theory, representation theory, harmonic analysis, and automorphic forms).
Browse src/Lib/ at commit 83e14ab4 →How the 2026 Lean 4 proof reduces the Riemann Hypothesis and GRH to one automorphic main inequality across seven pillars.
In src/Main.lean of leanprover-community/riemann-hypothesis (commit 83e14ab4), Lean 4.37.0-rc1 checks five theorems using only propext, Classical.choice, and Quot.sound: every nontrivial zero of the Riemann zeta function has real part 1/2 (Mathlib's RiemannHypothesis), no Dirichlet L-function vanishes for Re s > 1/2 (except the pole of a principal character at s = 1), and every zero of any Dirichlet L-function in the critical strip 0 < Re s < 1 lies on Re s = 1/2.
This Hub walkthrough traces the top-level reduction spine step by step, from the five theorem statements down to the main inequality, and links into all seven src/New proof pillars. Rather than working directly with zeros of L-functions, the proof converts non-vanishing in Re s > 1/2 into a one-sided upper bound on a weighted prime-counting remainder R_q₀(x). It then constructs a twisted lattice of automorphic forms on definite unitary groups over a cyclotomic CM field and compares an upper bound on covolume and index (Theorems A and B) against a lower bound from a product formula across primes (Theorem C). The huge main term cancels identically, leaving a bound tight enough to force the one-sided prime estimate and therefore GRH and RH.
Why a one-sided prime bound rules out off-line zeros
Suppose a Dirichlet L-function L(s, χ) modulo q₀ had a zero ρ = β + iγ with β > 1/2. In the explicit formula for primes in the residue class n ≡ 1 (mod q₀), that zero would create a wave of size roughly x^(β - 1) in the smoothed prime remainder R_q₀(x) = ∑ (n ≤ x) λ(n)(1/n - 1/x) - log(x)/φ(q₀) - c_q₀, where λ(n) = Λ(n)(1 - (n/d)) for n ≡ 1 (mod q₀) and 0 otherwise.
Because β - 1 > -1/2, an oscillating wave of amplitude x^(β - 1) cannot stay below x^(-1/2 + ε) forever: in New.Reduction.Zeros.Criterion, Landau's theorem applied to the Laplace transform of v ↦ R_q₀(e^v) (choosing a prime d whose quadratic twists have no competing zeros in the box Re s ≥ β, |Im s| ≤ |Im ρ|) shows that a strictly one-sided upper bound R_q₀(y) ≤ C y^(-1/2 + ε) for all large y prevents any zero to the right of 1/2.
To prove that one-sided upper bound, the main inequality (New.star_inequality) sandwiches the ratio (V + 2δ) / dim for a family of n ≥ (1 - 4/b²) dim automorphic forms between two bounds: Theorem C pushes it above the main amount minus 3 f a log⁴ b, while Theorems A and B push it below the main amount minus (n/dim)·m·rem + O(f a log⁴ b). The massive main amount cancels out on both sides; dividing by n/dim ≥ 1/2 leaves m·rem ≤ f·a·log⁵ b. Choosing m ≈ √x and log b ≤ 2x^ε turns that cancellation into R_q₀(x) ≤ C x^(-1/2 + 6ε).
Five theorems and the prime-counting error
Statements.lean defines the four custom predicates for RH and GRH in pure Mathlib terms. PrimeError defines the weighted prime remainder R_q(x) using nonnegative weights λ(n) = Λ(n)(1 - (n/d)) for n ≡ 1 (mod q). Criterion proves that a one-sided upper bound R_q₀(y) ≤ A y^(β - 1) for every prime d ≡ d₀ (mod q₀) rules out all zeros of Dirichlet L-functions in Re s > β, while PrimeNumberTheorem bounds the remainder at a much larger cutoff x₁.
- Nontrivial zeros of zeta lie on Re s = 1/2
- No Dirichlet L-function vanishes for Re s > 1/2
- Critical-strip zeros of L(s, χ) lie on Re s = 1/2
- Critical-strip zeros for primitive characters
- Weighted von Mangoldt function λ(n)
- Averaged logarithmic derivative for modulus q
- Smoothed prime-counting remainder
One-sided bound forces vanishing orders to match twisted ones
For q ≥ 1, prime d ≡ 7 (mod 8) coprime to q, and β > 0: if R_q(x) ≤ A x^(β - 1) for all large x and on the real interval (β, 1) the total zero order of χ_K-twisted characters is at most the untwisted total, then at every complex ρ with Re ρ > β the sum of untwisted zero orders equals the sum of χ_K-twisted zero orders.
theorem New.sum_entireL_orders_eq_twisted_of_primeRemainder_le {q : ℕ} {d : ℕ} [NeZero q] [Fact (Nat.Prime d)] (hd : d % 8 = 7) (hcop : q.Coprime d) {A : ℝ} {β : ℝ} (hβ : 0 < β) (hbound : ∀ᶠ (x : ℝ) in atTop, New.primeRemainder d q x ≤ A * x ^ (β - 1)) (hreal : ∀ (x : ℝ), β < x → x < 1 → ∑ χ, analyticOrderNatAt (New.entireL (New.quadTwist χ d)) ↑x ≤ ∑ χ, analyticOrderNatAt (New.entireL χ) ↑x) {ρ : ℂ} (hρ : β < ρ.re) : ∑ χ, analyticOrderNatAt (New.entireL χ) ρ = ∑ χ, analyticOrderNatAt (New.entireL (New.quadTwist χ d)) ρOne-sided prime criterion for a zero-free half-plane
Let q₀ > 0 be a multiple of 8, d₀ ≡ 7 (mod 8) coprime to q₀, and β > 1/2. If every prime d ≡ d₀ (mod q₀) satisfies R_q₀(x) ≤ A x^(β - 1) for some constant A and all large x, then L(ρ, ψ) ≠ 0 for every character ψ mod q₀ and every ρ ≠ 1 with Re ρ > β.
theorem New.LFunction_ne_zero_of_primeRemainder_le {q₀ : ℕ} [NeZero q₀] (hq₀ : 8 ∣ q₀) {d₀ : ℕ} (hd₀_mod : d₀ % 8 = 7) (hd₀_cop : d₀.Coprime q₀) {β : ℝ} (hβ : 1 / 2 < β) (h_bound : ∀ (d : Primes), ↑d ≡ d₀ [MOD q₀] → ∃ A, ∀ᶠ (x : ℝ) in atTop, New.primeRemainder (↑d) q₀ x ≤ A * x ^ (β - 1)) (ψ : DirichletCharacter ℂ q₀) {ρ : ℂ} (hρ_ne : ρ ≠ 1) (hρ_re : β < ρ.re) : DirichletCharacter.LFunction ψ ρ ≠ 0Prime number theorem decay of the prime remainder
For any fixed power B, |R_q(e^l)| ≤ l^(-B) for all sufficiently large l.
theorem New.eventually_abs_primeRemainder_exp_le_inv_pow {d : ℕ} [Fact (Nat.Prime d)] {q : ℕ} [NeZero q] (hd : d ≠ 2) (h_cop : q.Coprime d) (B : ℕ) : ∀ᶠ (v : ℝ) in atTop, |primeRemainder d q (rexp v)| ≤ 1 / v ^ B
Twisted lattices, heights and covolumes
Colength, Heights, TwistedLattice, and IntegralTargetForms set up the abstract arithmetic-geometry engine. A twisted lattice equips a complex inner product space V with linear maps Θ_ξ indexed by twists ξ, measuring archimedean size via CovolumeLe and p-adic integrality loss via IndexLe. Using the product formula on algebraic numbers (HeightLe.nonneg_of_one), covolume_add_index_nonneg proves 0 ≤ c + 2δ + n'(b_short + b_denom) + h, bounding covolume plus twice the index (plus completion cost) below by minus the height bound h of the inverse twist volume ratio Z(1) / Z(ξ_ι).
- Colength divisibility bound between submodules
Product formula (height of 1 is nonnegative)
If the constant family 1 indexed by prime p-adic isomorphisms has height at most c, then 0 ≤ c.
theorem TauCeti.PrimePadicIso.HeightLe.nonneg_of_one {c : ℝ} (h_one : HeightLe 1 c) : 0 ≤ c- Abstract twisted lattice structure
- Vectors integral at a p-adic place ι
- Logarithmic p-adic index bound δ
- Logarithmic archimedean covolume bound V
Hadamard's bound for twisted-lattice covolume
If each vector y_i in a family of size n satisfies ‖Θ₁ y_i‖_σ² ≤ exp(c) for every automorphism σ of ℂ, then the family has covolume at most n · c.
theorem New.TwistedLattice.covolumeLe_of_normSqAt_le {V : Type} {T : Type} [AddCommGroup V] [Module ℂ V] [One T] {L : TwistedLattice V T} {n : ℕ} {z : Fin n → V} {h : ℝ} (hz : ∀ (i : Fin n) (σ : ℂ ≃+* ℂ), L.normSqAt (z i) σ ≤ exp h) : L.CovolumeLe z (↑n * h)- Twisted Gram volume Z(ξ)
Height bound for the forward twist volume ratio
For a completed basis formed by an n-vector family y (index ≤ δ) and n' completion vectors z (clearing scalars of height ≤ b_denom) with total covolume ≤ a, the forward ratio Z(ξ_ι) / Z(1) has height at most a + (2δ + n' b_denom).
A twist for each prime: 0 ≤ covolume + 2·index + completion + height
Given an n-vector family y (covolume ≤ c, index ≤ δ) completed to a basis by n' vectors z (with ‖Θ₁ z_i‖_σ² ≤ exp b_short and clearing-scalar height ≤ b_denom), if Θ₁ is injective, Z(ξ_ι) ≠ 0, and Z(1)/Z(ξ_ι) has height ≤ h, then 0 ≤ c + 2δ + n'(b_short + b_denom) + h.
- Target automorphic forms as a twisted lattice
Every twisted lift on target forms is injective
For every m-fold twist ϑ, the composite theta lift Θ_ϑ on D.targetForms is injective.
Choosing the scales, field and places
Given parameters P (a multiple q₀ of 18480 and a prime d ≡ q₀/2 - 1 mod q₀), the Data files construct the cyclotomic CM field E = K(ζ_q₁), the vastly separated scales x ≪ x₁ ≪ b with a = x b, the lift count m in [√x, 2√x], the sparse set of b-places Φ_b, the a-places Φ_a, and the level primes p₀, p₁ and N. Existence proves that admissible data exist for every sufficiently large integer x.
- Top-level parameters (modulus q₀ and prime d)
- Cyclotomic CM field E = K(ζ)
- Group of infinite places of E
- Admissible data D for parameters P
- Place weight κ(τ)
- Long order a = x · b
- Set Φₐ of a-places (≡ 1 mod q₀)
- Local finite prime sum at place σ
- Archimedean derivative jet size
- Net direction amount across all infinite places
Existence of a large sparse set of b-places
For parameters s, n, L, W satisfying the sparsity inequalities, proves that Gal(E/K) contains a sparse subset T ≡ -1 (mod q₀) avoiding short multiplicative collisions with towerDeg s ≤ #T · W⁶ (later giving #Φₐ ≤ #Φ_b log b once W⁶ ≤ log b).
Admissible data exist at every large integer x
For 0 < ε < 1/100 and all sufficiently large integers x, constructs admissible data D : Data P with natX = x, natX₁ = ⌊exp(x^(ε/6))⌋, log x₁ ≥ x^(ε/6) - 1, log b ∈ [x^ε, x^ε + 1], and minimal powers m = 2^k ≥ √x and r = 3^j ≥ x⁵.
- Class number bound for the CM field E
Turning prime remainders into automorphic sizes
PrimeSums defines the three scalar quantities compared in the main inequality: the main amount (m k times the direction sum of jet size minus prime sum), the expected mean prime sum s_main, and the total remainder (the sum of deviations over Φₐ). Its central identity expresses the total remainder directly in terms of R_q₀(x), R_q₀(x₁), and R₁(x₁), while lower bounds control the leading term and prove it is nonnegative.
- Leading main amount across m lifts
- Expected mean prime sum
- Total prime remainder rem
Averaging prime sums over a-places separates x and x₁
Rewrites the sum over τ ∈ Φₐ of the local prime sum at a in terms of weighted sums at cutoffs x (on Φ_b) and x₁ (on Φₐ).
Identity unpacking the total remainder into prime-counting errors
Proves that the total remainder equals a (#Φ_b (R_q₀(x) - R_q₀(x₁)) + #Φₐ R₁(x₁)).
- Upper bound on each local prime sum
- Interval bounds for the derivative jet size
- Bounds on the direction amount
- Lower bound on the main amount
The main amount is nonnegative
Proves 0 ≤ D.mainAmount for all admissible data D.
theorem New.Data.mainAmount_nonneg {P : Parameters} (D : Data P) : 0 ≤ D.mainAmount
Upper bound: Theorems A and B (short forms and enough translates)
ShortAndEnough combines the Derivatives, UpperBound, and Spanning pillars to produce many independent target forms with small lifts and small index. Theorem A(a) uses the seesaw identity and archimedean size bounds to span the source by forms whose lifts are short. Theorem A(b) uses local p-adic divisibility to bound their index after multiplying by the gain-clearing factor c_B. Theorem B uses the second-moment spanning theorem to cover at least (1 - 4/b²) of the target dimension using few translates in the finite level group Ḡ.
- Rational p-adic gain-clearing factor
- Normalized translated Poincaré map s 𝔭
- Integral ramified source forms
Pillar (UpperBound): Seesaw identity for composite theta lifts
Identifies the m-fold theta lift of a Poincaré series on Y₀ with the restriction of a composite theta lift on Xₘ up to a nonzero scalar c_ss.
Pillar (UpperBound): Archimedean size of the composite lift
For any ramified source form φ bounded by exp(B), bounds every conjugate squared norm of its composite lift by exp(B + main amount - m·rem + 2 ∑ gain_p log p + f a log³ b).
Pillar (UpperBound): Local p-adic divisibility of the composite lift
At each prime p, finds a submodule S of colength dividing p^l with l ≤ allowed loss at p · dim(src) such that for every ramified form in S and every twist coprime to p, the composite lift has p-adic valuation at least gain(p) - allowed loss(p).
Logarithmic bound on the gain-clearing factor
Proves log c_B ≤ -∑ gain_l log l + f a log³ b + b (summed over non-split primes l < x₁), bounding the rounding and loss terms in c_B.
Theorem A(a): Integral source forms with short lifts span the source
The ramified source forms are spanned by integral forms φ whose normalized Poincaré lifts Θ₁(s 𝔭 φ) satisfy ‖Θ₁(s 𝔭 φ)‖_σ² ≤ exp(main amount - m·rem + f a log⁴ b) for every automorphism σ of ℂ and translate s ∈ Ḡ.
- Local integrality of normalized Poincaré images up to colength
Theorem A(b): Small p-adic index of normalized Poincaré images
Any finite family of target forms drawn from #t translates of integral ramified source forms has logarithmic index at most δ = #t · dim(src) · 2 f a log³ b in the target lattice.
Pillar (Spanning): Second-moment spread of a single translate
Shows that the images of the Poincaré map under random translates in the finite level group Ḡ (D.chosenGL) are well spread across the target space, via a second-moment unfolding computation.
Theorem B: Few translates span almost all of the target
Proves the target dimension is positive and finds a finite set t of translates in Ḡ with #t · dim(src) ≤ 5 dim(target) log(1 + 2b²) whose normalized Poincaré images span at least (1 - 4/b²) dim(target) dimensions.
Lower bound: Theorem C (integral forms are long)
LongForms combines the Congruences, OneLift, and Determinant/Chain pillars with the twisted-lattice product formula to prove Theorem C (integral_forms_long). Auxiliary forms complete any near-spanning family to a basis at controlled cost; Congruences supplies a regular family of m-fold twists with few congruences at each prime; Determinant/Chain factors the chain volume ratio Z(1)/Z(ξ_ι) into m single lifts bounded by OneLift. Together with the twisted-lattice product formula, this forces covolume plus twice the index to be at least dim · (main amount - 3 f a log⁴ b).
- Composite m-fold theta lift on target forms
- Chain Gram determinant Z(ϑ)
- Single-lift Gram determinant Zⱼ
- Auxiliary target form for basis completion
Pillar (Determinant/AuxiliaryForms): Spanning forms with short lifts on Y₀
Produces a spanning set of forms on Y₀ of principal level whose twisted lifts stay integral and satisfy uniform archimedean bounds.
Auxiliary forms span the target space
Constructs scalars γ(ϑ) ≠ 0 with γ(1) = 1 and proves that auxiliary target forms span the entire target form space.
Pillar (Congruences): Regular family of m-fold twists with few congruences
For every admissible data D, constructs a family of m-fold twists ξ_ι (one for each prime p-adic isomorphism ι) with coprime moduli and tightly bounded congruence denominators via Galois representations and Selmer bounds.
Pillar (OneLift): Height bound for one single lift
For a regular family of twists ξ_ι, bounds the height of the j-th single lift ratio Zⱼ(1)/Zⱼ(ξ_ιʲ) via the comparison operator and Rallis inner product formula.
Pillar (Determinant/Chain): Factorization of the chain determinant
Proves Z(ϑ) > 0 and Zⱼ(ϑʲ) > 0 for every m-fold twist ϑ, and expresses Z(ϑ)/Z(1) as (ϑ.normQ^(e/2) · ∏ (i < j) quotientRatio i j ϑ)^dim times the product of the m single-lift ratios Zⱼ(ϑʲ)/Zⱼ(1).
Height bound on the inverse chain volume ratio
Given a family of m-fold twists ξ_ι = θ(ι) with small ratios and bounded single-lift heights, proves Z(1)/Z(ξ_ι) has height at most dim · (b + f a log⁴ b - main amount).
Lower bound on covolume + 2·index with explicit completion cost
Completes an independent family of size n to a basis with dim - n auxiliary forms and applies covolume_add_index_nonneg to bound V + 2δ from below with the auxiliary completion cost kept explicit.
Theorem C: Integral target forms are long
For any linearly independent family of n ≥ (1 - 4/b²) dim target forms with covolume ≤ V and index ≤ δ, proves dim · (main amount - 3 f a log⁴ b) ≤ V + 2δ.
Cancellation, the one-sided bound, GRH and RH
MainInequality (star_inequality) puts Theorems A, B, and C side by side: the main amount cancels identically between the upper and lower bounds, leaving m · rem ≤ f a log⁵ b. OneSidedBound divides out m a #Φ_b, uses the prime number theorem to crush the x₁ terms to O(x⁻²), extends from integers to real y, and applies the one-sided criterion to prove New.grh. Finally, New.Main applies the functional equation to rule out zeros in 0 < Re s < 1/2 as well, and Main.lean packages all five headline theorems, including Mathlib's RiemannHypothesis.
The main inequality: m · rem ≤ f · a · log⁵ b
For any admissible data D : Data P, proves m · rem ≤ f · a · log⁵ b by combining Theorems A, B, and C so that the main amount cancels identically.
Isolating the prime remainder from the main inequality
Divides star_inequality by m · a · #Φ_b and unpacks the total-remainder identity to get R_q₀(x) ≤ φ(q₀) log⁶(b) / m + |R_q₀(x₁)| + log(b) |R₁(x₁)|.
- Admissible data with √x ≤ m and controlled log b
- Secondary cutoff remainders are O(x⁻²)
One-sided prime remainder bound at large integers
For 0 < ε < 1/100 and all sufficiently large integers x, proves R_q₀(x) ≤ (64 φ(q₀) + 3) x^(-1/2 + 6ε).
One-sided prime remainder bound for all large reals y
Extends the integer bound to real y via R_q₀(y) - R_q₀(⌊y⌋) ≤ 26/y, proving R_q₀(y) ≤ (128 φ(q₀) + 32) y^(-1/2 + ε) for every ε > 0 and all large real y.
Generalized Riemann Hypothesis in half-plane form
No Dirichlet L-function L(s, χ) vanishes for Re s > 1/2 (except at the pole s = 1 when χ is trivial).
Functional equation extends GRH to 0 < Re s < 1
From non-vanishing in Re s > 1/2, uses the functional equation and complex conjugation to prove every zero of L(s, χ) in 0 < Re s < 1 has Re s = 1/2.
Specializing GRH to the Riemann zeta function
Applies New.zeros_on_line to the trivial character modulo 1 (where L(s, 1) = ζ(s)) to prove RiemannZetaZerosOnLine.
GRH (half-plane form, Re s > 1/2)
Exported theorem in src/Main.lean: for every modulus N ≥ 1 and Dirichlet character χ mod N, L(s, χ) ≠ 0 whenever Re s > 1/2 and (χ ≠ 1 or s ≠ 1).
theorem LFunction_ne_zero_of_half_lt_re : DirichletLNonvanishingRightOfHalf
Generalized Riemann Hypothesis (critical strip)
Exported theorem in src/Main.lean: every zero of any Dirichlet L-function L(s, χ) with 0 < Re s < 1 has real part 1/2.
theorem LFunction_eq_zero_re : DirichletLZerosOnLine
GRH for primitive Dirichlet characters
Exported theorem in src/Main.lean: every zero of L(s, χ) in 0 < Re s < 1 for a primitive Dirichlet character χ has real part 1/2.
theorem LFunction_eq_zero_re_of_isPrimitive : PrimitiveDirichletLZerosOnLine
Riemann Hypothesis (spelled-out form)
Exported theorem in src/Main.lean: every zero s of riemannZeta outside {-2, -4, ...} and 1 has real part 1/2.
theorem riemannZeta_eq_zero_re : RiemannZetaZerosOnLine
The Riemann Hypothesis (Mathlib's RiemannHypothesis)
Exported theorem in src/Main.lean proving Mathlib's exact statement RiemannHypothesis with zero sorry and only propext, Classical.choice, and Quot.sound.
theorem riemannHypothesis : RiemannHypothesis