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.CutoffSmooth |
| 4 | public import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 5 | public import Mathlib.Analysis.SpecialFunctions.Log.Deriv |
| 6 | |
| 7 | public section |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | noncomputable section |
| 11 | open scoped BigOperators Topology ContDiff |
| 12 | open Filter Set MeasureTheory |
| 13 | namespace ConditionalGoldbach |
| 14 | |
| 15 | lemma cutoffPolynomial_of_nonpos {t : ℝ} (ht : t≤0) : cutoffPolynomial t=0 := by simp [cutoffPolynomial,ht] |
| 16 | lemma cutoffPolynomial_of_one_le {t : ℝ} (ht : 1≤t) : cutoffPolynomial t=1 := by simp [cutoffPolynomial,ht,show ¬t≤0 by linarith] |
| 17 | |
| 18 | lemma wideCutoff_contDiff : ContDiff ℝ 6 wideCutoff := by |
| 19 | unfold wideCutoff |
| 20 | exact (cutoffPolynomial_contDiff.comp (by fun_prop)).mul (cutoffPolynomial_contDiff.comp (by fun_prop)) |
| 21 | |
| 22 | lemma wideCutoff_reflection (x : ℝ) : wideCutoff x=wideCutoff (experimentN-x) := by |
| 23 | unfold wideCutoff |
| 24 | rw [show (experimentN:ℝ)-(experimentN-x)-16=x-16 by ring] |
| 25 | exact mul_comm _ _ |
| 26 | |
| 27 | lemma wideCutoff_plateau (x : ℝ) (hx : x∈Icc (1000:ℝ) (experimentN-1000)) : wideCutoff x=1 := by |
| 28 | norm_num [experimentN] at hx |
| 29 | unfold wideCutoff |
| 30 | rw [cutoffPolynomial_of_one_le (by norm_num; linarith [hx.1]), |
| 31 | cutoffPolynomial_of_one_le (by norm_num [experimentN]; linarith [hx.2])] |
| 32 | norm_num |
| 33 | |
| 34 | lemma wideCutoff_zero_left (x : ℝ) (hx : x≤16) : wideCutoff x=0 := by |
| 35 | unfold wideCutoff |
| 36 | rw [cutoffPolynomial_of_nonpos (by apply div_nonpos_of_nonpos_of_nonneg (by linarith); norm_num)] |
| 37 | simp |
| 38 | |
| 39 | lemma wideCutoff_zero_right (x : ℝ) (hx : (experimentN:ℝ)-16≤x) : wideCutoff x=0 := by |
| 40 | rw [wideCutoff_reflection] |
| 41 | exact wideCutoff_zero_left _ (by linarith) |
| 42 | |
| 43 | lemma wideCompanion_formula (u : ℝ) : wideCompanion u = |
| 44 | Real.sqrt (1-u)*wideCutoff (experimentN*u)/ |
| 45 | Real.sqrt (Real.log (experimentN*u)*Real.log (experimentN*(1-u))) := by |
| 46 | unfold wideCompanion |
| 47 | split_ifs with hu |
| 48 | · rfl |
| 49 | · have hc : wideCutoff (experimentN*u)=0 := by |
| 50 | simp only [mem_Ioo,not_and_or,not_lt] at hu |
| 51 | rcases hu with hu|hu |
| 52 | · apply wideCutoff_zero_left |
| 53 | norm_num [experimentN] at hu ⊢ |
| 54 | linarith |
| 55 | · apply wideCutoff_zero_right |
| 56 | norm_num [experimentN] at hu ⊢ |
| 57 | linarith |
| 58 | change (0:ℝ)=Real.sqrt (1-u)*wideCutoff ((experimentN:ℝ)*u)/Real.sqrt (Real.log ((experimentN:ℝ)*u)*Real.log ((experimentN:ℝ)*(1-u))) |
| 59 | rw [hc,mul_zero,zero_div] |
| 60 | |
| 61 | lemma wideCompanion_support : Function.support wideCompanion ⊆ |
| 62 | Ioo (16/experimentN:ℝ) (1-16/experimentN:ℝ) := by |
| 63 | intro u hu |
| 64 | by_contra hn |
| 65 | apply hu |
| 66 | unfold wideCompanion |
| 67 | exact ite_eq_right hn |
| 68 | |
| 69 | lemma wideWeight_support : Function.support wideWeight ⊆ |
| 70 | Ioo (16/experimentN:ℝ) (1-16/experimentN:ℝ) := by |
| 71 | intro u hu |
| 72 | apply wideCompanion_support |
| 73 | intro he |
| 74 | exact hu (by simp [wideWeight,he]) |
| 75 | |
| 76 | lemma wideWeight_hasCompactSupport : HasCompactSupport wideWeight := |
| 77 | HasCompactSupport.of_support_subset_isCompact isCompact_Icc |
| 78 | (wideWeight_support.trans Ioo_subset_Icc_self) |
| 79 | |
| 80 | lemma wideCompanion_hasCompactSupport : HasCompactSupport wideCompanion := |
| 81 | HasCompactSupport.of_support_subset_isCompact isCompact_Icc |
| 82 | (wideCompanion_support.trans Ioo_subset_Icc_self) |
| 83 | |
| 84 | lemma wideCompanion_contDiff : ContDiff ℝ 6 wideCompanion := by |
| 85 | rw [contDiff_iff_contDiffAt] |
| 86 | intro u |
| 87 | by_cases hu : u∈Icc (16/experimentN:ℝ) (1-16/experimentN:ℝ) |
| 88 | · have hNu : 1<(experimentN:ℝ)*u := by norm_num [experimentN] at hu ⊢; linarith [hu.1] |
| 89 | have hNv : 1<(experimentN:ℝ)*(1-u) := by norm_num [experimentN] at hu ⊢; linarith [hu.2] |
| 90 | have hu1 : 0<1-u := by norm_num [experimentN] at hu ⊢; linarith [hu.2] |
| 91 | have he : wideCompanion = fun v => Real.sqrt (1-v)*wideCutoff (experimentN*v)/ |
| 92 | Real.sqrt (Real.log (experimentN*v)*Real.log (experimentN*(1-v))) := funext wideCompanion_formula |
| 93 | rw [he] |
| 94 | apply ContDiffAt.div |
| 95 | · exact ((contDiffAt_const.sub contDiffAt_id).sqrt hu1.ne').mul |
| 96 | (wideCutoff_contDiff.contDiffAt.comp u (by fun_prop)) |
| 97 | · apply ContDiffAt.sqrt |
| 98 | · exact ((contDiffAt_const.mul contDiffAt_id).log (ne_of_gt (by linarith : 0<(experimentN:ℝ)*u))).mul |
| 99 | ((contDiffAt_const.mul (contDiffAt_const.sub contDiffAt_id)).log |
| 100 | (ne_of_gt (by linarith : 0<(experimentN:ℝ)*(1-u)))) |
| 101 | · exact (mul_pos (Real.log_pos hNu) (Real.log_pos hNv)).ne' |
| 102 | · exact (Real.sqrt_pos.mpr (mul_pos (Real.log_pos hNu) (Real.log_pos hNv))).ne' |
| 103 | · have he : wideCompanion =ᶠ[𝓝 u] fun _ => (0:ℝ) := by |
| 104 | filter_upwards [isClosed_Icc.isOpen_compl.mem_nhds hu] with v hv |
| 105 | by_contra hs |
| 106 | exact hv (Ioo_subset_Icc_self (wideCompanion_support hs)) |
| 107 | exact contDiffAt_const.congr_of_eventuallyEq he |
| 108 | |
| 109 | lemma wideWeight_contDiff : ContDiff ℝ 6 wideWeight := by |
| 110 | rw [contDiff_iff_contDiffAt] |
| 111 | intro u |
| 112 | by_cases hu : 0<u |
| 113 | · unfold wideWeight |
| 114 | exact wideCompanion_contDiff.contDiffAt.div (contDiffAt_id.sqrt hu.ne') |
| 115 | (Real.sqrt_pos.mpr hu).ne' |
| 116 | · have hupper : u < (16/experimentN:ℝ) := by |
| 117 | have hh : u≤0 := le_of_not_gt hu |
| 118 | norm_num [experimentN] |
| 119 | linarith |
| 120 | have he : wideWeight =ᶠ[𝓝 u] fun _ => (0:ℝ) := by |
| 121 | filter_upwards [Iio_mem_nhds hupper] with v hv |
| 122 | by_contra hs |
| 123 | have hh := (wideWeight_support hs).1 |
| 124 | change v < 16/experimentN at hv |
| 125 | linarith |
| 126 | exact contDiffAt_const.congr_of_eventuallyEq he |
| 127 | |
| 128 | |
| 129 | lemma wideWeight_product (u : ℝ) (hu : u∈Ioo (16/experimentN:ℝ) (1-16/experimentN:ℝ)) : |
| 130 | wideWeight u*wideWeight (1-u)=wideCutoff (experimentN*u)^2/ |
| 131 | (Real.log (experimentN*u)*Real.log (experimentN*(1-u))) := by |
| 132 | have hu0 : 0<u := by norm_num [experimentN] at hu; linarith [hu.1] |
| 133 | have hu1 : 0<1-u := by norm_num [experimentN] at hu; linarith [hu.2] |
| 134 | have hNu : 1<(experimentN:ℝ)*u := by norm_num [experimentN] at hu ⊢; linarith [hu.1] |
| 135 | have hNv : 1<(experimentN:ℝ)*(1-u) := by norm_num [experimentN] at hu ⊢; linarith [hu.2] |
| 136 | have huS := (Real.sqrt_pos.mpr hu0).ne' |
| 137 | have hvS := (Real.sqrt_pos.mpr hu1).ne' |
| 138 | have hL := mul_pos (Real.log_pos hNu) (Real.log_pos hNv) |
| 139 | have hLS := (Real.sqrt_pos.mpr hL).ne' |
| 140 | have hsq := Real.sq_sqrt hL.le |
| 141 | have hc : wideCutoff ((experimentN:ℝ)*(1-u))=wideCutoff (experimentN*u) := by |
| 142 | rw [show (experimentN:ℝ)*(1-u)=experimentN-experimentN*u by ring] |
| 143 | exact (wideCutoff_reflection _).symm |
| 144 | simp only [wideWeight,wideCompanion_formula,sub_sub_cancel,hc] |
| 145 | rw [mul_comm (Real.log (experimentN*(1-u))) (Real.log (experimentN*u))] |
| 146 | field_simp; |
| 147 | rw [Real.sq_sqrt (show 0 ≤ Real.log (u*(experimentN:ℝ))*Real.log ((1-u)*(experimentN:ℝ)) from by simpa only [mul_comm] using hL.le)] |
| 148 | |
| 149 | lemma wideWeight_product_integrable : IntervalIntegrable (fun u : ℝ => wideWeight u*wideWeight (1-u)) volume 0 1 := |
| 150 | (wideWeight_contDiff.continuous.mul (wideWeight_contDiff.continuous.comp (continuous_const.sub continuous_id))).intervalIntegrable _ _ |
| 151 | |
| 152 | lemma wideModelIntegrand_intervalIntegrable : IntervalIntegrable (fun x : ℝ => wideCutoff x^2/ |
| 153 | (Real.log x*Real.log ((experimentN:ℝ)-x))) volume 16 ((experimentN:ℝ)/2) := by |
| 154 | apply ContinuousOn.intervalIntegrable |
| 155 | intro x hx |
| 156 | rw [uIcc_of_le (by norm_num [experimentN] : (16:ℝ)≤(experimentN:ℝ)/2)] at hx |
| 157 | have hx0 : 0<x := by linarith [hx.1] |
| 158 | have hy0 : 0<(experimentN:ℝ)-x := by norm_num [experimentN] at hx ⊢; linarith [hx.2] |
| 159 | have hx1 : 1<x := by linarith [hx.1] |
| 160 | have hy1 : 1<(experimentN:ℝ)-x := by norm_num [experimentN] at hx ⊢; linarith [hx.2] |
| 161 | exact ((wideCutoff_contDiff.continuous.continuousAt.pow 2).div |
| 162 | ((continuousAt_id.log hx0.ne').mul ((continuousAt_const.sub continuousAt_id).log hy0.ne')) |
| 163 | (mul_pos (Real.log_pos hx1) (Real.log_pos hy1)).ne').continuousWithinAt |
| 164 | |
| 165 | theorem proposition_B_4_weight : |
| 166 | ContDiff ℝ 6 wideWeight ∧ HasCompactSupport wideWeight ∧ |
| 167 | Function.support wideWeight ⊆ Ioo (0 : ℝ) 1 ∧ |
| 168 | IntervalIntegrable (fun u : ℝ => wideWeight u * wideWeight (1 - u)) volume 0 1 ∧ |
| 169 | IntervalIntegrable (fun x : ℝ => wideCutoff x ^ 2 / |
| 170 | (Real.log x * Real.log ((experimentN : ℝ) - x))) volume 16 ((experimentN : ℝ) / 2) := by |
| 171 | refine ⟨wideWeight_contDiff,wideWeight_hasCompactSupport,?_,wideWeight_product_integrable, |
| 172 | wideModelIntegrand_intervalIntegrable⟩ |
| 173 | intro u hu |
| 174 | have hs := wideWeight_support hu |
| 175 | norm_num [experimentN] at hs |
| 176 | constructor <;> linarith [hs.1,hs.2] |
| 177 | |
| 178 | end ConditionalGoldbach |
