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.Definitions.Asymptotics |
| 4 | public import ConditionalGoldbach.Proofs.Characters |
| 5 | |
| 6 | /-! |
| 7 | # Algebraic properties of the character kernel |
| 8 | |
| 9 | These finite Gram arguments make no assumptions about the zeros of L-functions. |
| 10 | -/ |
| 11 | public section |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | noncomputable section |
| 15 | open scoped BigOperators ComplexConjugate Topology ContDiff |
| 16 | open MeasureTheory Filter Set Complex |
| 17 | namespace ConditionalGoldbach |
| 18 | attribute [local instance] Classical.propDecidable conductorNeZero |
| 19 | |
| 20 | lemma characterKernel_gram (N : ℕ) [NeZero N] (s z : ℂ) : |
| 21 | characterKernel N s (conj z) = |
| 22 | (2 / (N.totient : ℂ)) * ∑ χ ∈ oddCharacters N, |
| 23 | logDerivative χ s * conj (logDerivative χ z) := by |
| 24 | simp [characterKernel] |
| 25 | |
| 26 | lemma characterKernel_hermitian (N : ℕ) [NeZero N] : |
| 27 | HermitianKernel (fun s z => characterKernel N s (conj z)) := by |
| 28 | intro s z |
| 29 | simp only [characterKernel_gram, map_mul, map_sum, starRingEnd_self_apply] |
| 30 | have htwo : conj (2 : ℂ) = (2 : ℂ) := by |
| 31 | exact Complex.conj_ofReal 2 |
| 32 | have hscale : conj (2 / (N.totient : ℂ)) = 2 / N.totient := by |
| 33 | simp only [map_div₀, htwo, map_natCast] |
| 34 | rw [hscale] |
| 35 | congr 1 |
| 36 | apply Finset.sum_congr rfl |
| 37 | intro χ _ |
| 38 | ring |
| 39 | |
| 40 | /-- Every finite complex Gram kernel with nonnegative real scale is positive. -/ |
| 41 | lemma finite_gram_positive {ι : Type*} (s : Finset ι) (g : ι → ℂ → ℂ) |
| 42 | (c : ℝ) (hc : 0 ≤ c) : |
| 43 | PositiveKernel (fun z w => (c : ℂ) * ∑ k ∈ s, g k z * conj (g k w)) := by |
| 44 | intro n points coefficients |
| 45 | have hsq (k : ι) : |
| 46 | (∑ i : Fin n, ∑ j : Fin n, |
| 47 | coefficients i * conj (coefficients j) * (g k (points i) * conj (g k (points j)))) = |
| 48 | (‖∑ i : Fin n, coefficients i * g k (points i)‖ ^ 2 : ℝ) := by |
| 49 | rw [Complex.sq_norm, Complex.normSq_eq_conj_mul_self] |
| 50 | simp only [map_sum, map_mul, Finset.sum_mul, Finset.mul_sum] |
| 51 | apply Finset.sum_congr rfl |
| 52 | intro i _ |
| 53 | apply Finset.sum_congr rfl |
| 54 | intro j _ |
| 55 | ring |
| 56 | have heq : |
| 57 | (∑ i : Fin n, ∑ j : Fin n, coefficients i * conj (coefficients j) * |
| 58 | ((c : ℂ) * ∑ k ∈ s, g k (points i) * conj (g k (points j)))) = |
| 59 | (c : ℂ) * ∑ k ∈ s, (‖∑ i : Fin n, coefficients i * g k (points i)‖ ^ 2 : ℝ) := by |
| 60 | simp only [Complex.ofReal_sum] |
| 61 | simp_rw [← hsq] |
| 62 | calc |
| 63 | _ = (c : ℂ) * ∑ i : Fin n, ∑ j : Fin n, ∑ k ∈ s, |
| 64 | coefficients i * conj (coefficients j) * (g k (points i) * conj (g k (points j))) := by |
| 65 | simp only [Finset.mul_sum] |
| 66 | apply Finset.sum_congr rfl |
| 67 | intro i _ |
| 68 | apply Finset.sum_congr rfl |
| 69 | intro j _ |
| 70 | apply Finset.sum_congr rfl |
| 71 | intro k _ |
| 72 | ring |
| 73 | _ = _ := by |
| 74 | congr 1 |
| 75 | simp_rw [Finset.sum_comm (s := Finset.univ) (t := s)] |
| 76 | rw [heq] |
| 77 | simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, |
| 78 | ] |
| 79 | apply mul_nonneg hc |
| 80 | exact Finset.sum_nonneg fun _ _ => sq_nonneg _ |
| 81 | |
| 82 | lemma characterKernel_positive (N : ℕ) [NeZero N] : |
| 83 | PositiveKernel (fun s z => characterKernel N s (conj z)) := by |
| 84 | have h := finite_gram_positive (oddCharacters N) (fun χ => logDerivative χ) |
| 85 | (2 / (N.totient : ℝ)) (by positivity) |
| 86 | simpa only [characterKernel_gram, Complex.ofReal_div, Complex.ofReal_ofNat, |
| 87 | Complex.ofReal_natCast] using h |
| 88 | |
| 89 | /-- The character-kernel sections lie in the finite span of logarithmic derivatives. -/ |
| 90 | lemma characterKernel_sections_le (N : ℕ) [NeZero N] : |
| 91 | Submodule.span ℂ (Set.range (fun z : ℂ => fun s : ℂ => characterKernel N s (conj z))) ≤ |
| 92 | Submodule.span ℂ (Set.range (fun χ : Character N => logDerivative χ)) := by |
| 93 | apply Submodule.span_le.mpr |
| 94 | rintro f ⟨z, rfl⟩ |
| 95 | have heq : (fun s : ℂ => characterKernel N s (conj z)) = |
| 96 | ∑ χ ∈ oddCharacters N, |
| 97 | ((2 / (N.totient : ℂ)) * conj (logDerivative χ z)) • logDerivative χ := by |
| 98 | ext s |
| 99 | simp only [characterKernel_gram, Finset.sum_apply, Pi.smul_apply, smul_eq_mul, |
| 100 | Finset.mul_sum] |
| 101 | apply Finset.sum_congr rfl |
| 102 | intro χ _ |
| 103 | ring |
| 104 | change (fun s : ℂ => characterKernel N s (conj z)) ∈ _ |
| 105 | rw [heq] |
| 106 | apply Submodule.sum_mem |
| 107 | intro χ _ |
| 108 | apply Submodule.smul_mem |
| 109 | exact Submodule.subset_span ⟨χ, rfl⟩ |
| 110 | |
| 111 | theorem proposition_3_2_finite_rank (N : ℕ) [NeZero N] |
| 112 | (_hN : Even N) (_hN4 : 4 ≤ N) : |
| 113 | FiniteDimensional ℂ (Submodule.span ℂ (Set.range |
| 114 | (fun z : ℂ => fun s : ℂ => characterKernel N s (conj z)))) := by |
| 115 | let : FiniteDimensional ℂ (Submodule.span ℂ |
| 116 | (Set.range (fun χ : Character N => logDerivative χ))) := |
| 117 | FiniteDimensional.span_of_finite ℂ (Set.finite_range _) |
| 118 | exact Submodule.finiteDimensional_of_le (characterKernel_sections_le N) |
| 119 | |
| 120 | /-- Evaluating the odd projector at `(1,1)` counts exactly half the characters. -/ |
| 121 | lemma oddCharacters_card (N : ℕ) [NeZero N] (hN : Even N) (hN4 : 4 ≤ N) : |
| 122 | (oddCharacters N).card = N.totient / 2 := by |
| 123 | have hneg : (1 : ZMod N) ≠ -1 := by |
| 124 | intro h |
| 125 | have hh := ZMod.neg_one_eq_one_iff.mp h.symm |
| 126 | omega |
| 127 | have hp := lemma_3_1_odd_orthogonality N hN hN4 1 1 |
| 128 | simp [hneg] at hp |
| 129 | have htot : (N.totient : ℂ) ≠ 0 := by exact_mod_cast (NeZero.ne N.totient) |
| 130 | field_simp at hp |
| 131 | have hcard : 2 * (oddCharacters N).card = N.totient := by exact_mod_cast hp |
| 132 | omega |
| 133 | |
| 134 | /-- The numerical rank bound is controlled by odd characters, not all characters. -/ |
| 135 | lemma characterKernel_rank_le (N : ℕ) [NeZero N] (hN : Even N) (hN4 : 4 ≤ N) : |
| 136 | Module.finrank ℂ (Submodule.span ℂ (Set.range |
| 137 | (fun z : ℂ => fun s : ℂ => characterKernel N s (conj z)))) ≤ N.totient / 2 := by |
| 138 | classical |
| 139 | let S : Finset (ℂ → ℂ) := (oddCharacters N).image (fun χ => logDerivative χ) |
| 140 | have hle : Submodule.span ℂ (Set.range |
| 141 | (fun z : ℂ => fun s : ℂ => characterKernel N s (conj z))) ≤ |
| 142 | Submodule.span ℂ (S : Set (ℂ → ℂ)) := by |
| 143 | apply Submodule.span_le.mpr |
| 144 | rintro f ⟨z, rfl⟩ |
| 145 | have heq : (fun s : ℂ => characterKernel N s (conj z)) = |
| 146 | ∑ χ ∈ oddCharacters N, |
| 147 | ((2 / (N.totient : ℂ)) * conj (logDerivative χ z)) • logDerivative χ := by |
| 148 | ext s |
| 149 | simp only [characterKernel_gram, Finset.sum_apply, Pi.smul_apply, smul_eq_mul, |
| 150 | Finset.mul_sum] |
| 151 | apply Finset.sum_congr rfl |
| 152 | intro χ _ |
| 153 | ring |
| 154 | change (fun s : ℂ => characterKernel N s (conj z)) ∈ _ |
| 155 | rw [heq] |
| 156 | apply Submodule.sum_mem |
| 157 | intro χ hχ |
| 158 | apply Submodule.smul_mem |
| 159 | apply Submodule.subset_span |
| 160 | exact Finset.mem_image.mpr ⟨χ, hχ, rfl⟩ |
| 161 | calc |
| 162 | _ ≤ Module.finrank ℂ (Submodule.span ℂ (S : Set (ℂ → ℂ))) := Submodule.finrank_mono hle |
| 163 | _ ≤ S.card := finrank_span_finset_le_card S |
| 164 | _ ≤ (oddCharacters N).card := Finset.card_image_le |
| 165 | _ = N.totient / 2 := oddCharacters_card N hN hN4 |
| 166 | |
| 167 | end ConditionalGoldbach |
