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.Proofs.HalfPlaneWeightedCauchy |
| 4 | public import ConditionalGoldbach.Proofs.SpectralPoissonConvolution |
| 5 | |
| 6 | /-! Poisson representation and the square majorant on a right half-plane. -/ |
| 7 | public section |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | noncomputable section |
| 11 | open MeasureTheory Filter Set Complex |
| 12 | open scoped Topology ComplexConjugate BigOperators |
| 13 | namespace ConditionalGoldbach |
| 14 | |
| 15 | lemma halfPlane_affine_cauchy (f : ℂ → ℂ) |
| 16 | (hd : ∀ z : ℂ, 0 ≤ z.re → DifferentiableAt ℂ f z) |
| 17 | (hg : ∀ R : ℝ, 0 ≤ R → ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ Icc 0 R, ∀ t : ℝ, |
| 18 | ‖f (line x t)‖ ≤ C * (1 + |t|) ^ (1/2 : ℝ)) |
| 19 | (hb : ∃ R₀ B : ℝ, ∀ z : ℂ, R₀ ≤ z.re → ‖f z‖ ≤ B) |
| 20 | {ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : |
| 21 | Integrable (fun v : ℝ => f (line 0 (ℓ*v+t)) / (1 + (v : ℂ)^2)) ∧ |
| 22 | (∫ v : ℝ, f (line 0 (ℓ*v+t)) / (1 + (v : ℂ)^2)) = (Real.pi : ℂ) * f (line ℓ t) := by |
| 23 | let F : ℂ → ℂ := fun z => f ((ℓ : ℂ)*z+(t : ℂ)*I) |
| 24 | have he (x v : ℝ) : (ℓ : ℂ)*line x v+(t : ℂ)*I = line (ℓ*x) (ℓ*v+t) := by |
| 25 | unfold line; push_cast; ring |
| 26 | have hF := halfPlane_weighted_cauchy F (by |
| 27 | intro z hz |
| 28 | apply (hd ((ℓ : ℂ)*z+(t : ℂ)*I) (by simpa using mul_nonneg hℓ.le hz)).comp z |
| 29 | exact (differentiableAt_id.const_mul (ℓ : ℂ)).add_const ((t : ℂ)*I)) (by |
| 30 | intro R hR |
| 31 | obtain ⟨C,hC,hg⟩ := hg (ℓ*R) (mul_nonneg hℓ.le hR) |
| 32 | refine ⟨C * (1+ℓ+|t|) ^ (1/2 : ℝ), by positivity, ?_⟩ |
| 33 | intro x hx v |
| 34 | dsimp [F] |
| 35 | rw [he] |
| 36 | apply (hg (ℓ*x) ⟨mul_nonneg hℓ.le hx.1, mul_le_mul_of_nonneg_left hx.2 hℓ.le⟩ _).trans |
| 37 | have hv : 1+|ℓ*v+t| ≤ (1+ℓ+|t|)*(1+|v|) := by |
| 38 | have hh := abs_add_le (ℓ*v) t |
| 39 | rw [abs_mul, abs_of_pos hℓ] at hh |
| 40 | nlinarith [abs_nonneg v, abs_nonneg t, mul_nonneg (abs_nonneg t) (abs_nonneg v)] |
| 41 | have hp := Real.rpow_le_rpow (by positivity) hv (by norm_num : (0 : ℝ) ≤ 1/2) |
| 42 | rw [Real.mul_rpow (by positivity) (by positivity)] at hp |
| 43 | convert mul_le_mul_of_nonneg_left hp hC using 1; ring) (by |
| 44 | obtain ⟨R₀,B,hb⟩ := hb |
| 45 | refine ⟨R₀/ℓ, B, ?_⟩ |
| 46 | intro z hz |
| 47 | apply hb |
| 48 | simp only [Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, |
| 49 | Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_zero, sub_self, add_zero] |
| 50 | simpa only [mul_comm] using (div_le_iff₀ hℓ).mp hz) |
| 51 | have hz : (ℓ : ℂ)*1+(t : ℂ)*I = line ℓ t := by simp [line] |
| 52 | simpa only [F, he, mul_zero, hz] using hF |
| 53 | |
| 54 | lemma halfPlane_poisson (f : ℂ → ℂ) |
| 55 | (hd : ∀ z : ℂ, 0 ≤ z.re → DifferentiableAt ℂ f z) |
| 56 | (hg : ∀ R : ℝ, 0 ≤ R → ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ Icc 0 R, ∀ t : ℝ, |
| 57 | ‖f (line x t)‖ ≤ C * (1 + |t|) ^ (1/2 : ℝ)) |
| 58 | (hb : ∃ R₀ B : ℝ, ∀ z : ℂ, R₀ ≤ z.re → ‖f z‖ ≤ B) |
| 59 | {ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : |
| 60 | Integrable (fun v : ℝ => (poissonKernelReal ℓ (t-v) : ℂ) * f (line 0 v)) ∧ |
| 61 | (∫ v : ℝ, (poissonKernelReal ℓ (t-v) : ℂ) * f (line 0 v)) = f (line ℓ t) := by |
| 62 | obtain ⟨hI,hE⟩ := halfPlane_affine_cauchy f hd hg hb hℓ t |
| 63 | let g (v : ℝ) := f (line 0 (ℓ*v+t)) / (1 + (v : ℂ)^2) |
| 64 | let k (v : ℝ) := (poissonKernelReal ℓ (t-v) : ℂ) * f (line 0 v) |
| 65 | have he (v : ℝ) : k (ℓ*v+t) = ((Real.pi * ℓ : ℝ) : ℂ)⁻¹ * g v := by |
| 66 | dsimp [k,g,poissonKernelReal] |
| 67 | push_cast |
| 68 | have hℓc : (ℓ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hℓ.ne' |
| 69 | have hπ : (Real.pi : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr Real.pi_ne_zero |
| 70 | have hv : 1+(v : ℂ)^2 ≠ 0 := by exact_mod_cast (by positivity : (1 : ℝ)+v^2 ≠ 0) |
| 71 | have hd : (ℓ : ℂ)^2+((t : ℂ)-((ℓ : ℂ)*v+t))^2 ≠ 0 := by |
| 72 | have hr : ℓ^2+(t-(ℓ*v+t))^2 ≠ 0 := by positivity |
| 73 | exact_mod_cast hr |
| 74 | field_simp [hℓc,hπ,hv,hd] |
| 75 | ring |
| 76 | have hinv (v : ℝ) : k v = ((Real.pi * ℓ : ℝ) : ℂ)⁻¹ * g (ℓ⁻¹*(v-t)) := by |
| 77 | convert he (ℓ⁻¹*(v-t)) using 1 |
| 78 | congr 1 |
| 79 | field_simp [hℓ.ne'] |
| 80 | ring |
| 81 | have hki : Integrable k := by |
| 82 | have hi : Integrable (fun v : ℝ => g (ℓ⁻¹*(v-t))) := by |
| 83 | simpa only [g, sub_eq_add_neg] using (hI.comp_mul_left' (inv_ne_zero hℓ.ne')).comp_add_right (-t) |
| 84 | exact (hi.const_mul _).congr (Eventually.of_forall (fun v => (hinv v).symm)) |
| 85 | refine ⟨hki, ?_⟩ |
| 86 | change (∫ v : ℝ, k v) = _ |
| 87 | have hint : (∫ v : ℝ, k (ℓ*v+t)) = (ℓ⁻¹ : ℝ) • ∫ v : ℝ, k v := by |
| 88 | rw [Measure.integral_comp_mul_left (fun v => k (v+t)) ℓ, integral_add_right_eq_self, |
| 89 | abs_of_pos (inv_pos.mpr hℓ)] |
| 90 | simp_rw [he] at hint |
| 91 | rw [integral_const_mul] at hint |
| 92 | change ((Real.pi * ℓ : ℝ) : ℂ)⁻¹ * (∫ v : ℝ, g v) = _ at hint |
| 93 | rw [show (∫ v : ℝ, g v) = (Real.pi : ℂ)*f (line ℓ t) from hE] at hint |
| 94 | simp only [Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_mul] at hint |
| 95 | have hℓc : (ℓ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hℓ.ne' |
| 96 | have hπ : (Real.pi : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr Real.pi_ne_zero |
| 97 | field_simp [hℓc,hπ] at hint |
| 98 | linear_combination -hint |
| 99 | |
| 100 | lemma weighted_complex_square_mean_le (p : ℝ → ℝ) (f : ℝ → ℂ) |
| 101 | (hp : ∀ t, 0 ≤ p t) (hpi : Integrable p) (hpm : (∫ t, p t) = 1) |
| 102 | (hfi : Integrable (fun t => (p t : ℂ)*f t)) |
| 103 | (hsi : Integrable (fun t => p t * ‖f t‖ ^ 2)) : |
| 104 | ‖∫ t, (p t : ℂ)*f t‖ ^ 2 ≤ ∫ t, p t * ‖f t‖ ^ 2 := by |
| 105 | let m := ∫ t, (p t : ℂ)*f t |
| 106 | have hi : Integrable (fun t => (conj m * ((p t : ℂ)*f t)).re) := (hfi.const_mul (conj m)).re |
| 107 | have he (t : ℝ) : p t * ‖f t - m‖ ^ 2 = |
| 108 | p t * ‖f t‖ ^ 2 + p t * ‖m‖ ^ 2 - 2 * (conj m * ((p t : ℂ)*f t)).re := by |
| 109 | simp only [← Complex.normSq_eq_norm_sq, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, |
| 110 | Complex.mul_re, Complex.mul_im, Complex.conj_re, Complex.conj_im, Complex.ofReal_re, Complex.ofReal_im] |
| 111 | ring |
| 112 | have hpos : 0 ≤ ∫ t, p t * ‖f t‖ ^ 2 + p t * ‖m‖ ^ 2 - 2 * (conj m * ((p t : ℂ)*f t)).re := by |
| 113 | apply integral_nonneg |
| 114 | intro t |
| 115 | change 0 ≤ p t * ‖f t‖ ^ 2 + p t * ‖m‖ ^ 2 - 2 * (conj m * ((p t : ℂ)*f t)).re |
| 116 | rw [← he] |
| 117 | exact mul_nonneg (hp t) (sq_nonneg _) |
| 118 | have hsum : Integrable (fun t => p t * ‖f t‖ ^ 2 + p t * ‖m‖ ^ 2) := hsi.add (hpi.mul_const _) |
| 119 | rw [integral_sub hsum (hi.const_mul 2), |
| 120 | integral_add hsi (hpi.mul_const _), integral_mul_const, hpm, one_mul, integral_const_mul] at hpos |
| 121 | have hei : (∫ t, (conj m * ((p t : ℂ)*f t)).re) = (conj m*m).re := by |
| 122 | have hh : (∫ t, (conj m * ((p t : ℂ)*f t)).re) = (∫ t, conj m * ((p t : ℂ)*f t)).re := |
| 123 | integral_re (hfi.const_mul (conj m)) |
| 124 | rw [hh, integral_const_mul] |
| 125 | rw [hei, ← Complex.normSq_eq_conj_mul_self, Complex.ofReal_re, Complex.normSq_eq_norm_sq] at hpos |
| 126 | dsimp [m] at hpos |
| 127 | linarith |
| 128 | |
| 129 | lemma poissonKernelReal_weight_bound {ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : |
| 130 | ∃ C : ℝ, 0 ≤ C ∧ ∀ v : ℝ, poissonKernelReal ℓ (t-v) ≤ C / (1+v^2) := by |
| 131 | let A : ℝ := 2 * (1+t^2+ℓ^2) / ℓ^2 |
| 132 | have hA : 0 ≤ A := by dsimp [A]; positivity |
| 133 | refine ⟨(ℓ / Real.pi) * A, by positivity, ?_⟩ |
| 134 | intro v |
| 135 | have hp : 0 < ℓ^2+(t-v)^2 := by positivity |
| 136 | have hv : 1+v^2 ≤ A*(ℓ^2+(t-v)^2) := by |
| 137 | dsimp [A] |
| 138 | rw [div_mul_eq_mul_div] |
| 139 | apply (le_div_iff₀ (sq_pos_of_pos hℓ)).mpr |
| 140 | have hbase : 1+v^2 ≤ 2*(1+t^2)+2*(t-v)^2 := by nlinarith [sq_nonneg (2*t-v)] |
| 141 | have hm := mul_le_mul_of_nonneg_right hbase (sq_nonneg ℓ) |
| 142 | nlinarith [mul_nonneg (show 0 ≤ 1+t^2 by positivity) (sq_nonneg (t-v)), sq_nonneg (ℓ^2)] |
| 143 | unfold poissonKernelReal |
| 144 | have hh := div_le_div_of_nonneg_left (show 0 ≤ ℓ / Real.pi by positivity) |
| 145 | (show 0 < (1+v^2)/A from div_pos (by positivity) (by dsimp [A]; positivity)) |
| 146 | ((div_le_iff₀ (by dsimp [A]; positivity : 0 < A)).mpr (by simpa only [mul_comm] using hv)) |
| 147 | convert hh using 1 <;> field_simp |
| 148 | |
| 149 | lemma poissonKernelReal_translate_integral {ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : |
| 150 | Integrable (fun v : ℝ => poissonKernelReal ℓ (t-v)) ∧ |
| 151 | (∫ v : ℝ, poissonKernelReal ℓ (t-v)) = 1 := by |
| 152 | have he (v : ℝ) : poissonKernelReal ℓ (t-v) = poissonKernelReal ℓ (v-t) := by |
| 153 | unfold poissonKernelReal |
| 154 | congr 2 |
| 155 | ring |
| 156 | constructor |
| 157 | · apply ((poissonKernelReal_integral ℓ hℓ).1.comp_add_right (-t)).congr |
| 158 | filter_upwards [] with v |
| 159 | simpa only [sub_eq_add_neg] using (he v).symm |
| 160 | · simp_rw [he] |
| 161 | rw [integral_sub_right_eq_self] |
| 162 | exact (poissonKernelReal_integral ℓ hℓ).2 |
| 163 | |
| 164 | lemma halfPlane_poisson_square_bound (f : ℂ → ℂ) |
| 165 | (hd : ∀ z : ℂ, 0 ≤ z.re → DifferentiableAt ℂ f z) |
| 166 | (hg : ∀ R : ℝ, 0 ≤ R → ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ Icc 0 R, ∀ t : ℝ, |
| 167 | ‖f (line x t)‖ ≤ C * (1 + |t|) ^ (1/2 : ℝ)) |
| 168 | (hb : ∃ R₀ B : ℝ, ∀ z : ℂ, R₀ ≤ z.re → ‖f z‖ ≤ B) |
| 169 | (hI : Integrable (fun t : ℝ => ‖f (line 0 t)‖ ^ 2 / (1+t^2))) |
| 170 | {ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : |
| 171 | Integrable (fun v : ℝ => poissonKernelReal ℓ (t-v) * ‖f (line 0 v)‖ ^ 2) ∧ |
| 172 | ‖f (line ℓ t)‖ ^ 2 ≤ ∫ v : ℝ, poissonKernelReal ℓ (t-v) * ‖f (line 0 v)‖ ^ 2 := by |
| 173 | obtain ⟨hfi,hf⟩ := halfPlane_poisson f hd hg hb hℓ t |
| 174 | have hc : Continuous (fun v : ℝ => f (line 0 v)) := by |
| 175 | apply continuous_iff_continuousAt.mpr |
| 176 | intro v |
| 177 | exact (hd (line 0 v) (by simp [line])).continuousAt.comp |
| 178 | (show ContinuousAt (fun v : ℝ => line 0 v) v by unfold line; fun_prop) |
| 179 | have hi : Integrable (fun v : ℝ => poissonKernelReal ℓ (t-v) * ‖f (line 0 v)‖ ^ 2) := by |
| 180 | obtain ⟨C,hC,hbound⟩ := poissonKernelReal_weight_bound hℓ t |
| 181 | refine (hI.const_mul C).mono' ?_ ?_ |
| 182 | · exact (((poissonKernelReal_continuous ℓ hℓ).comp (continuous_const.sub continuous_id)).mul |
| 183 | (hc.norm.pow 2)).aestronglyMeasurable |
| 184 | · filter_upwards [] with v |
| 185 | rw [Real.norm_eq_abs, abs_of_nonneg (by unfold poissonKernelReal; positivity)] |
| 186 | convert mul_le_mul_of_nonneg_right (hbound v) (sq_nonneg ‖f (line 0 v)‖) using 1; ring |
| 187 | refine ⟨hi, ?_⟩ |
| 188 | rw [← hf] |
| 189 | exact weighted_complex_square_mean_le (fun v => poissonKernelReal ℓ (t-v)) (fun v => f (line 0 v)) |
| 190 | (fun v => (poissonKernelReal_bounds ℓ hℓ (t-v)).1) |
| 191 | (poissonKernelReal_translate_integral hℓ t).1 (poissonKernelReal_translate_integral hℓ t).2 hfi hi |
| 192 | |
| 193 | end ConditionalGoldbach |
