🏛️ Atlas✒️Formalizations.NumberTheory.NumberField.InvariantOrders.ConjugatePowers view on GitHub ↗40 theorems
/-Copyright (c) 2026 Carles Marín. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles Marín-/module public import Mathlib.Algebra.Ring.Autpublic import Mathlib.Algebra.Ring.Subring.Basicpublic import Mathlib.Algebra.BigOperators.Group.Finset.Basicpublic import Mathlib.Algebra.BigOperators.Group.Finset.Lemmaspublic import Mathlib.Algebra.BigOperators.Fieldpublic import Mathlib.Algebra.Field.Basicpublic import Mathlib.Data.Int.GCDpublic import Mathlib.Data.Nat.Prime.Basicpublic import Mathlib.Data.Fintype.Cardpublic import Mathlib.Tactic.Ringpublic import Mathlib.Tactic.FieldSimppublic import Mathlib.Tactic.LinearCombinationpublic import Mathlib.RingTheory.Valuation.Basicpublic import Mathlib.Algebra.Ring.GeomSumpublic import Mathlib.Algebra.Ring.Action.Basicpublic import Mathlib.Algebra.Polynomial.AlgebraMappublic import Mathlib.Data.ENat.Basicpublic import Mathlib.RingTheory.Int.Basic /-!# Further questions of Louboutin: cyclic prime degree, powers of `α`, and a quintic unit Abstract models; no number field is constructed.* Cyclic prime degree: `K` a field, `σ ∈ RingAut K` with `σ^ℓ = 1`, `ℓ` an odd prime,  `O = ℤ[α]` stable under `σ`, `σα ≠ α`; `N(x) = ∏_{h<ℓ} σʰx`, `IsU O x` for "`x ∈ O^×`",  `d_k = σᵏα − α`. The ratios `(σⁱα − σʲα)/d₁` are units for `i ≢ j`; `η = d₂/d₁` satisfies  `η − 1 = σ(d₁)/d₁`, `1 − η ∈ O^×`, `N(η − 1) = 1`, `N(1 − η) = −1`; for every ring hom from `O`  to a finite field `F`, `ℓ ≤ |F|`, and if `|F| = pᶠ` with `p < ℓ` and `f ∣ ℓ` then `f = ℓ`.* Powers of `α`: `N` a commutative ring with a group `G` acting by ring automorphisms and an  additive valuation `v` (`v x = ⊤ → x = 0`); if `0 < v(gα)` for all `g`, `gα ≠ α` for some `g`  and `k ≥ 2`, then `ℤ[conj αᵏ] ≠ ℤ[conj α]`. For `α³ − Cα + C = 0`, `C = C'² + C' + 7`:  `ℤ[conj αᵏ] = ℤ[conj α]` iff `k = 1`.* A quintic unit: `ε = ζᵃw` with `ζ⁵ = 1`, complex conjugation `c` with `c·ζ = ζ⁴`, `c·w = w`,  `5 ∤ a`, norm `1`: `ℤ[conj εᵏ] = ℤ[ζ]` for every `k` with `5 ∤ k`. ## Main results * `Louboutin.SeccionSeis.lem_ratios`, `Louboutin.SeccionSeis.cor_inert`.* `Louboutin.SeccionSeis.prop_val`, `Louboutin.SeccionSeis.prop_val_poly`,  `Louboutin.SeccionSeis.cor_q25`.* `Louboutin.SeccionSeis.prop_c27`. ## References * S. R. Louboutin, *On the order generated by the conjugates of an algebraic integer*, in:  Algebra, Logic and Number Theory, Banach Center Publ. 121 (2020), 107–124, doi:10.4064/bc121-10.* S. R. Louboutin, *When is the order generated by a cubic, quartic or quintic algebraic unit Galois  invariant: three conjectures*, Czechoslovak Math. J. 70 (2020), 905–919,  doi:10.21136/CMJ.2020.0019-19.* C. Marín, *Orders generated by conjugates of Galois quartic integers*, preprint (2026).-/ @[expose] public section namespace Louboutin.SeccionSeis open Finset /-! ## Cyclic fields of odd prime degree: lem:ratios and cor:inert -/ section ratios variable {K : Type*} [Field K] theorem pow_apply_add (σ : RingAut K) (m n : ℕ) (x : K) :    (σ ^ (m + n)) x = (σ ^ m) ((σ ^ n) x) := by  rw [pow_add]; rfl theorem pow_succ_apply (σ : RingAut K) (n : ℕ) (x : K) : (σ ^ (n + 1)) x = (σ ^ n) (σ x) := by  rw [pow_succ]; rfl /-- The norm N_{K/ℚ}(x) = ∏_{h<ℓ} σʰ(x) of a cyclic extension of degree ℓ generated by σ. -/def nrm (σ : RingAut K) (ℓ : ℕ) (x : K) : K := ∏ h ∈ range ℓ, (σ ^ h) x /-- `x ∈ O^×`: x is a nonzero element of O whose inverse lies in O. -/def IsU (O : Subring K) (x : K) : Prop := x ≠ 0 ∧ x ∈ O ∧ x⁻¹ ∈ O variable (σ : RingAut K) (ℓ : ℕ) theorem nrm_mul (x y : K) : nrm σ ℓ (x * y) = nrm σ ℓ x * nrm σ ℓ y := by  simp [nrm, map_mul, prod_mul_distrib] theorem nrm_inv (x : K) : nrm σ ℓ x⁻¹ = (nrm σ ℓ x)⁻¹ := by  simp [nrm, map_inv₀, prod_inv_distrib] theorem nrm_ne_zero {x : K} (hx : x ≠ 0) : nrm σ ℓ x ≠ 0 :=  prod_ne_zero_iff.mpr fun h _ => (map_ne_zero (σ ^ h)).mpr hx theorem nrm_neg_one : nrm σ ℓ (-1) = (-1) ^ ℓ := by  simp [nrm] theorem nrm_apply (hℓ1 : σ ^ ℓ = 1) (x : K) : nrm σ ℓ (σ x) = nrm σ ℓ x := by  unfold nrm  simp_rw [← pow_succ_apply]  rcases ℓ with _ | n  · simp  · rw [prod_range_succ (fun h => (σ ^ (h + 1)) x), prod_range_succ' (fun h => (σ ^ h) x), hℓ1]    simp theorem nrm_pow_apply (hℓ1 : σ ^ ℓ = 1) (k : ℕ) (x : K) : nrm σ ℓ ((σ ^ k) x) = nrm σ ℓ x := by  induction k with  | zero => simp  | succ k ih =>    rw [show σ ^ (k + 1) = σ * σ ^ k from pow_succ' σ k]    exact (nrm_apply σ ℓ hℓ1 _).trans ih variable {σ ℓ} theorem pow_mem_of_stab {O : Subring K} (hst : ∀ x ∈ O, σ x ∈ O) (n : ℕ) {x : K} (hx : x ∈ O) :    (σ ^ n) x ∈ O := by  induction n with  | zero => simpa using hx  | succ n ih =>    rw [show σ ^ (n + 1) = σ * σ ^ n from pow_succ' σ n]    exact hst _ ih theorem IsU.mul {O : Subring K} {x y : K} (hx : IsU O x) (hy : IsU O y) : IsU O (x * y) :=  ⟨mul_ne_zero hx.1 hy.1, O.mul_mem hx.2.1 hy.2.1, by    rw [mul_inv]; exact O.mul_mem hx.2.2 hy.2.2⟩ theorem IsU.neg {O : Subring K} {x : K} (hx : IsU O x) : IsU O (-x) :=  ⟨neg_ne_zero.mpr hx.1, O.neg_mem hx.2.1, by rw [inv_neg]; exact O.neg_mem hx.2.2⟩ theorem IsU.pow_apply {O : Subring K} (hst : ∀ x ∈ O, σ x ∈ O) (n : ℕ) {x : K} (hx : IsU O x) :    IsU O ((σ ^ n) x) :=  ⟨(map_ne_zero (σ ^ n)).mpr hx.1, pow_mem_of_stab hst n hx.2.1, by    rw [← map_inv₀]; exact pow_mem_of_stab hst n hx.2.2⟩ theorem IsU.isUnit {O : Subring K} {x : K} (hx : IsU O x) : IsUnit (⟨x, hx.2.1⟩ : O) :=  ⟨⟨⟨x, hx.2.1⟩, ⟨x⁻¹, hx.2.2⟩, Subtype.ext (mul_inv_cancel₀ hx.1),    Subtype.ext (inv_mul_cancel₀ hx.1)⟩, rfl⟩ /-- If u ∈ O and N(u) = ±1 then u⁻¹ = ±∏_{h=1}^{ℓ-1} σʰu ∈ O (O σ-stable). -/theorem IsU.of_nrm {O : Subring K} (hst : ∀ x ∈ O, σ x ∈ O) (hℓ : 1 ≤ ℓ) {u : K} (hu : u ∈ O)    (hN : nrm σ ℓ u = 1 ∨ nrm σ ℓ u = -1) : IsU O u := by  obtain ⟨n, rfl⟩ : ∃ n, ℓ = n + 1 := ⟨ℓ - 1, by omega⟩  have hP : (∏ h ∈ range n, (σ ^ (h + 1)) u) ∈ O :=    O.prod_mem fun h _ => pow_mem_of_stab hst _ hu  have hsplit : nrm σ (n + 1) u = u * ∏ h ∈ range n, (σ ^ (h + 1)) u := by    rw [nrm, prod_range_succ']; simp [mul_comm]  have hu0 : u ≠ 0 := by    rintro rfl    rcases hN with h | h <;> simp [hsplit] at h  refine ⟨hu0, hu, ?_⟩  rcases hN with h | h  · rw [inv_eq_of_mul_eq_one_right (hsplit ▸ h)]; exact hP  · rw [inv_eq_of_mul_eq_one_right (b := -∏ h ∈ range n, (σ ^ (h + 1)) u)      (by rw [mul_neg, ← hsplit, h, neg_neg])]    exact O.neg_mem hP variable (σ) in/-- d_k = σᵏα − α. -/def dd (α : K) (k : ℕ) : K := (σ ^ k) α - α /-- For O = ℤ[α] σ-stable and τ = σᵏ: τz − z ∈ d_k·O for every z ∈ O. -/theorem sub_mem_dd {O : Subring K} {α : K} (hO : O = Subring.closure {α})    (hst : ∀ x ∈ O, σ x ∈ O) (k : ℕ) {z : K} (hz : z ∈ O) :    ∃ q ∈ O, (σ ^ k) z - z = dd σ α k * q := by  rw [hO] at hz  induction hz using Subring.closure_induction with  | mem x hx =>    rw [Set.mem_singleton_iff.mp hx]    exact ⟨1, O.one_mem, by simp [dd]⟩  | zero => exact ⟨0, O.zero_mem, by simp⟩  | one => exact ⟨0, O.zero_mem, by simp⟩  | add x y _ _ hx hy =>    obtain ⟨q₁, h₁, e₁⟩ := hx    obtain ⟨q₂, h₂, e₂⟩ := hy    exact ⟨q₁ + q₂, O.add_mem h₁ h₂, by rw [map_add]; linear_combination e₁ + e₂⟩  | neg x _ hx =>    obtain ⟨q, h, e⟩ := hx    exact ⟨-q, O.neg_mem h, by rw [map_neg]; linear_combination -e⟩  | mul x y hxO hyO hx hy =>    obtain ⟨q₁, h₁, e₁⟩ := hx    obtain ⟨q₂, h₂, e₂⟩ := hy    have hyO' : y ∈ O := hO ▸ hyO    have hxO' : x ∈ O := hO ▸ hxO    refine ⟨q₁ * (σ ^ k) y + x * q₂,      O.add_mem (O.mul_mem h₁ (pow_mem_of_stab hst k hyO')) (O.mul_mem hxO' h₂), ?_⟩    rw [map_mul]; linear_combination (σ ^ k) y * e₁ + x * e₂ theorem alpha_mem {O : Subring K} {α : K} (hO : O = Subring.closure {α}) : α ∈ O := by  rw [hO]; exact Subring.subset_closure (Set.mem_singleton α) /-! Generic telescoping for an automorphism τ (later τ = σᵏ), e = τα − α. -/ section tele variable {O : Subring K} {α : K} (τ : RingAut K) /-- τ(e)/e ∈ O. -/theorem step_mem (hO : O = Subring.closure {α}) (hst : ∀ x ∈ O, τ x ∈ O) (he : τ α - α ≠ 0) :    τ (τ α - α) / (τ α - α) ∈ O := by  obtain ⟨q, hq, e⟩ := sub_mem_dd hO hst 1 (hst _ (alpha_mem hO))  simp only [dd, pow_one] at e  rw [map_sub, e, mul_div_cancel_left₀ _ he]; exact hq /-- N(τ(e)/e) = 1. -/theorem nrm_step {ℓ : ℕ} (hτℓ : τ ^ ℓ = 1) (he : τ α - α ≠ 0) :    nrm τ ℓ (τ (τ α - α) / (τ α - α)) = 1 := by  rw [div_eq_mul_inv, nrm_mul, nrm_inv, nrm_apply τ ℓ hτℓ, mul_inv_cancel₀ (nrm_ne_zero τ ℓ he)] theorem step_isU {ℓ : ℕ} (hO : O = Subring.closure {α}) (hst : ∀ x ∈ O, τ x ∈ O) (hℓ : 1 ≤ ℓ)    (hτℓ : τ ^ ℓ = 1) (he : τ α - α ≠ 0) : IsU O (τ (τ α - α) / (τ α - α)) :=  IsU.of_nrm hst hℓ (step_mem τ hO hst he) (Or.inl (nrm_step τ hτℓ he)) /-- τʰ(e)/e = ∏_{s<h} τˢ(τ(e)/e) ∈ O^×. -/theorem tel_isU {ℓ : ℕ} (hO : O = Subring.closure {α}) (hst : ∀ x ∈ O, τ x ∈ O) (hℓ : 1 ≤ ℓ)    (hτℓ : τ ^ ℓ = 1) (he : τ α - α ≠ 0) (h : ℕ) : IsU O ((τ ^ h) (τ α - α) / (τ α - α)) := by  induction h with  | zero => rw [pow_zero, RingAut.one_apply, div_self he]; exact ⟨one_ne_zero, O.one_mem, by simp⟩  | succ h ih =>    have hu := (step_isU τ hO hst hℓ hτℓ he).pow_apply hst h    have hne : (τ ^ h) (τ α - α) ≠ 0 := (map_ne_zero _).mpr he    have hE : (τ ^ (h + 1)) (τ α - α) / (τ α - α)        = (τ ^ h) (τ (τ α - α) / (τ α - α)) * ((τ ^ h) (τ α - α) / (τ α - α)) := by      rw [map_div₀, pow_succ_apply, div_mul_div_cancel₀ hne]    rw [hE]; exact hu.mul ih /-- (τᵐα − α)/e = Σ_{h<m} τʰ(e)/e. -/theorem tel_sum (m : ℕ) :    ((τ ^ m) α - α) / (τ α - α) = ∑ h ∈ range m, (τ ^ h) (τ α - α) / (τ α - α) := by  rw [← sum_div]; congr 1  have hE : ∀ h, (τ ^ h) (τ α - α) = (τ ^ (h + 1)) α - (τ ^ h) α := fun h => by    rw [map_sub, pow_succ_apply]  simp_rw [hE]  rw [sum_range_sub (fun h => (τ ^ h) α)]; simp theorem tel_mem {ℓ : ℕ} (hO : O = Subring.closure {α}) (hst : ∀ x ∈ O, τ x ∈ O) (hℓ : 1 ≤ ℓ)    (hτℓ : τ ^ ℓ = 1) (he : τ α - α ≠ 0) (m : ℕ) : ((τ ^ m) α - α) / (τ α - α) ∈ O := by  rw [tel_sum]; exact O.sum_mem fun h _ => (tel_isU τ hO hst hℓ hτℓ he h).2.1 end tele /-! The setting of lem:ratios. -/ section main variable {σ : RingAut K} {ℓ : ℕ} {O : Subring K} {α : K} theorem dd_one (σ : RingAut K) (α : K) : dd σ α 1 = σ α - α := by simp [dd] /-- d_k ≠ 0 for ℓ ∤ k (σᵏα = α with k invertible mod ℓ would give σα = α). -/theorem dd_ne_zero (hℓ : ℓ.Prime) (hℓ1 : σ ^ ℓ = 1) (hα : σ α ≠ α) {k : ℕ} (hk : ¬ ℓ ∣ k) :    dd σ α k ≠ 0 := by  intro h0  have hfix : (σ ^ k) α = α := sub_eq_zero.mp h0  obtain ⟨m, -, hm⟩ := Nat.exists_mul_mod_eq_one_of_coprime    ((hℓ.coprime_iff_not_dvd.mpr hk).symm) hℓ.one_lt  have hiter : ∀ j, (σ ^ (k * j)) α = α := by    intro j    induction j with    | zero => simp    | succ j ih => rw [Nat.mul_succ, pow_apply_add, hfix, ih]  apply hα  have := hiter m  rwa [pow_eq_pow_mod (k * m) hℓ1, hm, pow_one] at this theorem pow_pow_eq_one (hℓ1 : σ ^ ℓ = 1) (k : ℕ) : (σ ^ k) ^ ℓ = 1 := by  rw [← pow_mul, mul_comm, pow_mul, hℓ1, one_pow] /-- d_k/d₁ ∈ O^× for ℓ ∤ k. -/theorem ratio_isU (hℓ : ℓ.Prime) (hℓ1 : σ ^ ℓ = 1) (hO : O = Subring.closure {α})    (hst : ∀ x ∈ O, σ x ∈ O) (hα : σ α ≠ α) {k : ℕ} (hk : ¬ ℓ ∣ k) :    IsU O (dd σ α k / dd σ α 1) := by  have hℓ0 : 1 ≤ ℓ := hℓ.one_lt.le  have he1 : σ α - α ≠ 0 := sub_ne_zero.mpr hα  have hek : (σ ^ k) α - α ≠ 0 := dd_ne_zero hℓ hℓ1 hα hk  have hstk : ∀ x ∈ O, (σ ^ k) x ∈ O := fun x hx => pow_mem_of_stab hst k hx  have mem1 : dd σ α k / dd σ α 1 ∈ O := by    rw [dd_one]; exact tel_mem σ hO hst hℓ0 hℓ1 he1 k  obtain ⟨m, -, hm⟩ := Nat.exists_mul_mod_eq_one_of_coprime    ((hℓ.coprime_iff_not_dvd.mpr hk).symm) hℓ.one_lt  have mem2 : dd σ α 1 / dd σ α k ∈ O := by    have := tel_mem (σ ^ k) hO hstk hℓ0 (pow_pow_eq_one hℓ1 k) hek m    rwa [← pow_mul, pow_eq_pow_mod (k * m) hℓ1, hm] at this  exact ⟨div_ne_zero hek he1, mem1, by rw [inv_div]; exact mem2⟩ /-- **lem:ratios**, first assertion: (σⁱα − σʲα)/d₁ ∈ O^× for i ≢ j (mod ℓ). -/theorem ratios_isU (hℓ : ℓ.Prime) (hℓ1 : σ ^ ℓ = 1) (hO : O = Subring.closure {α})    (hst : ∀ x ∈ O, σ x ∈ O) (hα : σ α ≠ α) {i j : ℕ} (hij : i % ℓ ≠ j % ℓ) :    IsU O (((σ ^ i) α - (σ ^ j) α) / dd σ α 1) := by  have hℓ0 : 1 ≤ ℓ := hℓ.one_lt.le  have he1 : σ α - α ≠ 0 := sub_ne_zero.mpr hα  set k := i + (ℓ - 1) * j with hkdef  have hnat : j + k = i + ℓ * j := by    obtain ⟨n, rfl⟩ : ∃ n, ℓ = n + 1 := ⟨ℓ - 1, by omega⟩    simp only [hkdef, Nat.add_sub_cancel]; ring  have hk : ¬ ℓ ∣ k := by    rintro ⟨c, hc⟩    apply hij    rw [← Nat.add_mul_mod_self_left i ℓ j, ← hnat, hc, Nat.add_mul_mod_self_left]  have hσi : (σ ^ i) α = (σ ^ j) ((σ ^ k) α) := by    rw [← pow_apply_add, hnat, pow_add, pow_mul, hℓ1, one_pow, mul_one]  have hd1 : (σ ^ j) (dd σ α 1) ≠ 0 := (map_ne_zero _).mpr (by rw [dd_one]; exact he1)  have hE : ((σ ^ i) α - (σ ^ j) α) / dd σ α 1      = (σ ^ j) (dd σ α k / dd σ α 1) * ((σ ^ j) (σ α - α) / (σ α - α)) := by    rw [map_div₀, ← dd_one, div_mul_div_cancel₀ hd1, hσi]; simp only [dd, map_sub]  rw [hE]  exact ((ratio_isU hℓ hℓ1 hO hst hα hk).pow_apply hst j).mul    (tel_isU σ hO hst hℓ0 hℓ1 he1 j) /-- **lem:ratios** (6.2). O = ℤ[α] σ-stable, σ of odd prime order ℓ on K, σα ≠ α. Then    (σⁱα − σʲα)/d₁ ∈ O^× for i ≢ j (mod ℓ); η = d₂/d₁ and η − 1 = σ(d₁)/d₁ lie in O^×,    N(η − 1) = 1, and η is exceptional: 1 − η ∈ O^× with N(1 − η) = −1. -/theorem lem_ratios (hℓ : ℓ.Prime) (hℓ2 : ℓ ≠ 2) (hℓ1 : σ ^ ℓ = 1)    (hO : O = Subring.closure {α}) (hst : ∀ x ∈ O, σ x ∈ O) (hα : σ α ≠ α) :    (∀ i j : ℕ, i % ℓ ≠ j % ℓ → IsU O (((σ ^ i) α - (σ ^ j) α) / dd σ α 1)) ∧    IsU O (dd σ α 2 / dd σ α 1) ∧    dd σ α 2 / dd σ α 1 - 1 = σ (dd σ α 1) / dd σ α 1 ∧    IsU O (dd σ α 2 / dd σ α 1 - 1) ∧    nrm σ ℓ (dd σ α 2 / dd σ α 1 - 1) = 1 ∧    IsU O (1 - dd σ α 2 / dd σ α 1) ∧    nrm σ ℓ (1 - dd σ α 2 / dd σ α 1) = -1 := by  have hℓ0 : 1 ≤ ℓ := hℓ.one_lt.le  have he1 : σ α - α ≠ 0 := sub_ne_zero.mpr hα  have h2 : ¬ ℓ ∣ 2 := fun h => hℓ2 ((Nat.prime_dvd_prime_iff_eq hℓ Nat.prime_two).mp h)  have hη1 : dd σ α 2 / dd σ α 1 - 1 = σ (dd σ α 1) / dd σ α 1 := by    rw [dd_one, div_sub_one he1, dd, map_sub, show (σ ^ 2) α = σ (σ α) by rw [pow_two]; rfl]    ring_nf  have hstepU : IsU O (σ (dd σ α 1) / dd σ α 1) := by    rw [dd_one]; exact step_isU σ hO hst hℓ0 hℓ1 he1  have hN : nrm σ ℓ (dd σ α 2 / dd σ α 1 - 1) = 1 := by    rw [hη1, dd_one]; exact nrm_step σ hℓ1 he1  have hneg : 1 - dd σ α 2 / dd σ α 1 = -1 * (dd σ α 2 / dd σ α 1 - 1) := by ring  refine ⟨fun i j hij => ratios_isU hℓ hℓ1 hO hst hα hij, ratio_isU hℓ hℓ1 hO hst hα h2, hη1,    hη1 ▸ hstepU, hN, ?_, ?_⟩  · rw [show 1 - dd σ α 2 / dd σ α 1 = -(dd σ α 2 / dd σ α 1 - 1) by ring]    exact (hη1 ▸ hstepU).neg  · rw [hneg, nrm_mul, hN, nrm_neg_one, mul_one, (hℓ.odd_of_ne_two hℓ2).neg_one_pow] /-- **cor:inert** (6.3), core: the r_i = d_i/d₁ (i < ℓ) lie in O and have unit differences, so    their images under any ring hom O → F, F a finite field (the residue field of a prime above    p), are distinct: ℓ ≤ |F|. -/theorem cor_inert_card (hℓ : ℓ.Prime) (hℓ1 : σ ^ ℓ = 1) (hO : O = Subring.closure {α})    (hst : ∀ x ∈ O, σ x ∈ O) (hα : σ α ≠ α) {F : Type*} [Field F] [Fintype F] (φ : O →+* F) :    ℓ ≤ Fintype.card F := by  have hℓ0 : 1 ≤ ℓ := hℓ.one_lt.le  have he1 : σ α - α ≠ 0 := sub_ne_zero.mpr hα  have hmem : ∀ i : ℕ, dd σ α i / dd σ α 1 ∈ O := fun i => by    rw [dd_one]; exact tel_mem σ hO hst hℓ0 hℓ1 he1 i  let f : Fin ℓ → F := fun i => φ ⟨dd σ α i / dd σ α 1, hmem i⟩  have hf : Function.Injective f := by    intro i j hij    by_contra hne    have hmod : (i : ℕ) % ℓ ≠ j % ℓ := by      intro h      apply hne      apply Fin.ext      rwa [Nat.mod_eq_of_lt i.2, Nat.mod_eq_of_lt j.2] at h    have hU := ratios_isU hℓ hℓ1 hO hst hα hmod    have hunit := hU.isUnit.map φ    have hsub : (⟨((σ ^ (i : ℕ)) α - (σ ^ (j : ℕ)) α) / dd σ α 1, hU.2.1⟩ : O)        = ⟨dd σ α i / dd σ α 1, hmem i⟩ - ⟨dd σ α j / dd σ α 1, hmem j⟩ := by      apply Subtype.ext      rw [AddSubgroupClass.coe_sub]; simp only [dd]      ring    rw [hsub, map_sub] at hunit    change IsUnit (f i - f j) at hunit    rw [hij, sub_self] at hunit    exact not_isUnit_zero hunit  simpa using Fintype.card_le_of_injective f hf /-- **cor:inert** (6.3). If the residue field has pᶠ elements with p < ℓ and f ∣ ℓ (the residue    degree divides [K : ℚ] = ℓ), then f = ℓ: p is inert. -/theorem cor_inert (hℓ : ℓ.Prime) (hℓ1 : σ ^ ℓ = 1) (hO : O = Subring.closure {α})    (hst : ∀ x ∈ O, σ x ∈ O) (hα : σ α ≠ α) {F : Type*} [Field F] [Fintype F] (φ : O →+* F)    {p f : ℕ} (hcard : Fintype.card F = p ^ f) (hp : p < ℓ) (hf : f ∣ ℓ) : f = ℓ := by  have h := cor_inert_card hℓ hℓ1 hO hst hα φ  rw [hcard] at h  rcases hℓ.eq_one_or_self_of_dvd f hf with rfl | h'  · rw [pow_one] at h; omega  · exact h' end main end ratios /-! ## Powers of α: prop:val and cor:q25 -/ section val variable {N : Type*} [CommRing N] (G : Type*) [Group G] [MulSemiringAction G N] /-- ℤ[conj x]: the subring generated by the G-orbit of x (G the Galois group of the normal    closure, acting on its ring of integers N). -/def Zconj (x : N) : Subring N := Subring.closure (Set.range fun g : G => g • x) variable {G} /-- If m ≤ v(s − h·s) for every generator s and every h, the same holds on the whole subring    generated (x − h·x lies in the ideal generated by those differences). -/theorem le_val_closure (v : AddValuation N ℕ∞) {S : Set N} {m : ℕ∞}    (hS : ∀ s ∈ S, ∀ h : G, m ≤ v (s - h • s)) {x : N} (hx : x ∈ Subring.closure S) (h : G) :    m ≤ v (x - h • x) := by  induction hx using Subring.closure_induction with  | mem s hs => exact hS s hs h  | zero => simp [AddValuation.map_zero]  | one => simp [AddValuation.map_zero]  | add x y _ _ hx hy =>    rw [smul_add, show x + y - (h • x + h • y) = (x - h • x) + (y - h • y) by ring]    exact v.map_le_add hx hy  | neg x _ hx =>    rw [smul_neg, show -x - -(h • x) = -(x - h • x) by ring, v.map_neg]; exact hx  | mul x y _ _ hx hy =>    rw [smul_mul', show x * y - h • x * h • y = (x - h • x) * y + h • x * (y - h • y) by ring]    refine v.map_le_add ?_ ?_    · rw [v.map_mul]; exact hx.trans le_self_add    · rw [v.map_mul]; exact hy.trans le_add_self /-- v(aᵏ − bᵏ) ≥ v(a − b) + (k − 1) when v(a), v(b) ≥ 1. -/theorem val_pow_sub (v : AddValuation N ℕ∞) {a b : N} (ha : 1 ≤ v a) (hb : 1 ≤ v b) (k : ℕ) :    v (a - b) + ((k - 1 : ℕ) : ℕ∞) ≤ v (a ^ k - b ^ k) := by  rw [← geom_sum₂_mul, v.map_mul, add_comm]  gcongr  refine v.map_le_sum fun i hi => ?_  have hi' : i < k := mem_range.mp hi  rw [v.map_mul, v.map_pow, v.map_pow,    show ((k - 1 : ℕ) : ℕ∞) = (i : ℕ∞) + ((k - 1 - i : ℕ) : ℕ∞) by      rw [← Nat.cast_add]; congr 1; omega]  gcongr  · calc ((i : ℕ) : ℕ∞) = i • (1 : ℕ∞) := by rw [nsmul_one]      _ ≤ i • v a := nsmul_le_nsmul_right ha i  · calc ((k - 1 - i : ℕ) : ℕ∞) = (k - 1 - i) • (1 : ℕ∞) := by rw [nsmul_one]      _ ≤ (k - 1 - i) • v b := nsmul_le_nsmul_right hb _ /-- **prop:val** (6.5), valuation core. v a valuation of N with trivial support (𝔓-adic on 𝒪_N),    every conjugate of α has positive valuation, α is not G-fixed (α ∉ ℚ), k ≥ 2. Then    ℤ[conj αᵏ] ≠ ℤ[conj α]: μ(ℤ[conj αᵏ]) ≥ μ(ℤ[conj α]) + (k − 1) > μ(ℤ[conj α]). -/theorem prop_val (v : AddValuation N ℕ∞) (hsupp : ∀ x, v x = ⊤ → x = 0) (α : N)    (hpos : ∀ g : G, 1 ≤ v (g • α)) (hnq : ∃ g : G, g • α ≠ α) {k : ℕ} (hk : 2 ≤ k) :    Zconj G (α ^ k) ≠ Zconj G α := by  -- the minimum m₀ = min v(α_i − α_j), attained at (g₁, h₁)  obtain ⟨_, ⟨⟨g₁, h₁⟩, rfl⟩, hmin⟩ := wellFounded_lt.has_min    (Set.range fun p : G × G => v (p.1 • α - p.2 • α)) ⟨_, ⟨(1, 1), rfl⟩⟩  have hmin' : ∀ g h : G, v (g₁ • α - h₁ • α) ≤ v (g • α - h • α) := fun g h =>    not_lt.mp (hmin _ ⟨(g, h), rfl⟩)  set m₀ := v (g₁ • α - h₁ • α) with hm₀  have hfin : m₀ ≠ ⊤ := by    obtain ⟨g, hg⟩ := hnq    intro htop    have := hmin' g 1    rw [htop, top_le_iff, one_smul] at this    exact hg (sub_eq_zero.mp (hsupp _ this))  -- lower bound on ℤ[conj αᵏ]  have hlow : ∀ x ∈ Zconj G (α ^ k), ∀ h : G, m₀ + ((k - 1 : ℕ) : ℕ∞) ≤ v (x - h • x) := by    intro x hx h    refine le_val_closure v ?_ hx h    rintro s ⟨g, rfl⟩ h'    simp only [smul_pow', smul_smul]    exact (add_le_add (hmin' g (h' * g)) le_rfl).trans (val_pow_sub v (hpos g) (hpos _) k)  intro heq  have hx : g₁ • α ∈ Zconj G (α ^ k) := heq ▸ Subring.subset_closure ⟨g₁, rfl⟩  have := hlow _ hx (h₁ * g₁⁻¹)  rw [smul_smul, inv_mul_cancel_right, ← hm₀] at this  obtain ⟨n, hn⟩ := ENat.ne_top_iff_exists.mp hfin  rw [← hn, ← Nat.cast_add, Nat.cast_le] at this  have h2 : n + (k - 1) ≤ n := this  omega /-- **prop:val** (6.5) with its hypothesis as in the note: αⁿ ∈ p·N (from Π_α ≡ Xⁿ mod p) and    v(p) > 0 (𝔓 lies above p). -/theorem prop_val_root (v : AddValuation N ℕ∞) (hsupp : ∀ x, v x = ⊤ → x = 0) (α : N) {n p : ℕ}    (hroot : ∃ y : N, α ^ n = (p : N) * y) (hp : 1 ≤ v (p : N))    (hnq : ∃ g : G, g • α ≠ α) {k : ℕ} (hk : 2 ≤ k) : Zconj G (α ^ k) ≠ Zconj G α := by  refine prop_val v hsupp α (fun g => ?_) hnq hk  obtain ⟨y, hy⟩ := hroot  have hg : (g • α) ^ n = (p : N) * (g • y) := by    have hpg : g • (p : N) = p := by      have := map_natCast (MulSemiringAction.toRingHom G N g) p      rwa [MulSemiringAction.toRingHom_apply] at this    rw [← smul_pow', hy, smul_mul', hpg]  have hv : n • v (g • α) = v (p : N) + v (g • y) := by rw [← v.map_pow, hg, v.map_mul]  rw [Order.one_le_iff_ne_zero]  intro h0  rw [h0, nsmul_zero] at hv  have : (1 : ℕ∞) ≤ 0 := hv ▸ hp.trans le_self_add  exact absurd this (by norm_num) /-- Π_α ≡ Xⁿ (mod p) ⇒ αⁿ ∈ p·ℤ[α]: if Π ∈ ℤ[X] is monic of degree n with Π(α) = 0 and p    divides every coefficient of degree < n, then αⁿ = p·y. -/theorem pow_eq_p_mul (α : N) {P : Polynomial ℤ} (hm : P.Monic) {n p : ℕ} (hdeg : P.natDegree = n)    (hroot : Polynomial.aeval α P = 0) (hdvd : ∀ i < n, (p : ℤ) ∣ P.coeff i) :    ∃ y : N, α ^ n = (p : N) * y := by  choose q hq using hdvd  refine ⟨-∑ i ∈ (range n).attach, ((q i.1 (mem_range.mp i.2) : ℤ) : N) * α ^ i.1, ?_⟩  rw [Polynomial.aeval_eq_sum_range, hdeg, sum_range_succ] at hroot  have hlead : P.coeff n = 1 := by rw [← hdeg]; exact hm  rw [hlead, one_smul] at hroot  have hsum : ∑ i ∈ range n, P.coeff i • α ^ i      = (p : N) * ∑ i ∈ (range n).attach, ((q i.1 (mem_range.mp i.2) : ℤ) : N) * α ^ i.1 := by    rw [mul_sum, ← sum_attach (range n)]    refine sum_congr rfl fun i _ => ?_    rw [hq i.1 (mem_range.mp i.2), zsmul_eq_mul, Int.cast_mul, Int.cast_natCast, mul_assoc]  rw [mul_neg, ← hsum]; linear_combination hroot /-- **prop:val** (6.5), as stated: Π_α ≡ Xⁿ (mod p) (Π monic of degree n, p ∣ coeff_i for    i < n), v(p) > 0, α ∉ ℚ, k ≥ 2 ⇒ ℤ[conj αᵏ] ≠ ℤ[conj α]. -/theorem prop_val_poly (v : AddValuation N ℕ∞) (hsupp : ∀ x, v x = ⊤ → x = 0) (α : N)    {P : Polynomial ℤ} (hm : P.Monic) {n p : ℕ} (hdeg : P.natDegree = n)    (hroot : Polynomial.aeval α P = 0) (hdvd : ∀ i < n, (p : ℤ) ∣ P.coeff i)    (hp : 1 ≤ v (p : N)) (hnq : ∃ g : G, g • α ≠ α) {k : ℕ} (hk : 2 ≤ k) :    Zconj G (α ^ k) ≠ Zconj G α :=  prop_val_root v hsupp α (pow_eq_p_mul α hm hdeg hroot hdvd) hp hnq hk /-- **cor:q25** (6.6). α³ − Cα + C = 0 with C = C'² + C' + 7, α ∉ ℚ; for each prime p ∣ C a    valuation v_p of N with trivial support and v_p(p) ≥ 1 (a prime of 𝒪_N above p). Then for    k ≥ 1: ℤ[conj αᵏ] = ℤ[conj α] ↔ k = 1, i.e. S_α = {1}. -/theorem cor_q25 (α : N) {C C' : ℤ} (hC : C = C' ^ 2 + C' + 7) (hα : α ^ 3 - C * α + C = 0)    (hnq : ∃ g : G, g • α ≠ α)    (hval : ∀ p : ℕ, p.Prime → (p : ℤ) ∣ C →      ∃ v : AddValuation N ℕ∞, (∀ x, v x = ⊤ → x = 0) ∧ 1 ≤ v (p : N))    {k : ℕ} (hk : 1 ≤ k) : Zconj G (α ^ k) = Zconj G α ↔ k = 1 := by  constructor  · intro heq    by_contra hk1    have hC7 : 7 ≤ C := by      rcases le_or_gt 0 C' with h | h <;> nlinarith    obtain ⟨p, hp, hpC⟩ := Nat.exists_prime_and_dvd (n := C.natAbs) (by omega)    have hpC' : (p : ℤ) ∣ C := Int.natCast_dvd.mpr hpC    obtain ⟨v, hsupp, hvp⟩ := hval p hp hpC'    obtain ⟨c, hc⟩ := hpC'    have hroot : ∃ y : N, α ^ 3 = (p : N) * y :=      ⟨(c : N) * (α - 1), by        have : (C : N) = (p : N) * c := by rw [hc]; push_cast; ring        linear_combination hα + (α - 1) * this⟩    exact prop_val_root v hsupp α hroot hvp hnq (by omega) heq  · rintro rfl; rw [pow_one] end val /-! ## prop:c27 (Conjecture 27 of Lou20a): the algebraic core -/ section c27 variable {N : Type*} [CommRing N] {G : Type*} [Group G] [Fintype G] [DecidableEq G]  [MulSemiringAction G N] omit [Fintype G] [DecidableEq G] intheorem smul_mem_closure (ζ : N) (hζ : ∀ g : G, g • ζ ∈ Subring.closure {ζ}) (g : G) {x : N}    (hx : x ∈ Subring.closure {ζ}) : g • x ∈ Subring.closure {ζ} := by  induction hx using Subring.closure_induction with  | mem s hs => rw [Set.mem_singleton_iff.mp hs]; exact hζ g  | zero => rw [smul_zero]; exact Subring.zero_mem _  | one => rw [smul_one]; exact Subring.one_mem _  | add x y _ _ hx hy => rw [smul_add]; exact Subring.add_mem _ hx hy  | neg x _ hx => rw [smul_neg]; exact Subring.neg_mem _ hx  | mul x y _ _ hx hy => rw [smul_mul']; exact Subring.mul_mem _ hx hy /-- **prop:c27**, core. G finite (Gal(ℚ(ζ₅)/ℚ)) acting on N, c ∈ G (complex conjugation),    ζ⁵ = 1, c·ζ = ζ⁴ (= ζ̄), ε = ζᵃw with c·w = w (w = ±((1 − √5)/2)ᵇ is real), 5 ∤ a,    N(ε) = ∏_g g·ε = 1, G·ζ ⊆ ℤ[ζ] and ε ∈ ℤ[ζ]. Then ℤ[conj ε] = ℤ[ζ]:    ε̄⁻¹ = ∏_{g≠1} g·ε̄ ∈ A_ε, ε/ε̄ = ζ²ᵃ ∈ A_ε, and 5 ∤ 2a gives ζ ∈ A_ε. -/theorem c27_core (ζ w ε : N) (c : G) {a : ℕ} (hζ5 : ζ ^ 5 = 1) (hcζ : c • ζ = ζ ^ 4)    (hcw : c • w = w) (hε : ε = ζ ^ a * w) (ha : ¬ 5 ∣ a) (hN : ∏ g : G, g • ε = 1)    (hζ : ∀ g : G, g • ζ ∈ Subring.closure {ζ}) (hεZ : ε ∈ Subring.closure {ζ}) :    Zconj G ε = Subring.closure {ζ} := by  apply le_antisymm  · rw [Zconj, Subring.closure_le]    rintro _ ⟨g, rfl⟩    exact smul_mem_closure ζ hζ g hεZ  · rw [Subring.closure_le, Set.singleton_subset_iff]    set A := Zconj G ε    have hmem : ∀ g : G, g • ε ∈ A := fun g => Subring.subset_closure ⟨g, rfl⟩    -- ε̄ = c·ε has norm 1, and its inverse is the product of its other conjugates    have hNbar : ∏ g : G, g • (c • ε) = 1 := by      rw [← hN]      exact Fintype.prod_equiv (Equiv.mulRight c) _ _ fun g => by simp [smul_smul]    have hP : (∏ g ∈ univ.erase (1 : G), g • (c • ε)) ∈ A :=      A.prod_mem fun g _ => by rw [smul_smul]; exact hmem _    have hinv : c • ε * ∏ g ∈ univ.erase (1 : G), g • (c • ε) = 1 := by      rw [← hNbar, ← mul_prod_erase univ (fun g : G => g • (c • ε)) (mem_univ 1), one_smul]    -- ε = ζ²ᵃ ε̄    have hbar : ε = ζ ^ (2 * a) * (c • ε) := by      rw [hε, smul_mul', smul_pow', hcζ, hcw, ← pow_mul, ← mul_assoc, ← pow_add,        show 2 * a + 4 * a = 5 * a + a by ring, pow_add, pow_mul, hζ5, one_pow, one_mul]    have hz2 : ζ ^ (2 * a) ∈ A := by      have : ζ ^ (2 * a) = ε * ∏ g ∈ univ.erase (1 : G), g • (c • ε) :=        calc ζ ^ (2 * a) = ζ ^ (2 * a) * (c • ε * ∏ g ∈ univ.erase (1 : G), g • (c • ε)) := by              rw [hinv, mul_one]          _ = (ζ ^ (2 * a) * c • ε) * ∏ g ∈ univ.erase (1 : G), g • (c • ε) := by ring          _ = ε * ∏ g ∈ univ.erase (1 : G), g • (c • ε) := by rw [← hbar]      rw [this]; exact A.mul_mem (by simpa using hmem 1) hP    -- 5 ∤ 2a: ζ is a power of ζ²ᵃ    have h2a : ¬ 5 ∣ 2 * a := fun h =>      ((Nat.prime_five.dvd_mul).mp h).elim (fun h2 => by omega) ha    obtain ⟨m, -, hm⟩ := Nat.exists_mul_mod_eq_one_of_coprime      ((Nat.prime_five.coprime_iff_not_dvd.mpr h2a).symm) (by norm_num)    have hζm : (ζ ^ (2 * a)) ^ m = ζ := by      rw [← pow_mul, pow_eq_pow_mod (2 * a * m) hζ5, hm, pow_one]    rw [← hζm]; exact A.pow_mem hz2 m /-- **prop:c27** (6.8) ([Lou20a, Conjecture 27]): ℤ[conj εᵏ] = ℤ[ζ] for every k with 5 ∤ k, and    hence ℤ[conj εᵏ] = ℤ[conj ε]. -/theorem prop_c27 (ζ w ε : N) (c : G) {a : ℕ} (hζ5 : ζ ^ 5 = 1) (hcζ : c • ζ = ζ ^ 4)    (hcw : c • w = w) (hε : ε = ζ ^ a * w) (ha : ¬ 5 ∣ a) (hN : ∏ g : G, g • ε = 1)    (hζ : ∀ g : G, g • ζ ∈ Subring.closure {ζ}) (hεZ : ε ∈ Subring.closure {ζ}) {k : ℕ}    (hk : ¬ 5 ∣ k) :    Zconj G (ε ^ k) = Subring.closure {ζ} ∧ Zconj G (ε ^ k) = Zconj G ε := by  have hk' : Zconj G (ε ^ k) = Subring.closure {ζ} := by    refine c27_core ζ (w ^ k) (ε ^ k) c (a := a * k) hζ5 hcζ (by rw [smul_pow', hcw])      (by rw [hε, mul_pow, pow_mul]) (fun h => ((Nat.prime_five.dvd_mul).mp h).elim ha hk)      (by simp_rw [smul_pow']; rw [prod_pow, hN, one_pow]) hζ (Subring.pow_mem _ hεZ k)  exact ⟨hk', hk'.trans (c27_core ζ w ε c hζ5 hcζ hcw hε ha hN hζ hεZ).symm⟩ end c27 end Louboutin.SeccionSeis