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.Algebra.GroupWithZero.Submonoid.CancelMulZero |
| 4 | import Mathlib.Algebra.Order.Star.Int |
| 5 | import Mathlib.Data.Rat.Cast.OfScientific |
| 6 | import TauCeti.Algebra.Ring.GeomSum |
| 7 | public import New.Reduction.Data.AdmissibleData |
| 8 | import New.Reduction.Data.Magnitudes |
| 9 | |
| 10 | /-! |
| 11 | # Tight frames in `𝔞₀` |
| 12 | |
| 13 | A tight frame of length `h` is a finite family of vectors `y` of the lattice `𝔞₀`, counted with |
| 14 | multiplicities, such that `∑ y, (y† z) y = h z` for all `z`: a resolution of `h`. |
| 15 | |
| 16 | * `New.Parameters.exists_isTightFrame_coprime`: a tight frame in `𝔞₀` of length `h ≤ (d q₁) ^ 6` |
| 17 | prime to `q₁`, together with the unit-linear-form property. |
| 18 | * `New.Parameters.exists_isTightFrame_of_coprime`: this frame and the powers of `ζ` give tight |
| 19 | frames of every length `m ≥ q₁ h + R (q₁ + h)` with multiplicities at least `R`. |
| 20 | * `New.Data.exists_isTightFrame`: a tight frame of length `p₀ p₁ = D.M` with large multiplicities, |
| 21 | where `p₀` and `p₁` are the two primes `D.levelPrime 0` and `D.levelPrime 1` of the data. |
| 22 | |
| 23 | The powers of `ζ` form a tight frame of length `q₁`. To construct a tight frame of coprime length |
| 24 | `h` without using a dual basis, we solve a quadratic congruence `n z² + z + 1 ≡ 0 (mod q₁)` where |
| 25 | `n = (d + 1) / 4 = β (1 - β)`, set `t = (1 - β) + n z`, and for each prime factor `ℓ ∣ q₁` with |
| 26 | `q₁ = ℓ r` and `r = ℓ^a M` (`ℓ ∤ M`), we form the family |
| 27 | `u(ℓ, j, k, i) = ζ^j (0^k a_ℓ^i + (t M / q₁) (a_ℓ^i - a_ℓ^k))` where `a_ℓ = ζ^r`. |
| 28 | Summing over `(ℓ, j, k, i)` gives a tight frame whose length `h` is bounded by `(d q₁) ^ 6` and |
| 29 | coprime to `q₁`. |
| 30 | |
| 31 | Notions from other files: |
| 32 | * `P.E s` is the field `E = K(ζ)`, where `K = ℚ(√-d)` and `ζ = P.ζ s` is a primitive root of unity |
| 33 | of order `q₁ = P.q₁ s = P.q₀ * towerDeg s`. `P.zetaInt s` is `ζ` as an element of `𝓞 E`. |
| 34 | * `P.Φ s` is the set of infinite places of `E`; `Φ τ` is the complex embedding of `E` chosen at `τ`. |
| 35 | * `finiteImage id y ∈ Ô E` says that `y` lies in the lattice `𝔞₀ = E ∩ α Ô`, where `α` is the idele |
| 36 | of the Weil data and `Ô` is the ring of integral finite adeles. |
| 37 | * `P.periodFactor s` is a complex number; by `norm_iota_periodFactor` its absolute value at an |
| 38 | embedding `ιₚ : ℂ →+* ℂ_[p]` is given by the idele `α`. |
| 39 | * `β = (1 + √-d) / 2` is `quadGen d` in `ℂ`, `QuadField.betaK d` in `𝓞 K` and `P.betaKInE s` in |
| 40 | `𝓞 E`. |
| 41 | -/ |
| 42 | |
| 43 | @[expose] public section |
| 44 | |
| 45 | open Polynomial Finset ComplexConjugate NumberField |
| 46 | |
| 47 | namespace New |
| 48 | |
| 49 | section Families |
| 50 | |
| 51 | variable {E I J : Type} [Field E] [CMType E] [WeilData E] [Fintype I] [Fintype J] |
| 52 | |
| 53 | /-- The disjoint union of a tight frame `w` with multiplicities `m` and frame bound `M` and a tight |
| 54 | frame `w'` with multiplicities `m'` and frame bound `M'` is a tight frame with frame bound `M + M'`. |
| 55 | This disjoint union is the family `Sum.elim w w'` with multiplicities `Sum.elim m m'`. -/ |
| 56 | lemma IsTightFrame.sumElim {w : I → E} {w' : J → E} {m : I → ℕ} {m' : J → ℕ} {M M' : ℕ} |
| 57 | (hw : IsTightFrame w m M) (hw' : IsTightFrame w' m' M') : |
| 58 | IsTightFrame (Sum.elim w w') (Sum.elim m m') (M + M') := by |
| 59 | refine ⟨Sum.forall.2 ⟨hw.finiteImage_mem, hw'.finiteImage_mem⟩, fun σ τ ↦ ?_⟩ |
| 60 | simp [Fintype.sum_sum_type, hw.sum_mul_conj, hw'.sum_mul_conj, ite_add_ite] |
| 61 | |
| 62 | end Families |
| 63 | |
| 64 | /-- Let `d` be a prime with `d ≡ 7 mod 8`. An element of `K = ℚ(√-d)` fixed by complex conjugation |
| 65 | is rational. -/ |
| 66 | lemma QuadField.exists_algebraMap_eq_of_star_eq {d : ℕ} [PrimeSevenModEight d] {a : QuadField d} |
| 67 | (ha : star a = a) : ∃ q : ℚ, algebraMap ℚ (QuadField d) q = a := by |
| 68 | let aReal : maximalRealSubfield (QuadField d) := ⟨a, mem_maximalRealSubfield_iff_star_eq.2 ha⟩ |
| 69 | exact ⟨(CMExtension.equivMaximalRealSubfield ℚ (QuadField d)).symm aReal, |
| 70 | CMExtension.algebraMap_equivMaximalRealSubfield_symm_apply ℚ (QuadField d) aReal⟩ |
| 71 | |
| 72 | /-- Let `d` be a prime with `d ≡ 7 mod 8`. If a complex number `z` lies in `quadInt d`, the ring of |
| 73 | integers of `K = ℚ(√-d)` as a subring of `ℂ`, and is real, then `z` is a rational integer. -/ |
| 74 | lemma exists_eq_intCast_of_mem_quadInt_of_conj_eq {d : ℕ} [PrimeSevenModEight d] {z : ℂ} |
| 75 | (hz : z ∈ quadInt d) (h_real : conj z = z) : ∃ n : ℤ, z = n := by |
| 76 | obtain ⟨a, rfl⟩ : ∃ a : 𝓞 (QuadField d), ((a : QuadField d) : ℂ) = z := RingHom.mem_range.1 hz |
| 77 | have ha_real : star (a : QuadField d) = a := |
| 78 | Subtype.ext ((QuadField.coe_star_eq_conj d a).trans h_real) |
| 79 | obtain ⟨q, hq⟩ : ∃ q : ℚ, algebraMap ℚ (QuadField d) q = a := |
| 80 | QuadField.exists_algebraMap_eq_of_star_eq ha_real |
| 81 | have h_int : IsIntegral ℤ q := by |
| 82 | rw [← isIntegral_algebraMap_iff (B := QuadField d), hq] |
| 83 | exact a.isIntegral_coe |
| 84 | obtain ⟨n, rfl⟩ : ∃ n : ℤ, algebraMap ℤ ℚ n = q := |
| 85 | IsIntegrallyClosed.algebraMap_eq_of_integral h_int |
| 86 | exact ⟨n, by simp [← hq]⟩ |
| 87 | |
| 88 | namespace Parameters |
| 89 | |
| 90 | variable {P : Parameters} {s : ℕ} |
| 91 | |
| 92 | open scoped Classical in |
| 93 | /-- An element `y` of `E` lies in the lattice `𝔞₀`, that is `finiteImage id y ∈ Ô E`, if and only if |
| 94 | `relDifferentGen * y` is integral at the finite places dividing `betaKInE = (1 + √-d) / 2` and `y` |
| 95 | is integral at the other finite places. Here `relDifferentGen` generates the different of `E/K`. -/ |
| 96 | lemma finiteImage_mem_iff {y : P.E s} : |
| 97 | finiteImage id y ∈ Ô (P.E s) ↔ |
| 98 | ∀ w : FinPlace (P.E s), w.valuation (P.E s) |
| 99 | ((if P.betaKInE s ∈ w.asIdeal then (P.relDifferentGen s : P.E s) else 1) * y) ≤ 1 := by |
| 100 | refine mem_Ô.trans (forall_congr' fun w ↦ ?_) |
| 101 | by_cases hw : P.betaKInE s ∈ w.asIdeal <;> simp [finiteImage, WeilData.α, α, hw] |
| 102 | |
| 103 | /-- `Φ τ (betaKInE s) = quadGen P.d` for every infinite place `τ` of `E`. -/ |
| 104 | private lemma phi_betaKInE (τ : P.Φ s) : Φ τ (P.betaKInE s : P.E s) = quadGen P.d := by |
| 105 | rw [show (P.betaKInE s : P.E s) = algebraMap P.K (P.E s) (QuadField.betaK P.d) from rfl, |
| 106 | P.phi_algebraMap s τ] |
| 107 | rfl |
| 108 | |
| 109 | /-- Let `N = l * r` and `r = l ^ a * M` with `l` prime not dividing `M`, and let `ζ` be a root of |
| 110 | the cyclotomic polynomial `Φ_N`. Then `N` divides `Φ_N'(ζ) * (ζ ^ r - 1) * M`, by expanding |
| 111 | `Φ_M(X ^ l) = Φ_{M l}(X) * Φ_M(X)` by `l ^ a` and differentiating at `ζ`. -/ |
| 112 | private lemma natCast_dvd_eval_derivative_cyclotomic_mul {R : Type*} [CommRing R] [CharZero R] |
| 113 | {N l r a M : ℕ} {ζ : R} (hl_prime : l.Prime) (hl_ndvd_M : ¬ l ∣ M) (hN_eq : N = l * r) |
| 114 | (hr_eq : r = l ^ a * M) (h_root : (cyclotomic N R).eval ζ = 0) : |
| 115 | (N : R) ∣ (cyclotomic N R).derivative.eval ζ * (ζ ^ r - 1) * M := by |
| 116 | have hN_fac : M * l * l ^ a = N := by rw [hN_eq, hr_eq]; ring |
| 117 | have h_exp_eq : expand R (l ^ a * l) (cyclotomic M R) = |
| 118 | cyclotomic N R * expand R (l ^ a) (cyclotomic M R) := by |
| 119 | have h_step := |
| 120 | congrArg (expand R (l ^ a)) (cyclotomic_expand_eq_cyclotomic_mul hl_prime hl_ndvd_M R) |
| 121 | rw [expand_mul, h_step, map_mul, expand_pow_cyclotomic hl_prime (dvd_mul_left l M), hN_fac] |
| 122 | have h_deriv_exp : |
| 123 | (N : R) * ((cyclotomic M R).derivative.eval (ζ ^ (l ^ a * l)) * ζ ^ (l ^ a * l - 1)) = |
| 124 | (M : R) * ((cyclotomic N R).derivative.eval ζ * |
| 125 | (expand R (l ^ a) (cyclotomic M R)).eval ζ) := by |
| 126 | have h_eq := congrArg (fun f : R[X] ↦ f.derivative.eval ζ) h_exp_eq |
| 127 | simp only [derivative_expand, derivative_mul, eval_mul, eval_add, eval_natCast, eval_pow, |
| 128 | eval_X, expand_eval, h_root, zero_mul, add_zero] at h_eq |
| 129 | have h_mul := congrArg (fun x : R ↦ (M : R) * x) h_eq |
| 130 | have hN_cast : (M : R) * ((l ^ a * l : ℕ) : R) = (N : R) := by |
| 131 | exact_mod_cast (show M * (l ^ a * l) = N by rw [hN_eq, hr_eq]; ring) |
| 132 | calc (N : R) * ((cyclotomic M R).derivative.eval (ζ ^ (l ^ a * l)) * ζ ^ (l ^ a * l - 1)) |
| 133 | = (M : R) * ((cyclotomic M R).derivative.eval (ζ ^ (l ^ a * l)) * |
| 134 | (((l ^ a * l : ℕ) : R) * ζ ^ (l ^ a * l - 1))) := by |
| 135 | rw [← hN_cast]; ring |
| 136 | _ = (M : R) * ((cyclotomic N R).derivative.eval ζ * |
| 137 | (expand R (l ^ a) (cyclotomic M R)).eval ζ) := by simpa [expand_eval] using h_mul |
| 138 | have h_dvd_exp : (expand R (l ^ a) (cyclotomic M R)).eval ζ ∣ ζ ^ r - 1 := by |
| 139 | simpa [expand_eval, ← pow_mul, ← hr_eq] using |
| 140 | (Polynomial.eval_dvd (cyclotomic.dvd_X_pow_sub_one M R) (x := ζ ^ l ^ a)) |
| 141 | have h1 : (N : R) ∣ (M : R) * ((cyclotomic N R).derivative.eval ζ * |
| 142 | (expand R (l ^ a) (cyclotomic M R)).eval ζ) := |
| 143 | ⟨_, h_deriv_exp.symm⟩ |
| 144 | have h2 : (N : R) ∣ (M : R) * ((cyclotomic N R).derivative.eval ζ * (ζ ^ r - 1)) := |
| 145 | h1.trans (mul_dvd_mul_left (M : R) (mul_dvd_mul_left _ h_dvd_exp)) |
| 146 | simpa [mul_assoc, mul_left_comm, mul_comm] using h2 |
| 147 | |
| 148 | /-- Let `ζ` be a primitive `N`-th root of unity in a characteristic-zero domain `R`, and let `ℓ` |
| 149 | be a prime factor of `N = ℓ * r`. Writing `r = ℓ ^ a * M` with `ℓ ∤ M`, we have `M ≤ N`, the prime |
| 150 | factors of `N` dividing `M` are precisely those different from `ℓ`, and there exists `V ∈ R` with |
| 151 | `V ∣ M` and `Φ_N'(ζ) * (ζ ^ r - 1) * M = N * V`. -/ |
| 152 | lemma exists_cyclotomic_different_factor {R : Type*} [CommRing R] [IsDomain R] [CharZero R] |
| 153 | {N : ℕ} {ζ : R} (hζ : IsPrimitiveRoot ζ N) (ℓ : N.primeFactors) : |
| 154 | ∃ r M : ℕ, M ≤ N ∧ N = ℓ.val * r ∧ (∀ p ∈ N.primeFactors, p ∣ M ↔ p ≠ ℓ.val) ∧ |
| 155 | ∃ V : R, V ∣ (M : R) ∧ |
| 156 | (cyclotomic N R).derivative.eval ζ * (ζ ^ r - 1) * M = N * V := by |
| 157 | rcases ℓ with ⟨l, hl⟩ |
| 158 | obtain ⟨hl_prime, ⟨r, hN_eq⟩, hN_ne⟩ := Nat.mem_primeFactors.1 hl |
| 159 | have hN_pos : 0 < N := Nat.pos_of_ne_zero hN_ne |
| 160 | have hr_pos : 0 < r := Nat.pos_of_ne_zero fun hr0 ↦ hN_ne (by simp [hN_eq, hr0]) |
| 161 | have hr_lt : r < N := by |
| 162 | rw [hN_eq] |
| 163 | exact lt_mul_of_one_lt_left hr_pos hl_prime.one_lt |
| 164 | obtain ⟨q, hq⟩ : (X ^ r - 1) * cyclotomic N R ∣ X ^ N - 1 := |
| 165 | X_pow_sub_one_mul_cyclotomic_dvd_X_pow_sub_one_of_dvd R |
| 166 | (Nat.mem_properDivisors.2 ⟨⟨l, by rw [hN_eq, mul_comm]⟩, hr_lt⟩) |
| 167 | obtain ⟨a, M, hl_ndvd_M, hr_eq⟩ := r.exists_eq_pow_mul_and_not_dvd hr_pos.ne' l hl_prime.ne_one |
| 168 | have hM_le : M ≤ N := by |
| 169 | calc M ≤ l ^ a * M := Nat.le_mul_of_pos_left M (pow_pos hl_prime.pos a) |
| 170 | _ = r := hr_eq.symm |
| 171 | _ ≤ N := hr_lt.le |
| 172 | have hM_primes : ∀ p ∈ N.primeFactors, p ∣ M ↔ p ≠ l := by |
| 173 | grind [Nat.Prime.dvd_mul, Nat.prime_eq_prime_of_dvd_pow, Nat.prime_dvd_prime_iff_eq] |
| 174 | -- Differentiate `X ^ N - 1 = (X ^ r - 1) * Φ_N(X) * q(X)` at `ζ` and multiply by `ζ`. |
| 175 | have h_root : (cyclotomic N R).eval ζ = 0 := hζ.isRoot_cyclotomic hN_pos |
| 176 | have h_deriv_N : |
| 177 | (N : R) = (ζ ^ r - 1) * (cyclotomic N R).derivative.eval ζ * (q.eval ζ * ζ) := by |
| 178 | have hz : ((X ^ r - 1) * cyclotomic N R).eval ζ = 0 := by simp [h_root] |
| 179 | simpa [derivative_mul, h_root, mul_assoc] using |
| 180 | natCast_eq_eval_derivative_mul hN_ne hζ.pow_eq_one hz hq |
| 181 | -- `N` divides `Φ_N'(ζ) * (ζ ^ r - 1) * M`, by expanding `Φ_M` at `ζ ^ l ^ a`. |
| 182 | obtain ⟨V, hV_eq⟩ := |
| 183 | natCast_dvd_eval_derivative_cyclotomic_mul hl_prime hl_ndvd_M hN_eq hr_eq h_root |
| 184 | have hV_dvd_M : V ∣ (M : R) := |
| 185 | ⟨q.eval ζ * ζ, mul_left_cancel₀ (Nat.cast_ne_zero.2 hN_ne) |
| 186 | (by linear_combination (q.eval ζ * ζ) * hV_eq + (M : R) * h_deriv_N)⟩ |
| 187 | exact ⟨r, M, hM_le, hN_eq, hM_primes, V, hV_dvd_M, hV_eq⟩ |
| 188 | |
| 189 | /-- Every prime factor of `q₁ = P.q₁ s` divides `n = (d + 1) / 4`, so `q₁ ∣ n ^ q₁`. -/ |
| 190 | private lemma q₁_dvd_pow_q₁ : P.q₁ s ∣ ((P.d + 1) / 4) ^ P.q₁ s := by |
| 191 | have hn : (P.d + 1) / 4 ≠ 0 := by grind [P.sixty_four_lt_d] |
| 192 | refine (Nat.dvd_pow_self_iff (NeZero.ne _) hn).2 fun p hp ↦ ?_ |
| 193 | obtain ⟨h_prime, h_dvd, -⟩ := Nat.mem_primeFactors.1 hp |
| 194 | exact h_prime.mem_primeFactors (P.dvd_d_add_one_div_four_of_dvd_q₁ h_prime h_dvd) hn |
| 195 | |
| 196 | /-- Since `n = (d + 1) / 4` is nilpotent modulo `q₁`, the quadratic polynomial `n y² + y + 1` has |
| 197 | a root `z < q₁` modulo `q₁`. -/ |
| 198 | private lemma exists_quad_congr_mod_q₁ : |
| 199 | ∃ z < P.q₁ s, ∃ e : ℕ, ((P.d + 1) / 4) * z ^ 2 + z + 1 = P.q₁ s * e := by |
| 200 | set N : ℕ := P.q₁ s |
| 201 | set n : ℕ := (P.d + 1) / 4 |
| 202 | have hn : IsNilpotent (n : ZMod N) := |
| 203 | ⟨N, by rw [← Nat.cast_pow, (ZMod.natCast_eq_zero_iff _ N).2 q₁_dvd_pow_q₁]⟩ |
| 204 | -- The map `y ↦ n * y ^ 2 + y` on `ZMod N` is injective because `1 + n * (a + b)` is a unit. |
| 205 | have h_inj : Function.Injective fun y : ZMod N ↦ (n : ZMod N) * y ^ 2 + y := by |
| 206 | intro a b hab |
| 207 | have h_unit : IsUnit ((n : ZMod N) * (a + b) + 1) := |
| 208 | ((Commute.all _ _).isNilpotent_mul_right hn).isUnit_add_one |
| 209 | have h_fac : ((n : ZMod N) * (a + b) + 1) * (a - b) = 0 := by linear_combination hab |
| 210 | exact sub_eq_zero.1 (h_unit.mul_left_cancel (by simpa using h_fac)) |
| 211 | obtain ⟨y, hy⟩ := Finite.surjective_of_injective h_inj (-1 : ZMod N) |
| 212 | have h_dvd : N ∣ n * y.val ^ 2 + y.val + 1 := by |
| 213 | rw [← ZMod.natCast_eq_zero_iff] |
| 214 | push_cast |
| 215 | rw [ZMod.natCast_zmod_val] |
| 216 | linear_combination hy |
| 217 | obtain ⟨e, he⟩ := h_dvd |
| 218 | exact ⟨y.val, y.val_lt, e, he⟩ |
| 219 | |
| 220 | /-- Inner sum identity for the cyclotomic-orbit tight frame: for `α, β', W : ℂ` with |
| 221 | `∑ i : Fin l, α ^ i = 0` and `∑ i : Fin l, β' ^ i = 0` (`0 < l`), summing |
| 222 | `(0 ^ k * α ^ i + W * (α ^ i - α ^ k)) * (0 ^ k * β' ^ i + conj W * (β' ^ i - β' ^ k))` |
| 223 | over `k, i : Fin l` yields `(1 + W + conj W + 2 * l * (W * conj W)) * ∑ i : Fin l, (α * β') ^ i`. -/ |
| 224 | private lemma sum_inner_frame {l : ℕ} (hl : 0 < l) {α β' W : ℂ} |
| 225 | (hα : ∑ i : Fin l, α ^ i.val = 0) (hβ' : ∑ i : Fin l, β' ^ i.val = 0) : |
| 226 | ∑ k : Fin l, ∑ i : Fin l, |
| 227 | ((0 : ℂ) ^ k.val * α ^ i.val + W * (α ^ i.val - α ^ k.val)) * |
| 228 | ((0 : ℂ) ^ k.val * β' ^ i.val + conj W * (β' ^ i.val - β' ^ k.val)) = |
| 229 | (1 + W + conj W + 2 * (l : ℂ) * (W * conj W)) * ∑ i : Fin l, (α * β') ^ i.val := by |
| 230 | have h_zeroPow (g : Fin l → ℂ) : ∑ k : Fin l, (0 : ℂ) ^ k.val * g k = g ⟨0, hl⟩ := by |
| 231 | rw [Finset.sum_eq_single ⟨0, hl⟩] |
| 232 | · simp |
| 233 | · intro k _ hk; simp [zero_pow (fun h ↦ hk (Fin.ext h))] |
| 234 | · simp |
| 235 | -- Expand each summand into a `0 ^ k` term and a `W * conj W` term. |
| 236 | have h_expand (k i : Fin l) : |
| 237 | ((0 : ℂ) ^ k.val * α ^ i.val + W * (α ^ i.val - α ^ k.val)) * |
| 238 | ((0 : ℂ) ^ k.val * β' ^ i.val + conj W * (β' ^ i.val - β' ^ k.val)) = |
| 239 | (0 : ℂ) ^ k.val * ((0 : ℂ) ^ k.val * (α * β') ^ i.val + |
| 240 | conj W * ((α * β') ^ i.val - α ^ i.val * β' ^ k.val) + |
| 241 | W * ((α * β') ^ i.val - α ^ k.val * β' ^ i.val)) + |
| 242 | W * conj W * ((α * β') ^ i.1 - α ^ i.1 * β' ^ k.1 - α ^ k.1 * β' ^ i.1 + (α * β') ^ k.1) := by |
| 243 | rw [mul_pow, mul_pow]; ring |
| 244 | simp_rw [h_expand, Finset.sum_add_distrib, ← Finset.mul_sum, h_zeroPow] |
| 245 | simp_rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum, ← Finset.sum_mul, |
| 246 | pow_zero, one_mul, mul_one, hα, hβ', mul_zero, zero_mul, sub_zero, |
| 247 | Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, ← Finset.mul_sum] |
| 248 | simp_rw [Finset.sum_sub_distrib, hα, hβ', sub_zero] |
| 249 | ring |
| 250 | |
| 251 | /-- `periodFactor * conj (Φ τ y)` has absolute value 1 at the embedding `ιₚ : ℂ →+* ℂ_[p]` (the |
| 252 | instance `PadicPlace p`) for all `τ` in the CM type. These numbers are the coefficients of the |
| 253 | linear form `z ↦ periodFactor * ∑ τ, conj (Φ τ y) * Φ τ z`. -/ |
| 254 | def HasUnitLinearForm (P : Parameters) (s p : ℕ) [Fact p.Prime] [PadicPlace p] (y : P.E s) : |
| 255 | Prop := |
| 256 | ∀ τ : InfinitePlace (P.E s), ‖(ιₚ (P.periodFactor s * conj (Φ τ y)) : ℂ_[p])‖ = 1 |
| 257 | |
| 258 | /-- There is a tight frame `v` in `𝔞₀` with multiplicities `1` of length `h ≤ (d q₁) ^ 6` prime to |
| 259 | `q₁`, such that for every prime `p` and embedding `ιₚ : ℂ →+* ℂ_[p]`, either `1` or some member |
| 260 | `v i` has `HasUnitLinearForm`. -/ |
| 261 | theorem exists_isTightFrame_coprime (P : Parameters) (s : ℕ) : |
| 262 | ∃ (h : ℕ) (I : Type) (_ : Fintype I) (v : I → P.E s), |
| 263 | IsTightFrame v 1 h ∧ |
| 264 | h ≤ (P.d * P.q₁ s) ^ 6 ∧ |
| 265 | h.Coprime (P.q₁ s) ∧ |
| 266 | ∀ (p : ℕ) [Fact p.Prime] [PadicPlace p], |
| 267 | P.HasUnitLinearForm s p 1 ∨ ∃ i : I, P.HasUnitLinearForm s p (v i) := by |
| 268 | classical |
| 269 | set N : ℕ := P.q₁ s |
| 270 | set n : ℕ := (P.d + 1) / 4 |
| 271 | have hN_ne : N ≠ 0 := NeZero.ne N |
| 272 | have hN_pos : 0 < N := NeZero.pos N |
| 273 | have hζ : IsPrimitiveRoot (P.zetaInt s) N := isPrimitiveRoot_zetaInt |
| 274 | have hβ_mul : P.betaKInE s * (1 - P.betaKInE s) = (n : 𝓞 (P.E s)) := P.betaKInE_mul_one_sub s |
| 275 | -- Factor `Φ_N'(ζ)` at each prime `ℓ ∣ N`, and solve `n z² + z + 1 = N e`. |
| 276 | choose r M hM_le hN_eq hM_primes V hV_dvd hV_eq using |
| 277 | fun ℓ : N.primeFactors ↦ exists_cyclotomic_different_factor hζ ℓ |
| 278 | obtain ⟨z, hz_lt, e, he_eq⟩ := exists_quad_congr_mod_q₁ (P := P) (s := s) |
| 279 | obtain ⟨f, hf_eq⟩ : N ∣ n ^ N := q₁_dvd_pow_q₁ |
| 280 | let t : 𝓞 (P.E s) := 1 - P.betaKInE s + (n : 𝓞 (P.E s)) * (z : 𝓞 (P.E s)) |
| 281 | let a (ℓ : N.primeFactors) : 𝓞 (P.E s) := P.zetaInt s ^ r ℓ |
| 282 | -- The frame vectors indexed by `(ℓ, j, k, i) ∈ Σ ℓ : N.primeFactors, Fin (r ℓ) × Fin ℓ × Fin ℓ`. |
| 283 | let I : Type := Σ ℓ : N.primeFactors, Fin (r ℓ) × Fin ℓ.val × Fin ℓ.val |
| 284 | let u : I → P.E s := fun ⟨ℓ, j, k, i⟩ ↦ |
| 285 | (P.zetaInt s : P.E s) ^ j.val * |
| 286 | ((0 : P.E s) ^ k.val * (a ℓ : P.E s) ^ i.val + |
| 287 | ((t : P.E s) * (M ℓ : P.E s) / (N : P.E s)) * |
| 288 | ((a ℓ : P.E s) ^ i.val - (a ℓ : P.E s) ^ k.val)) |
| 289 | let c : ℕ := ∑ ℓ : N.primeFactors, (N + M ℓ * (1 + 2 * n * (z + ℓ.val * (M ℓ * e)))) |
| 290 | -- Step 1: Every `u x` lies in the lattice `𝔞₀ = E ∩ α Ô`. |
| 291 | have hu_mem (x : I) : finiteImage id (u x) ∈ Ô (P.E s) := by |
| 292 | rcases x with ⟨ℓ, j, k, i⟩ |
| 293 | refine finiteImage_mem_iff.2 fun v ↦ ?_ |
| 294 | obtain ⟨g, hg⟩ : a ℓ - 1 ∣ a ℓ ^ i.val - a ℓ ^ k.val := by |
| 295 | simpa using dvd_sub (sub_one_dvd_pow_sub_one (a ℓ) i.1) (sub_one_dvd_pow_sub_one (a ℓ) k.1) |
| 296 | have h_int_of_dvd (y : 𝓞 (P.E s)) (hdvd : (N : 𝓞 (P.E s)) ∣ y * t * (M ℓ * (a ℓ - 1))) : |
| 297 | v.valuation (P.E s) ((y : P.E s) * u ⟨ℓ, j, k, i⟩) ≤ 1 := by |
| 298 | obtain ⟨q, hq⟩ := hdvd |
| 299 | have h_eq : (y : P.E s) * u ⟨ℓ, j, k, i⟩ = |
| 300 | ((P.zetaInt s ^ j.val * (y * (0 : 𝓞 (P.E s)) ^ k.val * a ℓ ^ i.val + q * g) : 𝓞 (P.E s)) : |
| 301 | P.E s) := by |
| 302 | have hN_E : (N : P.E s) ≠ 0 := Nat.cast_ne_zero.2 hN_ne |
| 303 | have hg_E : (a ℓ : P.E s) ^ i.val - (a ℓ : P.E s) ^ k.val = |
| 304 | ((a ℓ : P.E s) - 1) * (g : P.E s) := by |
| 305 | exact_mod_cast hg |
| 306 | have hq_E : (y : P.E s) * (t : P.E s) * ((M ℓ : P.E s) * ((a ℓ : P.E s) - 1)) = |
| 307 | (N : P.E s) * (q : P.E s) := by |
| 308 | exact_mod_cast hq |
| 309 | simp only [u] |
| 310 | rw [hg_E] |
| 311 | field_simp [hN_E] |
| 312 | push_cast |
| 313 | linear_combination (P.zetaInt s : P.E s) ^ j.val * (g : P.E s) * hq_E |
| 314 | rw [h_eq] |
| 315 | exact v.valuation_le_one _ |
| 316 | by_cases hv : P.betaKInE s ∈ v.asIdeal |
| 317 | · rw [ite_eq_left hv] |
| 318 | refine h_int_of_dvd (P.relDifferentGen s) ⟨t * V ℓ, ?_⟩ |
| 319 | have hV_mul : P.relDifferentGen s * (a ℓ - 1) * M ℓ = N * V ℓ := hV_eq ℓ |
| 320 | linear_combination t * hV_mul |
| 321 | · rw [ite_eq_right hv, one_mul] |
| 322 | have h_unit : v.valuation (P.E s) (P.betaKInE s : P.E s) = 1 := |
| 323 | v.valuation_eq_one_iff_notMem.2 hv |
| 324 | have h_beta_dvd : (N : 𝓞 (P.E s)) ∣ P.betaKInE s ^ N * t := by |
| 325 | obtain ⟨w, hw⟩ := |
| 326 | sub_dvd_pow_sub_pow (P.betaKInE s) (-(n : 𝓞 (P.E s)) * (z : 𝓞 (P.E s))) N |
| 327 | have h_prod : (P.betaKInE s - (-(n : 𝓞 (P.E s)) * (z : 𝓞 (P.E s)))) * t = |
| 328 | (n : 𝓞 (P.E s)) * ((N : 𝓞 (P.E s)) * (e : 𝓞 (P.E s))) := by |
| 329 | have he_O : (n : 𝓞 (P.E s)) * (z : 𝓞 (P.E s)) ^ 2 + (z : 𝓞 (P.E s)) + 1 = |
| 330 | (N : 𝓞 (P.E s)) * (e : 𝓞 (P.E s)) := by exact_mod_cast he_eq |
| 331 | linear_combination hβ_mul + (n : 𝓞 (P.E s)) * he_O |
| 332 | have hf_O : (n : 𝓞 (P.E s)) ^ N = (N : 𝓞 (P.E s)) * (f : 𝓞 (P.E s)) := by |
| 333 | exact_mod_cast hf_eq |
| 334 | refine ⟨(n : 𝓞 (P.E s)) * (e : 𝓞 (P.E s)) * w + |
| 335 | (f : 𝓞 (P.E s)) * (-(z : 𝓞 (P.E s))) ^ N * t, ?_⟩ |
| 336 | have h_pow_neg : (-(n : 𝓞 (P.E s)) * (z : 𝓞 (P.E s))) ^ N = |
| 337 | (n : 𝓞 (P.E s)) ^ N * (-(z : 𝓞 (P.E s))) ^ N := by |
| 338 | rw [show -(n : 𝓞 (P.E s)) * (z : 𝓞 (P.E s)) = |
| 339 | (n : 𝓞 (P.E s)) * (-(z : 𝓞 (P.E s))) by ring, mul_pow] |
| 340 | linear_combination t * hw + w * h_prod + (-(z : 𝓞 (P.E s))) ^ N * t * hf_O + |
| 341 | t * h_pow_neg |
| 342 | have h_le := h_int_of_dvd (P.betaKInE s ^ N) (dvd_mul_of_dvd_left h_beta_dvd _) |
| 343 | simpa [map_mul, h_unit] using h_le |
| 344 | -- Step 2: Compute the frame Gram matrix `∑ x, Φ σ (u x) * conj (Φ τ (u x)) = δ(σ, τ) * c`. |
| 345 | have h_frame_sum (σ τ : P.Φ s) : |
| 346 | ∑ x : I, Φ σ (u x) * conj (Φ τ (u x)) = if σ = τ then (c : ℂ) else 0 := by |
| 347 | have h_zeta_frame : |
| 348 | ∑ m : Fin N, Φ σ ((P.zetaInt s : P.E s) ^ m.val) * |
| 349 | conj (Φ τ ((P.zetaInt s : P.E s) ^ m.val)) = if σ = τ then (N : ℂ) else 0 := by |
| 350 | have h1 := (P.isTightFrame_zeta_pow s 1).sum_mul_conj σ τ |
| 351 | have hN_C : ((P.q₀ : ℂ) * (towerDeg s : ℂ)) = (N : ℂ) := by exact_mod_cast rfl |
| 352 | simpa [hN_C] using h1 |
| 353 | have h_phi_t (ρ : P.Φ s) : Φ ρ (t : P.E s) = 1 - quadGen P.d + (n : ℂ) * (z : ℂ) := by |
| 354 | simp [t, phi_betaKInE] |
| 355 | have hβ_sum : quadGen P.d + conj (quadGen P.d) = 1 := by |
| 356 | have := congrArg (fun x : 𝓞 (P.E s) ↦ Φ σ (x : P.E s)) (P.star_betaKInE s) |
| 357 | simp only [coe_star_ringOfIntegers, map_star_complex, Complex.star_def, map_sub, map_one, |
| 358 | phi_betaKInE] at this |
| 359 | linear_combination this |
| 360 | have h_t_add : (1 - quadGen P.d + (n : ℂ) * (z : ℂ)) + |
| 361 | conj (1 - quadGen P.d + (n : ℂ) * (z : ℂ)) = 1 + 2 * (n : ℂ) * (z : ℂ) := by |
| 362 | simp only [map_add, map_sub, map_one, map_mul, map_natCast] |
| 363 | linear_combination -hβ_sum |
| 364 | have h_t_mul : (1 - quadGen P.d + (n : ℂ) * (z : ℂ)) * |
| 365 | conj (1 - quadGen P.d + (n : ℂ) * (z : ℂ)) = (n : ℂ) * ((N : ℂ) * (e : ℂ)) := by |
| 366 | have hβ_prod : quadGen P.d * (1 - quadGen P.d) = (n : ℂ) := by |
| 367 | have := congrArg (fun x : 𝓞 (P.E s) ↦ Φ σ (x : P.E s)) hβ_mul |
| 368 | simpa [phi_betaKInE] using this |
| 369 | have he_C : (n : ℂ) * (z : ℂ) ^ 2 + (z : ℂ) + 1 = (N : ℂ) * (e : ℂ) := by |
| 370 | exact_mod_cast he_eq |
| 371 | simp only [map_add, map_sub, map_one, map_mul, map_natCast] |
| 372 | linear_combination (1 - quadGen P.d + (n : ℂ) * (z : ℂ)) * (-hβ_sum) + hβ_prod + |
| 373 | (n : ℂ) * he_C |
| 374 | -- Compute the contribution of each prime factor `ℓ ∣ N`. |
| 375 | have h_block (ℓ : N.primeFactors) : |
| 376 | ∑ p : Fin (r ℓ) × Fin ℓ.val × Fin ℓ.val, |
| 377 | Φ σ (u ⟨ℓ, p⟩) * conj (Φ τ (u ⟨ℓ, p⟩)) = |
| 378 | if σ = τ then ((N + M ℓ * (1 + 2 * n * (z + ℓ.val * (M ℓ * e))) : ℕ) : ℂ) else 0 := by |
| 379 | have hℓ_prime : ℓ.val.Prime := Nat.prime_of_mem_primeFactors ℓ.property |
| 380 | have hN_comm : N = r ℓ * ℓ.val := (hN_eq ℓ).trans (mul_comm _ _) |
| 381 | have h_prim_a : IsPrimitiveRoot (a ℓ) ℓ.val := hζ.pow hN_pos hN_comm |
| 382 | have h_sum_a : ∑ i : Fin ℓ.val, (a ℓ : P.E s) ^ i.val = 0 := by |
| 383 | have h0 : ∑ i ∈ range ℓ.val, (a ℓ) ^ i = 0 := h_prim_a.geom_sum_eq_zero hℓ_prime.one_lt |
| 384 | rw [← Fin.sum_univ_eq_sum_range] at h0 |
| 385 | exact_mod_cast h0 |
| 386 | let α : ℂ := Φ σ (a ℓ : P.E s) |
| 387 | let β' : ℂ := conj (Φ τ (a ℓ : P.E s)) |
| 388 | have h_sum_ασ : ∑ i : Fin ℓ.val, α ^ i.val = 0 := by |
| 389 | simpa [α, map_sum, map_pow] using congrArg (Φ σ) h_sum_a |
| 390 | have h_sum_ατ : ∑ i : Fin ℓ.val, β' ^ i.val = 0 := by |
| 391 | simpa [β', map_sum, map_pow] using congrArg (conj ∘ Φ τ) h_sum_a |
| 392 | let γ : ℂ := Φ σ (P.zetaInt s : P.E s) * conj (Φ τ (P.zetaInt s : P.E s)) |
| 393 | have h_prod_sum : |
| 394 | (∑ j : Fin (r ℓ), γ ^ j.val) * (∑ i : Fin ℓ.val, (γ ^ r ℓ) ^ i.val) = |
| 395 | if σ = τ then (N : ℂ) else 0 := by |
| 396 | calc |
| 397 | _ = ∑ m : Fin N, γ ^ m.val := by |
| 398 | simp_rw [Fin.sum_univ_eq_sum_range] |
| 399 | rw [← TauCeti.geom_sum_range_mul, ← hN_comm] |
| 400 | _ = _ := by simpa [γ, mul_pow, map_pow] using h_zeta_frame |
| 401 | set W : ℂ := (1 - quadGen P.d + (n : ℂ) * (z : ℂ)) * (M ℓ : ℂ) / (N : ℂ) |
| 402 | have h_αβ : α * β' = γ ^ r ℓ := by simp [α, β', γ, a, mul_pow, map_pow] |
| 403 | have h_inner : |
| 404 | ∑ k : Fin ℓ.val, ∑ i : Fin ℓ.val, |
| 405 | ((0 : ℂ) ^ k.val * α ^ i.val + W * (α ^ i.val - α ^ k.val)) * |
| 406 | ((0 : ℂ) ^ k.val * β' ^ i.val + conj W * (β' ^ i.val - β' ^ k.val)) = |
| 407 | (1 + W + conj W + 2 * (ℓ.val : ℂ) * (W * conj W)) * |
| 408 | ∑ i : Fin ℓ.val, (γ ^ r ℓ) ^ i.val := by |
| 409 | simpa [h_αβ] using sum_inner_frame hℓ_prime.pos h_sum_ασ h_sum_ατ |
| 410 | have h_factor_val : |
| 411 | (1 + W + conj W + 2 * (ℓ.val : ℂ) * (W * conj W)) * (N : ℂ) = |
| 412 | ((N + M ℓ * (1 + 2 * n * (z + ℓ.val * (M ℓ * e))) : ℕ) : ℂ) := by |
| 413 | have hN_C : (N : ℂ) ≠ 0 := Nat.cast_ne_zero.2 hN_ne |
| 414 | have hW_conj : conj W = |
| 415 | conj (1 - quadGen P.d + (n : ℂ) * (z : ℂ)) * (M ℓ : ℂ) / (N : ℂ) := by simp [W] |
| 416 | rw [hW_conj] |
| 417 | simp only [W] |
| 418 | field_simp [hN_C] |
| 419 | push_cast |
| 420 | linear_combination (M ℓ : ℂ) * (N : ℂ) * h_t_add + |
| 421 | 2 * (ℓ.val : ℂ) * (M ℓ : ℂ) ^ 2 * h_t_mul |
| 422 | have h_u_apply (j : Fin (r ℓ)) (k i : Fin ℓ.val) : |
| 423 | Φ σ (u ⟨ℓ, j, k, i⟩) * conj (Φ τ (u ⟨ℓ, j, k, i⟩)) = |
| 424 | γ ^ j.val * |
| 425 | (((0 : ℂ) ^ k.val * α ^ i.val + W * (α ^ i.val - α ^ k.val)) * |
| 426 | ((0 : ℂ) ^ k.val * β' ^ i.val + conj W * (β' ^ i.val - β' ^ k.val))) := by |
| 427 | simp only [u, map_mul, map_add, map_sub, map_div₀, map_pow, map_zero, map_natCast, |
| 428 | h_phi_t, W, α, β', γ, mul_pow] |
| 429 | ring |
| 430 | calc ∑ p : Fin (r ℓ) × Fin ℓ.val × Fin ℓ.val, Φ σ (u ⟨ℓ, p⟩) * conj (Φ τ (u ⟨ℓ, p⟩)) |
| 431 | = ∑ j : Fin (r ℓ), ∑ k : Fin ℓ.val, ∑ i : Fin ℓ.val, |
| 432 | Φ σ (u ⟨ℓ, j, k, i⟩) * conj (Φ τ (u ⟨ℓ, j, k, i⟩)) := by |
| 433 | simp [Fintype.sum_prod_type] |
| 434 | _ = (∑ j : Fin (r ℓ), γ ^ j.val) * |
| 435 | ((1 + W + conj W + 2 * (ℓ.val : ℂ) * (W * conj W)) * |
| 436 | ∑ i : Fin ℓ.val, (γ ^ r ℓ) ^ i.val) := by |
| 437 | simp_rw [h_u_apply, ← Finset.mul_sum, h_inner, ← Finset.sum_mul] |
| 438 | _ = (1 + W + conj W + 2 * (ℓ.val : ℂ) * (W * conj W)) * |
| 439 | ((∑ j : Fin (r ℓ), γ ^ j.val) * (∑ i : Fin ℓ.val, (γ ^ r ℓ) ^ i.val)) := by ring |
| 440 | _ = if σ = τ then ((N + M ℓ * (1 + 2 * n * (z + ℓ.val * (M ℓ * e))) : ℕ) : ℂ) else 0 := by |
| 441 | rw [h_prod_sum] |
| 442 | split_ifs |
| 443 | · exact h_factor_val |
| 444 | · ring |
| 445 | rw [Fintype.sum_sigma] |
| 446 | simp_rw [h_block] |
| 447 | split_ifs <;> simp [c] |
| 448 | -- Step 3: `c` is coprime to `N`. |
| 449 | have hc_coprime : c.Coprime N := by |
| 450 | refine Nat.coprime_of_dvd fun p hp hpc hpN ↦ ?_ |
| 451 | have hp_mem : p ∈ N.primeFactors := Nat.mem_primeFactors.2 ⟨hp, hpN, hN_ne⟩ |
| 452 | have hp_n : p ∣ n := P.dvd_d_add_one_div_four_of_dvd_q₁ hp hpN |
| 453 | have h_zero : (c : ZMod p) = 0 := (ZMod.natCast_eq_zero_iff c p).2 hpc |
| 454 | have h_eval : (c : ZMod p) = (M ⟨p, hp_mem⟩ : ZMod p) := by |
| 455 | simp only [c, Nat.cast_sum] |
| 456 | rw [Finset.sum_eq_single ⟨p, hp_mem⟩] |
| 457 | · have hN0 : (N : ZMod p) = 0 := (ZMod.natCast_eq_zero_iff N p).2 hpN |
| 458 | have hn0 : (n : ZMod p) = 0 := (ZMod.natCast_eq_zero_iff n p).2 hp_n |
| 459 | simp [hN0, hn0] |
| 460 | · intro ℓ _ hℓ_ne |
| 461 | have hN0 : (N : ZMod p) = 0 := (ZMod.natCast_eq_zero_iff N p).2 hpN |
| 462 | have hM0 : (M ℓ : ZMod p) = 0 := |
| 463 | (ZMod.natCast_eq_zero_iff (M ℓ) p).2 |
| 464 | ((hM_primes ℓ p hp_mem).2 fun h ↦ hℓ_ne (Subtype.ext h.symm)) |
| 465 | simp [hN0, hM0] |
| 466 | · simp |
| 467 | have hp_M : p ∣ M ⟨p, hp_mem⟩ := (ZMod.natCast_eq_zero_iff _ p).1 (h_eval.symm.trans h_zero) |
| 468 | exact (hM_primes ⟨p, hp_mem⟩ p hp_mem).1 hp_M rfl |
| 469 | -- Step 4: Elementary polynomial bound `c ≤ (d * N) ^ 6`. |
| 470 | have hc_le : c ≤ (P.d * N) ^ 6 := by |
| 471 | have hd_ge : 7 ≤ P.d := by |
| 472 | have hmod : P.d % 8 = 7 := PrimeSevenModEight.mod_eight |
| 473 | omega |
| 474 | have hn_le : n ≤ P.d := by omega |
| 475 | have h_card : Fintype.card N.primeFactors ≤ N := by |
| 476 | rw [Fintype.card_coe] |
| 477 | calc N.primeFactors.card ≤ (Finset.Icc 1 N).card := |
| 478 | Finset.card_le_card fun p hp ↦ |
| 479 | Finset.mem_Icc.2 ⟨(Nat.prime_of_mem_primeFactors hp).pos, |
| 480 | Nat.le_of_mem_primeFactors hp⟩ |
| 481 | _ = N := by simp |
| 482 | have h_e_le : e ≤ n * N + 2 := by |
| 483 | have h1 : N * e ≤ n * N ^ 2 + N + 1 := by |
| 484 | have he' : n * z ^ 2 + z + 1 = N * e := he_eq |
| 485 | have hz_le : z ≤ N := hz_lt.le |
| 486 | have hmul : n * z ^ 2 ≤ n * N ^ 2 := Nat.mul_le_mul_left n (Nat.pow_le_pow_left hz_le 2) |
| 487 | omega |
| 488 | have h2 : N * e ≤ N * (n * N + 2) := by |
| 489 | calc N * e ≤ n * N ^ 2 + N + 1 := h1 |
| 490 | _ ≤ n * N ^ 2 + N + N := by omega |
| 491 | _ = N * (n * N + 2) := by ring |
| 492 | exact Nat.le_of_mul_le_mul_left h2 hN_pos |
| 493 | have h_term_le (ℓ : N.primeFactors) : |
| 494 | N + M ℓ * (1 + 2 * n * (z + ℓ.val * (M ℓ * e))) ≤ P.d ^ 6 * N ^ 5 := by |
| 495 | have hℓ_le : ℓ.val ≤ N := Nat.le_of_mem_primeFactors ℓ.property |
| 496 | have hM : M ℓ ≤ N := hM_le ℓ |
| 497 | have hz_le : z ≤ N := hz_lt.le |
| 498 | have h_inner1 : M ℓ * e ≤ (P.d + 2) * N ^ 2 := by |
| 499 | calc M ℓ * e ≤ N * (n * N + 2) := Nat.mul_le_mul hM h_e_le |
| 500 | _ ≤ N * (P.d * N + 2 * N) := by gcongr; omega |
| 501 | _ = (P.d + 2) * N ^ 2 := by ring |
| 502 | have h_inner2 : z + ℓ.val * (M ℓ * e) ≤ (P.d + 3) * N ^ 4 := by |
| 503 | calc z + ℓ.val * (M ℓ * e) |
| 504 | ≤ N + N * ((P.d + 2) * N ^ 2) := |
| 505 | Nat.add_le_add hz_le (Nat.mul_le_mul hℓ_le h_inner1) |
| 506 | _ ≤ N ^ 4 + (P.d + 2) * N ^ 4 := by |
| 507 | have hN4 : N ≤ N ^ 4 := Nat.le_self_pow (by norm_num) N |
| 508 | have hN34 : N ^ 3 ≤ N ^ 4 := Nat.pow_le_pow_right hN_pos (by norm_num) |
| 509 | have h_mul : N * ((P.d + 2) * N ^ 2) = (P.d + 2) * N ^ 3 := by ring |
| 510 | rw [h_mul] |
| 511 | exact Nat.add_le_add hN4 (Nat.mul_le_mul_left _ hN34) |
| 512 | _ = (P.d + 3) * N ^ 4 := by ring |
| 513 | have h_inner3 : 1 + 2 * n * (z + ℓ.val * (M ℓ * e)) ≤ (2 * P.d * (P.d + 3) + 1) * N ^ 4 := by |
| 514 | calc 1 + 2 * n * (z + ℓ.val * (M ℓ * e)) |
| 515 | ≤ N ^ 4 + 2 * P.d * ((P.d + 3) * N ^ 4) := |
| 516 | Nat.add_le_add (one_le_pow₀ hN_pos) |
| 517 | (Nat.mul_le_mul (Nat.mul_le_mul_left 2 hn_le) h_inner2) |
| 518 | _ = (2 * P.d * (P.d + 3) + 1) * N ^ 4 := by ring |
| 519 | have h_coeff : 1 + (2 * P.d * (P.d + 3) + 1) ≤ P.d ^ 6 := by |
| 520 | have hd_pos : 0 < P.d := lt_of_lt_of_le (by norm_num) hd_ge |
| 521 | have h7 : 7 * P.d ≤ P.d * P.d := Nat.mul_le_mul_right _ hd_ge |
| 522 | have h3 : P.d * P.d * 3 ≤ P.d ^ 6 := |
| 523 | calc P.d * P.d * 3 ≤ P.d * P.d * P.d := |
| 524 | Nat.mul_le_mul_left _ (le_trans (by norm_num) hd_ge) |
| 525 | _ = P.d ^ 3 := (pow_three' P.d).symm |
| 526 | _ ≤ P.d ^ 6 := Nat.pow_le_pow_right hd_pos (by norm_num) |
| 527 | have h_eq : 1 + (2 * P.d * (P.d + 3) + 1) = 2 * (P.d * P.d) + 6 * P.d + 2 := by ring |
| 528 | omega |
| 529 | calc N + M ℓ * (1 + 2 * n * (z + ℓ.val * (M ℓ * e))) |
| 530 | ≤ N ^ 5 + N * ((2 * P.d * (P.d + 3) + 1) * N ^ 4) := |
| 531 | Nat.add_le_add (Nat.le_self_pow (by norm_num) N) (Nat.mul_le_mul hM h_inner3) |
| 532 | _ = (1 + (2 * P.d * (P.d + 3) + 1)) * N ^ 5 := by ring |
| 533 | _ ≤ P.d ^ 6 * N ^ 5 := Nat.mul_le_mul_right _ h_coeff |
| 534 | calc c ≤ ∑ _ℓ : N.primeFactors, P.d ^ 6 * N ^ 5 := Finset.sum_le_sum fun ℓ _ ↦ h_term_le ℓ |
| 535 | _ = Fintype.card N.primeFactors * (P.d ^ 6 * N ^ 5) := by simp |
| 536 | _ ≤ N * (P.d ^ 6 * N ^ 5) := Nat.mul_le_mul_right _ h_card |
| 537 | _ = (P.d * N) ^ 6 := by ring |
| 538 | -- Step 5: Unit linear form for every prime `p` and embedding `ιₚ : ℂ →+* ℂ_[p]`. |
| 539 | have h_unit (p : ℕ) [Fact p.Prime] [PadicPlace p] : |
| 540 | P.HasUnitLinearForm s p 1 ∨ ∃ x : I, P.HasUnitLinearForm s p (u x) := by |
| 541 | by_cases h1 : P.HasUnitLinearForm s p 1 |
| 542 | · exact .inl h1 |
| 543 | right |
| 544 | have hp_dvd : p ∣ N := by |
| 545 | by_contra hp_ndvd |
| 546 | exact h1 fun τ ↦ by simp [P.norm_iota_periodFactor_eq_one s hp_ndvd] |
| 547 | have hp_prime : p.Prime := Fact.out |
| 548 | let ℓ : N.primeFactors := ⟨p, Nat.mem_primeFactors.2 ⟨hp_prime, hp_dvd, hN_ne⟩⟩ |
| 549 | have hr_pos : 0 < r ℓ := Nat.pos_of_ne_zero fun hr0 ↦ hN_ne (by simp [hN_eq ℓ, hr0]) |
| 550 | have h_emb (τ : P.Φ s) (y : P.E s) : weightEmbedding ιₚ τ y = ιₚ (conj (Φ τ y)) := |
| 551 | congrArg ιₚ (map_star_complex _ y) |
| 552 | have hβ_mem (τ : P.Φ s) : P.betaKInE s ∈ (placeOfEmb (weightEmbedding ιₚ τ)).asIdeal := by |
| 553 | have h_const : ∀ τ₁ τ₂ : P.Φ s, |
| 554 | P.betaKInE s ∈ (placeOfEmb (weightEmbedding ιₚ τ₁)).asIdeal ↔ |
| 555 | P.betaKInE s ∈ (placeOfEmb (weightEmbedding ιₚ τ₂)).asIdeal := fun τ₁ τ₂ ↦ by |
| 556 | simp [mem_placeOfEmb, h_emb, phi_betaKInE] |
| 557 | by_contra h_not |
| 558 | refine h1 fun τ' ↦ ?_ |
| 559 | have h_not' : P.betaKInE s ∉ (placeOfEmb (weightEmbedding ιₚ τ')).asIdeal := |
| 560 | mt (h_const τ' τ).1 h_not |
| 561 | simp [norm_iota_periodFactor τ', adeleExtension_alpha, h_not'] |
| 562 | refine ⟨⟨ℓ, ⟨0, hr_pos⟩, ⟨1, hp_prime.one_lt⟩, ⟨0, hp_prime.pos⟩⟩, fun τ ↦ ?_⟩ |
| 563 | let φ : P.E s →+* ℂ_[p] := weightEmbedding ιₚ τ |
| 564 | have h_factor : ‖ιₚ (P.periodFactor s)‖ = ‖φ (P.relDifferentGen s)‖ := by |
| 565 | rw [norm_iota_periodFactor τ, adeleExtension_alpha, ite_eq_left (hβ_mem τ), norm_inv, inv_inv] |
| 566 | have h_u_eq : (P.relDifferentGen s : P.E s) * |
| 567 | u ⟨ℓ, ⟨0, hr_pos⟩, ⟨1, hp_prime.one_lt⟩, ⟨0, hp_prime.pos⟩⟩ = |
| 568 | ((-t * V ℓ : 𝓞 (P.E s)) : P.E s) := by |
| 569 | have hN_E : (N : P.E s) ≠ 0 := Nat.cast_ne_zero.2 hN_ne |
| 570 | have hV_E : (P.relDifferentGen s : P.E s) * ((a ℓ : P.E s) - 1) * (M ℓ : P.E s) = |
| 571 | (N : P.E s) * (V ℓ : P.E s) := by exact_mod_cast hV_eq ℓ |
| 572 | simp only [u, pow_zero, pow_one, one_mul, zero_mul, zero_add] |
| 573 | field_simp [hN_E] |
| 574 | push_cast |
| 575 | linear_combination -(t : P.E s) * hV_E |
| 576 | rw [map_mul, norm_mul, ← h_emb, h_factor, ← norm_mul, ← map_mul, h_u_eq] |
| 577 | refine (norm_ringOfIntegers_le φ (-t * V ℓ)).eq_of_not_lt fun h_lt ↦ ?_ |
| 578 | have h_mem : -t * V ℓ ∈ (placeOfEmb φ).asIdeal := (mem_placeOfEmb φ _).2 h_lt |
| 579 | have h_t_notMem : t ∉ (placeOfEmb φ).asIdeal := by |
| 580 | intro ht_mem |
| 581 | have h1_mem : (1 : 𝓞 (P.E s)) ∈ (placeOfEmb φ).asIdeal := by |
| 582 | have h_n_mem : (n : 𝓞 (P.E s)) ∈ (placeOfEmb φ).asIdeal := by |
| 583 | rw [← hβ_mul] |
| 584 | exact Ideal.mul_mem_right _ _ (hβ_mem τ) |
| 585 | have h_eq : (1 : 𝓞 (P.E s)) = t + P.betaKInE s - (n : 𝓞 (P.E s)) * (z : 𝓞 (P.E s)) := by |
| 586 | dsimp only [t]; ring |
| 587 | rw [h_eq] |
| 588 | exact sub_mem (add_mem ht_mem (hβ_mem τ)) (Ideal.mul_mem_right _ _ h_n_mem) |
| 589 | exact (placeOfEmb φ).isPrime.one_notMem h1_mem |
| 590 | have hV_mem : V ℓ ∈ (placeOfEmb φ).asIdeal := by |
| 591 | rcases (placeOfEmb φ).isPrime.mem_or_mem h_mem with ht | hV |
| 592 | · exact absurd (neg_mem_iff.1 ht) h_t_notMem |
| 593 | · exact hV |
| 594 | have hM_mem : (M ℓ : 𝓞 (P.E s)) ∈ (placeOfEmb φ).asIdeal := |
| 595 | Ideal.mem_of_dvd _ (hV_dvd ℓ) hV_mem |
| 596 | have hp_M : p ∣ M ℓ := |
| 597 | (FinPlace.natCast_mem_iff_dvd (placeOfEmb φ) (natCast_mem_placeOfEmb φ)).1 hM_mem |
| 598 | exact (hM_primes ℓ p ℓ.property).1 hp_M rfl |
| 599 | refine ⟨c, I, inferInstance, u, ⟨hu_mem, ?_⟩, hc_le, hc_coprime, h_unit⟩ |
| 600 | simpa using h_frame_sum |
| 601 | |
| 602 | /-- Let `v` be a tight frame with multiplicities 1 of a length `h` prime to `q₁`. For every |
| 603 | `m ≥ q₁ h + R (q₁ + h)`, the powers `ζ ^ i`, `i < q₁`, and the members of `v` form a tight frame of |
| 604 | length `m` with suitable multiplicities, all at least `R`. -/ |
| 605 | lemma exists_isTightFrame_of_coprime {h : ℕ} {I : Type} [Fintype I] {v : I → P.E s} |
| 606 | (hv : IsTightFrame v 1 h) (h_coprime : h.Coprime (P.q₁ s)) {m R : ℕ} |
| 607 | (h_large : P.q₁ s * h + R * (P.q₁ s + h) ≤ m) : |
| 608 | ∃ c : Fin (P.q₁ s) ⊕ I → ℕ, |
| 609 | IsTightFrame (Sum.elim (fun i : Fin (P.q₁ s) ↦ P.ζ s ^ i.val) v) c m ∧ |
| 610 | ∀ j : Fin (P.q₁ s) ⊕ I, R ≤ c j := by |
| 611 | -- Every integer from `q₁ h` on is a sum of multiples of the coprime numbers `q₁` and `h`. |
| 612 | obtain ⟨a, b, hab⟩ : ∃ a b : ℕ, a * P.q₁ s + b * h = m - R * (P.q₁ s + h) := |
| 613 | Nat.exists_add_mul_eq_of_gcd_dvd_of_mul_pred_le (P.q₁ s) h _ |
| 614 | (by simp [h_coprime.symm.gcd_eq_one]) |
| 615 | ((Nat.mul_le_mul (Nat.pred_le _) (Nat.pred_le _)).trans (Nat.le_sub_of_add_le h_large)) |
| 616 | have h_sum : (a + R) * P.q₁ s + (b + R) * h = m := by lia |
| 617 | -- Take the powers of `ζ` `a + R` times and the frame `v` `b + R` times. |
| 618 | have h_pow : IsTightFrame (fun i : Fin (P.q₁ s) ↦ P.ζ s ^ i.val) (fun _ ↦ a + R) |
| 619 | ((a + R) * P.q₁ s) := by |
| 620 | simpa using (isTightFrame_pow isPrimitiveRoot_zeta).mul_left (a + R) |
| 621 | have hv_mul : IsTightFrame v (fun _ ↦ b + R) ((b + R) * h) := by simpa using hv.mul_left (b + R) |
| 622 | exact ⟨_, by simpa only [h_sum] using h_pow.sumElim hv_mul, by simp⟩ |
| 623 | |
| 624 | end Parameters |
| 625 | |
| 626 | namespace Data |
| 627 | |
| 628 | open Real |
| 629 | |
| 630 | variable {P : Parameters} (D : Data P) |
| 631 | |
| 632 | /-- Let `D` be data for the parameters `P` (a `Data P`), with field `E = D.E = P.E s` for the |
| 633 | exponent `s = D.towerExp`, weight `b = D.b`, and `f = D.f` the number of infinite places of `E`. The |
| 634 | principal level `M = D.M` is the product of the two distinct primes `D.levelPrime 0` and |
| 635 | `D.levelPrime 1` of the data, which lie in `[b ^ 10, b ^ 11]`. There is a tight frame `v` of length |
| 636 | `M` with multiplicities `c i ≥ 6 f b`. Moreover, for every prime `p` and embedding |
| 637 | `ιₚ : ℂ →+* ℂ_[p]`, some `y = v i` makes `periodFactor * conj (τ(y))` a unit at `ιₚ` for all `τ` in |
| 638 | the CM type. -/ |
| 639 | theorem exists_isTightFrame : |
| 640 | ∃ (I : Type) (_ : Fintype I) (v : I → D.E) (c : I → ℕ), |
| 641 | IsTightFrame v c D.M ∧ |
| 642 | (∀ i : I, 6 * D.f * D.b ≤ c i) ∧ |
| 643 | ∀ (p : ℕ) [Fact p.Prime] [PadicPlace p], ∃ i : I, P.HasUnitLinearForm D.towerExp p (v i) := by |
| 644 | obtain ⟨h, I, _, v, hv, h_le, h_coprime, h_unit⟩ := P.exists_isTightFrame_coprime D.towerExp |
| 645 | -- Since `h ≤ (d q₁) ^ 6`, the threshold `q₁ h + ⌈6 f b⌉ (q₁ + h)` is at most `D.M`. |
| 646 | have h_large : D.q₁ * h + ⌈6 * D.f * D.b⌉₊ * (D.q₁ + h) ≤ D.M := by |
| 647 | have h_bound : (h : ℝ) ≤ D.b := by |
| 648 | calc (h : ℝ) ≤ ((P.d * D.q₁) ^ 6 : ℕ) := Nat.cast_le.2 h_le |
| 649 | _ ≤ D.b := D.le_of_hasLogBound |
| 650 | have h_log : D.HasLogUpper h D.logB := ⟨by rwa [ite_eq_left rfl, Nat.abs_cast]⟩ |
| 651 | exact D.nat_le_of_hasLogBound |
| 652 | let u : Fin D.q₁ ⊕ I → D.E := Sum.elim (fun i : Fin D.q₁ ↦ P.ζ D.towerExp ^ i.val) v |
| 653 | obtain ⟨c, hu, hc⟩ : ∃ c : Fin D.q₁ ⊕ I → ℕ, |
| 654 | IsTightFrame u c D.M ∧ ∀ j : Fin D.q₁ ⊕ I, ⌈6 * D.f * D.b⌉₊ ≤ c j := |
| 655 | Parameters.exists_isTightFrame_of_coprime hv h_coprime h_large |
| 656 | refine ⟨Fin D.q₁ ⊕ I, inferInstance, u, c, hu, fun j ↦ Nat.ceil_le.1 (hc j), fun p _ _ ↦ ?_⟩ |
| 657 | rcases h_unit p with h1 | ⟨i, hi⟩ |
| 658 | · exact ⟨.inl ⟨0, NeZero.pos _⟩, by simpa [u] using h1⟩ |
| 659 | · exact ⟨.inr i, hi⟩ |
| 660 | |
| 661 | end Data |
| 662 | |
| 663 | end New |