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.SpectralCompletionUniform |
| 4 | |
| 5 | public section |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | noncomputable section |
| 9 | open scoped BigOperators ComplexConjugate Topology |
| 10 | open MeasureTheory Filter Set Complex |
| 11 | namespace ConditionalGoldbach |
| 12 | attribute [local instance] Classical.propDecidable |
| 13 | |
| 14 | /-- The real part of the quaternionic quadratic records the full imaginary radius. -/ |
| 15 | theorem quaternion_quadratic_re (q : Quaternion ℝ) : |
| 16 | (q * (1 - q)).re = q.re * (1 - q.re) + ‖q - (q.re : Quaternion ℝ)‖ ^ 2 := by |
| 17 | have hn := Quaternion.normSq_eq_norm_mul_self q.im |
| 18 | rw [Quaternion.normSq_def'] at hn |
| 19 | simp only [Quaternion.re_im, Quaternion.imI_im, Quaternion.imJ_im, Quaternion.imK_im, |
| 20 | zero_pow (by decide : 2 ≠ 0), zero_add] at hn |
| 21 | rw [Quaternion.sub_re_self] |
| 22 | simp only [Quaternion.re_mul, Quaternion.re_sub, Quaternion.re_one, Quaternion.imI_sub, |
| 23 | Quaternion.imI_one, Quaternion.imJ_sub, Quaternion.imJ_one, Quaternion.imK_sub, Quaternion.imK_one] |
| 24 | nlinarith |
| 25 | |
| 26 | theorem quaternion_critical_quadratic (q : Quaternion ℝ) (d : ℝ) |
| 27 | (hcrit : q.re = 1 / 2) (hnorm : ‖q - (q.re : Quaternion ℝ)‖ ^ 2 = (d - 1) / 4) : |
| 28 | q * (1 - q) = ((d / 4 : ℝ) : Quaternion ℝ) := by |
| 29 | have hre := quaternion_quadratic_re q |
| 30 | ext |
| 31 | · simp only [Quaternion.re_coe] |
| 32 | rw [hre, hnorm, hcrit] |
| 33 | ring |
| 34 | all_goals simp [hcrit, -Quaternion.coe_div, -Quaternion.coe_inv]; ring |
| 35 | |
| 36 | theorem quaternion_quadratic_three_cases (q : Quaternion ℝ) (d : ℝ) (hd : 0 < d) : |
| 37 | q * (1 - q) = ((d / 4 : ℝ) : Quaternion ℝ) ↔ |
| 38 | (1 < d ∧ q.re = 1 / 2 ∧ ‖q - (q.re : Quaternion ℝ)‖ = Real.sqrt (d - 1) / 2) ∨ |
| 39 | (d = 1 ∧ q = 1 / 2) ∨ |
| 40 | (0 < d ∧ d < 1 ∧ |
| 41 | (q = ((1 / 2 - Real.sqrt (1 - d) / 2 : ℝ) : Quaternion ℝ) ∨ |
| 42 | q = ((1 / 2 + Real.sqrt (1 - d) / 2 : ℝ) : Quaternion ℝ))) := by |
| 43 | have hhalf : (1 / 2 : Quaternion ℝ) = ((1 / 2 : ℝ) : Quaternion ℝ) := by |
| 44 | rw [Quaternion.coe_div]; rfl |
| 45 | constructor |
| 46 | · intro hroot |
| 47 | have hre := congrArg (fun q : Quaternion ℝ => q.re) hroot |
| 48 | rw [quaternion_quadratic_re, Quaternion.re_coe] at hre |
| 49 | rcases lt_trichotomy d 1 with hlt | heq | hgt |
| 50 | · have hcrit : q.re ≠ 1 / 2 := by |
| 51 | intro heq |
| 52 | rw [heq] at hre |
| 53 | nlinarith [sq_nonneg ‖q - (q.re : Quaternion ℝ)‖] |
| 54 | have hreal := quaternion_quadratic_real_of_off_critical q (d / 4) hroot hcrit |
| 55 | have hxeq : q.re * (1 - q.re) = d / 4 := by |
| 56 | rw [hreal] at hroot |
| 57 | have hh := congrArg (fun q : Quaternion ℝ => q.re) hroot |
| 58 | simpa [-Quaternion.coe_div, -Quaternion.coe_inv] using hh |
| 59 | have hs := Real.sq_sqrt (show 0 ≤ 1 - d by linarith) |
| 60 | have hsq : (2 * q.re - 1) ^ 2 = Real.sqrt (1 - d) ^ 2 := by nlinarith |
| 61 | rcases sq_eq_sq_iff_eq_or_eq_neg.1 hsq with hpos | hneg |
| 62 | · exact Or.inr (Or.inr ⟨hd, hlt, Or.inr (by rw [hreal]; congr 1; linarith)⟩) |
| 63 | · exact Or.inr (Or.inr ⟨hd, hlt, Or.inl (by rw [hreal]; congr 1; linarith)⟩) |
| 64 | · have hcrit := quaternion_quadratic_critical_of_bound q (d / 4) hroot (by rw [heq]) |
| 65 | have hn : ‖q - (q.re : Quaternion ℝ)‖ = 0 := by |
| 66 | nlinarith [norm_nonneg (q - (q.re : Quaternion ℝ))] |
| 67 | have hreal := sub_eq_zero.1 (norm_eq_zero.1 hn) |
| 68 | exact Or.inr (Or.inl ⟨heq, by rw [hreal, hcrit, hhalf]⟩) |
| 69 | · have hcrit := quaternion_quadratic_critical_of_bound q (d / 4) hroot (by linarith) |
| 70 | have hs := Real.sq_sqrt (show 0 ≤ d - 1 by linarith) |
| 71 | refine Or.inl ⟨hgt, hcrit, ?_⟩ |
| 72 | apply (sq_eq_sq₀ (norm_nonneg _) (by positivity)).1 |
| 73 | nlinarith |
| 74 | · rintro (⟨hgt, hcrit, hn⟩ | ⟨rfl, rfl⟩ | ⟨_, hlt, hq | hq⟩) |
| 75 | · apply quaternion_critical_quadratic q d hcrit |
| 76 | rw [hn] |
| 77 | have hs := Real.sq_sqrt (show 0 ≤ d - 1 by linarith) |
| 78 | nlinarith |
| 79 | · rw [hhalf] |
| 80 | apply quaternion_critical_quadratic |
| 81 | · rfl |
| 82 | · simp only [Quaternion.re_coe, sub_self, norm_zero, zero_pow (by decide : 2 ≠ 0), zero_div] |
| 83 | all_goals |
| 84 | rw [hq] |
| 85 | have hs := Real.sq_sqrt (show 0 ≤ 1 - d by linarith) |
| 86 | have hh : (1 / 2 - Real.sqrt (1 - d) / 2) * (1 - (1 / 2 - Real.sqrt (1 - d) / 2)) = d / 4 ∧ |
| 87 | (1 / 2 + Real.sqrt (1 - d) / 2) * (1 - (1 / 2 + Real.sqrt (1 - d) / 2)) = d / 4 := by |
| 88 | constructor <;> nlinarith |
| 89 | first |
| 90 | | simpa only [Quaternion.coe_mul, Quaternion.coe_sub, Quaternion.coe_one] using |
| 91 | congrArg (fun x : ℝ => (x : Quaternion ℝ)) hh.1 |
| 92 | | simpa only [Quaternion.coe_mul, Quaternion.coe_sub, Quaternion.coe_one] using |
| 93 | congrArg (fun x : ℝ => (x : Quaternion ℝ)) hh.2 |
| 94 | |
| 95 | theorem proposition_6_3_three_cases (N : ℕ) [NeZero N] |
| 96 | (hN : Even N) (hlarge : Real.exp 10 < (N : ℝ)) |
| 97 | (hGRH : GRH N) (ha : alpha N < beta) (q : Quaternion ℝ) : |
| 98 | spectralQuaternion N (residualOperator ha N) q = 0 ↔ |
| 99 | ∃ j : ℕ, eigenvalues (residualOperator ha N) j ≠ 0 ∧ |
| 100 | let d := spectralRootParameter N (eigenvalues (residualOperator ha N) j) |
| 101 | (1 < d ∧ q.re = 1 / 2 ∧ ‖q - (q.re : Quaternion ℝ)‖ = Real.sqrt (d - 1) / 2) ∨ |
| 102 | (d = 1 ∧ q = 1 / 2) ∨ |
| 103 | (0 < d ∧ d < 1 ∧ |
| 104 | (q = ((1 / 2 - Real.sqrt (1 - d) / 2 : ℝ) : Quaternion ℝ) ∨ |
| 105 | q = ((1 / 2 + Real.sqrt (1 - d) / 2 : ℝ) : Quaternion ℝ))) := by |
| 106 | have hparam := large_parameters hlarge |
| 107 | have hNpos : 0 < (N : ℝ) := by exact_mod_cast (show 0 < N by omega) |
| 108 | have hδ := spectralScale_pos N hNpos (singularSeries_pos N) hparam.2.1 |
| 109 | have hT := residualOperator_has_spectral_data N hN hlarge hGRH ha |
| 110 | rw [spectralQuaternion_eq_zero_iff N _ hT hδ.ne' q] |
| 111 | apply exists_congr |
| 112 | intro j |
| 113 | apply and_congr_right |
| 114 | intro hμ |
| 115 | have hd : 0 < spectralRootParameter N (eigenvalues (residualOperator ha N) j) := |
| 116 | div_pos (sq_pos_of_pos hδ) (sq_pos_of_ne_zero hμ) |
| 117 | have hr : spectralScale N ^ 2 / (4 * eigenvalues (residualOperator ha N) j ^ 2) = |
| 118 | spectralRootParameter N (eigenvalues (residualOperator ha N) j) / 4 := by |
| 119 | unfold spectralRootParameter |
| 120 | ring |
| 121 | rw [hr] |
| 122 | exact quaternion_quadratic_three_cases q _ hd |
| 123 | |
| 124 | end ConditionalGoldbach |
