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.HardyGaussian |
| 4 | |
| 5 | /-! The classical Fourier density of a Gaussian-regularized Hardy function. -/ |
| 6 | @[expose] public section |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | noncomputable section |
| 10 | open MeasureTheory Filter Set Complex FourierTransform |
| 11 | open scoped Topology ComplexConjugate |
| 12 | namespace ConditionalGoldbach |
| 13 | |
| 14 | lemma hardyGaussian_norm_sq_le (f : ℂ → ℂ) {ε : ℝ} (hε : 0 ≤ ε) (x t : ℝ) : |
| 15 | ‖hardyGaussian f ε 0 (line x t)‖ ^ 2 ≤ |
| 16 | Real.exp (2 * ε * x ^ 2) * ‖f (line x t)‖ ^ 2 := by |
| 17 | rw [hardyGaussian_line_norm] |
| 18 | simp only [zero_mul, sub_zero, mul_pow] |
| 19 | have hdecay : Real.exp (-ε * t ^ 2) ^ 2 ≤ 1 := by |
| 20 | rw [← Real.exp_nat_mul] |
| 21 | apply Real.exp_le_one_iff.mpr |
| 22 | apply mul_nonpos_of_nonneg_of_nonpos (by norm_num) |
| 23 | exact mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr hε) (sq_nonneg t) |
| 24 | have he : Real.exp (ε * x ^ 2) ^ 2 = Real.exp (2 * ε * x ^ 2) := by |
| 25 | rw [← Real.exp_nat_mul] |
| 26 | congr 1 |
| 27 | ring |
| 28 | rw [he] |
| 29 | have hn := mul_le_mul_of_nonneg_left hdecay (sq_nonneg (‖f (line x t)‖)) |
| 30 | simpa only [mul_one] using mul_le_mul_of_nonneg_left hn (Real.exp_pos _).le |
| 31 | |
| 32 | lemma hardyGaussian_line_memLp {a b x ε : ℝ} (hab : a < b) {f : ℂ → ℂ} |
| 33 | (hf : IsRawHardy a b f) (hx : x ∈ Ioo a b) (hε : 0 ≤ ε) : |
| 34 | MemLp (fun t : ℝ => hardyGaussian f ε 0 (line x t)) 2 volume := by |
| 35 | have hc : Continuous (fun t : ℝ => hardyGaussian f ε 0 (line x t)) := |
| 36 | (rawHardy_line_continuous hf hx).mul (by unfold line; fun_prop) |
| 37 | apply (memLp_two_iff_integrable_sq_norm hc.aestronglyMeasurable).mpr |
| 38 | have hi := ((rawHardy_line_memLp hab hf hx).norm.integrable_sq).const_mul |
| 39 | (Real.exp (2 * ε * x ^ 2)) |
| 40 | apply hi.mono' (hc.norm.pow 2).aestronglyMeasurable |
| 41 | filter_upwards [] with t |
| 42 | simpa only [Pi.pow_apply, Real.norm_eq_abs, abs_sq] using hardyGaussian_norm_sq_le f hε x t |
| 43 | |
| 44 | def hardyGaussianDensity (a b : ℝ) (f : ℂ → ℂ) (ε τ : ℝ) : ℂ := |
| 45 | (Real.sqrt (2 * Real.pi) : ℂ)⁻¹ * |
| 46 | ∫ t : ℝ, hardyGaussian f ε τ (line ((a + b) / 2) t) |
| 47 | |
| 48 | lemma hardyGaussian_frequency_factor (f : ℂ → ℂ) (ε τ x t : ℝ) : |
| 49 | hardyGaussian f ε τ (line x t) = |
| 50 | (Real.exp (-x * τ) : ℂ) * |
| 51 | (Complex.exp ((-t * τ : ℝ) * Complex.I) * hardyGaussian f ε 0 (line x t)) := by |
| 52 | simp only [hardyGaussian, Complex.ofReal_zero, zero_mul, sub_zero, Complex.ofReal_exp] |
| 53 | have he : (ε : ℂ) * line x t ^ 2 - (τ : ℂ) * line x t = |
| 54 | (-x * τ : ℝ) + ((-t * τ : ℝ) * Complex.I + (ε : ℂ) * line x t ^ 2) := by |
| 55 | simp only [line, Complex.ofReal_neg, Complex.ofReal_mul] |
| 56 | ring |
| 57 | rw [he, Complex.exp_add, Complex.exp_add] |
| 58 | ring |
| 59 | |
| 60 | lemma hardyGaussianDensity_eq_fourier {a b x ε : ℝ} (hab : a < b) {f : ℂ → ℂ} |
| 61 | (hf : IsRawHardy a b f) (hx : x ∈ Ioo a b) (hε : 0 < ε) (τ : ℝ) : |
| 62 | hardyGaussianDensity a b f ε τ = |
| 63 | (Real.exp (-x * τ) : ℂ) * (Real.sqrt (2 * Real.pi) : ℂ)⁻¹ * |
| 64 | 𝓕 (fun t : ℝ => hardyGaussian f ε 0 (line x t)) (τ / (2 * Real.pi)) := by |
| 65 | have hfourier : 𝓕 (fun t : ℝ => hardyGaussian f ε 0 (line x t)) (τ / (2 * Real.pi)) = |
| 66 | ∫ t : ℝ, Complex.exp ((-t * τ : ℝ) * Complex.I) * hardyGaussian f ε 0 (line x t) := by |
| 67 | rw [Real.fourier_eq'] |
| 68 | apply integral_congr_ae |
| 69 | filter_upwards [] with t |
| 70 | have hphase : -2 * Real.pi * inner ℝ t (τ / (2 * Real.pi)) = -t * τ := by |
| 71 | simp only [Real.inner_apply] |
| 72 | field_simp |
| 73 | rw [hphase, smul_eq_mul] |
| 74 | rw [hfourier] |
| 75 | unfold hardyGaussianDensity |
| 76 | rw [hardyGaussian_vertical_integral_eq hab hf (show (a + b) / 2 ∈ Ioo a b by constructor <;> linarith) |
| 77 | hx hε τ] |
| 78 | calc |
| 79 | _ = (Real.sqrt (2 * Real.pi) : ℂ)⁻¹ * ∫ t : ℝ, (Real.exp (-x * τ) : ℂ) * |
| 80 | (Complex.exp ((-t * τ : ℝ) * Complex.I) * hardyGaussian f ε 0 (line x t)) := by |
| 81 | congr 1 |
| 82 | apply integral_congr_ae |
| 83 | exact Eventually.of_forall (hardyGaussian_frequency_factor f ε τ x) |
| 84 | _ = _ := by rw [integral_const_mul]; ring |
| 85 | |
| 86 | lemma hardyGaussianDensity_continuous {a b ε : ℝ} (hab : a < b) {f : ℂ → ℂ} |
| 87 | (hf : IsRawHardy a b f) (hε : 0 < ε) : Continuous (hardyGaussianDensity a b f ε) := by |
| 88 | have hc : (a + b) / 2 ∈ Ioo a b := by constructor <;> linarith |
| 89 | have he : hardyGaussianDensity a b f ε = fun τ => |
| 90 | (Real.exp (-((a + b) / 2) * τ) : ℂ) * (Real.sqrt (2 * Real.pi) : ℂ)⁻¹ * |
| 91 | 𝓕 (fun t : ℝ => hardyGaussian f ε 0 (line ((a + b) / 2) t)) (τ / (2 * Real.pi)) := |
| 92 | funext (hardyGaussianDensity_eq_fourier hab hf hc hε) |
| 93 | rw [he] |
| 94 | exact ((by fun_prop : Continuous (fun τ : ℝ => (Real.exp (-((a + b) / 2) * τ) : ℂ))).mul_const _).mul |
| 95 | ((classical_fourier_continuous (hardyGaussian_line_integrable hab hf hc hε 0)).comp (by fun_prop)) |
| 96 | |
| 97 | lemma hardyGaussianDensity_weighted_line {a b x ε : ℝ} (hab : a < b) {f : ℂ → ℂ} |
| 98 | (hf : IsRawHardy a b f) (hx : x ∈ Ioo a b) (hε : 0 < ε) (τ : ℝ) : |
| 99 | (Real.exp (x * τ) : ℂ) * hardyGaussianDensity a b f ε τ = |
| 100 | (Real.sqrt (2 * Real.pi) : ℂ)⁻¹ * |
| 101 | 𝓕 (fun t : ℝ => hardyGaussian f ε 0 (line x t)) (τ / (2 * Real.pi)) := by |
| 102 | rw [hardyGaussianDensity_eq_fourier hab hf hx hε] |
| 103 | have he : (Real.exp (x * τ) : ℂ) * (Real.exp (-x * τ) : ℂ) = 1 := by |
| 104 | rw [← Complex.ofReal_mul, ← Real.exp_add] |
| 105 | simp |
| 106 | rw [← mul_assoc, ← mul_assoc, he, one_mul] |
| 107 | |
| 108 | lemma hardyGaussianDensity_weighted_memLp {a b x ε : ℝ} (hab : a < b) {f : ℂ → ℂ} |
| 109 | (hf : IsRawHardy a b f) (hx : x ∈ Ioo a b) (hε : 0 < ε) : |
| 110 | MemLp (fun τ : ℝ => (Real.exp (x * τ) : ℂ) * hardyGaussianDensity a b f ε τ) 2 volume := by |
| 111 | have hF := classical_fourier_memLp (hardyGaussian_line_integrable hab hf hx hε 0) |
| 112 | (hardyGaussian_line_memLp hab hf hx hε.le) |
| 113 | have hs := memLp_comp_real_mul hF (c := (2 * Real.pi)⁻¹) (by positivity) |
| 114 | have hm := hs.const_mul ((Real.sqrt (2 * Real.pi) : ℂ)⁻¹) |
| 115 | convert hm using 1 |
| 116 | funext τ |
| 117 | rw [hardyGaussianDensity_weighted_line hab hf hx hε] |
| 118 | congr 2 |
| 119 | ring_nf |
| 120 | |
| 121 | lemma hardyGaussianDensity_line_integral {a b x ε : ℝ} (hab : a < b) {f : ℂ → ℂ} |
| 122 | (hf : IsRawHardy a b f) (hx : x ∈ Ioo a b) (hε : 0 < ε) : |
| 123 | (∫ τ : ℝ, ‖hardyGaussianDensity a b f ε τ‖ ^ 2 * Real.exp (2 * x * τ)) = |
| 124 | ∫ t : ℝ, ‖hardyGaussian f ε 0 (line x t)‖ ^ 2 := by |
| 125 | let g : ℝ → ℂ := fun t => hardyGaussian f ε 0 (line x t) |
| 126 | let c : ℝ := (2 * Real.pi)⁻¹ |
| 127 | let k : ℂ := (Real.sqrt (2 * Real.pi) : ℂ)⁻¹ |
| 128 | calc |
| 129 | _ = ∫ τ : ℝ, ‖(Real.exp (x * τ) : ℂ) * hardyGaussianDensity a b f ε τ‖ ^ 2 := by |
| 130 | apply integral_congr_ae |
| 131 | filter_upwards [] with τ |
| 132 | simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _), |
| 133 | mul_pow, ← Real.exp_nat_mul, Nat.cast_ofNat, mul_comm, mul_assoc, mul_left_comm] |
| 134 | _ = ‖k‖ ^ 2 * ∫ τ : ℝ, ‖𝓕 g (c * τ)‖ ^ 2 := by |
| 135 | rw [← integral_const_mul] |
| 136 | apply integral_congr_ae |
| 137 | filter_upwards [] with τ |
| 138 | rw [hardyGaussianDensity_weighted_line hab hf hx hε, norm_mul, mul_pow] |
| 139 | rw [show τ / (2 * Real.pi) = c * τ by dsimp [c]; ring] |
| 140 | _ = ‖k‖ ^ 2 * (|c⁻¹| * ∫ τ : ℝ, ‖𝓕 g τ‖ ^ 2) := by |
| 141 | congr 1 |
| 142 | simpa only [smul_eq_mul] using |
| 143 | (Measure.integral_comp_mul_left (fun τ : ℝ => ‖𝓕 g τ‖ ^ 2) c) |
| 144 | _ = _ := by |
| 145 | rw [classical_fourier_norm_sq_integral (hardyGaussian_line_integrable hab hf hx hε 0) |
| 146 | (hardyGaussian_line_memLp hab hf hx hε.le)] |
| 147 | dsimp [k, c, g] |
| 148 | simp only [norm_inv, Complex.norm_real, Real.norm_eq_abs, |
| 149 | abs_of_nonneg (Real.sqrt_nonneg _), inv_pow, |
| 150 | Real.sq_sqrt (by positivity : 0 ≤ 2 * Real.pi), inv_inv, |
| 151 | abs_of_pos (by positivity : 0 < 2 * Real.pi)] |
| 152 | field_simp |
| 153 | |
| 154 | end ConditionalGoldbach |
