Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

| 1 | module |
| 2 | |
| 3 | import Mathlib.RingTheory.PiTensorProduct |
| 4 | import TauCeti.NumberTheory.Padics.Complex.Basic |
| 5 | public import Lib.CM.FormalGroup.PrimeNotation |
| 6 | public import Lib.CM.Integrality.LogTheta |
| 7 | import Lib.CM.FormalGroup.FormalParameter |
| 8 | import Lib.CM.GoodReduction |
| 9 | import Lib.CM.Integrality.IntegralSections |
| 10 | import Lib.General.Algebra.SeriesBounds |
| 11 | |
| 12 | /-! |
| 13 | # Frobenius congruence for `θ` and the coefficient of `z ^ (p - 1)` in `x` |
| 14 | |
| 15 | Let `d ≡ 7` modulo `8` be a prime, `C` a lattice with complex multiplication by the integers of |
| 16 | `K = ℚ(√-d)`, and `p` a prime that does not split in `K`. This file proves that |
| 17 | `θ(π_p z) / θ(z) ^ q_p` is `1` modulo `π_p` in `𝒪[[y]]`. For `g = -log θ` it follows that |
| 18 | `q_p g(z) - g(π_p z)` lies in `π_p 𝒪[[y]]`. Independently of this congruence, it shows by a |
| 19 | recursion that at an inert prime the coefficient of `z ^ (p - 1)` in `x` is a unit; this is used in |
| 20 | the last step for the exponent on one curve (`New.CMLattice.norm_coeff_exponentSeries_eq_one`). |
| 21 | |
| 22 | Notions from other files: |
| 23 | * `chiK d p` is the Legendre symbol `(p / d)`: it is `1`, `-1`, `0` when `p` is split, inert, |
| 24 | ramified in `K`. |
| 25 | * `π_p = piPrime d p` is `√-d` for `p = d` and `p` otherwise; `q_p = primeNorm d p` is `p ^ 2` for |
| 26 | inert `p` and `p` otherwise. |
| 27 | * `PadicPlace p` is the choice of a ring homomorphism `ιₚ : ℂ →+* ℂ_[p]`, and `taylorVia ιₚ f` is |
| 28 | the Taylor series of `f` at `0`, with coefficients sent to `ℂ_[p]` by `ιₚ`. |
| 29 | * `θ`, `x`, `y` are the series of the theta function `C.θ`, of `C.translatedX z = ℘(z + t) - ℘(t)` |
| 30 | and of `C.translatedY z = (℘'(z + t) - a₁ x(z)) / 2`. Here `t = C.t` is the chosen point of order |
| 31 | two, the lattice is scaled so that `℘''(t) = 2`, and `a₁ = C.a₁` satisfies `a₁ ^ 2 = 12 ℘(t)`; |
| 32 | moreover `g = C.negLogTheta = -log θ`. |
| 33 | * `C.integralSeriesRing = 𝒪[[y]]` is the ring of power series in `y` with coefficients in the |
| 34 | valuation ring `𝒪` of `ℂ_[p]`. |
| 35 | |
| 36 | ## Main definitions and results |
| 37 | |
| 38 | * `New.CMLattice.exists_rescale_theta_eq_pow_mul_one_add_smul`: at a non-split prime `p` the |
| 39 | quotient `θ(π_p z) / θ(z) ^ q_p` is `1` modulo `π_p` in `𝒪[[y]]`. |
| 40 | * `New.CMLattice.exists_negLogTheta_frobenius_congruence`: `q_p g(z) - g(π_p z) ∈ π_p 𝒪[[y]]` for |
| 41 | `g = -log θ`. |
| 42 | * `New.CMLattice.norm_coeff_taylorVia_translatedX_eq_one`: at an inert prime `p` the coefficient |
| 43 | of `z ^ (p - 1)` in the series `x` is a unit. |
| 44 | -/ |
| 45 | |
| 46 | @[expose] public section |
| 47 | |
| 48 | /-! |
| 49 | ## The Frobenius congruence for `θ` |
| 50 | |
| 51 | The quotient `θ(π_p z) / θ(z) ^ q_p` is a polynomial in `x` of degree less than `q_p / 2`, so the |
| 52 | congruence can be checked below the degree `q_p`, where `π_p g` is integral. |
| 53 | -/ |
| 54 | |
| 55 | section FrobeniusCongruence |
| 56 | |
| 57 | open PowerSeries IsUltrametricDist |
| 58 | |
| 59 | namespace New |
| 60 | variable {d p : ℕ} [PrimeSevenModEight d] [Fact p.Prime] |
| 61 | |
| 62 | /-- A prime `p` with `chiK d p ≠ 1`, that is, with Legendre symbol `(p / d) ≠ 1`, so that `p` does |
| 63 | not split in `ℚ(√-d)`, is odd (`p ≠ 2`), as `2` splits. -/ |
| 64 | lemma ne_two_of_chiK_ne_one (hp : chiK d p ≠ 1) : p ≠ 2 := by |
| 65 | rintro rfl |
| 66 | exact hp QuadField.chiK_two |
| 67 | |
| 68 | /-- Let `d ≡ 7` modulo `8` be a prime. If the prime `p` does not split in `ℚ(√-d)`, that is |
| 69 | `chiK d p ≠ 1`, then `primeNorm d p`, which is `p ^ 2` or `p`, is odd, since the prime `2` |
| 70 | splits. -/ |
| 71 | lemma odd_primeNorm (hp : chiK d p ≠ 1) : Odd (primeNorm d p) := by |
| 72 | obtain ⟨e, -, h_eq⟩ : ∃ e : ℕ, e ≠ 0 ∧ primeNorm d p = p ^ e := exists_primeNorm_eq_pow d p |
| 73 | rw [h_eq] |
| 74 | exact ((Fact.out : p.Prime).odd_of_ne_two (ne_two_of_chiK_ne_one hp)).pow |
| 75 | |
| 76 | /-- If `p` is inert in `ℚ(√-d)`, then `p < q_p = primeNorm d p = p ^ 2`. -/ |
| 77 | lemma lt_primeNorm_of_chiK_eq_neg_one (hp : chiK d p = -1) : p < primeNorm d p := by |
| 78 | rw [primeNorm, ite_eq_left hp] |
| 79 | exact lt_self_pow₀ (Fact.out : p.Prime).one_lt one_lt_two |
| 80 | |
| 81 | variable [PadicPlace p] |
| 82 | |
| 83 | /-- Let `d ≡ 7` modulo `8` be a prime and `p` a prime that does not split in `ℚ(√-d)`. Then |
| 84 | `|q_p| = |π_p| ^ 2` in `ℂ_[p]`, as `q_p = ± π_p ^ 2`. -/ |
| 85 | lemma norm_primeNorm (hp : chiK d p ≠ 1) : ‖(primeNorm d p : ℂ_[p])‖ = ‖ιₚ (piPrime d p)‖ ^ 2 := by |
| 86 | obtain ⟨rfl, h_ram⟩ | ⟨hd, h_split | h_inert⟩ := chiK_cases d p |
| 87 | · rw [← norm_pow, piPrime_sq_of_ramified rfl, norm_neg, primeNorm, h_ram, |
| 88 | ite_eq_right (by norm_num)] |
| 89 | · exact absurd h_split hp |
| 90 | · rw [piPrime, ite_eq_right hd, map_natCast, primeNorm, ite_eq_left h_inert, Nat.cast_pow, |
| 91 | norm_pow] |
| 92 | |
| 93 | /-- Let `d ≡ 7` modulo `8` be a prime and `p` a prime that does not split in `ℚ(√-d)`. Then |
| 94 | `|π_p| ≤ p ^ (-1 / (p - 1))` in `ℂ_[p]`, as `p ≥ 3` (the prime `2` splits) and the valuation of |
| 95 | `π_p` is at least `1 / 2`. -/ |
| 96 | lemma norm_piPrime_le_rpow (hp : chiK d p ≠ 1) : |
| 97 | ‖ιₚ (piPrime d p)‖ ≤ p ^ (-(1 / (p - 1)) : ℝ) := by |
| 98 | have h_three : (3 : ℝ) ≤ p := |
| 99 | mod_cast (Fact.out : p.Prime).two_le.lt_of_ne' (ne_two_of_chiK_ne_one hp) |
| 100 | have h_exponent : 1 / (p - 1 : ℝ) ≤ piPrimeValuation d p := |
| 101 | (one_div_le_one_div_of_le two_pos (by linarith)).trans (half_le_piPrimeValuation d p) |
| 102 | rw [norm_piPrime] |
| 103 | exact Real.rpow_le_rpow_of_exponent_le (by linarith) (neg_le_neg h_exponent) |
| 104 | |
| 105 | /-- Let `d ≡ 7` modulo `8` and `p` be primes. Then `|π_p| ≤ |√-d|` in `ℂ_[p]`, via the homomorphism |
| 106 | `ιₚ : ℂ →+* ℂ_[p]` that `PadicPlace p` chooses. -/ |
| 107 | lemma norm_piPrime_le_norm_sqrt_neg : ‖ιₚ (piPrime d p)‖ ≤ ‖ιₚ (.I * √d)‖ := by |
| 108 | obtain rfl | hd := eq_or_ne p d |
| 109 | · rw [piPrime, ite_eq_left rfl] |
| 110 | · have h_sq : ‖ιₚ (.I * √d)‖ ^ 2 = 1 := by |
| 111 | rw [← norm_pow, map_I_mul_sqrt_sq, norm_neg, |
| 112 | ((Nat.coprime_primes Fact.out Fact.out).2 hd).norm_natCast_eq_one] |
| 113 | rw [(pow_eq_one_iff_of_nonneg (norm_nonneg _) two_ne_zero).1 h_sq] |
| 114 | exact (norm_piPrime_lt_one d).le |
| 115 | |
| 116 | /-- Let `d ≡ 7` modulo `8` and `p` be primes. Then `|π_p| ≤ |n|` in `ℂ_[p]` for `0 < n < q_p`. -/ |
| 117 | lemma norm_piPrime_le_norm_natCast {n : ℕ} (hn_ne : n ≠ 0) (hn : n < primeNorm d p) : |
| 118 | ‖ιₚ (piPrime d p)‖ ≤ ‖(n : ℂ_[p])‖ := by |
| 119 | have hp : p.Prime := Fact.out |
| 120 | by_cases h_inert : chiK d p = -1 |
| 121 | · have hd : p ≠ d := by |
| 122 | rintro rfl |
| 123 | simp [chiK, ZMod.natCast_self] at h_inert |
| 124 | have hn_lt : n < p ^ 2 := by rwa [primeNorm, ite_eq_left h_inert] at hn |
| 125 | have h_val : padicValNat p n ≤ 1 := Nat.padicValNat_def ▸ |
| 126 | Nat.le_of_lt_succ ((multiplicity_le_nat_log n).trans_lt (Nat.log_lt_of_lt_pow hn_ne hn_lt)) |
| 127 | rw [piPrime, ite_eq_right hd, map_natCast, norm_p_eq_inv, |
| 128 | norm_natCast_eq_inv_pow_padicValNat hn_ne] |
| 129 | exact (pow_one _).symm.trans_le (pow_le_pow_of_le_one (by positivity) p.cast_inv_le_one h_val) |
| 130 | · have hn_lt : n < p := by rwa [primeNorm, ite_eq_right h_inert] at hn |
| 131 | rw [(Nat.coprime_of_lt_prime hn_ne hn_lt hp).norm_natCast_eq_one] |
| 132 | exact (norm_piPrime_lt_one d).le |
| 133 | |
| 134 | /-- Let `d ≡ 7` modulo `8` and `p` be primes. Then `|π_p| ≤ |(k + 2) (k + 1)|` in `ℂ_[p]` for |
| 135 | `k + 2 < q_p`, as one of the two factors is prime to `p`. -/ |
| 136 | lemma norm_piPrime_le_norm_mul_succ {k : ℕ} (hk : k + 2 < primeNorm d p) : |
| 137 | ‖ιₚ (piPrime d p)‖ ≤ ‖((k + 2 : ℕ) : ℂ_[p]) * (k + 1 : ℕ)‖ := by |
| 138 | have hp : p.Prime := Fact.out |
| 139 | rw [norm_mul] |
| 140 | by_cases h_dvd : p ∣ k + 1 |
| 141 | · have h_coprime : p.Coprime (k + 2) := hp.coprime_iff_not_dvd.2 |
| 142 | fun h_dvd_succ ↦ hp.not_dvd_one ((Nat.dvd_add_right h_dvd).1 h_dvd_succ) |
| 143 | rw [h_coprime.norm_natCast_eq_one, one_mul] |
| 144 | exact norm_piPrime_le_norm_natCast k.succ_ne_zero (by omega) |
| 145 | · rw [(hp.coprime_iff_not_dvd.2 h_dvd).norm_natCast_eq_one, mul_one] |
| 146 | exact norm_piPrime_le_norm_natCast (k + 1).succ_ne_zero hk |
| 147 | |
| 148 | namespace CMLattice |
| 149 | variable (C : CMLattice d) |
| 150 | |
| 151 | /-- Let `d ≡ 7` modulo `8` be a prime and `p` a prime that does not split in `ℚ(√-d)`. Then |
| 152 | `θ(π_p z) = θ(z) ^ q_p * R(x(z))` as power series over `ℂ_[p]`, for a polynomial `R` of degree less |
| 153 | than `q_p / 2`. -/ |
| 154 | lemma exists_rescale_theta_eq_pow_mul_aeval (hp : chiK d p ≠ 1) : |
| 155 | ∃ R : Polynomial ℂ_[p], |
| 156 | 2 * R.natDegree < primeNorm d p ∧ |
| 157 | rescale (ιₚ (piPrime d p)) (taylorVia ιₚ C.θ) = |
| 158 | taylorVia ιₚ C.θ ^ primeNorm d p * R.aeval (taylorVia ιₚ C.translatedX) := by |
| 159 | -- `θ(π z)` is an even section of degree `q`, bounded by the `q`-th power of the naive height. |
| 160 | have h_isog : C.IsIsogeny C.periodPair (piPrime d p) (primeNorm d p) := |
| 161 | ⟨C.mul_mem_of_quadInt (piPrime_mem_quadInt d), by rw [piPrime_mul_conj d hp]⟩ |
| 162 | let f : ℂ → ℂ := fun z ↦ C.θ (piPrime d p * z) |
| 163 | have h_mem : f ∈ C.sections (primeNorm d p) := by |
| 164 | simpa only [one_mul] using C.comp_mul_mem_sections h_isog C.theta_mem |
| 165 | have h_le (z : ℂ) : ‖ιₚ (f z)‖ ≤ C.naiveHeight z ^ primeNorm d p := |
| 166 | (C.norm_theta_le_naiveHeight _).trans (C.naiveHeight_mul_le h_isog z) |
| 167 | have h_even : f.Even := fun z ↦ by simp only [f, mul_neg, theta_neg] |
| 168 | obtain ⟨R, hR⟩ : ∃ R : Polynomial ℂ, C.IsIntegralEvenExpansion (primeNorm d p) f R := |
| 169 | C.exists_polynomial_of_even h_mem h_le h_even |
| 170 | refine ⟨R.map ιₚ, ?_, ?_⟩ |
| 171 | · obtain ⟨k, hk⟩ : Odd (primeNorm d p) := odd_primeNorm hp |
| 172 | have h_deg : 2 * R.natDegree ≤ primeNorm d p := hR.two_mul_natDegree_le |
| 173 | grind [Polynomial.natDegree_map] |
| 174 | · rw [← hR.taylorVia_eq, taylorVia, taylorVia, taylorAtZero_comp_mul, rescale_map] |
| 175 | |
| 176 | /-- Let `d ≡ 7` modulo `8` be a prime and `p` a prime that does not split in `ℚ(√-d)`. Then |
| 177 | `|π_p| |g_n| ≤ 1` for the `n`-th coefficient `g_n` of `g` and `n < q_p`. -/ |
| 178 | lemma norm_piPrime_mul_coeff_negLogTheta_le_one (hp : chiK d p ≠ 1) {n : ℕ} |
| 179 | (hn : n < primeNorm d p) : ‖ιₚ (piPrime d p)‖ * ‖coeff n C.negLogTheta‖ ≤ 1 := by |
| 180 | match n with |
| 181 | | 0 => simp [constantCoeff_negLogTheta] |
| 182 | | 1 => simp [coeff_one_negLogTheta] |
| 183 | | 2 => |
| 184 | have h_two : ‖(2 : ℂ_[p])‖ = 1 := mod_cast Nat.Coprime.norm_natCast_eq_one |
| 185 | ((Nat.coprime_primes Fact.out Nat.prime_two).2 (ne_two_of_chiK_ne_one hp)) ℂ_[p] |
| 186 | have h_sqrt : ‖ιₚ (.I * √d)‖ * ‖coeff 2 C.negLogTheta‖ ≤ 1 := by |
| 187 | simpa only [norm_mul, h_two, one_mul] using C.norm_sqrt_mul_coeff_two_negLogTheta_le_one |
| 188 | exact (mul_le_mul_of_nonneg_right norm_piPrime_le_norm_sqrt_neg (norm_nonneg _)).trans h_sqrt |
| 189 | | k + 3 => |
| 190 | -- Compare the coefficients of `z ^ (k + 1)` in `g'' = g''(0) + x`. |
| 191 | have h_coeff : ((k + 1 + 2 : ℕ) : ℂ_[p]) * (k + 1 + 1 : ℕ) * coeff (k + 3) C.negLogTheta = |
| 192 | coeff (k + 1) (taylorVia ιₚ C.translatedX) := by |
| 193 | have h_coeff_eq : coeff (k + 1) (d⁄dX (d⁄dX C.negLogTheta)) = |
| 194 | coeff (k + 1) (taylorVia ιₚ C.translatedX) := by |
| 195 | rw [C.derivative_derivative_negLogTheta, map_add, coeff_succ_C, zero_add] |
| 196 | rw [← h_coeff_eq, coeff_derivative, coeff_derivative] |
| 197 | push_cast |
| 198 | ring |
| 199 | calc ‖ιₚ (piPrime d p)‖ * ‖coeff (k + 3) C.negLogTheta‖ |
| 200 | ≤ ‖((k + 1 + 2 : ℕ) : ℂ_[p]) * (k + 1 + 1 : ℕ)‖ * ‖coeff (k + 3) C.negLogTheta‖ := |
| 201 | mul_le_mul_of_nonneg_right (norm_piPrime_le_norm_mul_succ hn) (norm_nonneg _) |
| 202 | _ = ‖coeff (k + 1) (taylorVia ιₚ C.translatedX)‖ := by rw [← norm_mul, h_coeff] |
| 203 | _ ≤ 1 := C.norm_coeff_le_one_of_lt C.taylorVia_translatedX_mem_integralSeriesRing (by omega) |
| 204 | |
| 205 | /-- Let `d ≡ 7` modulo `8` be a prime and `p` a prime that does not split in `ℚ(√-d)`. For `n < q_p` |
| 206 | the `n`-th coefficient `(q_p - π_p ^ n) g_n` of `q_p g(z) - g(π_p z)` has norm at most `|π_p|`. -/ |
| 207 | lemma norm_coeff_smul_negLogTheta_sub_rescale_le (hp : chiK d p ≠ 1) {n : ℕ} |
| 208 | (hn : n < primeNorm d p) : |
| 209 | ‖coeff n ((primeNorm d p : ℂ_[p]) • C.negLogTheta - |
| 210 | rescale (ιₚ (piPrime d p)) C.negLogTheta)‖ ≤ ‖ιₚ (piPrime d p)‖ := by |
| 211 | rw [map_sub, coeff_smul, coeff_rescale, smul_eq_mul, ← sub_mul, norm_mul] |
| 212 | match n with |
| 213 | | 0 => simp [constantCoeff_negLogTheta] |
| 214 | | 1 => simp [coeff_one_negLogTheta] |
| 215 | | k + 2 => |
| 216 | have h_bound : ‖ιₚ (piPrime d p)‖ * ‖coeff (k + 2) C.negLogTheta‖ ≤ 1 := |
| 217 | C.norm_piPrime_mul_coeff_negLogTheta_le_one hp hn |
| 218 | set π : ℂ_[p] := ιₚ (piPrime d p) |
| 219 | have h_factor : ‖(primeNorm d p : ℂ_[p]) - π ^ (k + 2)‖ ≤ ‖π‖ ^ 2 := by |
| 220 | rw [sub_eq_add_neg] |
| 221 | refine (norm_add_le_max _ _).trans (max_le (norm_primeNorm hp).le ?_) |
| 222 | rw [norm_neg, norm_pow] |
| 223 | exact pow_le_pow_of_le_one (norm_nonneg π) (norm_piPrime_lt_one d).le (Nat.le_add_left 2 k) |
| 224 | calc ‖(primeNorm d p : ℂ_[p]) - π ^ (k + 2)‖ * ‖coeff (k + 2) C.negLogTheta‖ |
| 225 | ≤ ‖π‖ ^ 2 * ‖coeff (k + 2) C.negLogTheta‖ := by gcongr |
| 226 | _ = ‖π‖ * (‖π‖ * ‖coeff (k + 2) C.negLogTheta‖) := by ring |
| 227 | _ ≤ ‖π‖ := mul_le_of_le_one_right (norm_nonneg π) h_bound |
| 228 | |
| 229 | /-- For `x = z² + ⋯` and `2 * R.natDegree < q_p`, a norm bound of `‖π‖` on the coefficients |
| 230 | of `R(x)` below degree `q_p` bounds every coefficient of `R` by `‖π‖`. Thus `π⁻¹ • R(x)` |
| 231 | lies in the integral series ring. -/ |
| 232 | private lemma inv_smul_aeval_translatedX_mem_integralSeriesRing |
| 233 | (R : Polynomial ℂ_[p]) {π : ℂ_[p]} (h_degree : 2 * R.natDegree < primeNorm d p) |
| 234 | (h_series : ∀ n < primeNorm d p, ‖coeff n (R.aeval (taylorVia ιₚ C.translatedX))‖ ≤ ‖π‖) : |
| 235 | π⁻¹ • R.aeval (taylorVia ιₚ C.translatedX) ∈ C.integralSeriesRing := by |
| 236 | let x : ℂ_[p]⟦X⟧ := taylorVia ιₚ C.translatedX |
| 237 | have hx : x ∈ C.integralSeriesRing := C.taylorVia_translatedX_mem_integralSeriesRing |
| 238 | have h_polynomial_coeff (i : ℕ) (hi : 2 * i < primeNorm d p) : ‖R.coeff i‖ ≤ ‖π‖ := |
| 239 | norm_coeff_le_of_aeval C.X_sq_dvd_taylorVia_translatedX C.coeff_two_taylorVia_translatedX |
| 240 | (fun k hk ↦ C.norm_coeff_le_one_of_lt hx hk) h_series hi |
| 241 | change π⁻¹ • R.aeval x ∈ C.integralSeriesRing |
| 242 | rw [Polynomial.aeval_eq_sum_range, Finset.smul_sum] |
| 243 | refine sum_mem fun i hi ↦ ?_ |
| 244 | rw [smul_smul] |
| 245 | refine C.isSeriesGenerator_translatedY.smul_mem ?_ (pow_mem hx i) |
| 246 | rw [norm_mul, norm_inv] |
| 247 | exact inv_mul_le_one_of_le₀ (h_polynomial_coeff i (by grind)) (norm_nonneg π) |
| 248 | |
| 249 | /-- The Frobenius congruence. Let `d ≡ 7` modulo `8` be a prime and `p` a prime that does not split |
| 250 | in `ℚ(√-d)`. The Taylor series of `θ` at `0`, mapped by the chosen `ιₚ : ℂ →+* ℂ_[p]`, satisfies |
| 251 | `θ(π_p z) = θ(z) ^ q_p * (1 + π_p H)` for some `H ∈ 𝒪[[y]]`. -/ |
| 252 | lemma exists_rescale_theta_eq_pow_mul_one_add_smul (hp : chiK d p ≠ 1) : |
| 253 | ∃ H : ℂ_[p]⟦X⟧, H ∈ C.integralSeriesRing ∧ |
| 254 | rescale (ιₚ (piPrime d p)) (taylorVia ιₚ C.θ) = |
| 255 | taylorVia ιₚ C.θ ^ primeNorm d p * (1 + ιₚ (piPrime d p) • H) := by |
| 256 | set π : ℂ_[p] := ιₚ (piPrime d p) |
| 257 | set x : ℂ_[p]⟦X⟧ := taylorVia ιₚ C.translatedX |
| 258 | obtain ⟨R, h_degree_bound, h_theta_factorization⟩ : ∃ R : Polynomial ℂ_[p], |
| 259 | 2 * R.natDegree < primeNorm d p ∧ |
| 260 | rescale π (taylorVia ιₚ C.θ) = taylorVia ιₚ C.θ ^ primeNorm d p * R.aeval x := |
| 261 | C.exists_rescale_theta_eq_pow_mul_aeval hp |
| 262 | -- `R(x) = exp (q g(z) - g(π z))` is `1` modulo `π` below the degree `q`. |
| 263 | have h_low_series_coeff (n : ℕ) (hn : n < primeNorm d p) : ‖coeff n ((R - 1).aeval x)‖ ≤ ‖π‖ := by |
| 264 | rw [map_sub, map_one, ← C.expSubst_smul_negLogTheta_sub_rescale_eq h_theta_factorization] |
| 265 | exact norm_coeff_expSubst_sub_one_le (norm_piPrime_le_rpow hp) |
| 266 | (constantCoeff_smul_sub_rescale C.constantCoeff_negLogTheta _ _) |
| 267 | (fun k hk ↦ C.norm_coeff_smul_negLogTheta_sub_rescale_le hp hk) hn |
| 268 | have h_sub_degree_bound : (R - 1).natDegree ≤ R.natDegree := by simpa using R.natDegree_sub_le 1 |
| 269 | have h_low_degree := (Nat.mul_le_mul_left 2 h_sub_degree_bound).trans_lt h_degree_bound |
| 270 | refine ⟨π⁻¹ • (R - 1).aeval x, |
| 271 | C.inv_smul_aeval_translatedX_mem_integralSeriesRing (R - 1) h_low_degree h_low_series_coeff, ?_⟩ |
| 272 | rw [smul_inv_smul₀ ((map_ne_zero ιₚ).2 (piPrime_ne_zero d)), map_sub, map_one, add_sub_cancel, |
| 273 | h_theta_factorization] |
| 274 | |
| 275 | /-- The logarithm of the Frobenius congruence. Let `d ≡ 7` modulo `8` be a prime and `p` a prime |
| 276 | that does not split in `ℚ(√-d)`. Then `q_p g(z) - g(π_p z) = π_p H` for some `H ∈ 𝒪[[y]]`. -/ |
| 277 | lemma exists_negLogTheta_frobenius_congruence (hp : chiK d p ≠ 1) : |
| 278 | ∃ H : ℂ_[p]⟦X⟧, H ∈ C.integralSeriesRing ∧ |
| 279 | (primeNorm d p : ℂ_[p]) • C.negLogTheta - rescale (ιₚ (piPrime d p)) C.negLogTheta = |
| 280 | ιₚ (piPrime d p) • H := by |
| 281 | set π : ℂ_[p] := ιₚ (piPrime d p) |
| 282 | obtain ⟨H, hH, h_theta_congruence⟩ : ∃ H : ℂ_[p]⟦X⟧, H ∈ C.integralSeriesRing ∧ |
| 283 | rescale π (taylorVia ιₚ C.θ) = taylorVia ιₚ C.θ ^ primeNorm d p * (1 + π • H) := |
| 284 | C.exists_rescale_theta_eq_pow_mul_one_add_smul hp |
| 285 | have hπ : π ≠ 0 := (map_ne_zero ιₚ).2 (piPrime_ne_zero d) |
| 286 | let G : ℂ_[p]⟦X⟧ := π⁻¹ • ((primeNorm d p : ℂ_[p]) • C.negLogTheta - rescale π C.negLogTheta) |
| 287 | have h_log_factorization : |
| 288 | π • G = (primeNorm d p : ℂ_[p]) • C.negLogTheta - rescale π C.negLogTheta := |
| 289 | smul_inv_smul₀ hπ _ |
| 290 | have h_log_constant_zero : constantCoeff G = 0 := by |
| 291 | rw [constantCoeff_smul, constantCoeff_smul_sub_rescale C.constantCoeff_negLogTheta, smul_zero] |
| 292 | have h_exp_congruence : expSubst (π • G) = 1 + π • H := by |
| 293 | rw [h_log_factorization, C.expSubst_smul_negLogTheta_sub_rescale_eq h_theta_congruence] |
| 294 | exact ⟨G, C.isSeriesGenerator_translatedY.mem_of_expSubst_smul_eq hπ (norm_piPrime_le_rpow hp) |
| 295 | h_log_constant_zero hH h_exp_congruence, h_log_factorization.symm⟩ |
| 296 | |
| 297 | end CMLattice |
| 298 | |
| 299 | end New |
| 300 | |
| 301 | end FrobeniusCongruence |
| 302 | |
| 303 | /-! |
| 304 | ## The coefficient of `z ^ (p - 1)` in `x` at an inert prime |
| 305 | |
| 306 | The numbers `h_n = [z ^ (p - 1)] x ^ n` satisfy a three-term recursion modulo `p` that leads from |
| 307 | `h_0 = 0` and `h_1` to `h_((p - 1) / 2) = 1`. |
| 308 | -/ |
| 309 | |
| 310 | section SupersingularCoeff |
| 311 | |
| 312 | open PowerSeries IsUltrametricDist |
| 313 | |
| 314 | namespace New.CMLattice |
| 315 | |
| 316 | section Derivatives |
| 317 | variable {d : ℕ} (C : CMLattice d) |
| 318 | variable {K : Type*} [Field K] [CharZero K] (ι : ℂ →+* K) |
| 319 | |
| 320 | /-- `x'² = 4 x³ + a₁² x² + 4 x` for the Taylor series `x` of `℘(z + t) - ℘(t)`, with coefficients |
| 321 | mapped to `K` by `ι`. -/ |
| 322 | lemma derivative_taylorVia_translatedX_sq : |
| 323 | d⁄dX (taylorVia ι C.translatedX) ^ 2 = 4 * taylorVia ι C.translatedX ^ 3 + |
| 324 | .C (ι C.a₁) ^ 2 * taylorVia ι C.translatedX ^ 2 + 4 * taylorVia ι C.translatedX := by |
| 325 | rw [derivative_taylorVia_translatedX] |
| 326 | linear_combination 4 * C.taylorVia_curve_eq ι |
| 327 | |
| 328 | /-- `x'' = 6 x² + a₁² x + 2` for the Taylor series `x` of `℘(z + t) - ℘(t)`, with coefficients |
| 329 | mapped to `K` by `ι`. -/ |
| 330 | lemma derivative_derivative_taylorVia_translatedX : |
| 331 | d⁄dX (d⁄dX (taylorVia ι C.translatedX)) = 6 * taylorVia ι C.translatedX ^ 2 + |
| 332 | .C (ι C.a₁) ^ 2 * taylorVia ι C.translatedX + 2 := by |
| 333 | have h_deriv : d⁄dX (d⁄dX (taylorVia ι C.translatedX)) = |
| 334 | 2 * d⁄dX (taylorVia ι C.translatedY) + |
| 335 | .C (ι C.a₁) * d⁄dX (taylorVia ι C.translatedX) := by |
| 336 | conv_lhs => rw [derivative_taylorVia_translatedX] |
| 337 | simp [two_mul, Derivation.leibniz] |
| 338 | rw [h_deriv, derivative_taylorVia_translatedY, derivative_taylorVia_translatedX] |
| 339 | ring |
| 340 | |
| 341 | /-- `(xⁿ x')' = (4 n + 6) xⁿ⁺² + (n + 1) a₁² xⁿ⁺¹ + (4 n + 2) xⁿ` for the Taylor series `x` of |
| 342 | `℘(z + t) - ℘(t)`, with coefficients mapped to `K` by `ι`. -/ |
| 343 | lemma derivative_pow_mul_derivative_taylorVia_translatedX (n : ℕ) : |
| 344 | d⁄dX (taylorVia ι C.translatedX ^ n * d⁄dX (taylorVia ι C.translatedX)) = |
| 345 | (4 * n + 6 : K) • taylorVia ι C.translatedX ^ (n + 2) + |
| 346 | ((n + 1) * ι C.a₁ ^ 2 : K) • taylorVia ι C.translatedX ^ (n + 1) + |
| 347 | (4 * n + 2 : K) • taylorVia ι C.translatedX ^ n := by |
| 348 | rw [Derivation.leibniz, Derivation.leibniz_pow, derivative_derivative_taylorVia_translatedX] |
| 349 | simp only [smul_eq_C_mul, smul_eq_mul, nsmul_eq_mul, map_add, map_mul, map_pow, map_ofNat, |
| 350 | map_natCast, map_one] |
| 351 | cases n with |
| 352 | | zero => simp |
| 353 | | succ n => |
| 354 | rw [Nat.add_sub_cancel] |
| 355 | push_cast |
| 356 | linear_combination |
| 357 | (n + 1) * taylorVia ι C.translatedX ^ n * C.derivative_taylorVia_translatedX_sq ι |
| 358 | |
| 359 | end Derivatives |
| 360 | |
| 361 | variable {d : ℕ} (C : CMLattice d) [PrimeSevenModEight d] |
| 362 | variable {p : ℕ} [Fact p.Prime] [PadicPlace p] |
| 363 | |
| 364 | /-- Let `d ≡ 7` modulo `8` be a prime and `p` a prime that is inert in `ℚ(√-d)`. The numbers |
| 365 | `h_n = [z ^ (p - 1)] x ^ n` satisfy a recursion modulo the maximal ideal: `(4 n + 6) |
| 366 | h_(n + 2) + (n + 1) a₁² h_(n + 1) + (4 n + 2) h_n` has norm less than `1`. -/ |
| 367 | lemma norm_coeff_pow_taylorVia_translatedX_recursion_lt_one (hp : chiK d p = -1) (n : ℕ) : |
| 368 | ‖(4 * n + 6) * coeff (p - 1) (taylorVia ιₚ C.translatedX ^ (n + 2)) + |
| 369 | (n + 1) * ιₚ C.a₁ ^ 2 * coeff (p - 1) (taylorVia ιₚ C.translatedX ^ (n + 1)) + |
| 370 | (4 * n + 2) * coeff (p - 1) (taylorVia ιₚ C.translatedX ^ n)‖ < 1 := by |
| 371 | -- This is the coefficient of `z ^ (p - 1)` in `(xⁿ x')'`, so `p` times an integral number. |
| 372 | set x : ℂ_[p]⟦X⟧ := taylorVia ιₚ C.translatedX with hx |
| 373 | have hx_mem : x ∈ C.integralSeriesRing := C.taylorVia_translatedX_mem_integralSeriesRing |
| 374 | have h_int : ‖coeff p (x ^ n * d⁄dX x)‖ ≤ 1 := C.norm_coeff_le_one_of_lt |
| 375 | (mul_mem (pow_mem hx_mem n) (C.derivative_mem_integralSeriesRing hx_mem)) |
| 376 | (lt_primeNorm_of_chiK_eq_neg_one hp) |
| 377 | have h_deriv : coeff (p - 1) (d⁄dX (x ^ n * d⁄dX x)) = |
| 378 | coeff p (x ^ n * d⁄dX x) * (p : ℂ_[p]) := by |
| 379 | rw [coeff_derivative, ← Nat.cast_add_one, Nat.sub_add_cancel (Fact.out : p.Prime).one_le] |
| 380 | calc _ = ‖coeff (p - 1) (d⁄dX (x ^ n * d⁄dX x))‖ := by |
| 381 | simp only [hx, C.derivative_pow_mul_derivative_taylorVia_translatedX ιₚ n, map_add, |
| 382 | coeff_smul, smul_eq_mul] |
| 383 | _ = ‖coeff p (x ^ n * d⁄dX x)‖ * ‖(p : ℂ_[p])‖ := by rw [h_deriv, norm_mul] |
| 384 | _ < 1 := (mul_le_of_le_one_left (norm_nonneg _) h_int).trans_lt (PadicComplex.norm_p_lt_one p) |
| 385 | |
| 386 | omit [PrimeSevenModEight d] in |
| 387 | /-- The coefficient of `z ^ (2 m)` in `x ^ m` is `1`, as the Taylor series `x` of |
| 388 | `℘(z + t) - ℘(t)`, mapped by `ιₚ : ℂ →+* ℂ_[p]`, is `z² + ⋯`. Here `t = C.t` is the chosen point of |
| 389 | order two, with `℘''(t) = 2`. -/ |
| 390 | lemma coeff_two_mul_taylorVia_translatedX_pow (m : ℕ) : |
| 391 | coeff (2 * m) (taylorVia ιₚ C.translatedX ^ m) = (1 : ℂ_[p]) := by |
| 392 | obtain ⟨u, hu⟩ : X ^ 2 ∣ taylorVia ιₚ C.translatedX := C.X_sq_dvd_taylorVia_translatedX |
| 393 | have hu_one : constantCoeff u = 1 := by |
| 394 | simpa [hu, coeff_X_pow_mul'] using C.coeff_two_taylorVia_translatedX (p := p) |
| 395 | simp [hu, mul_pow, ← pow_mul, coeff_X_pow_mul', hu_one] |
| 396 | |
| 397 | /-- Let `d ≡ 7` modulo `8` be a prime and `p = 2 m + 1` a prime that is inert in `ℚ(√-d)`. If the |
| 398 | coefficient of `z ^ (p - 1)` in `x` has norm less than `1`, then so does that in `x ^ n` for every |
| 399 | `n ≤ m`, by the recursion for these coefficients. -/ |
| 400 | lemma norm_coeff_pow_taylorVia_translatedX_lt_one (hp : chiK d p = -1) {m : ℕ} |
| 401 | (hp_eq : p = 2 * m + 1) (h_lt : ‖coeff (p - 1) (taylorVia ιₚ C.translatedX)‖ < 1) |
| 402 | {n : ℕ} (hn : n ≤ m) : |
| 403 | ‖coeff (p - 1) (taylorVia ιₚ C.translatedX ^ n)‖ < 1 := by |
| 404 | have hp_prime : p.Prime := Fact.out |
| 405 | induction n using Nat.twoStepInduction with |
| 406 | | zero => simp [coeff_one, Nat.sub_ne_zero_of_lt hp_prime.one_lt] |
| 407 | | one => simpa only [pow_one] using h_lt |
| 408 | | more n ih₀ ih₁ => |
| 409 | set c₀ : ℂ_[p] := coeff (p - 1) (taylorVia ιₚ C.translatedX ^ n) |
| 410 | set c₁ : ℂ_[p] := coeff (p - 1) (taylorVia ιₚ C.translatedX ^ (n + 1)) |
| 411 | set c₂ : ℂ_[p] := coeff (p - 1) (taylorVia ιₚ C.translatedX ^ (n + 2)) |
| 412 | have h_recursion_small : |
| 413 | ‖(4 * n + 6) * c₂ + (n + 1) * ιₚ C.a₁ ^ 2 * c₁ + (4 * n + 2) * c₀‖ < 1 := |
| 414 | C.norm_coeff_pow_taylorVia_translatedX_recursion_lt_one hp n |
| 415 | -- `4 n + 6 = 2 (2 n + 3)` with `p` odd and `2 n + 3 < p`. |
| 416 | have h_coprime : p.Coprime (2 * (2 * n + 3)) := |
| 417 | .mul_right (Nat.coprime_two_right.2 ⟨m, hp_eq⟩) |
| 418 | (Nat.coprime_of_lt_prime (Nat.succ_ne_zero _) (by omega) hp_prime) |
| 419 | have h_leading_unit : ‖(4 * n + 6 : ℂ_[p])‖ = 1 := by |
| 420 | rw [← h_coprime.norm_natCast_eq_one ℂ_[p]] |
| 421 | norm_num [mul_add, ← mul_assoc] |
| 422 | have h_factor₁ : ‖(n + 1) * ιₚ C.a₁ ^ 2‖ ≤ 1 := by |
| 423 | rw [norm_mul, norm_pow] |
| 424 | refine (mul_le_of_le_one_left (by positivity) ?_).trans |
| 425 | (pow_le_one₀ (norm_nonneg _) C.norm_a₁_le_one) |
| 426 | exact_mod_cast norm_natCast_le_one ℂ_[p] (n + 1) |
| 427 | have h_previous_terms_small : ‖(n + 1) * ιₚ C.a₁ ^ 2 * c₁ + (4 * n + 2) * c₀‖ < 1 := |
| 428 | norm_lt_one_of_eq_mul_add_mul h_factor₁ (mod_cast norm_natCast_le_one ℂ_[p] (4 * n + 2)) |
| 429 | rfl (ih₁ (by omega)) (ih₀ (by omega)) |
| 430 | -- The leading coefficient is a unit, so the recursion propagates strict smallness to `c₂`. |
| 431 | calc ‖c₂‖ = ‖(4 * n + 6) * c₂‖ := by rw [norm_mul, h_leading_unit, one_mul] |
| 432 | _ = ‖((4 * n + 6) * c₂ + (n + 1) * ιₚ C.a₁ ^ 2 * c₁ + (4 * n + 2) * c₀) + |
| 433 | -((n + 1) * ιₚ C.a₁ ^ 2 * c₁ + (4 * n + 2) * c₀)‖ := by ring_nf |
| 434 | _ < 1 := (norm_add_le_max _ _).trans_lt (max_lt h_recursion_small (by rwa [norm_neg])) |
| 435 | |
| 436 | /-- Let `d ≡ 7` modulo `8` be a prime and `p` a prime that is inert in `ℚ(√-d)`. The coefficient of |
| 437 | `z ^ (p - 1)` in the Taylor series `x` of `℘(z + t) - ℘(t)`, mapped by `ιₚ : ℂ →+* ℂ_[p]`, has norm |
| 438 | `1`. -/ |
| 439 | lemma norm_coeff_taylorVia_translatedX_eq_one (hp : chiK d p = -1) : |
| 440 | ‖coeff (p - 1) (taylorVia ιₚ C.translatedX)‖ = 1 := by |
| 441 | -- If this coefficient is not a unit, neither is that in `x ^ m` for `p = 2 m + 1`, which is `1`. |
| 442 | obtain ⟨m, hp_eq⟩ : Odd p := |
| 443 | (Fact.out : p.Prime).odd_of_ne_two (ne_two_of_chiK_ne_one (by simp [hp] : chiK d p ≠ 1)) |
| 444 | have h_le : ‖coeff (p - 1) (taylorVia ιₚ C.translatedX)‖ ≤ 1 := |
| 445 | C.norm_coeff_le_one_of_lt C.taylorVia_translatedX_mem_integralSeriesRing |
| 446 | ((Nat.sub_le p 1).trans_lt (lt_primeNorm_of_chiK_eq_neg_one hp)) |
| 447 | refine h_le.eq_of_not_lt fun h_lt ↦ ?_ |
| 448 | have h_last : ‖coeff (p - 1) (taylorVia ιₚ C.translatedX ^ m)‖ < 1 := |
| 449 | C.norm_coeff_pow_taylorVia_translatedX_lt_one hp hp_eq h_lt le_rfl |
| 450 | simp [show p - 1 = 2 * m by omega, C.coeff_two_mul_taylorVia_translatedX_pow m] at h_last |
| 451 | |
| 452 | end New.CMLattice |
| 453 | |
| 454 | end SupersingularCoeff |