goldbach-spectral-bridge
Li and Liu's GRH + S ⇒ Goldbach in Lean, checked against the paper by Comparator: clean it up together, and settle S
| 1 | module |
| 2 | |
| 3 | public import ConditionalGoldbach.Definitions.Model |
| 4 | public import Mathlib.Analysis.LocallyConvex.AbsConvexOpen |
| 5 | import Mathlib.Tactic.NormNum.RealSqrt |
| 6 | |
| 7 | /-! The three exact beta integrals and their absolute convergence. -/ |
| 8 | public section |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | noncomputable section |
| 12 | open scoped BigOperators ComplexConjugate Topology ContDiff |
| 13 | open MeasureTheory Filter Set Complex |
| 14 | namespace ConditionalGoldbach |
| 15 | |
| 16 | lemma beta_substitution_image (h : ℝ) (hh : 0 < h) : |
| 17 | (fun u : ℝ => h * u / (1 - u)) '' Ioo 0 1 = Ioi 0 := by |
| 18 | ext x |
| 19 | constructor |
| 20 | · rintro ⟨u, hu, rfl⟩ |
| 21 | exact div_pos (mul_pos hh hu.1) (sub_pos.mpr hu.2) |
| 22 | · intro hx |
| 23 | change 0 < x at hx |
| 24 | refine ⟨x / (h + x), ?_, ?_⟩ |
| 25 | · constructor |
| 26 | · exact div_pos hx (by linarith) |
| 27 | · exact (div_lt_one (by linarith)).2 (by linarith) |
| 28 | · have hd : h + x ≠ 0 := ne_of_gt (by linarith) |
| 29 | have hx' : 1 - x / (h + x) ≠ 0 := by |
| 30 | apply ne_of_gt |
| 31 | exact sub_pos.mpr ((div_lt_one (by linarith)).2 (by linarith)) |
| 32 | field_simp [hh.ne']; |
| 33 | ring |
| 34 | |
| 35 | lemma beta_substitution_injective (h : ℝ) (hh : 0 < h) : |
| 36 | Set.InjOn (fun u : ℝ => h * u / (1 - u)) (Ioo 0 1) := by |
| 37 | intro u hu v hv heq |
| 38 | have hu0 : 1 - u ≠ 0 := ne_of_gt (sub_pos.mpr hu.2) |
| 39 | have hv0 : 1 - v ≠ 0 := ne_of_gt (sub_pos.mpr hv.2) |
| 40 | have he := (div_eq_div_iff hu0 hv0).mp heq |
| 41 | nlinarith |
| 42 | |
| 43 | lemma beta_substitution_deriv (h u : ℝ) (hu : u ∈ Ioo (0 : ℝ) 1) : |
| 44 | HasDerivAt (fun u : ℝ => h * u / (1 - u)) (h / (1 - u) ^ 2) u := by |
| 45 | convert ((hasDerivAt_id u).const_mul h).fun_div ((hasDerivAt_const u 1).sub (hasDerivAt_id u)) |
| 46 | (ne_of_gt (sub_pos.mpr hu.2)) using 1 <;> simp only [Pi.sub_apply, id_eq]; ring |
| 47 | |
| 48 | lemma beta_substitution_integrand (h : ℝ) (hh : 0 < h) (s z : ℂ) |
| 49 | (u : ℝ) (hu : u ∈ Ioo (0 : ℝ) 1) : |
| 50 | (h / (1 - u) ^ 2 : ℝ) • |
| 51 | (((h * u / (1 - u) : ℝ) : ℂ) ^ (-1 / 2 - s) * |
| 52 | ((h * u / (1 - u) + h : ℝ) : ℂ) ^ (-1 / 2 - z)) = |
| 53 | (h : ℂ) ^ (-(s + z)) * |
| 54 | ((u : ℂ) ^ ((1 / 2 - s) - 1) * (1 - (u : ℂ)) ^ ((s + z) - 1)) := by |
| 55 | have hv : 0 < 1 - u := sub_pos.mpr hu.2 |
| 56 | have hc : (h : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hh.ne' |
| 57 | have hvC : (1 - (u : ℂ)) ≠ 0 := by exact_mod_cast hv.ne' |
| 58 | have hsum : h * u / (1 - u) + h = h / (1 - u) := by field_simp; ring |
| 59 | rw [hsum] |
| 60 | simp only [Complex.real_smul, Complex.ofReal_div] |
| 61 | rw [Complex.div_cpow_ofReal_nonneg (mul_pos hh hu.1).le hv.le, |
| 62 | Complex.div_cpow_ofReal_nonneg hh.le hv.le, |
| 63 | Complex.ofReal_mul, Complex.mul_cpow_ofReal_nonneg hh.le hu.1.le] |
| 64 | simp only [Complex.ofReal_sub, Complex.ofReal_one, Complex.ofReal_pow] |
| 65 | have he1 : -1 / 2 - s = (1 / 2 - s) - 1 := by ring |
| 66 | rw [he1] |
| 67 | have hpH : (h : ℂ) * ((h : ℂ) ^ ((1 / 2 - s) - 1) * (h : ℂ) ^ (-1 / 2 - z)) = |
| 68 | (h : ℂ) ^ (-(s + z)) := by |
| 69 | calc |
| 70 | _ = (h : ℂ) ^ (1 : ℂ) * ((h : ℂ) ^ ((1 / 2 - s) - 1) * |
| 71 | (h : ℂ) ^ (-1 / 2 - z)) := by rw [Complex.cpow_one] |
| 72 | _ = _ := by |
| 73 | rw [← Complex.cpow_add _ _ hc, ← Complex.cpow_add _ _ hc] |
| 74 | congr 1 |
| 75 | ring |
| 76 | have hpV : (1 - (u : ℂ)) ^ (2 : ℕ) * |
| 77 | ((1 - (u : ℂ)) ^ ((1 / 2 - s) - 1) * (1 - (u : ℂ)) ^ (-1 / 2 - z)) = |
| 78 | (1 - (u : ℂ)) ^ (1 - (s + z)) := by |
| 79 | rw [← Complex.cpow_add _ _ hvC, ← Complex.cpow_natCast, ← Complex.cpow_add _ _ hvC] |
| 80 | congr 1 |
| 81 | ring |
| 82 | calc |
| 83 | _ = (h : ℂ) * ((h : ℂ) ^ ((1 / 2 - s) - 1) * (h : ℂ) ^ (-1 / 2 - z)) * |
| 84 | (u : ℂ) ^ ((1 / 2 - s) - 1) / |
| 85 | ((1 - (u : ℂ)) ^ (2 : ℕ) * |
| 86 | ((1 - (u : ℂ)) ^ ((1 / 2 - s) - 1) * (1 - (u : ℂ)) ^ (-1 / 2 - z))) := by simp only [div_eq_mul_inv, mul_inv_rev]; ring |
| 87 | _ = _ := by |
| 88 | have hvInv : ((1 - (u : ℂ)) ^ (1 - (s + z)))⁻¹ = |
| 89 | (1 - (u : ℂ)) ^ ((s + z) - 1) := by |
| 90 | rw [← Complex.cpow_neg] |
| 91 | congr 1 |
| 92 | ring |
| 93 | rw [hpH, hpV, div_eq_mul_inv, hvInv] |
| 94 | ring |
| 95 | |
| 96 | lemma beta_difference_integral (h : ℝ) (hh : 0 < h) (s z : ℂ) : |
| 97 | (∫ x in Ioi (0 : ℝ), (x : ℂ) ^ (-1 / 2 - s) * (x + h : ℂ) ^ (-1 / 2 - z)) = |
| 98 | (h : ℂ) ^ (-(s + z)) * betaIntegral (1 / 2 - s) (s + z) := by |
| 99 | rw [← beta_substitution_image h hh] |
| 100 | rw [integral_image_eq_integral_abs_deriv_smul measurableSet_Ioo |
| 101 | (fun u hu => (beta_substitution_deriv h u hu).hasDerivWithinAt) |
| 102 | (beta_substitution_injective h hh)] |
| 103 | calc |
| 104 | _ = ∫ u in Ioo (0 : ℝ) 1, (h : ℂ) ^ (-(s + z)) * |
| 105 | ((u : ℂ) ^ ((1 / 2 - s) - 1) * (1 - (u : ℂ)) ^ ((s + z) - 1)) := by |
| 106 | apply setIntegral_congr_fun measurableSet_Ioo |
| 107 | intro u hu |
| 108 | dsimp only |
| 109 | rw [abs_of_pos (div_pos hh (sq_pos_of_pos (sub_pos.mpr hu.2)))] |
| 110 | simpa only [Complex.ofReal_add] using beta_substitution_integrand h hh s z u hu |
| 111 | _ = _ := by |
| 112 | rw [integral_const_mul, betaIntegral, |
| 113 | intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), integral_Ioc_eq_integral_Ioo] |
| 114 | |
| 115 | lemma beta_sum_integral (h : ℝ) (hh : 0 < h) (s z : ℂ) : |
| 116 | (∫ x in Ioo (0 : ℝ) h, (x : ℂ) ^ (-1 / 2 - s) * (h - x : ℂ) ^ (-1 / 2 - z)) = |
| 117 | (h : ℂ) ^ (-(s + z)) * betaIntegral (1 / 2 - s) (1 / 2 - z) := by |
| 118 | have he1 : (1 / 2 - s : ℂ) - 1 = -1 / 2 - s := by ring |
| 119 | have he2 : (1 / 2 - z : ℂ) - 1 = -1 / 2 - z := by ring |
| 120 | have he3 : (1 / 2 - s : ℂ) + (1 / 2 - z) - 1 = -(s + z) := by ring |
| 121 | simpa only [intervalIntegral.integral_of_le hh.le, integral_Ioc_eq_integral_Ioo, |
| 122 | he1, he2, he3, Complex.ofReal_sub] using Complex.betaIntegral_scaled (1 / 2 - s) (1 / 2 - z) hh |
| 123 | |
| 124 | lemma beta_difference_integrable (h : ℝ) (hh : 0 < h) (s z : ℂ) |
| 125 | (hd : (s, z) ∈ betaDomain) : |
| 126 | IntegrableOn (fun x : ℝ => (x : ℂ) ^ (-1 / 2 - s) * |
| 127 | (x + h : ℂ) ^ (-1 / 2 - z)) (Ioi 0) := by |
| 128 | have hs : 0 < (1 / 2 - s).re := by simp only [sub_re]; norm_num; linarith [hd.1] |
| 129 | have hz : 0 < (s + z).re := hd.2.2 |
| 130 | have hi := Complex.betaIntegral_convergent hs hz |
| 131 | rw [← beta_substitution_image h hh, |
| 132 | integrableOn_image_iff_integrableOn_abs_deriv_smul measurableSet_Ioo |
| 133 | (fun u hu => (beta_substitution_deriv h u hu).hasDerivWithinAt) |
| 134 | (beta_substitution_injective h hh)] |
| 135 | apply IntegrableOn.congr_fun ((hi.1.mono_set Ioo_subset_Ioc_self).const_mul ((h : ℂ) ^ (-(s + z)))) |
| 136 | · intro u hu |
| 137 | dsimp only |
| 138 | rw [abs_of_pos (div_pos hh (sq_pos_of_pos (sub_pos.mpr hu.2)))] |
| 139 | simpa only [Complex.ofReal_add] using (beta_substitution_integrand h hh s z u hu).symm |
| 140 | · exact measurableSet_Ioo |
| 141 | |
| 142 | lemma beta_sum_integrable (h : ℝ) (hh : 0 < h) (s z : ℂ) |
| 143 | (hd : (s, z) ∈ betaDomain) : |
| 144 | IntegrableOn (fun x : ℝ => (x : ℂ) ^ (-1 / 2 - s) * |
| 145 | (h - x : ℂ) ^ (-1 / 2 - z)) (Ioo 0 h) := by |
| 146 | have hs : 0 < (1 / 2 - s).re := by simp only [sub_re]; norm_num; linarith [hd.1] |
| 147 | have hz : 0 < (1 / 2 - z).re := by simp only [sub_re]; norm_num; linarith [hd.2.1] |
| 148 | have hi := Complex.betaIntegral_convergent hs hz |
| 149 | have hi' := hi.comp_mul_right (c := h⁻¹) |
| 150 | simp only [zero_div, one_div, inv_inv, ← div_eq_mul_inv] at hi' |
| 151 | have he1 : (1 / 2 - s : ℂ) - 1 = -1 / 2 - s := by ring |
| 152 | have he2 : (1 / 2 - z : ℂ) - 1 = -1 / 2 - z := by ring |
| 153 | apply IntegrableOn.congr_fun ((hi'.1.mono_set Ioo_subset_Ioc_self).const_mul |
| 154 | ((h : ℂ) ^ ((-1 / 2 - s) + (-1 / 2 - z)))) |
| 155 | · intro x hx |
| 156 | dsimp only |
| 157 | have hxh : 0 ≤ x / h := (div_pos hx.1 hh).le |
| 158 | have hrest : 0 ≤ 1 - x / h := sub_nonneg.mpr ((div_le_one hh).2 hx.2.le) |
| 159 | have hc : (h : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hh.ne' |
| 160 | calc |
| 161 | _ = ((h : ℂ) ^ (-1 / 2 - s) * ((x / h : ℝ) : ℂ) ^ (-1 / 2 - s)) * |
| 162 | ((h : ℂ) ^ (-1 / 2 - z) * ((1 - x / h : ℝ) : ℂ) ^ (-1 / 2 - z)) := by |
| 163 | rw [Complex.cpow_add _ _ hc] |
| 164 | simp only [Complex.ofReal_sub, Complex.ofReal_one] |
| 165 | ring_nf |
| 166 | _ = (h * (x / h) : ℝ) ^ (-1 / 2 - s) * (h * (1 - x / h) : ℝ) ^ (-1 / 2 - z) := by |
| 167 | simp only [Complex.ofReal_mul] |
| 168 | rw [Complex.mul_cpow_ofReal_nonneg hh.le hxh, |
| 169 | Complex.mul_cpow_ofReal_nonneg hh.le hrest] |
| 170 | _ = _ := by |
| 171 | congr 2 |
| 172 | · field_simp |
| 173 | · push_cast |
| 174 | field_simp |
| 175 | · exact measurableSet_Ioo |
| 176 | |
| 177 | theorem lemma_4_1 (h : ℝ) (hh : 0 < h) (s z : ℂ) (_hd : (s, z) ∈ betaDomain) : |
| 178 | (∫ x in Ioi (0 : ℝ), (x : ℂ) ^ (-1 / 2 - s) * (x + h : ℂ) ^ (-1 / 2 - z)) = |
| 179 | (h : ℂ) ^ (-(s + z)) * betaIntegral (1 / 2 - s) (s + z) ∧ |
| 180 | (∫ x in Ioi (0 : ℝ), (x : ℂ) ^ (-1 / 2 - z) * (x + h : ℂ) ^ (-1 / 2 - s)) = |
| 181 | (h : ℂ) ^ (-(s + z)) * betaIntegral (1 / 2 - z) (s + z) ∧ |
| 182 | (∫ x in Ioo (0 : ℝ) h, (x : ℂ) ^ (-1 / 2 - s) * (h - x : ℂ) ^ (-1 / 2 - z)) = |
| 183 | (h : ℂ) ^ (-(s + z)) * betaIntegral (1 / 2 - s) (1 / 2 - z) := by |
| 184 | exact ⟨beta_difference_integral h hh s z, |
| 185 | by simpa [add_comm] using beta_difference_integral h hh z s, |
| 186 | beta_sum_integral h hh s z⟩ |
| 187 | |
| 188 | theorem lemma_4_1_absolute_convergence (h : ℝ) (hh : 0 < h) |
| 189 | (s z : ℂ) (hd : (s, z) ∈ betaDomain) : |
| 190 | IntegrableOn (fun x : ℝ => (x : ℂ) ^ (-1 / 2 - s) * |
| 191 | (x + h : ℂ) ^ (-1 / 2 - z)) (Ioi 0) ∧ |
| 192 | IntegrableOn (fun x : ℝ => (x : ℂ) ^ (-1 / 2 - z) * |
| 193 | (x + h : ℂ) ^ (-1 / 2 - s)) (Ioi 0) ∧ |
| 194 | IntegrableOn (fun x : ℝ => (x : ℂ) ^ (-1 / 2 - s) * |
| 195 | (h - x : ℂ) ^ (-1 / 2 - z)) (Ioo 0 h) := by |
| 196 | exact ⟨beta_difference_integrable h hh s z hd, |
| 197 | beta_difference_integrable h hh z s ⟨hd.2.1, hd.1, by simpa [add_comm] using hd.2.2⟩, |
| 198 | beta_sum_integrable h hh s z hd⟩ |
| 199 | |
| 200 | theorem lemma_4_1_signed_model (h : ℝ) (hh : 0 < h) |
| 201 | (s z : ℂ) (hd : (s, z) ∈ betaDomain) : |
| 202 | let I₁ := ∫ x in Ioi (0 : ℝ), |
| 203 | (x : ℂ) ^ (-1 / 2 - s) * (x + h : ℂ) ^ (-1 / 2 - z) |
| 204 | let I₂ := ∫ x in Ioi (0 : ℝ), |
| 205 | (x : ℂ) ^ (-1 / 2 - z) * (x + h : ℂ) ^ (-1 / 2 - s) |
| 206 | let I₃ := ∫ x in Ioo (0 : ℝ) h, |
| 207 | (x : ℂ) ^ (-1 / 2 - s) * (h - x : ℂ) ^ (-1 / 2 - z) |
| 208 | I₁ + I₂ - I₃ = (h : ℂ) ^ (-(s + z)) * betaKernel s z ∧ |
| 209 | ∀ N k : ℕ, Even N → 4 ≤ N → 0 < k → h = (k * N : ℕ) → |
| 210 | (singularSeries (k * N) : ℂ) * (I₁ + I₂ - I₃) = |
| 211 | singularSeries (k * N) * (h : ℂ) ^ (-(s + z)) * betaKernel s z := by |
| 212 | dsimp only |
| 213 | obtain ⟨h₁, h₂, h₃⟩ := lemma_4_1 h hh s z hd |
| 214 | rw [h₁, h₂, h₃] |
| 215 | constructor |
| 216 | · unfold betaKernel |
| 217 | ring |
| 218 | · intro N k hN hN4 hk hhN |
| 219 | unfold betaKernel |
| 220 | ring |
| 221 | |
| 222 | end ConditionalGoldbach |
