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 | public import Mathlib.NumberTheory.Padics.AddChar |
| 4 | import Mathlib.Algebra.Polynomial.Basis |
| 5 | import Mathlib.Algebra.Ring.IsFormallyReal |
| 6 | public import Mathlib.Topology.Algebra.Ring.Compact -- shake: keep (needed public by an exposed definition) |
| 7 | import Mathlib.Topology.Connected.Separation |
| 8 | import Mathlib.Topology.MetricSpace.Ultra.TotallySeparated |
| 9 | import TauCeti.RingTheory.Huber.Normed |
| 10 | public import Lib.ClassField.Places.ValuationSubrings |
| 11 | public import Lib.General.NumberTheory.CoefficientRings |
| 12 | public import Lib.PadicHodge.PeriodRings.AxTheorem |
| 13 | public import Lib.Cohomology.Etale.Basic |
| 14 | public import Lib.General.NumberTheory.ImaginaryQuadraticField |
| 15 | import Lib.PadicComparison.Descent.TestCategory |
| 16 | import Lib.PadicHodge.Crystalline.Basic |
| 17 | |
| 18 | /-! |
| 19 | # Roots of unity as limits and the ℓ-adic valuation |
| 20 | |
| 21 | The first section approximates the roots of unity ζ in ℂ_p with ζ^{q_p} = ζ by images of |
| 22 | integers of K = ℚ(√−d). The second collects properties of the ℓ-adic valuation and of coefficient |
| 23 | rings. |
| 24 | |
| 25 | * `quadInt d` is the ring of integers of K inside ℂ, and a `PadicPlace p` fixes a map ιₚ : ℂ → ℂ_p. |
| 26 | * `primeNorm d p` is the number q_p, equal to p² if the Legendre symbol `chiK d p` = (p/d) is −1 and |
| 27 | to p otherwise. |
| 28 | * v = `New.ellVal` is the normalised valuation on ℚ̄_ℓ = `PadicAlgCl ℓ`, truncated to 0 on elements |
| 29 | of norm at least 1, so that its values lie in [0, ∞]. |
| 30 | * O denotes a ring in `New.CoeffRing ℓ`: the ring of integers of a finite Galois extension of ℚ_ℓ |
| 31 | inside ℚ̄_ℓ. `ThePrime ℓ` says that ℓ is prime. |
| 32 | |
| 33 | ## Main definitions and results |
| 34 | |
| 35 | * `New.mem_normPairClosure_of_pow_eq`: an element `ζ` of `ℂ_p` with `ζ ^ q_p = ζ` is a |
| 36 | limit of images of integers `α` of `K`, in such a way that the image of `α ᾱ` tends to |
| 37 | `ζ ^ (p + 1)`. |
| 38 | * `New.CoeffRing.normLength`, `New.CoeffRing.normLength_addVal`: the rescaling of lengths of |
| 39 | O-modules that sends the additive valuation of x to v(x), so that they become comparable for |
| 40 | different O. |
| 41 | * `New.CoeffRing.eventually_exists_isPrimitiveRoot`: all large O hold a primitive k-th root of |
| 42 | unity. |
| 43 | |
| 44 | ## Relation to the literature |
| 45 | |
| 46 | Known result: Teichmüller representatives as limits of powers. Source: Serre, Local Fields, Chapter |
| 47 | II. |
| 48 | -/ |
| 49 | |
| 50 | @[expose] public section |
| 51 | |
| 52 | namespace New |
| 53 | |
| 54 | /-! |
| 55 | ## Roots of unity as limits of integers of `K` |
| 56 | |
| 57 | Proof idea: lift the residue of `ζ` to an integer `a` of `K` and take the powers `a ^ q_p ^ n`. |
| 58 | -/ |
| 59 | |
| 60 | section TeichmullerLimits |
| 61 | |
| 62 | open NumberField Complex IsLocalRing PadicInt QuadField AddChar ComplexConjugate |
| 63 | variable {p : ℕ} [hp : Fact p.Prime] |
| 64 | |
| 65 | /-- If `‖u - 1‖ < 1` in `ℂ_p` and `p ∣ q`, then `u ^ q ^ n` tends to `1` as `n → ∞`. -/ |
| 66 | lemma tendsto_pow_pow_of_norm_sub_one_lt {u : ℂ_[p]} (hu : ‖u - 1‖ < 1) {q : ℕ} (hq : p ∣ q) : |
| 67 | Filter.Tendsto (fun n : ℕ ↦ u ^ q ^ n) Filter.atTop (nhds 1) := by |
| 68 | -- `k ↦ u ^ k` extends to a continuous character `κ` of `ℤ_p`, the one attached to `u - 1`, |
| 69 | -- and `q ^ n → 0` in `ℤ_p`. The correspondence needs a bounded action of `ℤ_p` on `ℂ_p`. |
| 70 | let alg : Algebra ℤ_[p] ℂ_[p] := .compHom _ Coe.ringHom |
| 71 | let _ : SMul ℤ_[p] ℂ_[p] := alg.toSMul |
| 72 | have : IsBoundedSMul ℤ_[p] ℂ_[p] := |
| 73 | ⟨fun a ↦ dist_smul_pair a.val, fun a b ↦ dist_pair_smul a.val b.val⟩ |
| 74 | let κ : {κ : AddChar ℤ_[p] ℂ_[p] // Continuous κ} := |
| 75 | (continuousAddCharEquiv_of_norm_mul p ℂ_[p]).symm ⟨u - 1, hu⟩ |
| 76 | have hκ (k : ℕ) : κ.val k = u ^ k := by simpa [κ] using κ.val.map_nsmul_eq_pow k 1 |
| 77 | -- by continuity, `κ (q ^ n) → κ 0 = 1`, as `q ^ n → 0` |
| 78 | simpa [Function.comp_def, ← hκ] using (κ.prop.tendsto 0).comp |
| 79 | (tendsto_pow_atTop_nhds_zero_of_norm_lt_one (norm_natCast_lt_one_iff.mpr hq)) |
| 80 | |
| 81 | /-- A nonzero fixed point of the `q`-th power map, with `p ∣ q`, has norm one. -/ |
| 82 | private lemma norm_eq_one_of_pow_eq_self_of_dvd {q : ℕ} (hq : p ∣ q) {y : ℂ_[p]} |
| 83 | (hy_ne : y ≠ 0) (hy : y ^ q = y) : ‖y‖ = 1 := by |
| 84 | have hq_one : q ≠ 1 := fun h ↦ hp.out.not_dvd_one (h ▸ hq) |
| 85 | by_contra h_norm |
| 86 | apply hq_one |
| 87 | apply pow_right_injective₀ (norm_pos_iff.mpr hy_ne) h_norm |
| 88 | simpa only [norm_pow, pow_one] using congrArg norm hy |
| 89 | |
| 90 | /-- If `x` and `y` have the same residue in the valuation ring of `ℂ_p`, `p ∣ q`, and `y ^ q = y`, |
| 91 | then the powers `x ^ (q ^ n)` tend to `y`. -/ |
| 92 | lemma tendsto_pow_pow_of_residue_eq {q : ℕ} (hq : p ∣ q) {x y : valRingCp p} |
| 93 | (hxy : residue (valRingCp p) x = residue (valRingCp p) y) (hy : y.val ^ q = y.val) : |
| 94 | Filter.Tendsto (fun n : ℕ ↦ x.val ^ q ^ n) Filter.atTop (nhds y.val) := by |
| 95 | have h_sub : ‖x.val - y.val‖ < 1 := residue_eq_iff_valuation_sub_lt_one.1 hxy |
| 96 | obtain rfl | hy_ne := eq_or_ne y 0 |
| 97 | · -- A lift of zero has norm less than one, and the exponents tend to infinity. |
| 98 | have hq_ne : q ≠ 0 := fun h ↦ by simp [h] at hy |
| 99 | have h_small : ‖x.val‖ < 1 := by simpa using h_sub |
| 100 | have hq_gt : 1 < q := hp.out.one_lt.trans_le (Nat.le_of_dvd (Nat.pos_of_ne_zero hq_ne) hq) |
| 101 | exact (tendsto_pow_atTop_nhds_zero_of_norm_lt_one h_small).comp |
| 102 | (tendsto_pow_atTop_atTop_of_one_lt hq_gt) |
| 103 | have hy_val : y.val ≠ 0 := fun h ↦ hy_ne (Subtype.ext h) |
| 104 | have hy_norm := norm_eq_one_of_pow_eq_self_of_dvd hq hy_val hy |
| 105 | have hy_fixed (n : ℕ) : y.val ^ q ^ n = y.val := by |
| 106 | simpa using Function.iterate_fixed (f := (· ^ q)) hy n |
| 107 | have h_div : ‖x.val / y.val - 1‖ < 1 := by simpa [div_sub_one hy_val, hy_norm] using h_sub |
| 108 | simpa [div_pow, hy_fixed, hy_val] using |
| 109 | (tendsto_pow_pow_of_norm_sub_one_lt h_div hq).mul_const y.val |
| 110 | |
| 111 | variable (d : ℕ) [PrimeSevenModEight d] |
| 112 | |
| 113 | /-- The element `I * √d` lies in `quadInt d`. -/ |
| 114 | lemma I_mul_sqrt_mem_quadInt : I * √d ∈ quadInt d := ⟨sqrtNegDInt d, by simp [two_mul]⟩ |
| 115 | |
| 116 | /-- Let `p` be a prime, `d` a prime congruent to 7 modulo 8, and let `φ` map the integers of |
| 117 | `K = ℚ(√-d)` to a field of characteristic `p`. An element `z` with `z ^ q_p = z`, where |
| 118 | `q_p = primeNorm d p` is `p ^ 2` if the Legendre symbol `chiK d p = (p/d)` is `-1` and `p` |
| 119 | otherwise, is the image of an integer whose conjugate has the image `z ^ p`. -/ |
| 120 | lemma QuadField.exists_map_eq_and_map_star_eq_pow {k : Type*} [Field k] [CharP k p] |
| 121 | (φ : 𝓞 (QuadField d) →+* k) (z : k) (hz_pow : z ^ primeNorm d p = z) : |
| 122 | ∃ a : 𝓞 (QuadField d), φ a = z ∧ φ (star a) = z ^ p := by |
| 123 | -- The fixed points of Frobenius lie in the prime field, so they are images of integers. |
| 124 | have prime_field (x : k) (hx : frobenius k p x = x) : ∃ n : ℤ, n = x := |
| 125 | (mem_bot_iff_intCast p k).1 ((Subfield.mem_bot_iff_pow_eq_self _ p).2 hx) |
| 126 | rw [← frobenius_def] |
| 127 | obtain h_not_inert | h_inert := em' (chiK d p = -1) |
| 128 | · -- `q_p = p`: Frobenius fixes `z`, so a rational integer will do. |
| 129 | obtain ⟨n, rfl⟩ := prime_field z (by simpa [h_not_inert, frobenius_def] using hz_pow) |
| 130 | exact ⟨n, by simp⟩ |
| 131 | -- `q_p = p²`: Frobenius applied twice fixes `z`, and it acts as conjugation on `e = φ betaK`, |
| 132 | -- where `betaK = (1 + √-d) / 2`. We write `z = m + n e` with `m`, `n` fixed by Frobenius and take |
| 133 | -- `a = m + n betaK`. |
| 134 | have hp_ne_two : p ≠ 2 := fun h_two ↦ by simp [h_two, chiK_two] at h_inert |
| 135 | have hz : frobenius k p (frobenius k p z) = z := by |
| 136 | simpa [h_inert, frobenius_def, sq, pow_mul] using hz_pow |
| 137 | have he : frobenius k p (φ (betaK d)) = 1 - φ (betaK d) := by |
| 138 | rw [frobenius_def, ← pow_one p, eq_comm, eq_map_betaK_pow_iff hp_ne_two, h_inert, |
| 139 | show φ (sqrtNegDInt d) = 2 * φ (betaK d) - 1 by simp [map_ofNat]] |
| 140 | ring |
| 141 | -- `2 e - 1`, a square root of `-d`, has the `(p - 1)`-st power `-1`, so it is not `0`. |
| 142 | have hδ_ne : 2 * φ (betaK d) - 1 ≠ 0 := fun h_zero ↦ by |
| 143 | simpa [h_inert, h_zero, map_ofNat, Nat.sub_ne_zero_of_lt hp.out.one_lt] |
| 144 | using chiK_eq_pow_of_sq_eq_neg hp_ne_two (map_sqrtNegDInt_sq φ) |
| 145 | -- Frobenius negates both `z - z ^ p` and `2 e - 1`, so it fixes their quotient `n`. |
| 146 | have hδ_frob : frobenius k p (2 * φ (betaK d) - 1) = -(2 * φ (betaK d) - 1) := by |
| 147 | rw [map_sub, map_mul, map_one, he, map_ofNat] |
| 148 | ring |
| 149 | obtain ⟨n, hn⟩ : ∃ n : ℤ, n = (z - frobenius k p z) / (2 * φ (betaK d) - 1) := |
| 150 | prime_field _ (by rw [map_div₀, map_sub, hz, hδ_frob, div_neg, ← neg_div, neg_sub]) |
| 151 | rw [eq_div_iff hδ_ne] at hn |
| 152 | -- Frobenius sends `z - n e` to `z ^ p - n (1 - e)`, and `z - z ^ p = n (2 e - 1)`. |
| 153 | obtain ⟨m, hm⟩ : ∃ m : ℤ, m = z - n * φ (betaK d) := prime_field _ <| by |
| 154 | rw [map_sub, map_mul, map_intCast, he] |
| 155 | linear_combination hn |
| 156 | -- Frobenius sends `z` to `z - n (2 e - 1)`, which is `m + n (1 - e)`, the image of `star a`. |
| 157 | have h_frob_z : frobenius k p z = m + n * (1 - φ (betaK d)) := by linear_combination hn - hm |
| 158 | exact ⟨m + n * betaK d, by simp [hm], by simp [h_frob_z, star_add, star_mul']⟩ |
| 159 | |
| 160 | variable [PadicPlace p] |
| 161 | |
| 162 | omit [PrimeSevenModEight d] in |
| 163 | /-- The image of `I * √d` under `ιₚ` squares to `-d`. -/ |
| 164 | lemma map_I_mul_sqrt_sq : ιₚ (I * √d) ^ 2 = -d := by |
| 165 | simpa using congrArg (fun w : QuadField d ↦ ιₚ (w : ℂ)) (sqrtNegD_sq d) |
| 166 | |
| 167 | /-- The closure in `ℂ_p²` of the set of images under `ιₚ` of the pairs `(α, α ᾱ)`, with `α` an |
| 168 | integer of `K = ℚ(√-d)`. -/ |
| 169 | noncomputable def normPairClosure : Set (ℂ_[p] × ℂ_[p]) := |
| 170 | closure {(ιₚ a, ιₚ (a * conj a)) | a ∈ quadInt d} |
| 171 | |
| 172 | /-- If `ζ` is an element of `ℂ_p` with `ζ ^ q_p = ζ`, where `q_p = primeNorm d p` |
| 173 | (`p ^ 2` if `chiK d p = -1`, else `p`), then `(ζ, ζ ^ (p + 1))` lies in `normPairClosure d`: it is a |
| 174 | limit of images under `ιₚ` of pairs `(α, α ᾱ)` with `α` an integer of `K = ℚ(√-d)`. -/ |
| 175 | lemma mem_normPairClosure_of_pow_eq {ζ : ℂ_[p]} (hζ_pow : ζ ^ primeNorm d p = ζ) : |
| 176 | (ζ, ζ ^ (p + 1)) ∈ normPairClosure d := by |
| 177 | obtain rfl | hζ_ne := eq_or_ne ζ 0 |
| 178 | · exact subset_closure ⟨0, (quadInt d).zero_mem, by simp⟩ |
| 179 | set q := primeNorm d p |
| 180 | have hq : p ∣ q := by simp [q, apply_ite] |
| 181 | have hζ_norm := norm_eq_one_of_pow_eq_self_of_dvd hq hζ_ne hζ_pow |
| 182 | -- Lift the residue of `ζ` to an integer `a` of `K` whose conjugate lifts that of `ζ ^ p`. |
| 183 | let φ : 𝓞 (QuadField d) →+* valRingCp p := |
| 184 | ((ιₚ.domRestrict (QuadField d)).comp (algebraMap _ _)).codRestrict (valRingCp p) |
| 185 | (norm_ringOfIntegers_le (ιₚ.domRestrict (QuadField d))) |
| 186 | let z : valRingCp p := ⟨ζ, hζ_norm.le⟩ |
| 187 | obtain ⟨a, ha, ha_star⟩ := exists_map_eq_and_map_star_eq_pow d |
| 188 | ((residue (valRingCp p)).comp φ) (residue _ z) |
| 189 | ((map_pow (residue _) z _).symm.trans (congrArg _ (Subtype.ext hζ_pow))) |
| 190 | have lim_a := tendsto_pow_pow_of_residue_eq hq ha hζ_pow |
| 191 | have hz_p_pow : (z ^ p).val ^ q = (z ^ p).val := by |
| 192 | change (ζ ^ p) ^ q = ζ ^ p |
| 193 | rw [pow_right_comm, hζ_pow] |
| 194 | have lim_star := tendsto_pow_pow_of_residue_eq hq ha_star hz_p_pow |
| 195 | refine mem_closure_iff_seq_limit.2 ⟨_, fun n ↦ ⟨_, ⟨a ^ q ^ n, rfl⟩, rfl⟩, ?_⟩ |
| 196 | simpa [φ, RingHom.codRestrict, pow_succ'] using lim_a.prodMk_nhds (lim_a.mul lim_star) |
| 197 | |
| 198 | end TeichmullerLimits |
| 199 | |
| 200 | /-! |
| 201 | ## The normalised ℓ-adic valuation and normalised lengths |
| 202 | |
| 203 | We have v(x) = −log_ℓ |x| for |x| ≤ 1, with v(ℓ) = 1 and v(0) = ∞, and v(x) = 0 for |x| ≥ 1. |
| 204 | By this truncation, v is in general only subadditive on products (`New.ellVal_mul_le`). Each O is an |
| 205 | instance of `New.PadicIntegerRing`; in particular O/x is finite for x ≠ 0. |
| 206 | -/ |
| 207 | |
| 208 | section Valuation |
| 209 | |
| 210 | open IsDiscreteValuationRing Real ENNReal NeZero |
| 211 | |
| 212 | variable {ℓ : ℕ} [ThePrime ℓ] {O : CoeffRing ℓ} {x y : PadicAlgCl ℓ} {c : NNReal} |
| 213 | |
| 214 | /-! ### The valuation on ℚ̄_ℓ -/ |
| 215 | |
| 216 | /-- For `x`, `y` in ℚ̄_ℓ with `‖y‖ ≤ 1` and a real `c ≥ 0`, the inequality v(x) ≤ c + v(y) means |
| 217 | `ℓ ^ (-c) * ‖y‖ ≤ ‖x‖`, where v = `ellVal` is the normalised valuation. -/ |
| 218 | lemma ellVal_le_add_iff (hy : ‖y‖ ≤ 1) : |
| 219 | ellVal x ≤ c + ellVal y ↔ ℓ ^ (-c.toReal) * ‖y‖ ≤ ‖x‖ := by |
| 220 | have hℓ : (1 : ℝ) < ℓ := mod_cast (Fact.out : ℓ.Prime).one_lt |
| 221 | -- the cases `y = 0` and `x = 0` are immediate |
| 222 | obtain rfl | hy_ne := eq_or_ne y 0 |
| 223 | · simp [ellVal] |
| 224 | have hy_pos : 0 < ‖y‖ := norm_pos_iff.2 hy_ne |
| 225 | obtain rfl | hx_ne := eq_or_ne x 0 |
| 226 | · simpa [ellVal, hy_ne] using (by positivity : 0 < (ℓ : ℝ) ^ (-c.toReal) * ‖y‖) |
| 227 | -- away from `0`, take logarithms in base `ℓ` |
| 228 | have hy_log : 0 ≤ -logb ℓ ‖y‖ := neg_nonneg.2 (logb_nonpos hℓ hy_pos.le hy) |
| 229 | have h_val : ellVal x ≤ c + ellVal y ↔ -logb ℓ ‖x‖ ≤ c.toReal + -logb ℓ ‖y‖ := by |
| 230 | simp [ellVal, hx_ne, hy_ne, ofReal_le_iff_le_toReal, toReal_add, toReal_ofReal hy_log] |
| 231 | rw [h_val, ← le_div_iff₀ hy_pos, ← le_logb_iff_rpow_le hℓ (by positivity), |
| 232 | logb_div (by simpa) hy_pos.ne'] |
| 233 | grind |
| 234 | |
| 235 | /-- For `c ≥ 0`, the inequality v(x) ≤ c means `ℓ ^ (-c) ≤ ‖x‖`, where v = `ellVal`. -/ |
| 236 | lemma ellVal_le_iff : ellVal x ≤ c ↔ ℓ ^ (-c.toReal) ≤ ‖x‖ := by |
| 237 | simpa [ellVal] using ellVal_le_add_iff norm_one.le |
| 238 | |
| 239 | /-- An upper bound `c` for the normalised valuation of `x` gives the lower bound |
| 240 | `exp (-(c * log ℓ))` for its norm. -/ |
| 241 | lemma exp_neg_mul_log_le_norm_of_ellVal_le (h : ellVal x ≤ c) : |
| 242 | exp (-(c * log ℓ)) ≤ ‖x‖ := by |
| 243 | calc exp (-(c * log ℓ)) = (ℓ : ℝ) ^ (-(c : ℝ)) := by |
| 244 | simp [rpow_def_of_pos, NeZero.pos, mul_comm] |
| 245 | _ ≤ ‖x‖ := ellVal_le_iff.1 h |
| 246 | |
| 247 | /-- The truncated valuation compares norms in reverse order after capping the norm of `y` at one. |
| 248 | When `‖y‖ ≥ 1` its valuation is zero, so the comparison asks whether `‖x‖ ≥ 1` as well. -/ |
| 249 | lemma ellVal_le_ellVal_iff : ellVal x ≤ ellVal y ↔ min ‖y‖ 1 ≤ ‖x‖ := by |
| 250 | obtain hy | hy := le_total ‖y‖ 1 |
| 251 | · simpa [min_eq_left hy] using (ellVal_le_add_iff (x := x) (c := 0) hy) |
| 252 | have zero_iff (z : PadicAlgCl ℓ) : ellVal z = 0 ↔ 1 ≤ ‖z‖ := by |
| 253 | simpa using (ellVal_le_iff (x := z) (c := 0)) |
| 254 | simp [min_eq_right hy, (zero_iff y).2 hy, zero_iff] |
| 255 | |
| 256 | /-- For `x`, `y` in `intQpBar ℓ`, the valuation ring of ℚ̄_ℓ, `x` divides `y` exactly if |
| 257 | v(x) ≤ v(y), where v = `ellVal` is the normalised valuation. -/ |
| 258 | lemma Selmer.dvd_iff_ellVal_le {x y : intQpBar ℓ} : x ∣ y ↔ ellVal x.val ≤ ellVal y.val := by |
| 259 | rw [ellVal_le_ellVal_iff, min_eq_left (show ‖y.val‖ ≤ 1 from y.prop)] |
| 260 | exact (Valuation.integer.integers _).dvd_iff_le |
| 261 | |
| 262 | /-- The valuation v = `ellVal` is antitone in the norm: if `‖y‖ ≤ ‖x‖`, then v(x) ≤ v(y). -/ |
| 263 | lemma ellVal_le_ellVal (h_le : ‖y‖ ≤ ‖x‖) : ellVal x ≤ ellVal y := |
| 264 | ellVal_le_ellVal_iff.2 ((min_le_left _ _).trans h_le) |
| 265 | |
| 266 | /-- For nonzero factors, truncate the sum of their signed valuations at zero. -/ |
| 267 | private lemma ellVal_mul_of_ne_zero (hx : x ≠ 0) (hy : y ≠ 0) : |
| 268 | ellVal (x * y) = ENNReal.ofReal (-logb ℓ ‖x‖ + -logb ℓ ‖y‖) := by |
| 269 | have hx_norm : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx |
| 270 | have hy_norm : ‖y‖ ≠ 0 := norm_ne_zero_iff.mpr hy |
| 271 | rw [ellVal, norm_mul, ite_eq_right (mul_ne_zero hx_norm hy_norm), |
| 272 | logb_mul hx_norm hy_norm, neg_add] |
| 273 | |
| 274 | /-- The normalised valuation v = `ellVal` on ℚ̄_ℓ (v(x) is the positive part of −log_ℓ ‖x‖, and v(0) |
| 275 | = ∞) is subadditive on products: v(xy) ≤ v(x) + v(y). -/ |
| 276 | lemma ellVal_mul_le : ellVal (x * y) ≤ ellVal x + ellVal y := by |
| 277 | -- if a factor is `0`, the right side is `∞` |
| 278 | obtain rfl | hx := eq_or_ne x 0 |
| 279 | · simp [ellVal] |
| 280 | obtain rfl | hy := eq_or_ne y 0 |
| 281 | · simp [ellVal] |
| 282 | rw [ellVal_mul_of_ne_zero hx hy] |
| 283 | -- for nonzero arguments this is subadditivity of the positive part, applied to logarithms |
| 284 | simpa [ellVal, hx, hy] using (ofReal_add_le (p := -logb ℓ ‖x‖) (q := -logb ℓ ‖y‖)) |
| 285 | |
| 286 | /-- The truncated valuation is additive on products when both factors have norm at most one. -/ |
| 287 | lemma Selmer.ellVal_mul_eq_add_of_norm_le_one (hx : ‖x‖ ≤ 1) (hy : ‖y‖ ≤ 1) : |
| 288 | ellVal (x * y) = ellVal x + ellVal y := by |
| 289 | obtain rfl | hx_ne := eq_or_ne x 0 |
| 290 | · simp [ellVal] |
| 291 | obtain rfl | hy_ne := eq_or_ne y 0 |
| 292 | · simp [ellVal] |
| 293 | have hℓ : (1 : ℝ) < ℓ := mod_cast (Fact.out : ℓ.Prime).one_lt |
| 294 | have h_nonneg (z : PadicAlgCl ℓ) (hz : ‖z‖ ≤ 1) : 0 ≤ -logb ℓ ‖z‖ := |
| 295 | neg_nonneg.2 (logb_nonpos hℓ (norm_nonneg z) hz) |
| 296 | rw [ellVal_mul_of_ne_zero hx_ne hy_ne] |
| 297 | simpa [ellVal, hx_ne, hy_ne] using ofReal_add (h_nonneg x hx) (h_nonneg y hy) |
| 298 | |
| 299 | /-- The normalised valuation `ellVal` of `x ^ k` is `k` times that of `x`. -/ |
| 300 | @[simp] |
| 301 | lemma ellVal_pow (k : ℕ) : ellVal (x ^ k) = k * ellVal x := by |
| 302 | obtain rfl | hk := eq_or_ne k 0 |
| 303 | · simp [ellVal] |
| 304 | obtain rfl | hx_ne := eq_or_ne x 0 |
| 305 | · simp [ellVal, hk] |
| 306 | · simp [← mul_neg, ellVal, logb_pow, hx_ne] |
| 307 | |
| 308 | /-- The normalised valuation of a nonzero natural number `n` in ℚ̄_ℓ is its ℓ-adic valuation. -/ |
| 309 | lemma ellVal_natCast {n : ℕ} (hn : n ≠ 0) : ellVal (ℓ := ℓ) n = padicValNat ℓ n := by |
| 310 | have h_norm : ‖(n : PadicAlgCl ℓ)‖ = ‖(n : ℚ_[ℓ])‖ := mod_cast PadicAlgCl.norm_extends ℓ n |
| 311 | simp [hn, h_norm, Padic.norm_eq_zpow_neg_valuation, ellVal, logb_pow, Fact.out, NeZero.ne, |
| 312 | Nat.padicValNat_def] |
| 313 | |
| 314 | /-- The normalised valuation `ellVal` of `ℓ` is `1`. -/ |
| 315 | @[simp] |
| 316 | lemma ellVal_ell : ellVal (ℓ : PadicAlgCl ℓ) = 1 := by |
| 317 | simp [norm_p_eq_inv, ellVal, NeZero.ne, Fact.out] |
| 318 | |
| 319 | /-- For each nonzero order, `ℚ̄_ℓ` has a primitive root of unity of norm `1`. -/ |
| 320 | lemma exists_isPrimitiveRoot_norm_eq_one (n : ℕ) [NeZero n] : |
| 321 | ∃ ζ : PadicAlgCl ℓ, IsPrimitiveRoot ζ n ∧ ‖ζ‖ = 1 := by |
| 322 | obtain ⟨ζ, hζ⟩ := HasEnoughRootsOfUnity.exists_isPrimitiveRoot (PadicAlgCl ℓ) n |
| 323 | exact ⟨ζ, hζ, (hζ.isOfFinOrder (NeZero.ne n)).norm_eq_one⟩ |
| 324 | |
| 325 | namespace CoeffRing |
| 326 | |
| 327 | /-! ### Coefficient rings: units, lengths, roots of unity and finite quotients -/ |
| 328 | |
| 329 | variable (O) in |
| 330 | /-- A chosen uniformiser of the discrete valuation ring `O`. -/ |
| 331 | protected noncomputable def uniformizer : ↑O := (exists_irreducible O).choose |
| 332 | |
| 333 | variable (O) in |
| 334 | /-- The chosen uniformiser of `O` is irreducible. -/ |
| 335 | lemma irreducible_uniformizer : Irreducible O.uniformizer := (exists_irreducible O).choose_spec |
| 336 | |
| 337 | /-- Normalised length: the additive map sending n to n·v(ϖ) and ∞ to ∞, where ϖ is the chosen |
| 338 | uniformiser `O.uniformizer` and v(ℓ) = 1. -/ |
| 339 | noncomputable def normLength : ℕ∞ →+ ℝ≥0∞ := |
| 340 | AddMonoidHom.ENatMap |
| 341 | { toFun n := n * (-logb ℓ ‖O.uniformizer.val‖).toNNReal |
| 342 | map_zero' := by simp |
| 343 | map_add' := by simp [add_mul] } |
| 344 | |
| 345 | /-- The normalised length of `∞` is `∞`. -/ |
| 346 | lemma normLength_top : O.normLength ⊤ = ∞ := rfl |
| 347 | |
| 348 | /-- The normalised length of `n` is `-n log_ℓ ‖ϖ‖`, with `ϖ` the chosen uniformiser of `O`. -/ |
| 349 | lemma normLength_natCast (n : ℕ) : |
| 350 | O.normLength n = n * ENNReal.ofReal (-logb ℓ ‖O.uniformizer.val‖) := rfl |
| 351 | |
| 352 | /-- Let `O` be a coefficient ring, the ring of integers of a finite Galois extension of ℚ_ℓ inside |
| 353 | ℚ̄_ℓ, with chosen uniformiser ϖ. For x ∈ O, let `addVal O x` be the number of factors of ϖ in x, and |
| 354 | let the normalised length `normLength` send n to n·v(ϖ) (and ∞ to ∞). Then the normalised length of |
| 355 | `addVal O x` equals v(x), where v = `ellVal` equals −log_ℓ|·| on elements of ℚ̄_ℓ of norm ≤ 1, |
| 356 | normalised by v(ℓ) = 1. -/ |
| 357 | @[simp] |
| 358 | lemma normLength_addVal (x : ↑O) : O.normLength (addVal O x) = ellVal x.val := by |
| 359 | have hϖ : Irreducible O.uniformizer := O.irreducible_uniformizer |
| 360 | obtain rfl | hx := eq_or_ne x 0 |
| 361 | · simp [ellVal, normLength_top] |
| 362 | -- `x = u * ϖ ^ n` with `‖u‖ = 1`, and both sides are `n` times the valuation of `ϖ` |
| 363 | obtain ⟨n, u, rfl⟩ := eq_unit_mul_pow_irreducible hx hϖ |
| 364 | have hu_norm : ‖(u : ↑O).val‖ = 1 := (isUnit_iff_norm_eq_one _).1 u.isUnit |
| 365 | have h_ellVal : ellVal (u * O.uniformizer ^ n : ↑O).val = |
| 366 | n * ENNReal.ofReal (-logb ℓ ‖O.uniformizer.val‖) := by |
| 367 | simp [← mul_neg, hϖ.ne_zero, hu_norm, ellVal, logb_pow] |
| 368 | rw [addVal_def' u hϖ n, h_ellVal, normLength_natCast] |
| 369 | |
| 370 | /-- The normalised length of `k * g` is `k` times that of `g`, for `k` a natural number. -/ |
| 371 | @[simp] |
| 372 | lemma normLength_natCast_mul (k : ℕ) (g : ℕ∞) : O.normLength (k * g) = k * O.normLength g := by |
| 373 | simp [← nsmul_eq_mul] |
| 374 | |
| 375 | /-- The normalised length is monotone. -/ |
| 376 | @[gcongr] |
| 377 | lemma normLength_mono : Monotone O.normLength := fun a b hab ↦ by |
| 378 | obtain ⟨c, rfl⟩ := le_iff_exists_add.1 hab |
| 379 | simp |
| 380 | |
| 381 | /-- For `k ≠ 0`, all coefficient rings `O` (rings of integers of finite Galois extensions of ℚ_ℓ |
| 382 | inside ℚ̄_ℓ) that are sufficiently large with respect to inclusion contain a primitive `k`-th root |
| 383 | of unity. -/ |
| 384 | lemma eventually_exists_isPrimitiveRoot (k : ℕ) [NeZero k] : |
| 385 | ∀ᶠ O : CoeffRing ℓ in Filter.atTop, ∃ ζ : ↑O, IsPrimitiveRoot ζ k := by |
| 386 | obtain ⟨ζ, hζ, h_norm⟩ := exists_isPrimitiveRoot_norm_eq_one (ℓ := ℓ) k |
| 387 | -- A root of unity has norm `1`, so it lies in all large enough `O`. |
| 388 | filter_upwards [eventually_mem h_norm.le] with O hO |
| 389 | exact ⟨⟨ζ, hO⟩, .coe_submonoidClass_iff.1 hζ⟩ |
| 390 | |
| 391 | /-- A coefficient ring is an ℓ-adic integer ring; its quotients by nonzero ideals are finite, as |
| 392 | these ideals are open and the ring is compact. -/ |
| 393 | noncomputable instance : PadicIntegerRing O ℓ where |
| 394 | finiteQuotient hI := AddSubgroup.quotient_finite_of_isOpen _ (isOpen_iff.mpr hI) |
| 395 | |
| 396 | end CoeffRing |
| 397 | |
| 398 | end Valuation |
| 399 | |
| 400 | end New |