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.WideMoments |
| 4 | |
| 5 | public section |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | noncomputable section |
| 9 | open scoped BigOperators |
| 10 | namespace ConditionalGoldbach |
| 11 | |
| 12 | lemma norm_square_difference_le (z w : ℂ) : |
| 13 | |‖z‖^2-‖w‖^2| ≤ 2*‖w‖*‖z-w‖+‖z-w‖^2 := by |
| 14 | have hdiff := abs_norm_sub_norm_le z w |
| 15 | have htri : ‖z‖ ≤ ‖w‖+‖z-w‖ := by |
| 16 | have hh := norm_add_le w (z-w) |
| 17 | rw [add_sub_cancel] at hh |
| 18 | exact hh |
| 19 | calc |
| 20 | _ = |‖z‖-‖w‖| * (‖z‖+‖w‖) := by |
| 21 | rw [← abs_of_nonneg (add_nonneg (norm_nonneg _) (norm_nonneg _)),← abs_mul] |
| 22 | congr 1 |
| 23 | ring |
| 24 | _ ≤ ‖z-w‖*(‖z‖+‖w‖) := |
| 25 | mul_le_mul_of_nonneg_right hdiff (add_nonneg (norm_nonneg _) (norm_nonneg _)) |
| 26 | _ ≤ _ := by nlinarith [norm_nonneg (z-w)] |
| 27 | |
| 28 | lemma finite_signed_moment_error {ι : Type*} [Fintype ι] (f g : ι → ℂ) (s : ι → ℝ) |
| 29 | (hs : ∀ i, |s i|≤1) (a ε : ℝ) (ha : 0≤a) (hε : 0≤ε) |
| 30 | (herr : a*(∑ i, ‖f i-g i‖^2)≤ε^2) : |
| 31 | |a*(∑ i, s i*‖f i‖^2)-a*(∑ i, s i*‖g i‖^2)| ≤ |
| 32 | 2*Real.sqrt (a*∑ i, ‖g i‖^2)*ε+ε^2 := by |
| 33 | have hS : 0≤∑ i, ‖g i‖^2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) |
| 34 | have hE : 0≤∑ i, ‖f i-g i‖^2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) |
| 35 | have hc := Real.sum_mul_le_sqrt_mul_sqrt Finset.univ (fun i => ‖g i‖) (fun i => ‖f i-g i‖) |
| 36 | have hse : Real.sqrt (a*∑ i, ‖f i-g i‖^2)≤ε := |
| 37 | (Real.sqrt_le_iff).mpr ⟨hε,herr⟩ |
| 38 | have hroot : a*(Real.sqrt (∑ i, ‖g i‖^2)*Real.sqrt (∑ i, ‖f i-g i‖^2))= |
| 39 | Real.sqrt (a*∑ i, ‖g i‖^2)*Real.sqrt (a*∑ i, ‖f i-g i‖^2) := by |
| 40 | rw [Real.sqrt_mul ha,Real.sqrt_mul ha] |
| 41 | have hh := Real.sq_sqrt ha |
| 42 | calc |
| 43 | _ = (Real.sqrt a)^2*(Real.sqrt (∑ i, ‖g i‖^2)*Real.sqrt (∑ i, ‖f i-g i‖^2)) := by rw [hh] |
| 44 | _ = _ := by ring |
| 45 | have hc' : a*(∑ i, ‖g i‖*‖f i-g i‖)≤Real.sqrt (a*∑ i, ‖g i‖^2)*ε := by |
| 46 | apply (mul_le_mul_of_nonneg_left hc ha).trans |
| 47 | rw [hroot] |
| 48 | exact mul_le_mul_of_nonneg_left hse (Real.sqrt_nonneg _) |
| 49 | calc |
| 50 | _ = a*|∑ i, s i*(‖f i‖^2-‖g i‖^2)| := by |
| 51 | rw [← mul_sub,← Finset.sum_sub_distrib] |
| 52 | simp only [← mul_sub,abs_mul,abs_of_nonneg ha] |
| 53 | _ ≤ a*∑ i, |s i*(‖f i‖^2-‖g i‖^2)| := |
| 54 | mul_le_mul_of_nonneg_left (Finset.abs_sum_le_sum_abs _ _) ha |
| 55 | _ ≤ a*∑ i, (2*‖g i‖*‖f i-g i‖+‖f i-g i‖^2) := by |
| 56 | apply mul_le_mul_of_nonneg_left _ ha |
| 57 | apply Finset.sum_le_sum |
| 58 | intro i _ |
| 59 | rw [abs_mul] |
| 60 | exact (mul_le_of_le_one_left (abs_nonneg _) (hs i)).trans (norm_square_difference_le _ _) |
| 61 | _ = 2*(a*∑ i, ‖g i‖*‖f i-g i‖)+a*∑ i, ‖f i-g i‖^2 := by |
| 62 | simp only [Finset.sum_add_distrib, mul_assoc,← Finset.mul_sum] |
| 63 | ring |
| 64 | _ ≤ _ := by linarith |
| 65 | |
| 66 | lemma wideSignedMoment_error (Ihat : Character experimentN → ℂ) (ε : ℝ) (hε : 0≤ε) |
| 67 | (herr : (5760:ℝ)⁻¹*∑ χ : Character experimentN, ‖countingIntegral χ-Ihat χ‖^2 ≤ ε^2) : |
| 68 | |wideCorrelation-approxSignedMoment Ihat| ≤ |
| 69 | 2*Real.sqrt (approxDiagonalMoment Ihat)*ε+ε^2 := by |
| 70 | rw [counting_signed_energy] |
| 71 | exact finite_signed_moment_error countingIntegral Ihat (fun χ => (χ (-1)).re) |
| 72 | (fun χ => (Complex.abs_re_le_norm _).trans (χ.norm_le_one _)) |
| 73 | _ ε (by positivity) hε herr |
| 74 | |
| 75 | end ConditionalGoldbach |
