Lean reader

LiCriterion/Main.lean

141 lines11 declarationsno sorryimports LiCriterion.Zeros

Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports LiCriterion.Zeros, which it does not have: you can read it there, but it will not check. Build the project itself to check it.

  1. import LiCriterion.Zeros
  2. /-!
  3. # Li's criterion, forward direction: RH ⇒ `λₙ > 0` for every `n ≥ 1`
  4. Under RH every `ρ ∈ nontrivialPosZeros` has `Re ρ = 1/2`, so `w = 1 - 1/ρ` lies on the unit
  5. circle (`|ρ - 1| = |ρ|`). For `‖v‖ = 1`, `2 Re (1 - v) = ‖1 - v‖²`; with `v = wⁿ` each summand of
  6. `lambda n` is `‖1 - wⁿ‖² ∈ [0, n² ‖ρ‖⁻²]` (`‖1 - wⁿ‖ ≤ n ‖1 - w‖ = n / ‖ρ‖`). The family is
  7. therefore summable by `summable_inv_sq_nontrivialPosZeros`. A zero with `‖ρ‖ > n`
  8. (`exists_nontrivialPosZeros_norm_gt`) has `‖1 - wⁿ‖ ≥ nδ - n²δ² > 0` for `δ = 1/‖ρ‖ < 1/n`, so
  9. the sum is strictly positive.
  10. -/
  11. open Complex
  12. namespace RiemannHypothesis
  13. /-- `‖1 - wⁿ‖ ≤ n ‖1 - w‖` for `‖w‖ ≤ 1`. -/
  14. lemma norm_one_sub_pow_le {w : ℂ} (hw : ‖w‖ ≤ 1) (n : ℕ) : ‖1 - w ^ n‖ ≤ n * ‖1 - w‖ := by
  15. induction n with
  16. | zero => simp
  17. | succ n ih =>
  18. have e : 1 - w ^ (n + 1) = (1 - w ^ n) + w ^ n * (1 - w) := by ring
  19. have h2 : ‖w ^ n * (1 - w)‖ ≤ 1 * ‖1 - w‖ := by
  20. rw [norm_mul, norm_pow]
  21. exact mul_le_mul_of_nonneg_right (pow_le_one₀ (norm_nonneg _) hw) (norm_nonneg _)
  22. rw [e]
  23. calc ‖(1 - w ^ n) + w ^ n * (1 - w)‖ ≤ ‖1 - w ^ n‖ + ‖w ^ n * (1 - w)‖ := norm_add_le _ _
  24. _ ≤ n * ‖1 - w‖ + 1 * ‖1 - w‖ := add_le_add ih h2
  25. _ = ((n + 1 : ℕ) : ℝ) * ‖1 - w‖ := by push_cast; ring
  26. /-- Second order: `‖1 - wⁿ - n (1 - w)‖ ≤ n² ‖1 - w‖²` for `‖w‖ ≤ 1`. -/
  27. lemma norm_one_sub_pow_sub_le {w : ℂ} (hw : ‖w‖ ≤ 1) (n : ℕ) :
  28. ‖1 - w ^ n - n * (1 - w)‖ ≤ (n : ℝ) ^ 2 * ‖1 - w‖ ^ 2 := by
  29. induction n with
  30. | zero => simp
  31. | succ n ih =>
  32. have e : 1 - w ^ (n + 1) - ((n + 1 : ℕ) : ℂ) * (1 - w)
  33. = (1 - w ^ n - n * (1 - w)) + (1 - w) * (w ^ n - 1) := by push_cast; ring
  34. have h2 : ‖(1 - w) * (w ^ n - 1)‖ ≤ ‖1 - w‖ * (n * ‖1 - w‖) := by
  35. rw [norm_mul, norm_sub_rev (w ^ n)]
  36. exact mul_le_mul_of_nonneg_left (norm_one_sub_pow_le hw n) (norm_nonneg _)
  37. rw [e]
  38. have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n
  39. have hδ : 0 ≤ ‖1 - w‖ ^ 2 := sq_nonneg _
  40. calc ‖(1 - w ^ n - n * (1 - w)) + (1 - w) * (w ^ n - 1)‖
  41. ≤ ‖1 - w ^ n - n * (1 - w)‖ + ‖(1 - w) * (w ^ n - 1)‖ := norm_add_le _ _
  42. _ ≤ (n : ℝ) ^ 2 * ‖1 - w‖ ^ 2 + ‖1 - w‖ * (n * ‖1 - w‖) := add_le_add ih h2
  43. _ ≤ ((n + 1 : ℕ) : ℝ) ^ 2 * ‖1 - w‖ ^ 2 := by
  44. push_cast; nlinarith [mul_nonneg hn hδ]
  45. /-- On the unit circle, `2 Re (1 - v) = ‖1 - v‖²`. -/
  46. lemma two_mul_re_one_sub_eq {v : ℂ} (hv : ‖v‖ = 1) : 2 * (1 - v).re = ‖1 - v‖ ^ 2 := by
  47. have h : v.re * v.re + v.im * v.im = 1 := by
  48. rw [← Complex.normSq_apply, ← Complex.sq_norm, hv, one_pow]
  49. rw [Complex.sq_norm, Complex.normSq_apply]
  50. simp only [sub_re, one_re, sub_im, one_im]
  51. linear_combination (-1 : ℝ) * h
  52. /-- On the critical line, `‖1 - 1/ρ‖ = 1`. -/
  53. lemma norm_one_sub_inv_eq_one {ρ : ℂ} (hre : ρ.re = 1 / 2) : ‖1 - 1 / ρ‖ = 1 := by
  54. have hρ0 : ρ ≠ 0 := fun h => by rw [h] at hre; norm_num at hre
  55. have hn : ‖ρ - 1‖ = ‖ρ‖ := by
  56. rw [Complex.norm_def, Complex.norm_def, Complex.normSq_apply, Complex.normSq_apply]
  57. congr 1
  58. simp only [sub_re, one_re, sub_im, one_im, hre]
  59. ring
  60. rw [show 1 - 1 / ρ = (ρ - 1) / ρ by field_simp, norm_div, hn,
  61. div_self (norm_ne_zero_iff.mpr hρ0)]
  62. /-- Every element of `nontrivialPosZeros` is a nontrivial zero in Mathlib's sense, so RH puts it
  63. on the critical line. -/
  64. lemma re_eq_half_of_RH (hRH : RiemannHypothesis) {ρ : ℂ} (hρ : ρ ∈ nontrivialPosZeros) :
  65. ρ.re = 1 / 2 := by
  66. obtain ⟨_, _, him, hζ⟩ := hρ
  67. refine hRH ρ hζ ?_ ?_
  68. · rintro ⟨k, rfl⟩
  69. simp at him
  70. · rintro rfl
  71. simp at him
  72. /-- The summand of `lambda n`, under RH: `2 Re (1 - wⁿ) = ‖1 - wⁿ‖²` with `w = 1 - 1/ρ`. -/
  73. lemma summand_eq_of_RH (hRH : RiemannHypothesis) (n : ℕ) (ρ : nontrivialPosZeros) :
  74. 2 * (1 - (1 - 1 / ρ.1) ^ n).re = ‖1 - (1 - 1 / ρ.1) ^ n‖ ^ 2 :=
  75. two_mul_re_one_sub_eq (by rw [norm_pow, norm_one_sub_inv_eq_one (re_eq_half_of_RH hRH ρ.2),
  76. one_pow])
  77. lemma norm_one_sub_one_sub_inv (ρ : ℂ) : ‖1 - (1 - 1 / ρ)‖ = ‖ρ‖⁻¹ := by
  78. rw [sub_sub_cancel, norm_div, norm_one, one_div]
  79. /-- Under RH the summands of `lambda n` are summable. -/
  80. theorem summable_lambda_summand_of_RH (hRH : RiemannHypothesis) (n : ℕ) :
  81. Summable fun ρ : nontrivialPosZeros => 2 * (1 - (1 - 1 / ρ.1) ^ n).re := by
  82. refine Summable.of_nonneg_of_le (fun ρ => ?_) (fun ρ => ?_)
  83. (summable_inv_sq_nontrivialPosZeros.mul_left ((n : ℝ) ^ 2))
  84. · rw [summand_eq_of_RH hRH]; positivity
  85. · rw [summand_eq_of_RH hRH, ← mul_pow, ← norm_one_sub_one_sub_inv]
  86. have hw : ‖1 - 1 / ρ.1‖ ≤ 1 := (norm_one_sub_inv_eq_one (re_eq_half_of_RH hRH ρ.2)).le
  87. exact pow_le_pow_left₀ (norm_nonneg _) (norm_one_sub_pow_le hw n) 2
  88. /-- A zero with `‖ρ‖ > n ≥ 1` contributes a strictly positive summand. -/
  89. lemma summand_pos_of_RH (hRH : RiemannHypothesis) {n : ℕ} (hn : 0 < n) (ρ : nontrivialPosZeros)
  90. (hρ : (n : ℝ) < ‖ρ.1‖) : 0 < 2 * (1 - (1 - 1 / ρ.1) ^ n).re := by
  91. rw [summand_eq_of_RH hRH]
  92. set w : ℂ := 1 - 1 / ρ.1
  93. have hw : ‖w‖ ≤ 1 := (norm_one_sub_inv_eq_one (re_eq_half_of_RH hRH ρ.2)).le
  94. set δ : ℝ := ‖1 - w‖
  95. have hnpos : (0 : ℝ) < n := by exact_mod_cast hn
  96. have hρpos : 0 < ‖ρ.1‖ := hnpos.trans hρ
  97. have hδ : δ = ‖ρ.1‖⁻¹ := norm_one_sub_one_sub_inv _
  98. have hδpos : 0 < δ := by rw [hδ]; positivity
  99. have hnδ : n * δ < 1 := by
  100. rw [hδ, ← div_eq_mul_inv, div_lt_one hρpos]; exact hρ
  101. have h2 := norm_one_sub_pow_sub_le hw n
  102. -- `n δ = ‖n (1 - w)‖ ≤ ‖1 - wⁿ‖ + ‖1 - wⁿ - n (1 - w)‖`
  103. have h3 : (n : ℝ) * δ ≤ ‖1 - w ^ n‖ + ‖1 - w ^ n - n * (1 - w)‖ := by
  104. have e : (n : ℂ) * (1 - w) = (1 - w ^ n) - (1 - w ^ n - n * (1 - w)) := by ring
  105. have := norm_sub_le (1 - w ^ n) (1 - w ^ n - n * (1 - w))
  106. rw [← e, norm_mul, Complex.norm_natCast] at this
  107. exact this
  108. have h4 : 0 < ‖1 - w ^ n‖ := by
  109. have : 0 < (n : ℝ) * δ * (1 - n * δ) := mul_pos (mul_pos hnpos hδpos) (by linarith)
  110. nlinarith
  111. positivity
  112. /-- **Li's criterion, RH ⇒ positivity** (Li 1997; Bombieri–Lagarias 1999): under the Riemann
  113. hypothesis, `lambda n > 0` for every `n > 0`. This is formal-conjectures' `li_criterion_rhs`
  114. with RH as a hypothesis. -/
  115. theorem li_criterion_rhs_of_RH (hRH : RiemannHypothesis) : LiCriterionRHS := by
  116. intro n hn
  117. obtain ⟨ρ, hρ, hR⟩ := exists_nontrivialPosZeros_norm_gt n
  118. exact (summable_lambda_summand_of_RH hRH n).tsum_pos
  119. (fun ρ => by rw [summand_eq_of_RH hRH]; positivity) ⟨ρ, hρ⟩
  120. (summand_pos_of_RH hRH hn ⟨ρ, hρ⟩ hR)
  121. /-- The forward direction of formal-conjectures' `li_criterion`. -/
  122. theorem li_criterion_forward : RiemannHypothesis → ∀ n > 0, 0 < lambda n :=
  123. fun hRH _ hn => li_criterion_rhs_of_RH hRH hn
  124. end RiemannHypothesis