Lean / senamakel/li-criterion-rh / Zeros.lean
Lean readerLiCriterion/Zeros.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports LiCriterion.Statement, Erdos985.Analytic.Principal.Identity.Zeros, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import LiCriterion.Statementimport Erdos985.Analytic.Principal.Identity.Zeros/-!# The nontrivial zeros of ζ: summability of `Σ 1/|ρ|²` and unboundednessBoth results are unconditional.* `summable_inv_sq_nontrivialPosZeros`: `Σ_{ρ ∈ nontrivialPosZeros} ‖ρ‖⁻² < ∞`, from erdos-985'sHadamard theorem for `ξ = xiZeta` (`hadamard_logDeriv`, order ≤ 1).* `exists_nontrivialPosZeros_norm_gt`: for every `R` there is `ρ ∈ nontrivialPosZeros` with`R < ‖ρ‖`, i.e. ζ has infinitely many nontrivial zeros. If all zeros were bounded, there wouldbe finitely many (they have summable `‖ρ‖⁻²`), so the genus-one Hadamard product would give`‖ξ(x)‖ ≤ exp(A + B|x|)`, while `ξ(2n+2) ≥ n! / π^(n+1)` grows faster than any exponential.-/open Complex Erdos985.Analytic Erdos985.Analytic.PrincipalAux Complex.Hadamardopen scoped ComplexConjugatenamespace RiemannHypothesislemma xiZeta_ne_zero_at_zero : xiZeta 0 ≠ 0 := by rw [xiZeta_zero]; exact one_ne_zero/-- A zero of `ζ` in the critical strip is a zero of `ξ`. -/lemma xiZeta_eq_zero_of_mem {ρ : ℂ} (h0 : 0 < ρ.re) (h1 : ρ.re < 1) (hζ : riemannZeta ρ = 0) :xiZeta ρ = 0 := byhave hρ0 : ρ ≠ 0 := fun h => by rw [h] at h0; simp at h0have hρ1 : ρ ≠ 1 := fun h => by rw [h] at h1; simp at h1rw [xiZeta_eq hρ0 hρ1]have hΓ := Gammaℝ_ne_zero_of_re_pos h0have : completedRiemannZeta ρ = 0 := byhave h := riemannZeta_def_of_ne_zero hρ0rw [hζ, eq_comm, div_eq_zero_iff] at hexact h.resolve_right hΓrw [this, mul_zero]/-- A zero of `ξ` is a zero of `ζ` in the critical strip. -/lemma mem_strip_of_xiZeta_eq_zero {ρ : ℂ} (hρ : xiZeta ρ = 0) :0 < ρ.re ∧ ρ.re < 1 ∧ riemannZeta ρ = 0 := byobtain ⟨h0, h1⟩ := xiZeta_zero_re_mem hρrefine ⟨h0, h1, ?_⟩have hρ0 : ρ ≠ 0 := fun h => by rw [h] at h0; simp at h0have hρ1 : ρ ≠ 1 := fun h => by rw [h] at h1; simp at h1rw [xiZeta_eq hρ0 hρ1] at hρhave hΛ : completedRiemannZeta ρ = 0 := byrcases mul_eq_zero.mp hρ with h | h· rcases mul_eq_zero.mp h with h | h· exact absurd h hρ0· exact absurd (sub_eq_zero.mp h) hρ1· exact hrw [riemannZeta_def_of_ne_zero hρ0, hΛ, zero_div]/-- `Σ_{ρ ∈ nontrivialPosZeros} ‖ρ‖⁻² < ∞`. -/theorem summable_inv_sq_nontrivialPosZeros :Summable fun ρ : nontrivialPosZeros => ‖(ρ : ℂ)‖⁻¹ ^ 2 := byhave hs := (hadamard_logDeriv differentiable_xiZeta xiZeta_ne_zero_at_zero xiZeta_growth).1 1one_pos-- drop the multiplicities (each is ≥ 1)have hs' : Summable fun ρ : {ρ : ℂ // xiZeta ρ = 0} => ‖(ρ : ℂ)‖⁻¹ ^ 2 := byrefine Summable.of_nonneg_of_le (fun _ => by positivity) (fun ρ => ?_) hshave hm : (1 : ℝ) ≤ analyticOrderNatAt xiZeta ρ := byexact_mod_cast Nat.one_le_iff_ne_zero.mpr (xiZeta_order_ne_zero ρ.2)have : ‖(ρ : ℂ)‖ ^ ((1 : ℝ) + 1) = ‖(ρ : ℂ)‖ ^ 2 := byrw [show (1 : ℝ) + 1 = (2 : ℕ) by norm_num, Real.rpow_natCast]rw [this, inv_pow, div_eq_mul_inv]exact le_mul_of_one_le_left (by positivity) hmlet e : nontrivialPosZeros → {ρ : ℂ // xiZeta ρ = 0} := fun ρ =>⟨ρ.1, xiZeta_eq_zero_of_mem ρ.2.1 ρ.2.2.1 ρ.2.2.2.2⟩have he : Function.Injective e := fun a b h => byhave h' : (e a).1 = (e b).1 := congrArg Subtype.val hexact Subtype.ext h'have := hs'.comp_injective heexact this/-- `ζ(x) ≥ 1` in real part for real `x > 1`. -/lemma one_le_re_riemannZeta {x : ℝ} (hx : 1 < x) : 1 ≤ (riemannZeta x).re := byhave hx' : 1 < (x : ℂ).re := by simpa using hxhave h := Complex.hasSum_re (LSeriesHasSum_one hx')have hterm : ∀ n : ℕ, (LSeries.term (1 : ℕ → ℂ) (x : ℂ) n).re =if n = 0 then 0 else ((n : ℝ) ^ x)⁻¹ := byintro nrcases eq_or_ne n 0 with rfl | hn· simp· rw [LSeries.term_of_ne_zero hn]; simp only [hn, ↓reduceIte]have : ((n : ℂ) ^ (x : ℂ)) = (((n : ℝ) ^ x : ℝ) : ℂ) := byrw [Complex.ofReal_cpow (Nat.cast_nonneg n)]; simprw [Pi.one_apply, this, ← Complex.ofReal_one, ← Complex.ofReal_div, Complex.ofReal_re,one_div]have h1 := le_hasSum h 1 (fun j _ => by rw [hterm]; split_ifs <;> positivity)simpa [hterm] using h1/-- `‖ξ(2n+2)‖ ≥ n! / π^(n+1)`. -/lemma factorial_div_le_norm_xiZeta (n : ℕ) :(n.factorial : ℝ) / Real.pi ^ (n + 1) ≤ ‖xiZeta (2 * n + 2)‖ := byset s : ℂ := 2 * n + 2 with hshave hsre : s.re = 2 * n + 2 := by simp [hs]have hs0 : s ≠ 0 := fun h => byhave := congrArg Complex.re h; rw [hsre] at this; simp at this; linarithhave hs1 : s ≠ 1 := fun h => byhave := congrArg Complex.re h; rw [hsre] at this; simp at this; linarithhave hsx : s = ((2 * n + 2 : ℝ) : ℂ) := by simp [hs]have hΓ : Gammaℝ s = ((Real.pi ^ (n + 1))⁻¹ * n.factorial : ℝ) := byrw [Gammaℝ, show s / 2 = (n : ℂ) + 1 by rw [hs]; ring, Complex.Gamma_nat_eq_factorial,show -s / 2 = -(((n + 1 : ℕ) : ℂ)) by rw [hs]; push_cast; ring, Complex.cpow_neg,Complex.cpow_natCast]push_cast; ringhave hΛ : completedRiemannZeta s = Gammaℝ s * riemannZeta s := byrw [riemannZeta_def_of_ne_zero hs0, mul_div_cancel₀ _(Gammaℝ_ne_zero_of_re_pos (by rw [hsre]; positivity))]have hpos : 0 ≤ (Real.pi ^ (n + 1))⁻¹ * (n.factorial : ℝ) := by positivityrw [xiZeta_eq hs0 hs1, hΛ, hΓ, norm_mul, norm_mul, norm_mul, Complex.norm_real,Real.norm_of_nonneg hpos]have hζ : 1 ≤ ‖riemannZeta s‖ := byrw [hsx]have hn0 : (0 : ℝ) ≤ n := Nat.cast_nonneg nexact (one_le_re_riemannZeta (by linarith)).trans (Complex.re_le_norm _)have hs_ge : 1 ≤ ‖s‖ := byrw [hsx, Complex.norm_real, Real.norm_of_nonneg (by positivity)]; linarithhave hs1_ge : 1 ≤ ‖s - 1‖ := byhave : s - 1 = ((2 * n + 1 : ℝ) : ℂ) := by rw [hs]; push_cast; ringrw [this, Complex.norm_real, Real.norm_of_nonneg (by positivity)]; linarithcalc (n.factorial : ℝ) / Real.pi ^ (n + 1)= 1 * 1 * ((Real.pi ^ (n + 1))⁻¹ * n.factorial) * 1 := by ring_ ≤ ‖s‖ * ‖s - 1‖ * ((Real.pi ^ (n + 1))⁻¹ * n.factorial) * ‖riemannZeta s‖ := bygcongr_ = _ := by ring/-- `‖E₁(u)‖ ≤ exp (2‖u‖)` for the genus-one Weierstrass factor `E₁(u) = (1 - u) eᵘ`. -/lemma norm_weierstrassFactor_one_le (u : ℂ) :‖weierstrassFactor 1 u‖ ≤ Real.exp (2 * ‖u‖) := byrw [weierstrassFactor_def, partialLogSum_eq_sum]simp only [Finset.range_one, Finset.sum_singleton, zero_add, pow_one, Nat.cast_zero, div_one]rw [norm_mul, Complex.norm_exp]have h1 : ‖1 - u‖ ≤ Real.exp ‖u‖ := bycalc ‖1 - u‖ ≤ ‖(1 : ℂ)‖ + ‖u‖ := norm_sub_le _ __ = ‖u‖ + 1 := by simp [add_comm]_ ≤ Real.exp ‖u‖ := Real.add_one_le_exp _have h2 : Real.exp u.re ≤ Real.exp ‖u‖ := Real.exp_le_exp.mpr (Complex.re_le_norm u)calc ‖1 - u‖ * Real.exp u.re ≤ Real.exp ‖u‖ * Real.exp ‖u‖ :=mul_le_mul h1 h2 (Real.exp_pos _).le (Real.exp_pos _).le_ = Real.exp (2 * ‖u‖) := by rw [← Real.exp_add]; ring_nf/-- If the zeros of `ξ` are bounded, then `ξ` grows at most exponentially on the reals. -/lemma exp_bound_of_bounded_zeros {R : ℝ} (hR : 0 < R)(hbd : ∀ ρ : ℂ, xiZeta ρ = 0 → ‖ρ‖ ≤ R) :∃ A B : ℝ, ∀ z : ℂ, ‖xiZeta z‖ ≤ Real.exp (A + B * ‖z‖) := byclassicalhave hord := HadamardAux.entireOfOrderAtMost_one differentiable_xiZeta xiZeta_ne_zero_at_zeroxiZeta_growthhave hnot : ∃ z, xiZeta z ≠ 0 := ⟨0, xiZeta_ne_zero_at_zero⟩have hsum2 : Summable (fun p : divisorZeroIndex₀ xiZeta Set.univ =>‖divisorZeroIndex₀_val p‖⁻¹ ^ (2 : ℕ)) := bysimpa [Nat.floor_one] using hord.summable_norm_inv_pow_divisorZeroIndex₀ (by norm_num) hnot-- every term is at least `R⁻²`, so the index is finitehave hfin : Finite (divisorZeroIndex₀ xiZeta Set.univ) := byhave ht := hsum2.tendsto_cofinite_zerohave hev := ht.eventually (gt_mem_nhds (show (0 : ℝ) < (R⁻¹) ^ 2 by positivity))rw [Filter.eventually_cofinite] at hevrefine Set.finite_univ_iff.mp (hev.subset fun p _ => ?_)simp only [Set.mem_ofPred_eq, not_lt]have hp := hbd _ (HadamardAux.val_isZero differentiable_xiZeta p)have hp0 : 0 < ‖divisorZeroIndex₀_val p‖ := norm_pos_iff.mpr (divisorZeroIndex₀_val_ne_zero p)gcongrhave _ : Fintype (divisorZeroIndex₀ xiZeta Set.univ) := Fintype.ofFinite _obtain ⟨P, hdeg, hfac⟩ := hadamard_factorization_of_order (by norm_num : (0 : ℝ) ≤ 1) hnot hordhave h0 : analyticOrderNatAt xiZeta 0 = 0 := byby_contra hexact xiZeta_ne_zero_at_zero (apply_eq_zero_of_analyticOrderNatAt_ne_zero h)have hdeg' : P.degree ≤ 1 := by simpa [Nat.floor_one] using hdegset S : ℝ := ∑ p : divisorZeroIndex₀ xiZeta Set.univ, ‖divisorZeroIndex₀_val p‖⁻¹refine ⟨‖P.coeff 0‖, ‖P.coeff 1‖ + 2 * S, fun z => ?_⟩rw [hfac z, h0, pow_zero, mul_one, Nat.floor_one, divisorCanonicalProduct, tprod_fintype,norm_mul, norm_prod]have hP : ‖Complex.exp (P.eval z)‖ ≤ Real.exp (‖P.coeff 0‖ + ‖P.coeff 1‖ * ‖z‖) := byrw [Complex.norm_exp]refine Real.exp_le_exp.mpr ((Complex.re_le_norm _).trans ?_)have heval : P.eval z = P.coeff 1 * z + P.coeff 0 := byconv_lhs => rw [Polynomial.eq_X_add_C_of_degree_le_one hdeg']simprw [heval]calc ‖P.coeff 1 * z + P.coeff 0‖ ≤ ‖P.coeff 1 * z‖ + ‖P.coeff 0‖ := norm_add_le _ __ = _ := by rw [norm_mul]; ringhave hG : ∏ p : divisorZeroIndex₀ xiZeta Set.univ,‖weierstrassFactor 1 (z / divisorZeroIndex₀_val p)‖ ≤ Real.exp (2 * S * ‖z‖) := bycalc ∏ p : divisorZeroIndex₀ xiZeta Set.univ,‖weierstrassFactor 1 (z / divisorZeroIndex₀_val p)‖≤ ∏ p : divisorZeroIndex₀ xiZeta Set.univ,Real.exp (2 * (‖divisorZeroIndex₀_val p‖⁻¹ * ‖z‖)) := byrefine Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun p _ => ?_)refine (norm_weierstrassFactor_one_le _).trans_eq ?_rw [norm_div, div_eq_inv_mul]_ = Real.exp (2 * S * ‖z‖) := byrw [← Real.exp_sum, ← Finset.mul_sum, ← Finset.sum_mul, mul_assoc]calc ‖Complex.exp (P.eval z)‖ * ∏ p : divisorZeroIndex₀ xiZeta Set.univ,‖weierstrassFactor 1 (z / divisorZeroIndex₀_val p)‖≤ Real.exp (‖P.coeff 0‖ + ‖P.coeff 1‖ * ‖z‖) * Real.exp (2 * S * ‖z‖) :=mul_le_mul hP hG (by positivity) (by positivity)_ = Real.exp (‖P.coeff 0‖ + (‖P.coeff 1‖ + 2 * S) * ‖z‖) := byrw [← Real.exp_add]; ring_nf/-- `ξ` does not grow at most exponentially along `2n + 2`. -/lemma not_exp_bound (A B : ℝ) : ¬ ∀ z : ℂ, ‖xiZeta z‖ ≤ Real.exp (A + B * ‖z‖) := byintro hset c : ℝ := Real.pi * Real.exp (2 * |B|)set K : ℝ := Real.pi * Real.exp (A + 2 * |B|)have hK : 0 < K := by positivityhave ht := FloorSemiring.tendsto_pow_div_factorial_atTop cobtain ⟨n, hn⟩ := (ht.eventually (gt_mem_nhds (inv_pos.mpr hK))).existshave hfac : (0 : ℝ) < n.factorial := by exact_mod_cast Nat.factorial_pos nhave hlow := factorial_div_le_norm_xiZeta nhave hup := h (2 * n + 2)have hz : ‖(2 * n + 2 : ℂ)‖ = 2 * n + 2 := byhave : (2 * n + 2 : ℂ) = ((2 * n + 2 : ℝ) : ℂ) := by push_cast; ringrw [this, Complex.norm_real, Real.norm_of_nonneg (by positivity)]rw [hz] at hup-- `n! ≤ π^(n+1) exp(A + B(2n+2)) ≤ K cⁿ`have hB : B * (2 * n + 2) ≤ |B| * (2 * n + 2) :=mul_le_mul_of_nonneg_right (le_abs_self B) (by positivity)have h1 : (n.factorial : ℝ) ≤ Real.pi ^ (n + 1) * Real.exp (A + |B| * (2 * n + 2)) := byhave hπ : 0 < Real.pi ^ (n + 1) := by positivityhave := hlow.trans (hup.trans (Real.exp_le_exp.mpr(show A + B * (2 * n + 2) ≤ A + |B| * (2 * n + 2) by linarith)))rwa [div_le_iff₀ hπ, mul_comm] at thishave h2 : Real.pi ^ (n + 1) * Real.exp (A + |B| * (2 * n + 2)) = K * c ^ n := bysimp only [K, c, mul_pow, ← Real.exp_nat_mul, pow_succ]rw [show A + |B| * (2 * n + 2) = (A + 2 * |B|) + n * (2 * |B|) by ring, Real.exp_add]ringrw [h2] at h1have := (div_lt_iff₀ hfac).mp hnrw [inv_mul_eq_div, lt_div_iff₀ hK] at thisnlinarith/-- **ζ has infinitely many nontrivial zeros**: for every `R` there is a nontrivial zero `ρ` with`Im ρ > 0` and `‖ρ‖ > R`. -/theorem exists_nontrivialPosZeros_norm_gt (R : ℝ) :∃ ρ ∈ nontrivialPosZeros, R < ‖ρ‖ := byby_contra hconpush Not at hconset R' := max R 1have hbd : ∀ ρ : ℂ, xiZeta ρ = 0 → ‖ρ‖ ≤ R' := byintro ρ hρobtain ⟨h0, h1, hζ⟩ := mem_strip_of_xiZeta_eq_zero hρrcases lt_trichotomy ρ.im 0 with him | him | him· have hc : conj ρ ∈ nontrivialPosZeros :=⟨by simpa using h0, by simpa using h1, by simpa using him,by rw [riemannZeta_conj, hζ, map_zero]⟩have := hcon _ hcrw [Complex.norm_conj] at thisexact this.trans (le_max_left _ _)· have : ρ = (ρ.re : ℂ) := Complex.ext (by simp) (by simp [him])rw [this, Complex.norm_real, Real.norm_of_nonneg h0.le]exact h1.le.trans (le_max_right _ _)· exact (hcon ρ ⟨h0, h1, him, hζ⟩).trans (le_max_left _ _)obtain ⟨A, B, hAB⟩ := exp_bound_of_bounded_zeros (lt_of_lt_of_le one_pos (le_max_right R 1)) hbdexact not_exp_bound A B hABend RiemannHypothesis