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.Order.Star.Rat |
| 4 | import Mathlib.Algebra.Order.Star.Real |
| 5 | import Mathlib.Data.NNRat.BigOperators |
| 6 | import Mathlib.RingTheory.PiTensorProduct |
| 7 | public import Lib.General.NumberTheory.GaussValuation |
| 8 | import Lib.General.NumberTheory.PadicLimitsValuation |
| 9 | |
| 10 | /-! |
| 11 | # Roots of unity `ζ` with polynomials hardly more divisible at `ζ - 1` than at given points |
| 12 | |
| 13 | For `ρ > 0`, `ε > 0`, finitely many integral polynomials `P_i` in at most `s₀` variables and points |
| 14 | `x_i` whose coordinates have valuation at least `ρ`, with a bound on `∑ v(P_i(x_i))`, we find roots |
| 15 | of unity `ζ_j` of `ℓ`-power order with `v(ζ_j - 1) ≤ ρ` such that `v(P_i((ζ_j - 1)_j))` exceeds |
| 16 | `v(P_i(x_i))` by at most `ε`. The orders of the `ζ_j` are bounded before the polynomials are given. |
| 17 | |
| 18 | * `New.Selmer.exists_rootOfUnity_eval_le_gaussVal_add`: the step in one variable, by counting roots. |
| 19 | * `New.Selmer.exists_rootsOfUnity_ellVal_eval_le_add`: several variables, by moving one coordinate |
| 20 | of all points at a time. |
| 21 | |
| 22 | Notions from other files: |
| 23 | * `New.ThePrime ℓ`: the class saying that `ℓ` is prime and is the prime in scope. |
| 24 | * `New.ellVal`: the valuation `v(x) = max (-log_ℓ |x|) 0` on `ℚ̄_ℓ`, with `v ℓ = 1` and `v 0 = ∞`; |
| 25 | `New.intQpBar ℓ` is the ring `ℤ̄_ℓ` of integral elements. |
| 26 | * `New.Selmer.gaussVal`: the Gauss valuation `v_ρ(g) = min_i (v(y_i) + ρ i)` of `g = ∑ y_i Y ^ i`. |
| 27 | |
| 28 | ## Relation to the literature |
| 29 | |
| 30 | Finitely many integral polynomials of any degree that are little divisible at given points of |
| 31 | positive valuation remain so at a single tuple of `ζ - 1`, with `ζ` roots of unity of `ℓ`-power |
| 32 | order. A degree-free bound at some `ℓ`-power root of unity for one element is known in the |
| 33 | literature. Related work: Kriz–Nordentoft, Horizontal p-adic L-functions, 2023; Serban, An |
| 34 | infinitesimal p-adic multiplicative Manin–Mumford conjecture, 2018; Kurihara, The structure of |
| 35 | Selmer groups of elliptic curves and modular symbols, 2014. |
| 36 | -/ |
| 37 | |
| 38 | @[expose] public section |
| 39 | |
| 40 | noncomputable section |
| 41 | |
| 42 | namespace New.Selmer |
| 43 | |
| 44 | open Finset Polynomial Filter |
| 45 | |
| 46 | open scoped NNReal ENNReal NNRat |
| 47 | |
| 48 | variable {ℓ : ℕ} [ThePrime ℓ] |
| 49 | |
| 50 | /-! ### The radii `ρ_h` and the harmonic sum -/ |
| 51 | |
| 52 | variable (ℓ) in |
| 53 | /-- The number `ρ_h = 1 / φ(ℓ ^ h)`, where `φ` is Euler's totient. For `h ≥ 1` it is the valuation |
| 54 | `v(ζ - 1)`, normalised by `v ℓ = 1`, for `ζ` of order `ℓ ^ h`. -/ |
| 55 | def rootRadius (h : ℕ) : ℚ≥0 := (Nat.totient (ℓ ^ h) : ℚ≥0)⁻¹ |
| 56 | |
| 57 | lemma totient_pow_pos (h : ℕ) : 0 < Nat.totient (ℓ ^ h) := |
| 58 | Nat.totient_pos.2 (pow_pos (Fact.out : ℓ.Prime).pos h) |
| 59 | |
| 60 | lemma coe_rootRadius (h : ℕ) : |
| 61 | ((rootRadius ℓ h : ℝ≥0) : ℝ≥0∞) = (Nat.totient (ℓ ^ h) : ℝ≥0∞)⁻¹ := by |
| 62 | rw [rootRadius, NNRat.cast_inv, NNRat.cast_natCast, |
| 63 | ENNReal.coe_inv (Nat.cast_ne_zero.2 (totient_pow_pos h).ne'), ENNReal.coe_natCast] |
| 64 | |
| 65 | /-- For `h ≥ 1` and a primitive `ℓ ^ h`-th root of unity `ζ` in `ℤ̄_ℓ = intQpBar ℓ`, the valuation |
| 66 | `v(ζ - 1)`, where `v = ellVal` is normalised by `v ℓ = 1`, is the radius `ρ_h = 1 / φ(ℓ ^ h)`. -/ |
| 67 | lemma ellVal_sub_one_eq_rootRadius {h : ℕ} (hh : 1 ≤ h) {ζ : intQpBar ℓ} |
| 68 | (hζ : IsPrimitiveRoot ζ (ℓ ^ h)) : ellVal (ζ - 1).val = (rootRadius ℓ h : ℝ≥0) := by |
| 69 | obtain ⟨k, rfl⟩ : ∃ k : ℕ, h = k + 1 := Nat.exists_eq_add_of_le' hh |
| 70 | rw [ellVal_sub_one_of_isPrimitiveRoot hζ, coe_rootRadius] |
| 71 | |
| 72 | lemma strictMono_totient_pow_succ : StrictMono fun k : ℕ ↦ Nat.totient (ℓ ^ (k + 1)) := by |
| 73 | have hℓ : ℓ.Prime := Fact.out |
| 74 | simp only [Nat.totient_prime_pow_succ hℓ] |
| 75 | exact (pow_right_strictMono₀ hℓ.one_lt).mul_const (Nat.sub_pos_of_lt hℓ.one_lt) |
| 76 | |
| 77 | /-- The radii `rootRadius ℓ h` with `h ≥ 1` are distinct. -/ |
| 78 | lemma rootRadius_injOn : Set.InjOn (rootRadius ℓ) (Set.Ici 1) := by |
| 79 | intro h hh h' hh' h_eq |
| 80 | obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le' hh |
| 81 | obtain ⟨k', rfl⟩ := Nat.exists_eq_add_of_le' hh' |
| 82 | exact congrArg (· + 1) |
| 83 | (strictMono_totient_pow_succ.injective (by simpa [rootRadius] using h_eq)) |
| 84 | |
| 85 | /-- For `ρ > 0`, all large `h` have `rootRadius ℓ h = 1 / φ(ℓ ^ h) ≤ ρ`. -/ |
| 86 | lemma eventually_rootRadius_le {ρ : ℚ≥0} (hρ : 0 < ρ) : |
| 87 | ∀ᶠ h : ℕ in atTop, rootRadius ℓ h ≤ ρ := by |
| 88 | filter_upwards [eventually_ge_atTop (⌈ρ⁻¹⌉₊ + 1)] with h hh |
| 89 | obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le' (le_of_add_le_right hh) |
| 90 | have h_totient : ⌈ρ⁻¹⌉₊ ≤ Nat.totient (ℓ ^ (k + 1)) := |
| 91 | (Nat.le_of_succ_le_succ hh).trans strictMono_totient_pow_succ.le_apply |
| 92 | exact inv_le_of_inv_le₀ hρ ((Nat.le_ceil _).trans (Nat.cast_le.2 h_totient)) |
| 93 | |
| 94 | variable (ℓ) in |
| 95 | /-- The exponents `h` with `1 ≤ h ≤ h₀` and `ρ_h ≤ ρ`, where `ρ_h = rootRadius ℓ h`. -/ |
| 96 | def radiusExponents (ρ : ℚ≥0) (h₀ : ℕ) : Finset ℕ := {h ∈ Icc 1 h₀ | rootRadius ℓ h ≤ ρ} |
| 97 | |
| 98 | omit [ThePrime ℓ] in |
| 99 | lemma mem_radiusExponents {ρ : ℚ≥0} {h h₀ : ℕ} : |
| 100 | h ∈ radiusExponents ℓ ρ h₀ ↔ 1 ≤ h ∧ h ≤ h₀ ∧ rootRadius ℓ h ≤ ρ := by |
| 101 | rw [radiusExponents, mem_filter, mem_Icc, and_assoc] |
| 102 | |
| 103 | /-- Let `ρ > 0` and `δ > 0`. As the harmonic series diverges, there is an `h₀` such that `δ` times |
| 104 | the sum of `1 / (h + 1)` over `radiusExponents ℓ ρ h₀` (the `h` with `1 ≤ h ≤ h₀` and |
| 105 | `rootRadius ℓ h = 1 / φ(ℓ ^ h) ≤ ρ`) exceeds `B`. -/ |
| 106 | lemma exists_lt_mul_sum_radiusExponents {ρ : ℚ≥0} {δ : ℝ≥0} (hρ : 0 < ρ) (B : ℝ≥0) (hδ : 0 < δ) : |
| 107 | ∃ h₀ : ℕ, B < δ * ∑ h ∈ radiusExponents ℓ ρ h₀, ((h : ℝ≥0) + 1)⁻¹ := by |
| 108 | obtain ⟨N, hN⟩ : ∃ N : ℕ, ∀ h ≥ N, 1 ≤ h ∧ rootRadius ℓ h ≤ ρ := |
| 109 | eventually_atTop.1 ((eventually_ge_atTop 1).and (eventually_rootRadius_le hρ)) |
| 110 | have h_diverges : ∀ᶠ n : ℕ in atTop, |
| 111 | (B : ℝ) / δ + ∑ h ∈ range N, 1 / ((h : ℝ) + 1) < ∑ h ∈ range n, 1 / ((h : ℝ) + 1) := |
| 112 | Real.tendsto_sum_range_one_div_nat_succ_atTop.eventually_gt_atTop _ |
| 113 | obtain ⟨h₀, h_large, hNh₀⟩ := (h_diverges.and (eventually_ge_atTop N)).exists |
| 114 | have h_tail : B / δ < ∑ h ∈ Ico N h₀, ((h : ℝ≥0) + 1)⁻¹ := by |
| 115 | rw [← sum_range_add_sum_Ico _ hNh₀, add_comm, add_lt_add_iff_left] at h_large |
| 116 | simpa [← NNReal.coe_lt_coe] using h_large |
| 117 | have h_subset : Ico N h₀ ⊆ radiusExponents ℓ ρ h₀ := fun h hh ↦ by |
| 118 | obtain ⟨hNh, hh₀⟩ := mem_Ico.1 hh |
| 119 | exact mem_radiusExponents.2 ⟨(hN h hNh).1, hh₀.le, (hN h hNh).2⟩ |
| 120 | exact ⟨h₀, (div_lt_iff₀' hδ).1 (h_tail.trans_le (sum_le_sum_of_subset h_subset))⟩ |
| 121 | |
| 122 | /-! ### One variable -/ |
| 123 | |
| 124 | open Classical in |
| 125 | /-- The multiset of roots of `g` in `ℤ̄_ℓ = intQpBar ℓ` of valuation `r`, counted with multiplicity, |
| 126 | where the valuation `ellVal` is normalised by `v ℓ = 1`. For `r = ρ_h` it is written `R_h` in the |
| 127 | docstrings. -/ |
| 128 | def rootsOfValuation (g : (intQpBar ℓ)[X]) (r : ℚ≥0) : Multiset (intQpBar ℓ) := |
| 129 | g.roots.filter fun α : intQpBar ℓ ↦ ellVal α.val = (r : ℝ≥0) |
| 130 | |
| 131 | /-- A member of `rootsOfValuation g r`, the roots of `g` in `ℤ̄_ℓ` of valuation `r`, has valuation |
| 132 | `r`. -/ |
| 133 | lemma ellVal_of_mem_rootsOfValuation {g : (intQpBar ℓ)[X]} {r : ℚ≥0} {α : intQpBar ℓ} |
| 134 | (hα : α ∈ rootsOfValuation g r) : ellVal α.val = (r : ℝ≥0) := |
| 135 | (Multiset.mem_filter.1 hα).2 |
| 136 | |
| 137 | open Classical in |
| 138 | /-- For the valuation `v = ellVal` on `ℚ̄_ℓ`, normalised by `v ℓ = 1`, the number of roots of `g` in |
| 139 | `ℤ̄_ℓ = intQpBar ℓ` with `v(α) = r`, counted with multiplicity, times `c` is the sum, over all roots |
| 140 | `α` in `ℤ̄_ℓ` with multiplicity, of `c` if `v(α) = r` and `0` otherwise. -/ |
| 141 | lemma card_rootsOfValuation_mul (g : (intQpBar ℓ)[X]) (r : ℚ≥0) (c : ℝ≥0∞) : |
| 142 | (rootsOfValuation g r).card * c = |
| 143 | (g.roots.map fun α : intQpBar ℓ ↦ if ellVal α.val = (r : ℝ≥0) then c else 0).sum := by |
| 144 | rw [rootsOfValuation] |
| 145 | induction g.roots using Multiset.induction_on with |
| 146 | | empty => simp |
| 147 | | cons α s ih => by_cases hα : ellVal α.val = (r : ℝ≥0) <;> simp [hα, ← ih, add_mul, add_comm] |
| 148 | |
| 149 | /-- Let `v = ellVal` be the valuation on `ℚ̄_ℓ` with `v ℓ = 1`, let `g = ∑ y_i Y ^ i` be a |
| 150 | polynomial over the valuation ring `ℤ̄_ℓ = intQpBar ℓ`, and let `v_r(g) = gaussVal r g` be its Gauss |
| 151 | valuation `min_i (v(y_i) + r i)`. At a point `y` of valuation `r` only the roots `α` of `g` in |
| 152 | `ℤ̄_ℓ` of valuation `r` matter: `v(g(y)) - v_r(g) = ∑ (v(y - α) - r)` over the multiset |
| 153 | `rootsOfValuation g r` of these roots, counted with multiplicity, stated here without |
| 154 | subtraction. -/ |
| 155 | lemma ellVal_eval_add_card_mul (g : (intQpBar ℓ)[X]) {r : ℚ≥0} {y : intQpBar ℓ} |
| 156 | (hy : ellVal y.val = (r : ℝ≥0)) : |
| 157 | ellVal (g.eval y).val + (rootsOfValuation g r).card * ((r : ℝ≥0) : ℝ≥0∞) = |
| 158 | gaussVal r g + |
| 159 | ((rootsOfValuation g r).map fun α : intQpBar ℓ ↦ ellVal (y - α).val).sum := by |
| 160 | classical |
| 161 | set R : Multiset (intQpBar ℓ) := rootsOfValuation g r |
| 162 | set R' : Multiset (intQpBar ℓ) := g.roots.filter fun α ↦ ¬ellVal α.val = (r : ℝ≥0) |
| 163 | have h_split : g.roots = R + R' := (Multiset.filter_add_not _ g.roots).symm |
| 164 | have h_other : ∀ α ∈ R', ellVal (y - α).val = min (ellVal α.val) (r : ℝ≥0) := fun α hα ↦ by |
| 165 | rw [ellVal_sub_eq_min_of_ne (hy.trans_ne (Ne.symm (Multiset.mem_filter.1 hα).2)), hy, min_comm] |
| 166 | have h_same : ∀ α ∈ R, min (ellVal α.val) (r : ℝ≥0) = (r : ℝ≥0) := |
| 167 | fun α hα ↦ min_eq_right (ellVal_of_mem_rootsOfValuation hα).ge |
| 168 | rw [ellVal_eval_eq_add_sum_roots, gaussVal_eq_add_sum_roots (ρ := r), h_split] |
| 169 | simp only [Multiset.map_add, Multiset.sum_add, Multiset.map_congr rfl h_other, |
| 170 | Multiset.map_congr rfl h_same, Multiset.map_const', Multiset.sum_replicate, nsmul_eq_mul] |
| 171 | ring |
| 172 | |
| 173 | open Classical in |
| 174 | /-- Let `α` be in the valuation ring `ℤ̄_ℓ = intQpBar ℓ` of `ℚ̄_ℓ` and `v = ellVal` the valuation |
| 175 | with `v ℓ = 1`. At most one radius `ρ_h = rootRadius ℓ h = 1 / φ(ℓ ^ h)` with `h` in |
| 176 | `radiusExponents ℓ ρ h₀` equals `v(α)`, so the sum of these radii is at most `min (v(α)) ρ`. -/ |
| 177 | lemma sum_rootRadius_filter_le_min {ρ : ℚ≥0} {h₀ : ℕ} (α : intQpBar ℓ) : |
| 178 | ∑ h ∈ radiusExponents ℓ ρ h₀ with ellVal α.val = (rootRadius ℓ h : ℝ≥0), |
| 179 | ((rootRadius ℓ h : ℝ≥0) : ℝ≥0∞) ≤ min (ellVal α.val) (ρ : ℝ≥0) := by |
| 180 | obtain h_empty | ⟨k, hk⟩ := |
| 181 | {h ∈ radiusExponents ℓ ρ h₀ | ellVal α.val = (rootRadius ℓ h : ℝ≥0)}.eq_empty_or_nonempty |
| 182 | · simp [h_empty] |
| 183 | · obtain ⟨hk_mem, hk_val⟩ := mem_filter.1 hk |
| 184 | obtain ⟨hk_one, -, hk_radius⟩ := mem_radiusExponents.1 hk_mem |
| 185 | rw [sum_eq_single_of_mem k hk, hk_val] |
| 186 | · exact le_min le_rfl (mod_cast hk_radius) |
| 187 | · intro h hh h_ne |
| 188 | obtain ⟨hh_mem, hh_val⟩ := mem_filter.1 hh |
| 189 | have h_radii : rootRadius ℓ h = rootRadius ℓ k := mod_cast hh_val.symm.trans hk_val |
| 190 | exact absurd (rootRadius_injOn (mem_radiusExponents.1 hh_mem).1 hk_one h_radii) h_ne |
| 191 | |
| 192 | /-- Let `v = ellVal` be the valuation on `ℚ̄_ℓ` with `v ℓ = 1`, and let `g = ∑ y_i Y ^ i` be a |
| 193 | polynomial over `ℤ̄_ℓ = intQpBar ℓ`. Let `ρ_h = rootRadius ℓ h = 1 / φ(ℓ ^ h)`, and let |
| 194 | `R_h = rootsOfValuation g ρ_h` be the multiset of roots of `g` in `ℤ̄_ℓ` of valuation `ρ_h`, counted |
| 195 | with multiplicity. The sum of `#R_h ρ_h` over `radiusExponents ℓ ρ h₀` is at most the Gauss |
| 196 | valuation `gaussVal ρ g = min_i (v(y_i) + ρ i)`. -/ |
| 197 | lemma sum_card_rootsOfValuation_mul_le {ρ : ℚ≥0} {h₀ : ℕ} (g : (intQpBar ℓ)[X]) : |
| 198 | ∑ h ∈ radiusExponents ℓ ρ h₀, (rootsOfValuation g (rootRadius ℓ h)).card * |
| 199 | ((rootRadius ℓ h : ℝ≥0) : ℝ≥0∞) ≤ gaussVal ρ g := by |
| 200 | classical |
| 201 | -- A root lies in at most one `R_h`, and its summand `min (v(α)) ρ` in `v_ρ(g)` is then `ρ_h`. |
| 202 | calc _ = (g.roots.map fun α ↦ |
| 203 | ∑ h ∈ radiusExponents ℓ ρ h₀ with ellVal α.val = (rootRadius ℓ h : ℝ≥0), |
| 204 | ((rootRadius ℓ h : ℝ≥0) : ℝ≥0∞)).sum := by |
| 205 | simp only [sum_filter, Multiset.sum_map_sum, card_rootsOfValuation_mul] |
| 206 | _ ≤ (g.roots.map fun α ↦ min (ellVal α.val) (ρ : ℝ≥0)).sum := |
| 207 | Multiset.sum_map_le_sum_map _ _ fun α _ ↦ sum_rootRadius_filter_le_min α |
| 208 | _ ≤ gaussVal ρ g := le_add_self.trans_eq (gaussVal_eq_add_sum_roots g).symm |
| 209 | |
| 210 | /-- Let `v = ellVal` be the valuation on `ℚ̄_ℓ` with `v ℓ = 1`, and let `g = ∑ y_i Y ^ i` be a |
| 211 | polynomial over `ℤ̄_ℓ = intQpBar ℓ`. Let `ρ_h = rootRadius ℓ h = 1 / φ(ℓ ^ h)`, and let |
| 212 | `R_h = rootsOfValuation g ρ_h` be the multiset of roots of `g` in `ℤ̄_ℓ` of valuation `ρ_h`, counted |
| 213 | with multiplicity. Suppose that the Gauss valuation `gaussVal ρ g = min_i (v(y_i) + ρ i)` is at most |
| 214 | `B`. Suppose also that `B` is less than `δ` times the sum of `1 / (h + 1)` over |
| 215 | `radiusExponents ℓ ρ h₀`. Then one of these `h` has `#R_h ρ_h ≤ δ / (h + 1)`. -/ |
| 216 | lemma exists_card_rootsOfValuation_mul_le {ρ : ℚ≥0} {h₀ : ℕ} {B δ : ℝ≥0} |
| 217 | (h_harmonic : B < δ * ∑ h ∈ radiusExponents ℓ ρ h₀, ((h : ℝ≥0) + 1)⁻¹) |
| 218 | {g : (intQpBar ℓ)[X]} (hg : gaussVal ρ g ≤ B) : |
| 219 | ∃ h ∈ radiusExponents ℓ ρ h₀, |
| 220 | (rootsOfValuation g (rootRadius ℓ h)).card * (rootRadius ℓ h : ℝ≥0) ≤ δ / (h + 1) := by |
| 221 | by_contra! h_many |
| 222 | have h_count : ∑ h ∈ radiusExponents ℓ ρ h₀, |
| 223 | (rootsOfValuation g (rootRadius ℓ h)).card * (rootRadius ℓ h : ℝ≥0) ≤ B := |
| 224 | mod_cast (sum_card_rootsOfValuation_mul_le g).trans hg |
| 225 | refine h_harmonic.not_ge (le_trans ?_ h_count) |
| 226 | simpa [mul_sum, div_eq_mul_inv] using sum_le_sum fun h hh ↦ (h_many h hh).le |
| 227 | |
| 228 | /-- An integral `α` is close to few `ζ - 1`: if `1 + α` is a unit of `ℤ̄_ℓ`, then the sum of |
| 229 | `min (v(ζ - 1 - α)) 1` over the primitive `ℓ ^ h`-th roots of unity `ζ` is at most `h + 1`, where |
| 230 | `v = ellVal` is the valuation with `v ℓ = 1`. -/ |
| 231 | lemma sum_min_ellVal_sub_le {α : intQpBar ℓ} (hα : IsUnit (1 + α)) (h : ℕ) : |
| 232 | ∑ ζ ∈ primitiveRoots (ℓ ^ h) (intQpBar ℓ), min (ellVal (ζ - 1 - α).val) 1 ≤ h + 1 := by |
| 233 | -- The numbers `ζ - 1 - α` are roots of `f = (1 + α + Y) ^ ℓ ^ h - 1`, whose coefficient of `Y` is |
| 234 | -- `ℓ ^ h` times a unit. Both sides are compared with `v₁(f)`. |
| 235 | set f : (intQpBar ℓ)[X] := (X + C (1 + α)) ^ ℓ ^ h - 1 with hf |
| 236 | have h_coeff : f.coeff 1 = (1 + α) ^ (ℓ ^ h - 1) * ℓ ^ h := by |
| 237 | rw [hf, coeff_sub, coeff_X_add_C_pow, coeff_one, ite_eq_right one_ne_zero, sub_zero, |
| 238 | Nat.choose_one_right, Nat.cast_pow] |
| 239 | have h_val : ellVal (f.coeff 1).val = h := by |
| 240 | rw [h_coeff, ellVal_val_mul, ellVal_eq_zero_iff_isUnit.2 (hα.pow _), zero_add] |
| 241 | simp [ellVal_pow, ellVal_ell] |
| 242 | have hf_ne : f ≠ 0 := fun h_zero ↦ ENNReal.natCast_ne_top h |
| 243 | (h_val.symm.trans (ellVal_eq_top_iff.2 (by simp [h_zero]))) |
| 244 | have h_roots : |
| 245 | (primitiveRoots (ℓ ^ h) (intQpBar ℓ)).val.map (fun ζ ↦ ζ - 1 - α) ≤ f.roots := by |
| 246 | have h_inj : Function.Injective fun ζ : intQpBar ℓ ↦ ζ - 1 - α := |
| 247 | sub_left_injective.comp sub_left_injective |
| 248 | refine (Multiset.le_iff_subset ((primitiveRoots _ _).nodup.map h_inj)).2 fun y hy ↦ ?_ |
| 249 | obtain ⟨ζ, hζ, rfl⟩ := Multiset.mem_map.1 hy |
| 250 | have h_point : ζ - 1 - α + (1 + α) = ζ := by ring |
| 251 | rw [mem_roots hf_ne, IsRoot.def, hf, eval_sub, eval_pow, eval_add, eval_X, eval_C, eval_one, |
| 252 | h_point, (isPrimitiveRoot_of_mem_primitiveRoots hζ).pow_eq_one, sub_self] |
| 253 | calc _ ≤ (f.roots.map fun y ↦ min (ellVal y.val) 1).sum := by |
| 254 | obtain ⟨rest, h_rest⟩ := Multiset.le_iff_exists_add.1 h_roots |
| 255 | simp [h_rest] |
| 256 | _ ≤ gaussVal 1 f := by simp [gaussVal_eq_add_sum_roots (ρ := 1)] |
| 257 | _ ≤ h + 1 := by simpa [h_val] using gaussVal_le_coeff (ρ := 1) f 1 |
| 258 | |
| 259 | /-- The valuation ring `ℤ̄_ℓ = intQpBar ℓ` of `ℚ̄_ℓ` contains a primitive `ℓ ^ h`-th root of |
| 260 | unity. -/ |
| 261 | lemma exists_isPrimitiveRoot_pow (h : ℕ) : ∃ ζ : intQpBar ℓ, IsPrimitiveRoot ζ (ℓ ^ h) := by |
| 262 | have : NeZero (ℓ ^ h) := ⟨pow_ne_zero h (Fact.out : ℓ.Prime).ne_zero⟩ |
| 263 | obtain ⟨ζ, hζ, h_norm⟩ := exists_isPrimitiveRoot_norm_eq_one (ℓ := ℓ) (ℓ ^ h) |
| 264 | -- Membership in the valuation ring is by definition the bound `‖ζ‖ ≤ 1`. |
| 265 | have h_int : ζ ∈ intQpBar ℓ := h_norm.le |
| 266 | exact ⟨⟨ζ, h_int⟩, IsPrimitiveRoot.coe_submonoidClass_iff.1 hζ⟩ |
| 267 | |
| 268 | /-- Averaging over the roots of unity of order `ℓ ^ h`. Let `v = ellVal` be the valuation on `ℚ̄_ℓ` |
| 269 | with `v ℓ = 1` and `ρ_h = rootRadius ℓ h = 1 / φ(ℓ ^ h)`, so that there are `1 / ρ_h` such roots in |
| 270 | `ℤ̄_ℓ = intQpBar ℓ`. Let `R` be a multiset in `ℤ̄_ℓ` with `1 + α` a unit for all `α ∈ R`. Then for |
| 271 | one such root of unity `ζ` the numbers `min (v(ζ - 1 - α)) 1`, `α ∈ R`, add up to at most |
| 272 | `#R ρ_h (h + 1)`. -/ |
| 273 | lemma exists_sum_min_ellVal_sub_le (h : ℕ) {R : Multiset (intQpBar ℓ)} |
| 274 | (hR : ∀ α ∈ R, IsUnit (1 + α)) : |
| 275 | ∃ ζ : intQpBar ℓ, IsPrimitiveRoot ζ (ℓ ^ h) ∧ |
| 276 | (R.map fun α : intQpBar ℓ ↦ min (ellVal (ζ - 1 - α).val) 1).sum ≤ |
| 277 | R.card * ((rootRadius ℓ h : ℝ≥0) : ℝ≥0∞) * (h + 1) := by |
| 278 | obtain ⟨ζ₀, hζ₀⟩ := exists_isPrimitiveRoot_pow (ℓ := ℓ) h |
| 279 | set μ : Finset (intQpBar ℓ) := primitiveRoots (ℓ ^ h) (intQpBar ℓ) |
| 280 | set c : ℝ≥0∞ := ((rootRadius ℓ h : ℝ≥0) : ℝ≥0∞) with hc |
| 281 | have h_card : #μ * c = 1 := by |
| 282 | simp [μ, hζ₀.card_primitiveRoots, hc, coe_rootRadius, ENNReal.mul_inv_cancel, |
| 283 | (totient_pow_pos h).ne'] |
| 284 | have h_total : ∑ ζ ∈ μ, (R.map fun α ↦ min (ellVal (ζ - 1 - α).val) 1).sum ≤ |
| 285 | ∑ _ζ ∈ μ, R.card * c * (h + 1) := |
| 286 | calc _ = (R.map fun α ↦ ∑ ζ ∈ μ, min (ellVal (ζ - 1 - α).val) 1).sum := |
| 287 | Multiset.sum_map_sum.symm |
| 288 | _ ≤ (R.map fun _ ↦ (h + 1 : ℝ≥0∞)).sum := |
| 289 | Multiset.sum_map_le_sum_map _ _ fun α hα ↦ sum_min_ellVal_sub_le (hR α hα) h |
| 290 | _ = R.card * (#μ * c) * (h + 1) := by simp [h_card, mul_add] |
| 291 | _ = ∑ _ζ ∈ μ, R.card * c * (h + 1) := by rw [sum_const, nsmul_eq_mul]; ring |
| 292 | obtain ⟨ζ, hζ, h_average⟩ := ENNReal.exists_le_of_sum_le |
| 293 | ⟨ζ₀, (mem_primitiveRoots (pow_pos (Fact.out : ℓ.Prime).pos h)).2 hζ₀⟩ h_total |
| 294 | exact ⟨ζ, isPrimitiveRoot_of_mem_primitiveRoots hζ, h_average⟩ |
| 295 | |
| 296 | /-- An element `1 + α` of `ℤ̄_ℓ = intQpBar ℓ` is a unit if the valuation `ellVal` of `α` is |
| 297 | positive. -/ |
| 298 | lemma isUnit_one_add_of_ellVal_pos {α : intQpBar ℓ} (hα : 0 < ellVal α.val) : IsUnit (1 + α) := by |
| 299 | have h_one : ellVal (1 : intQpBar ℓ).val = 0 := ellVal_eq_zero_iff_isUnit.2 isUnit_one |
| 300 | rw [← ellVal_eq_zero_iff_isUnit, ellVal_add_eq_min_of_ne (h_one.trans_ne hα.ne), h_one, |
| 301 | min_eq_left hα.le] |
| 302 | |
| 303 | /-- Write `v = ellVal` for the valuation on `ℚ̄_ℓ` with `v ℓ = 1`, and |
| 304 | `v_r(g) = gaussVal r g = min_i (v(y_i) + r i)` for the Gauss valuation of a polynomial |
| 305 | `g = ∑ y_i Y ^ i` over the ring `ℤ̄_ℓ = intQpBar ℓ` of integral elements. Let `δ < 1`, and let `δ` |
| 306 | times the sum of `1 / (h + 1)` over the exponents `1 ≤ h ≤ h₀` with `ρ_h ≤ ρ` exceed `B`, where |
| 307 | `ρ_h = rootRadius ℓ h = 1 / φ(ℓ ^ h)`. If `v_ρ(g) ≤ B`, then for one of these exponents `h` and some |
| 308 | `ζ` of order `ℓ ^ h` we have `v(g(ζ - 1)) ≤ v_{ρ_h}(g) + δ`. -/ |
| 309 | theorem exists_rootOfUnity_eval_le_gaussVal_add {ρ : ℚ≥0} {h₀ : ℕ} {B δ : ℝ≥0} (hδ : δ < 1) |
| 310 | (h_harmonic : B < δ * ∑ h ∈ radiusExponents ℓ ρ h₀, ((h : ℝ≥0) + 1)⁻¹) |
| 311 | {g : (intQpBar ℓ)[X]} (hg : gaussVal ρ g ≤ B) : |
| 312 | ∃ h ∈ radiusExponents ℓ ρ h₀, ∃ ζ : intQpBar ℓ, IsPrimitiveRoot ζ (ℓ ^ h) ∧ |
| 313 | ellVal (g.eval (ζ - 1)).val ≤ gaussVal (rootRadius ℓ h) g + δ := by |
| 314 | -- Choose `h` with few roots `α` of valuation `ρ_h`, then `ζ` with `ζ - 1` far from them. |
| 315 | obtain ⟨h, hh, h_few⟩ := exists_card_rootsOfValuation_mul_le h_harmonic hg |
| 316 | obtain ⟨h_one, -, -⟩ := mem_radiusExponents.1 hh |
| 317 | set R : Multiset (intQpBar ℓ) := rootsOfValuation g (rootRadius ℓ h) |
| 318 | have h_unit : ∀ α ∈ R, IsUnit (1 + α) := fun α hα ↦ isUnit_one_add_of_ellVal_pos <| by |
| 319 | simp [ellVal_of_mem_rootsOfValuation hα, coe_rootRadius] |
| 320 | obtain ⟨ζ, hζ, h_average⟩ := exists_sum_min_ellVal_sub_le h h_unit |
| 321 | have h_min : (R.map fun α ↦ min (ellVal (ζ - 1 - α).val) 1).sum ≤ δ := |
| 322 | h_average.trans (mod_cast (le_div_iff₀ (by positivity)).1 h_few) |
| 323 | -- As `δ < 1`, no minimum is `1`. |
| 324 | have h_not_one : ∀ α ∈ R, ellVal (ζ - 1 - α).val = min (ellVal (ζ - 1 - α).val) 1 := by |
| 325 | intro α hα |
| 326 | have h_le : min (ellVal (ζ - 1 - α).val) 1 ≤ δ := |
| 327 | (Multiset.le_sum_of_mem (Multiset.mem_map_of_mem _ hα)).trans h_min |
| 328 | have h_lt : ellVal (ζ - 1 - α).val < 1 := by |
| 329 | simpa using h_le.trans_lt (ENNReal.coe_lt_one_iff.2 hδ) |
| 330 | exact (min_eq_left h_lt.le).symm |
| 331 | refine ⟨h, hh, ζ, hζ, ?_⟩ |
| 332 | calc ellVal (g.eval (ζ - 1)).val |
| 333 | ≤ ellVal (g.eval (ζ - 1)).val + R.card * ((rootRadius ℓ h : ℝ≥0) : ℝ≥0∞) := le_self_add |
| 334 | _ = gaussVal (rootRadius ℓ h) g + (R.map fun α ↦ ellVal (ζ - 1 - α).val).sum := |
| 335 | ellVal_eval_add_card_mul g (ellVal_sub_one_eq_rootRadius h_one hζ) |
| 336 | _ = gaussVal (rootRadius ℓ h) g + (R.map fun α ↦ min (ellVal (ζ - 1 - α).val) 1).sum := by |
| 337 | rw [Multiset.map_congr rfl h_not_one] |
| 338 | _ ≤ gaussVal (rootRadius ℓ h) g + δ := add_le_add_right h_min _ |
| 339 | |
| 340 | /-! ### Several variables -/ |
| 341 | |
| 342 | variable {σ ι : Type*} |
| 343 | |
| 344 | /-- If `b i ≤ a i` for all `i`, the sum `∑ b i` is finite and `∑ a i ≤ ∑ b i + c`, then |
| 345 | `a i ≤ b i + c` for each `i`. -/ |
| 346 | lemma le_add_of_sum_le_sum_add [Fintype ι] {a b : ι → ℝ≥0∞} {c : ℝ≥0∞} |
| 347 | (hba : ∀ i : ι, b i ≤ a i) (hb : ∑ i : ι, b i ≠ ⊤) (h_sum : ∑ i : ι, a i ≤ ∑ i : ι, b i + c) |
| 348 | (i : ι) : a i ≤ b i + c := by |
| 349 | -- The excesses `a k - b k` add up to at most `c`. |
| 350 | have h_excess : ∑ k : ι, (a k - b k) ≤ c := by |
| 351 | rwa [← ENNReal.add_le_add_iff_left hb, ← sum_add_distrib, |
| 352 | sum_congr rfl fun k _ ↦ add_tsub_cancel_of_le (hba k)] |
| 353 | exact tsub_le_iff_left.1 ((single_le_sum_of_canonicallyOrdered (mem_univ i)).trans h_excess) |
| 354 | |
| 355 | /-- For a point `x` with coordinates in `ℤ̄_ℓ = intQpBar ℓ` and a coordinate index `j`, the |
| 356 | polynomial `P` at `x` with one variable `Y` in place of `x j`. -/ |
| 357 | def freeCoordinate [DecidableEq σ] (x : σ → intQpBar ℓ) (j : σ) |
| 358 | (P : MvPolynomial σ (intQpBar ℓ)) : (intQpBar ℓ)[X] := |
| 359 | MvPolynomial.aeval (Function.update (fun k : σ ↦ C (x k)) j X) P |
| 360 | |
| 361 | /-- The value of `freeCoordinate x j P` at `y` is the value of `P` at the point `x` with its |
| 362 | coordinate `x j` replaced by `y`. -/ |
| 363 | lemma eval_freeCoordinate [DecidableEq σ] (x : σ → intQpBar ℓ) (j : σ) |
| 364 | (P : MvPolynomial σ (intQpBar ℓ)) (y : intQpBar ℓ) : |
| 365 | (freeCoordinate x j P).eval y = MvPolynomial.eval (Function.update x j y) P := by |
| 366 | rw [freeCoordinate, ← coe_aeval_eq_eval, MvPolynomial.comp_aeval_apply, |
| 367 | MvPolynomial.aeval_eq_eval] |
| 368 | refine congrArg (MvPolynomial.eval · P) (funext fun k ↦ ?_) |
| 369 | by_cases hk : k = j <;> simp [hk] |
| 370 | |
| 371 | /-- Moving one coordinate `j`. Let `δ < 1`, and let `δ` times the sum of `1 / (h + 1)` over the |
| 372 | exponents `1 ≤ h ≤ h₀` with `1 / φ(ℓ ^ h) ≤ ρ` exceed `B`. Let `P i` be polynomials and `x i` points |
| 373 | over the valuation ring `ℤ̄_ℓ = intQpBar ℓ` of `ℚ̄_ℓ` with `v(x i j) ≥ ρ` and |
| 374 | `∑ i, v(P i (x i)) ≤ B`. Then all `x i j` can be replaced by one number `ζ - 1`, with |
| 375 | `ζ ^ ℓ ^ h₀ = 1` and `v(ζ - 1) ≤ ρ`, so that each `v(P i (x i))`, and also their sum, grows by at |
| 376 | most `δ`. -/ |
| 377 | lemma exists_ellVal_eval_update_le_add [DecidableEq σ] [Fintype ι] {ρ : ℚ≥0} {h₀ : ℕ} {B δ : ℝ≥0} |
| 378 | (hδ : δ < 1) (h_harmonic : B < δ * ∑ h ∈ radiusExponents ℓ ρ h₀, ((h : ℝ≥0) + 1)⁻¹) |
| 379 | (P : ι → MvPolynomial σ (intQpBar ℓ)) {x : ι → σ → intQpBar ℓ} {j : σ} |
| 380 | (hx : ∀ i : ι, (ρ : ℝ≥0) ≤ ellVal (x i j).val) |
| 381 | (hP : ∑ i : ι, ellVal (MvPolynomial.eval (x i) (P i)).val ≤ B) : |
| 382 | ∃ ζ : intQpBar ℓ, |
| 383 | ζ ^ ℓ ^ h₀ = 1 ∧ |
| 384 | ellVal (ζ - 1).val ≤ (ρ : ℝ≥0) ∧ |
| 385 | (∀ i : ι, ellVal (MvPolynomial.eval (Function.update (x i) j (ζ - 1)) (P i)).val ≤ |
| 386 | ellVal (MvPolynomial.eval (x i) (P i)).val + δ) ∧ |
| 387 | ∑ i : ι, ellVal (MvPolynomial.eval (Function.update (x i) j (ζ - 1)) (P i)).val ≤ |
| 388 | ∑ i : ι, ellVal (MvPolynomial.eval (x i) (P i)).val + δ := by |
| 389 | -- Apply the case of one variable to the product of the `g i`. |
| 390 | set g : ι → (intQpBar ℓ)[X] := fun i ↦ freeCoordinate (x i) j (P i) |
| 391 | have h_eval (i : ι) (y : intQpBar ℓ) : |
| 392 | (g i).eval y = MvPolynomial.eval (Function.update (x i) j y) (P i) := eval_freeCoordinate .. |
| 393 | have h_old (i : ι) : gaussVal ρ (g i) ≤ ellVal (MvPolynomial.eval (x i) (P i)).val := by |
| 394 | simpa [h_eval] using gaussVal_le_eval (g i) (hx i) |
| 395 | have h_prod : gaussVal ρ (∏ i : ι, g i) ≤ B := by |
| 396 | simpa [gaussVal_prod] using (sum_le_sum fun i _ ↦ h_old i).trans hP |
| 397 | obtain ⟨h, hh, ζ, hζ, h_prod_eval⟩ : |
| 398 | ∃ h ∈ radiusExponents ℓ ρ h₀, ∃ ζ : intQpBar ℓ, IsPrimitiveRoot ζ (ℓ ^ h) ∧ |
| 399 | ellVal ((∏ i : ι, g i).eval (ζ - 1)).val ≤ gaussVal (rootRadius ℓ h) (∏ i : ι, g i) + δ := |
| 400 | exists_rootOfUnity_eval_le_gaussVal_add hδ h_harmonic h_prod |
| 401 | obtain ⟨h_one, hh₀, h_radius⟩ := mem_radiusExponents.1 hh |
| 402 | have hζ_val : ellVal (ζ - 1).val = (rootRadius ℓ h : ℝ≥0) := |
| 403 | ellVal_sub_one_eq_rootRadius h_one hζ |
| 404 | have h_compare (i : ι) : |
| 405 | gaussVal (rootRadius ℓ h) (g i) ≤ ellVal (MvPolynomial.eval (x i) (P i)).val := |
| 406 | (gaussVal_mono h_radius (g i)).trans (h_old i) |
| 407 | have h_compare_sum : ∑ i : ι, gaussVal (rootRadius ℓ h) (g i) ≤ |
| 408 | ∑ i : ι, ellVal (MvPolynomial.eval (x i) (P i)).val := sum_le_sum fun i _ ↦ h_compare i |
| 409 | have h_sum : |
| 410 | ∑ i : ι, ellVal ((g i).eval (ζ - 1)).val ≤ ∑ i : ι, gaussVal (rootRadius ℓ h) (g i) + δ := by |
| 411 | rwa [gaussVal_prod, eval_prod, ellVal_prod] at h_prod_eval |
| 412 | have h_each (i : ι) : ellVal ((g i).eval (ζ - 1)).val ≤ gaussVal (rootRadius ℓ h) (g i) + δ := |
| 413 | le_add_of_sum_le_sum_add (fun k ↦ gaussVal_le_eval (g k) hζ_val.ge) |
| 414 | (ne_top_of_le_ne_top ENNReal.coe_ne_top (h_compare_sum.trans hP)) h_sum i |
| 415 | simp only [h_eval] at h_sum h_each |
| 416 | refine ⟨ζ, (hζ.pow_eq_one_iff_dvd _).2 (pow_dvd_pow ℓ hh₀), |
| 417 | hζ_val.trans_le (mod_cast h_radius), fun i ↦ ?_, ?_⟩ |
| 418 | · exact (h_each i).trans (add_le_add_left (h_compare i) _) |
| 419 | · exact h_sum.trans (add_le_add_left h_compare_sum _) |
| 420 | |
| 421 | /-- Moving the coordinates in a finite set `t` in turn. Let `δ < 1` and `#σ δ ≤ 1`, and let `δ` |
| 422 | times the sum of `1 / (h + 1)` over the exponents `1 ≤ h ≤ h₀` with `1 / φ(ℓ ^ h) ≤ ρ` exceed |
| 423 | `β + 1`. Let `P i` be polynomials and `x i` points over the valuation ring `ℤ̄_ℓ = intQpBar ℓ` of |
| 424 | `ℚ̄_ℓ` with `v(x i j) ≥ ρ` for all `j` and `∑ i, v(P i (x i)) ≤ β`. Then the coordinates `x i j` |
| 425 | with `j ∈ t` can be replaced by numbers `ζ j - 1`, the same for all `i`, with `ζ j ^ ℓ ^ h₀ = 1` and |
| 426 | `v(ζ j - 1) ≤ ρ`, so that each `v(P i (x i))` grows by at most `#t δ` and their sum stays at most |
| 427 | `β + #t δ`. -/ |
| 428 | lemma exists_ellVal_eval_piecewise_le_add [DecidableEq σ] [Fintype σ] [Fintype ι] {ρ : ℚ≥0} {h₀ : ℕ} |
| 429 | {δ β : ℝ≥0} (hδ : δ < 1) |
| 430 | (h_harmonic : β + 1 < δ * ∑ h ∈ radiusExponents ℓ ρ h₀, ((h : ℝ≥0) + 1)⁻¹) |
| 431 | (hσ_card : Fintype.card σ * δ ≤ 1) (P : ι → MvPolynomial σ (intQpBar ℓ)) |
| 432 | {x : ι → σ → intQpBar ℓ} (hx : ∀ (i : ι) (j : σ), (ρ : ℝ≥0) ≤ ellVal (x i j).val) |
| 433 | (hP : ∑ i : ι, ellVal (MvPolynomial.eval (x i) (P i)).val ≤ β) (t : Finset σ) : |
| 434 | ∃ ζ : σ → intQpBar ℓ, |
| 435 | (∀ j ∈ t, ζ j ^ ℓ ^ h₀ = 1) ∧ |
| 436 | (∀ j ∈ t, ellVal (ζ j - 1).val ≤ (ρ : ℝ≥0)) ∧ |
| 437 | (∀ i : ι, ellVal (MvPolynomial.eval (t.piecewise (fun j : σ ↦ ζ j - 1) (x i)) (P i)).val ≤ |
| 438 | ellVal (MvPolynomial.eval (x i) (P i)).val + #t * δ) ∧ |
| 439 | ∑ i : ι, ellVal (MvPolynomial.eval (t.piecewise (fun j : σ ↦ ζ j - 1) (x i)) (P i)).val ≤ |
| 440 | β + #t * δ := by |
| 441 | induction t using Finset.induction_on with |
| 442 | | empty => exact ⟨1, by simp, by simp, by simp, by simpa using hP⟩ |
| 443 | | insert j t hj ih => |
| 444 | obtain ⟨ζ, h_pow, h_val, h_each, h_sum⟩ := ih |
| 445 | -- The points `y i` have the coordinates in `t` moved; now move the coordinate `j`. |
| 446 | set y : ι → σ → intQpBar ℓ := fun i ↦ t.piecewise (fun k ↦ ζ k - 1) (x i) |
| 447 | have h_loss : (#t * δ : ℝ≥0) ≤ 1 := |
| 448 | (mul_le_mul_left (Nat.cast_le.2 (card_le_univ t)) δ).trans hσ_card |
| 449 | have h_below : ∑ i : ι, ellVal (MvPolynomial.eval (y i) (P i)).val ≤ (β + 1 : ℝ≥0) := |
| 450 | h_sum.trans (mod_cast add_le_add_right h_loss β) |
| 451 | obtain ⟨ξ, hξ_pow, hξ_val, h_each_step, h_sum_step⟩ := |
| 452 | exists_ellVal_eval_update_le_add (j := j) hδ h_harmonic P |
| 453 | (fun i ↦ by simpa [y, hj] using hx i j) h_below |
| 454 | have h_old : ∀ k ∈ t, Function.update ζ j ξ k = ζ k := |
| 455 | fun k hk ↦ Function.update_of_ne (ne_of_mem_of_not_mem hk hj) ξ ζ |
| 456 | have h_point (i : ι) : (insert j t).piecewise (fun k ↦ Function.update ζ j ξ k - 1) (x i) = |
| 457 | Function.update (y i) j (ξ - 1) := by |
| 458 | rw [piecewise_insert, Function.update_self, |
| 459 | piecewise_congr t (fun k hk ↦ by rw [h_old k hk]) fun _ _ ↦ rfl] |
| 460 | have h_card_insert : (#(insert j t) * δ : ℝ≥0∞) = #t * δ + δ := by simp [hj, add_one_mul] |
| 461 | refine ⟨Function.update ζ j ξ, ?_, ?_, fun i ↦ ?_, ?_⟩ |
| 462 | · simp +contextual [h_old, hξ_pow, h_pow] |
| 463 | · rw [forall_mem_insert, Function.update_self] |
| 464 | exact ⟨hξ_val, fun k hk ↦ by simpa only [h_old k hk] using h_val k hk⟩ |
| 465 | · rw [h_point, h_card_insert, ← add_assoc] |
| 466 | exact (h_each_step i).trans (add_le_add_left (h_each i) _) |
| 467 | · simp only [h_point, h_card_insert, ← add_assoc] |
| 468 | exact h_sum_step.trans (add_le_add_left h_sum _) |
| 469 | |
| 470 | /-- Let a natural number `s₀`, a rational `ρ > 0`, `β ≥ 0` and `ε > 0` be given. There is an `h₀` |
| 471 | with the following property. Let `P i` be finitely many polynomials over `ℤ̄_ℓ = intQpBar ℓ` in one |
| 472 | set of at most `s₀` variables, and `x i` points whose coordinates have valuation at least `ρ`, with |
| 473 | `∑ i, v(P i (x i)) ≤ β`. Then there are roots of unity `ζ j` of orders dividing `ℓ ^ h₀` with |
| 474 | `v(ζ j - 1) ≤ ρ` for all `j` and `v(P i ((ζ j - 1)_j)) ≤ v(P i (x i)) + ε` for all `i`. -/ |
| 475 | theorem exists_rootsOfUnity_ellVal_eval_le_add (s₀ : ℕ) {ρ : ℚ≥0} (hρ : 0 < ρ) (β : ℝ≥0) {ε : ℝ≥0} |
| 476 | (hε : 0 < ε) : |
| 477 | ∃ h₀ : ℕ, ∀ (σ ι : Type) [Fintype σ] [Fintype ι] (P : ι → MvPolynomial σ (intQpBar ℓ)) |
| 478 | (x : ι → σ → intQpBar ℓ), |
| 479 | Fintype.card σ ≤ s₀ → |
| 480 | (∀ (i : ι) (j : σ), (ρ : ℝ≥0) ≤ ellVal (x i j).val) → |
| 481 | ∑ i : ι, ellVal (MvPolynomial.eval (x i) (P i)).val ≤ β → |
| 482 | ∃ ζ : σ → intQpBar ℓ, |
| 483 | (∀ j : σ, ζ j ^ ℓ ^ h₀ = 1) ∧ |
| 484 | (∀ j : σ, ellVal (ζ j - 1).val ≤ (ρ : ℝ≥0)) ∧ |
| 485 | ∀ i : ι, ellVal (MvPolynomial.eval (fun j : σ ↦ ζ j - 1) (P i)).val ≤ |
| 486 | ellVal (MvPolynomial.eval (x i) (P i)).val + ε := by |
| 487 | classical |
| 488 | -- Take `h₀` from the harmonic sum and move all coordinates, each with the loss |
| 489 | -- `δ = min ε 1 / (s₀ + 2)`, so that `δ < 1` and the total loss is at most `min ε 1`. |
| 490 | set δ : ℝ≥0 := min ε 1 / (s₀ + 2) |
| 491 | have h_pos : (0 : ℝ≥0) < s₀ + 2 := by positivity |
| 492 | have hδ_lt : δ < 1 := |
| 493 | (div_lt_one h_pos).2 ((min_le_right ε 1).trans_lt (one_lt_two.trans_le le_add_self)) |
| 494 | obtain ⟨h₀, h_harmonic⟩ : |
| 495 | ∃ h₀ : ℕ, β + 1 < δ * ∑ h ∈ radiusExponents ℓ ρ h₀, ((h : ℝ≥0) + 1)⁻¹ := |
| 496 | exists_lt_mul_sum_radiusExponents hρ (β + 1) (by positivity) |
| 497 | refine ⟨h₀, fun σ ι _ _ P x hσ_card hx hP ↦ ?_⟩ |
| 498 | have h_loss : (Fintype.card σ * δ : ℝ≥0) ≤ min ε 1 := |
| 499 | calc (Fintype.card σ * δ : ℝ≥0) ≤ (s₀ + 2) * δ := |
| 500 | mul_le_mul_left (le_add_right (mod_cast hσ_card)) δ |
| 501 | _ = min ε 1 := mul_div_cancel₀ (min ε 1) h_pos.ne' |
| 502 | obtain ⟨h_loss_ε, h_loss_one⟩ := le_min_iff.1 h_loss |
| 503 | obtain ⟨ζ, h_pow, h_val, h_each, -⟩ := |
| 504 | exists_ellVal_eval_piecewise_le_add hδ_lt h_harmonic h_loss_one P hx hP univ |
| 505 | refine ⟨ζ, fun j ↦ h_pow j (mem_univ j), fun j ↦ h_val j (mem_univ j), fun i ↦ ?_⟩ |
| 506 | calc ellVal (MvPolynomial.eval (fun j : σ ↦ ζ j - 1) (P i)).val |
| 507 | = ellVal (MvPolynomial.eval (univ.piecewise (fun j : σ ↦ ζ j - 1) (x i)) (P i)).val := by |
| 508 | rw [piecewise_univ] |
| 509 | _ ≤ ellVal (MvPolynomial.eval (x i) (P i)).val + Fintype.card σ * δ := h_each i |
| 510 | _ ≤ ellVal (MvPolynomial.eval (x i) (P i)).val + ε := add_le_add_right (mod_cast h_loss_ε) _ |
| 511 | |
| 512 | end New.Selmer |
| 513 | |
| 514 | end |