🏛️ Atlas✒️Formalizations.NumberTheory.NumberField.InvariantOrders.CyclicPrimeBezout view on GitHub ↗18 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.Tactic.Ringpublic import Mathlib.Tactic.LinearCombinationpublic import Mathlib.RingTheory.Ideal.Quotient.Basicpublic import Mathlib.RingTheory.Ideal.Spanpublic import Mathlib.Algebra.BigOperators.Group.Finset.Basicpublic import Mathlib.Algebra.BigOperators.Ring.Finset /-!# Galois-invariant monogenic orders in cyclic fields of prime degree: the algebraic core In any commutative ring `R`:* four Bézout certificates (by `ring`): `A Φ₅(t) − B((t+1)⁵ − 1) = 11`,  `A' Φ₅(t) + B'((t+1)⁵ + 1) = 11`, `C Φ₇(t) − D((t+1)⁷ − 1) = 58`,  `C' Φ₇(t) + D'((t+1)⁷ + 1) = 86`;* hence `Φ_ℓ(t) ∈ I` and `(1 + t)^ℓ − ε ∈ I` (`ε = ±1`) give `11 ∈ I` (`ℓ = 5`), and `58 ∈ I`  resp. `86 ∈ I` (`ℓ = 7`);* the congruence step, for every `ℓ`: with `σ : R →+* R`, `σ^[ℓ] = id`, `d = σα − α`, `σd = t d`,  `σ` trivial modulo `dR`, `d` a non-zero-divisor and `∏_{j<ℓ} σ^[j](1 + t) = ε`, one has  `∑_{j<ℓ} t^j ∈ (d)` and `(1 + t)^ℓ − ε ∈ (d)`.That these hypotheses hold for a Galois-invariant monogenic order, ramification, the conductor,local maximality at `11` and Gras's theorem are not formalized; primality of `ℓ` is not used. ## Main results * `Louboutin.QuinticBezout.bezout5_plus`, `bezout5_minus`, `bezout7_plus`, `bezout7_minus`.* `Louboutin.QuinticBezout.eleven_mem`, `fiftyeight_mem`, `eightysix_mem`.* `Louboutin.QuinticBezout.cyclotomic_mem`, `Louboutin.QuinticBezout.norm_mem`,  `Louboutin.QuinticBezout.quintic_eleven_mem`, `Louboutin.QuinticBezout.septic_mem_span`. ## References * M.-N. Gras, *Non monogénéité de l'anneau des entiers des extensions cycliques de ℚ de degré  premier l ≥ 5*, J. Number Theory 23 (1986), 347–353.* C. Marín, *Orders generated by conjugates of Galois quartic integers*, preprint (2026).-/ @[expose] public section namespace Louboutin.QuinticBezout open Finset variable {R : Type*} [CommRing R] /-- Φ₅(t). -/def phi5 (t : R) : R := t ^ 4 + t ^ 3 + t ^ 2 + t + 1/-- Φ₇(t). -/def phi7 (t : R) : R := t ^ 6 + t ^ 5 + t ^ 4 + t ^ 3 + t ^ 2 + t + 1 /-! ### S1 Bézout certificates -/ theorem bezout5_plus (t : R) :    (5*t^4 + 25*t^3 + 45*t^2 + 34*t + 11) * phi5 t      - (5*t^3 + 5*t^2 + 9) * ((t+1)^5 - 1) = 11 := by  unfold phi5; ring theorem bezout5_minus (t : R) :    (-5*t^4 - 25*t^3 - 45*t^2 - 32*t - 3) * phi5 t      + (5*t^3 + 5*t^2 + 7) * ((t+1)^5 + 1) = 11 := by  unfold phi5; ring theorem bezout7_plus (t : R) :    (28*t^6 + 175*t^5 + 441*t^4 + 560*t^3 + 364*t^2 + 124*t + 58) * phi7 t      - (28*t^5 + 7*t^4 + 7*t^3 + 28*t^2 + 26) * ((t+1)^7 - 1) = 58 := by  unfold phi7; ring theorem bezout7_minus (t : R) :    (-35*t^6 - 231*t^5 - 637*t^4 - 945*t^3 - 798*t^2 - 346*t - 18) * phi7 t      + (35*t^5 + 21*t^4 + 21*t^3 + 35*t^2 + 52) * ((t+1)^7 + 1) = 86 := by  unfold phi7; ring /-! ### S2 Ideal corollaries -/ theorem eleven_mem {I : Ideal R} {t ε : R} (hε : ε = 1 ∨ ε = -1)    (hΦ : phi5 t ∈ I) (hN : (1 + t) ^ 5 - ε ∈ I) : (11 : R) ∈ I := by  rcases hε with rfl | rfl  · rw [← bezout5_plus t]    refine I.sub_mem (I.mul_mem_left _ hΦ) (I.mul_mem_left _ ?_)    convert hN using 1; ring  · rw [← bezout5_minus t]    refine I.add_mem (I.mul_mem_left _ hΦ) (I.mul_mem_left _ ?_)    convert hN using 1; ring theorem fiftyeight_mem {I : Ideal R} {t : R}    (hΦ : phi7 t ∈ I) (hN : (1 + t) ^ 7 - 1 ∈ I) : (58 : R) ∈ I := by  rw [← bezout7_plus t]  refine I.sub_mem (I.mul_mem_left _ hΦ) (I.mul_mem_left _ ?_)  convert hN using 1; ring theorem eightysix_mem {I : Ideal R} {t : R}    (hΦ : phi7 t ∈ I) (hN : (1 + t) ^ 7 - (-1) ∈ I) : (86 : R) ∈ I := by  rw [← bezout7_minus t]  refine I.add_mem (I.mul_mem_left _ hΦ) (I.mul_mem_left _ ?_)  convert hN using 1; ring theorem septic_mem {I : Ideal R} {t ε : R}    (hΦ : phi7 t ∈ I) (hN : (1 + t) ^ 7 - ε ∈ I) :    (ε = 1 → (58 : R) ∈ I) ∧ (ε = -1 → (86 : R) ∈ I) :=  ⟨fun h => fiftyeight_mem hΦ (h ▸ hN), fun h => eightysix_mem hΦ (h ▸ hN)⟩ /-! ### S3 The congruence step (generic ℓ) -/ section Congruence variable (σ : R →+* R) theorem iter_mul (j : ℕ) (x y : R) : σ^[j] (x * y) = σ^[j] x * σ^[j] y := by  induction j generalizing x y with  | zero => rfl  | succ j ih => simp only [Function.iterate_succ_apply', ih, map_mul] theorem iter_sub (j : ℕ) (x y : R) : σ^[j] (x - y) = σ^[j] x - σ^[j] y := by  induction j generalizing x y with  | zero => rfl  | succ j ih => simp only [Function.iterate_succ_apply', ih, map_sub] /-- σ^[j] d = (∏_{i<j} σ^[i] t) · d. -/theorem iter_d (d t : R) (H1 : σ d = t * d) (j : ℕ) :    σ^[j] d = (∏ i ∈ range j, σ^[i] t) * d := by  induction j with  | zero => simp  | succ j ih =>    rw [Function.iterate_succ_apply, H1, iter_mul, ih, prod_range_succ]; ring /-- σ is trivial mod (d), hence so are its iterates. -/theorem iter_mk (d : R) (H2 : ∀ x : R, ∃ y, σ x - x = d * y) (j : ℕ) (x : R) :    Ideal.Quotient.mk (Ideal.span {d}) (σ^[j] x) = Ideal.Quotient.mk (Ideal.span {d}) x := by  induction j with  | zero => rfl  | succ j ih =>    rw [Function.iterate_succ_apply', ← ih, Ideal.Quotient.eq]    obtain ⟨y, hy⟩ := H2 (σ^[j] x)    rw [hy]; exact Ideal.mul_mem_right _ _ (Ideal.mem_span_singleton_self d) /-- Main congruence step: Φ_ℓ(t) = Σ_{j<ℓ} t^j ∈ (d), d = σα − α. -/theorem cyclotomic_mem (ℓ : ℕ) (α t : R) (hℓ : ∀ x, σ^[ℓ] x = x)    (H1 : σ (σ α - α) = t * (σ α - α))    (H2 : ∀ x : R, ∃ y, σ x - x = (σ α - α) * y)    (H3 : ∀ z : R, (σ α - α) * z = 0 → z = 0) :    (∑ j ∈ range ℓ, t ^ j) ∈ Ideal.span {σ α - α} := by  set d := σ α - α with hd  have tele : ∑ j ∈ range ℓ, σ^[j] d = 0 := by    have : ∀ j, σ^[j] d = σ^[j+1] α - σ^[j] α := fun j => by      rw [hd, iter_sub, ← Function.iterate_succ_apply]    simp_rw [this]    rw [sum_range_sub (fun j => σ^[j] α), hℓ]; simp  simp_rw [iter_d σ d t H1] at tele  rw [← sum_mul, mul_comm] at tele  have h0 := H3 _ tele  rw [← Ideal.Quotient.eq_zero_iff_mem]  have : Ideal.Quotient.mk (Ideal.span {d}) (∑ j ∈ range ℓ, ∏ i ∈ range j, σ^[i] t) = 0 := by    rw [h0, map_zero]  rw [map_sum] at this ⊢  simp_rw [map_prod, iter_mk σ d H2, prod_const, card_range] at this  simpa [map_pow] using this /-- Norm congruence: (1+t)^ℓ − ε ∈ (d). -/theorem norm_mem (ℓ : ℕ) (d t ε : R)    (H2 : ∀ x : R, ∃ y, σ x - x = d * y)    (H4 : ∏ j ∈ range ℓ, σ^[j] (1 + t) = ε) :    (1 + t) ^ ℓ - ε ∈ Ideal.span {d} := by  rw [← Ideal.Quotient.eq_zero_iff_mem, map_sub, ← H4, map_prod, sub_eq_zero]  simp_rw [iter_mk σ d H2, prod_const, card_range, map_pow] theorem phi5_eq (t : R) : phi5 t = ∑ j ∈ range 5, t ^ j := by  simp [phi5, sum_range_succ]; ring theorem phi7_eq (t : R) : phi7 t = ∑ j ∈ range 7, t ^ j := by  simp [phi7, sum_range_succ]; ring /-- ℓ = 5: 11 ∈ (σα − α). -/theorem quintic_eleven_mem (α t ε : R) (hε : ε = 1 ∨ ε = -1) (hℓ : ∀ x, σ^[5] x = x)    (H1 : σ (σ α - α) = t * (σ α - α))    (H2 : ∀ x : R, ∃ y, σ x - x = (σ α - α) * y)    (H3 : ∀ z : R, (σ α - α) * z = 0 → z = 0)    (H4 : ∏ j ∈ range 5, σ^[j] (1 + t) = ε) :    (11 : R) ∈ Ideal.span {σ α - α} :=  eleven_mem hε ((phi5_eq t).symm ▸ cyclotomic_mem σ 5 α t hℓ H1 H2 H3)    (norm_mem σ 5 _ t ε H2 H4) /-- ℓ = 7: 58 ∈ (σα − α) if ε = 1, 86 ∈ (σα − α) if ε = −1. -/theorem septic_mem_span (α t ε : R) (hℓ : ∀ x, σ^[7] x = x)    (H1 : σ (σ α - α) = t * (σ α - α))    (H2 : ∀ x : R, ∃ y, σ x - x = (σ α - α) * y)    (H3 : ∀ z : R, (σ α - α) * z = 0 → z = 0)    (H4 : ∏ j ∈ range 7, σ^[j] (1 + t) = ε) :    (ε = 1 → (58 : R) ∈ Ideal.span {σ α - α}) ∧ (ε = -1 → (86 : R) ∈ Ideal.span {σ α - α}) :=  septic_mem ((phi7_eq t).symm ▸ cyclotomic_mem σ 7 α t hℓ H1 H2 H3)    (norm_mem σ 7 _ t ε H2 H4) end Congruence end Louboutin.QuinticBezout