Part I, chapter 5
Reflection and descent
The functional equation mirrors the strip through the point : a zero on the left is a zero on the right. And every Dirichlet -function reduces to a primitive one, so the half-plane statement for primitive characters is all the arithmetic has to deliver.
draft, under review10 minfirst published in v0.1.0, 2026-11-22
The mirror
Riemann’s functional equation relates the zeta function at to its value at :
Suppose we know there are no zeros with other than the pole at . Take a zero with that is not a trivial zero. Then has real part greater than one half, and the equation, read at , gives as a product of four factors: a power of , a cosine, a Gamma value and . The first three are non-zero: because , and vanishes only when is an odd integer, which would make an even integer, that is, a trivial zero or . So with , against what we know. The only option left is .
Formalism.VW.rh_of_righttheoremGammaFactorNonvanishing/RhOfRight.lean:5This argument, with the three non-vanishing facts proved inline from Mathlib's functional equation; the case is excluded separately because .
theorem Formalism.VW.rh_of_right (hz : ∀ s : ℂ, 1 / 2 < s.re → s ≠ 1 → riemannZeta s ≠ 0) : RiemannHypothesis
This argument, with the three non-vanishing facts proved inline from Mathlib's functional equation; the case is excluded separately because .
Full declaration with proof
theorem Formalism.VW.rh_of_right (hz : ∀ s : ℂ, 1 / 2 < s.re → s ≠ 1 → riemannZeta s ≠ 0) : RiemannHypothesis := by
unfold RiemannHypothesis
intro s hs htriv hs1
rcases lt_trichotomy s.re (1 / 2) with hlt | heq | hgt
· exfalso
have hpi : (Real.pi : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero
have hs0 : s ≠ 0 := by
rintro rfl
rw [riemannZeta_zero] at hs
norm_num at hs
have ht : 1 / 2 < (1 - s).re := by
rw [Complex.sub_re, Complex.one_re]
linarith
have h1 : (1 - s) ≠ 1 := by
intro h
apply hs0
linear_combination -h
have hnat : ∀ n : ℕ, (1 - s) ≠ -(n : ℂ) := by
intro n h
have hr := congrArg Complex.re h
rw [Complex.sub_re, Complex.one_re, Complex.neg_re, Complex.natCast_re] at hr
have : (0 : ℝ) ≤ n := n.cast_nonneg
linarith
have key := riemannZeta_one_sub hnat h1
rw [sub_sub_cancel, hs] at key
have hz' := hz (1 - s) ht h1
have h2pi : (2 : ℂ) * (2 * (Real.pi : ℂ)) ^ (-(1 - s)) ≠ 0 :=
mul_ne_zero two_ne_zero (Complex.cpow_ne_zero_iff.2 (Or.inl (mul_ne_zero two_ne_zero hpi)))
have hG : Complex.Gamma (1 - s) ≠ 0 := Complex.Gamma_ne_zero_of_re_pos (by linarith)
have hcos : Complex.cos ((Real.pi : ℂ) * (1 - s) / 2) ≠ 0 := by
rw [Ne, Complex.cos_eq_zero_iff]
rintro ⟨k, hk⟩
have h3 : ((1 - s) - (2 * (k : ℂ) + 1)) * (Real.pi : ℂ) = 0 := by
linear_combination 2 * hk
rcases mul_eq_zero.1 h3 with h | h
· have hsk : s = -2 * (k : ℂ) := by linear_combination -h
have hre : s.re = -2 * (k : ℝ) := by
rw [hsk, Complex.mul_re]
simp
rcases lt_trichotomy k 0 with hk0 | hk0 | hk0
· have : (k : ℝ) ≤ -1 := by exact_mod_cast (show k ≤ -1 by omega)
linarith
· apply hs0
rw [hsk, hk0]
simp
· apply htriv
refine ⟨(k - 1).toNat, ?_⟩
have hnk : ((k - 1).toNat : ℤ) = k - 1 := Int.toNat_of_nonneg (by omega)
have h' : (((k - 1).toNat : ℕ) : ℂ) = (k : ℂ) - 1 := by
have := congrArg (fun m : ℤ => (m : ℂ)) hnk
push_cast at this
exact this
rw [hsk, h']
ring
· exact hpi h
exact (mul_ne_zero (mul_ne_zero (mul_ne_zero h2pi hG) hcos) hz') key.symm
· exact heq
· exact absurd hs (hz s hgt hs1)The theorem on the route of the proof is the version for every character, specialised to the trivial character modulo , whose -function is .
Formalism.VW.rh_of_everytheoremGammaFactorNonvanishing/CritLine.lean:29From the half-plane statement for every Dirichlet character to the Riemann Hypothesis, through the reflection above.
theorem Formalism.VW.rh_of_every (h : UpperTheory.EveryCharacter) : RiemannHypothesis
From the half-plane statement for every Dirichlet character to the Riemann Hypothesis, through the reflection above.
Full declaration with proof
theorem Formalism.VW.rh_of_every (h : UpperTheory.EveryCharacter) : RiemannHypothesis :=
Formalism.VW.rh_of_right fun s hs hs1 => by
have := h 1 (1 : DirichletCharacter ℂ 1) s hs (Or.inr hs1)
rwa [LFunction_modOne_eq] at thisThe same mirror for Dirichlet L-functions
For a primitive character of conductor the functional equation is cleaner when stated for the completed -function, , where the Gamma factor is or according as is even or odd. Then is a non-zero constant times . Two facts carry the argument over: the Gamma factor never vanishes for , and the inverse of a primitive character is primitive.
Formalism.VW.gammaFactor_ne_zerotheoremGammaFactorNonvanishing/CritLine.lean:6Both parities: has no zeros in the right half-plane.
theorem Formalism.VW.gammaFactor_ne_zero {N : ℕ} (χ : DirichletCharacter ℂ N) {s : ℂ} (hs : 0 < s.re) : gammaFactor χ s ≠ 0
Both parities: has no zeros in the right half-plane.
Full declaration with proof
theorem Formalism.VW.gammaFactor_ne_zero {N : ℕ} (χ : DirichletCharacter ℂ N) {s : ℂ} (hs : 0 < s.re) : gammaFactor χ s ≠ 0 := by
rcases χ.even_or_odd with h | h
· rw [h.gammaFactor_def]; exact Gammaℝ_ne_zero_of_re_pos hs
· rw [h.gammaFactor_def]; exact Gammaℝ_ne_zero_of_re_pos (by rw [add_re, one_re]; linarith)Formalism.VW.critLinetheoremGammaFactorNonvanishing/CritLine.lean:11For a primitive and a zero in the strip: if , pass to the completed function, reflect to , divide by the Gamma factor, and obtain a zero of with real part above one half, against the half-plane statement; so .
theorem Formalism.VW.critLine (h : UpperTheory.EveryCharacter) (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (hχ : χ.IsPrimitive) (s : ℂ) (h0 : 0 < s.re) (h1 : s.re < 1) (hz : LFunction χ s = 0) : s.re = 1 / 2
For a primitive and a zero in the strip: if , pass to the completed function, reflect to , divide by the Gamma factor, and obtain a zero of with real part above one half, against the half-plane statement; so .
Full declaration with proof
theorem Formalism.VW.critLine (h : UpperTheory.EveryCharacter) (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (hχ : χ.IsPrimitive) (s : ℂ)
(h0 : 0 < s.re) (h1 : s.re < 1) (hz : LFunction χ s = 0) : s.re = 1 / 2 := by
have hs0 : s ≠ 0 := fun e => by simp [e] at h0
have hs1 : s ≠ 1 := fun e => by simp [e] at h1
by_contra hne
rcases lt_or_gt_of_ne hne with hlt | hgt
· have hinv : χ⁻¹.IsPrimitive := by
rw [isPrimitive_def, conductor_inv]; exact hχ
have hc : completedLFunction χ s = 0 := by
rw [LFunction_eq_completed_div_gammaFactor χ s (Or.inl hs0)] at hz
exact (div_eq_zero_iff.1 hz).resolve_right (Formalism.VW.gammaFactor_ne_zero χ h0)
have hfe := hinv.completedLFunction_one_sub s
rw [inv_inv, hc, mul_zero] at hfe
have h2 : (1 - s) ≠ 0 := sub_ne_zero.2 hs1.symm
refine h N χ⁻¹ (1 - s) (by rw [sub_re, one_re]; linarith) (Or.inr fun e => hs0 (by linear_combination -e)) ?_
rw [LFunction_eq_completed_div_gammaFactor χ⁻¹ (1 - s) (Or.inl h2), hfe, zero_div]
· exact h N χ s hgt (Or.inr hs1) hzClaim.prim_reflecttheoremCharacterBoxes/ClaimStrip.lean:42The reflection step on its own: a zero of a primitive -function at in the strip gives a zero of the inverse character at .
theorem prim_reflect {M : ℕ} [NeZero M] (ψ : DirichletCharacter ℂ M) (hψ : ψ.IsPrimitive) {s : ℂ} (hs0 : 0 < s.re) (hs1 : s.re < 1) (h : DirichletCharacter.LFunction ψ s = 0) : DirichletCharacter.LFunction ψ⁻¹ (1 - s) = 0
The reflection step on its own: a zero of a primitive -function at in the strip gives a zero of the inverse character at .
Full declaration with proof
theorem prim_reflect {M : ℕ} [NeZero M] (ψ : DirichletCharacter ℂ M) (hψ : ψ.IsPrimitive) {s : ℂ}
(hs0 : 0 < s.re) (hs1 : s.re < 1) (h : DirichletCharacter.LFunction ψ s = 0) :
DirichletCharacter.LFunction ψ⁻¹ (1 - s) = 0 := by
have hs0' : s ≠ 0 := fun e => by rw [e, Complex.zero_re] at hs0; exact lt_irrefl _ hs0
have ht0 : 0 < (1 - s).re := by rw [Complex.sub_re, Complex.one_re]; linarith
have ht0' : 1 - s ≠ 0 := fun e => by rw [e, Complex.zero_re] at ht0; exact lt_irrefl _ ht0
have hc : DirichletCharacter.completedLFunction ψ s = 0 := by
rw [DirichletCharacter.LFunction_eq_completed_div_gammaFactor ψ s (Or.inl hs0'),
div_eq_zero_iff] at h
exact h.resolve_right (gamma_ne_zero ψ hs0)
have hψ' : (ψ⁻¹).IsPrimitive := by
rw [DirichletCharacter.isPrimitive_def, DirichletCharacter.conductor_inv]; exact hψ
have fe := hψ'.completedLFunction_one_sub s
rw [inv_inv, hc, mul_zero] at fe
rw [DirichletCharacter.LFunction_eq_completed_div_gammaFactor ψ⁻¹ (1 - s) (Or.inl ht0'), fe,
zero_div]Descent to primitive characters
A Dirichlet character modulo need not be primitive: it may be induced from a character of a smaller modulus, its conductor. The two -functions differ by finitely many Euler factors,
and each factor is non-zero for , since . So a zero of in the right half-plane is a zero of , and it is enough to prove the half-plane statement for primitive characters.
UpperTheory.Top.imprimitivetheoremCharacterBoxes/Imprimitive.lean:5The version on the route: from the statement for all primitive characters, the half-plane statement for every character and modulus, by the Euler-factor identity and the bound on each factor.
theorem UpperTheory.Top.imprimitive : ZeroFreeAll → ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ), 1 / 2 < s.re → (χ ≠ 1 ∨ s ≠ 1) → DirichletCharacter.LFunction χ s ≠ 0
The version on the route: from the statement for all primitive characters, the half-plane statement for every character and modulus, by the Euler-factor identity and the bound on each factor.
Full declaration with proof
theorem UpperTheory.Top.imprimitive :
ZeroFreeAll → ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N) (s : ℂ), 1 / 2 < s.re → (χ ≠ 1 ∨ s ≠ 1) →
DirichletCharacter.LFunction χ s ≠ 0 := by
intro h N _ χ s hs hχs
haveI : NeZero χ.conductor := (PChar.of χ).ne
have hL : DirichletCharacter.LFunction χ.primitiveCharacter s ≠ 0 := h (PChar.of χ) trivial s hs
have hχ' : χ.primitiveCharacter ≠ 1 ∨ s ≠ 1 := by
rcases hχs with hχ | hs1
· left
intro h1
apply hχ
rw [← χ.changeLevel_primitiveCharacter, h1, DirichletCharacter.changeLevel_one]
· exact Or.inr hs1
have hrw := DirichletCharacter.LFunction_changeLevel χ.conductor_dvd_level χ.primitiveCharacter hχ'
rw [χ.changeLevel_primitiveCharacter] at hrw
rw [hrw]
refine mul_ne_zero hL (Finset.prod_ne_zero_iff.mpr fun p hp => ?_)
have hp' := Nat.prime_of_mem_primeFactors hp
intro h0
have key : χ.primitiveCharacter p * (p : ℂ) ^ (-s) = 1 := by linear_combination -h0
have h1 : ‖χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ 1 := DirichletCharacter.norm_le_one _ _
have h2 : ‖(p : ℂ) ^ (-s)‖ < 1 := by
rw [Complex.norm_natCast_cpow_of_pos hp'.pos, Complex.neg_re]
exact Real.rpow_lt_one_of_one_lt_of_neg (by exact_mod_cast hp'.one_lt) (by linarith)
have hn : ‖χ.primitiveCharacter p * (p : ℂ) ^ (-s)‖ < 1 := by
rw [norm_mul]
calc ‖χ.primitiveCharacter (p : ZMod χ.conductor)‖ * ‖(p : ℂ) ^ (-s)‖
≤ 1 * ‖(p : ℂ) ^ (-s)‖ := by gcongr
_ < 1 := by simpa using h2
rw [key, norm_one] at hn
exact lt_irrefl _ hnClaim.factor_ne_zerotheoremCharacterBoxes/ClaimStrip.lean:7One Euler factor is non-zero for .
theorem factor_ne_zero {M : ℕ} (ψ : DirichletCharacter ℂ M) {s : ℂ} (hs : 0 < s.re) (p : ℕ) (hp : p.Prime) : (1 : ℂ) - ψ p * (p : ℂ) ^ (-s) ≠ 0
One Euler factor is non-zero for .
Full declaration with proof
theorem factor_ne_zero {M : ℕ} (ψ : DirichletCharacter ℂ M) {s : ℂ} (hs : 0 < s.re) (p : ℕ)
(hp : p.Prime) : (1 : ℂ) - ψ p * (p : ℂ) ^ (-s) ≠ 0 := by
intro h
have h1 : ψ p * (p : ℂ) ^ (-s) = 1 := by linear_combination -h
have hp1 : (1 : ℝ) < p := by exact_mod_cast hp.one_lt
have hpow : ‖(p : ℂ) ^ (-s)‖ < 1 := by
rw [Complex.norm_natCast_cpow_of_pos hp.pos, Complex.neg_re]
exact Real.rpow_lt_one_of_one_lt_of_neg hp1 (by linarith)
have hn : ‖ψ p * (p : ℂ) ^ (-s)‖ < 1 := by
rw [norm_mul]
calc ‖ψ p‖ * ‖(p : ℂ) ^ (-s)‖ ≤ 1 * ‖(p : ℂ) ^ (-s)‖ := by
gcongr; exact ψ.norm_le_one _
_ < 1 := by rw [one_mul]; exact hpow
rw [h1, norm_one] at hn
exact lt_irrefl _ hnClaim.prim_zerotheoremCharacterBoxes/ClaimStrip.lean:23A zero in the strip passes to the primitive character.
theorem prim_zero {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) [NeZero χ.conductor] {s : ℂ} (hs0 : 0 < s.re) (hs1 : s.re < 1) (h : DirichletCharacter.LFunction χ s = 0) : DirichletCharacter.LFunction χ.primitiveCharacter s = 0
A zero in the strip passes to the primitive character.
Full declaration with proof
theorem prim_zero {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) [NeZero χ.conductor] {s : ℂ}
(hs0 : 0 < s.re) (hs1 : s.re < 1) (h : DirichletCharacter.LFunction χ s = 0) :
DirichletCharacter.LFunction χ.primitiveCharacter s = 0 := by
have hs : s ≠ 1 := fun e => by rw [e, Complex.one_re] at hs1; exact lt_irrefl _ hs1
have key := DirichletCharacter.LFunction_changeLevel χ.conductor_dvd_level
χ.primitiveCharacter (Or.inr hs)
rw [χ.changeLevel_primitiveCharacter, h] at key
rcases mul_eq_zero.mp key.symm with h' | h'
· exact h'
· obtain ⟨p, hp, hp0⟩ := Finset.prod_eq_zero_iff.mp h'
exact absurd hp0 (factor_ne_zero _ hs0 p (Nat.prime_of_mem_primeFactors hp))Put together, reflection and descent give the three forms of the Generalized Riemann Hypothesis that the archive exports: no zeros to the right of the line, zeros in the strip lie on the line, and the same for primitive characters.
Claim.striptheoremCharacterBoxes/ClaimStrip.lean:59From the half-plane statement to the critical-strip statement, for every character: descend to the primitive character, reflect, and use the half-plane statement on the other side.
theorem strip (h : HalfPlane) : Strip
From the half-plane statement to the critical-strip statement, for every character: descend to the primitive character, reflect, and use the half-plane statement on the other side.
Full declaration with proof
theorem strip (h : HalfPlane) : Strip := by
unfold HalfPlane at h
intro N _ χ s hs0 hs1 hz
have hs : s ≠ 1 := fun e => by rw [e, Complex.one_re] at hs1; exact lt_irrefl _ hs1
have hs0' : s ≠ 0 := fun e => by rw [e, Complex.zero_re] at hs0; exact lt_irrefl _ hs0
rcases lt_trichotomy s.re (1 / 2) with hlt | heq | hgt
· exfalso
haveI : NeZero χ.conductor := ⟨χ.conductor_ne_zero⟩
have hp := prim_zero χ hs0 hs1 hz
have hr := prim_reflect χ.primitiveCharacter χ.primitiveCharacter_isPrimitive hs0 hs1 hp
have ht : (1 : ℂ) - s ≠ 1 := fun e => hs0' (sub_eq_self.mp e)
exact h χ.conductor χ.primitiveCharacter⁻¹ (1 - s)
(by rw [Complex.sub_re, Complex.one_re]; linarith) (Or.inr ht) hr
· exact heq
· exact absurd hz (h N χ s hgt (Or.inr hs))Claim.zetatheoremCharacterBoxes/ClaimStrip.lean:75The Riemann Hypothesis in Mathlib's form, from the half-plane statement, with the trivial zeros and handled by the functional equation for and Mathlib's non-vanishing for .
theorem zeta (h : HalfPlane) : Zeta
The Riemann Hypothesis in Mathlib's form, from the half-plane statement, with the trivial zeros and handled by the functional equation for and Mathlib's non-vanishing for .
Full declaration with proof
theorem zeta (h : HalfPlane) : Zeta := by
intro s hz htriv hs1
have hs0 : s ≠ 0 := fun e => by rw [e, riemannZeta_zero] at hz; norm_num at hz
rcases lt_or_ge 0 s.re with hpos | hnpos
· rcases lt_or_ge s.re 1 with hlt1 | hge1
· have hL : DirichletCharacter.LFunction (1 : DirichletCharacter ℂ 1) s = 0 := by
rw [DirichletCharacter.LFunction_modOne_eq]; exact hz
exact strip h 1 1 s hpos hlt1 hL
· exact absurd hz (riemannZeta_ne_zero_of_one_le_re hge1)
· exfalso
have hG : Gammaℝ s ≠ 0 := by
intro hg
obtain ⟨n, hn⟩ := Complex.Gammaℝ_eq_zero_iff.mp hg
rcases n with _ | n
· exact hs0 (by simpa using hn)
· exact htriv ⟨n, by rw [hn]; push_cast; ring⟩
have hc : completedRiemannZeta s = 0 := by
rw [riemannZeta_def_of_ne_zero hs0, div_eq_zero_iff] at hz
exact hz.resolve_right hG
have h1s : 1 - s ≠ 0 := fun e => by
have := congrArg Complex.re e
rw [Complex.sub_re, Complex.one_re, Complex.zero_re] at this
linarith
have hz' : riemannZeta (1 - s) = 0 := by
rw [riemannZeta_def_of_ne_zero h1s, completedRiemannZeta_one_sub, hc, zero_div]
exact riemannZeta_ne_zero_of_one_le_re (by rw [Complex.sub_re, Complex.one_re]; linarith) hz'What Mathlib supplies here
This chapter is the part of the proof that leans most directly on Mathlib’s library of -functions: the functional equation riemannZeta_one_sub, the completed -function and its functional equation for primitive characters, the Gamma factor by parity, the change-of-level identity for induced characters, and non-vanishing of and of for . None of this is specific to the proof; it is what makes the statement of the theorem in Mathlib’s vocabulary exact. See Mathlib's RiemannHypothesis.