/-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 Formalizations.NumberTheory.NumberField.InvariantOrders.Saturationpublic import Mathlib.SetTheory.Cardinal.Finitepublic import Mathlib.GroupTheory.QuotientGroup.Basicpublic import Mathlib.Tactic.TFAE /-!# The quotient `A/β€[Ξ±]` of a quartic order with a triangular basis In the model of `Saturation` (`K = β(Ξ±)` as `ββ΄`, `β€[Ξ±] = β€β΄`), an order `M` is given with atriangular `β€`-basis `1, Οβ, Οβ, Οβ`, `Ο_k = (Ξ±α΅ + P_k(Ξ±))/d_k`, `P_k β β€[X]` of degree `< k`,`0 < dβ β£ dβ β£ dβ` (the structure `Louboutin.Triang`; the existence of such a basis is cited fromLouboutin 2020, Prop. 10, and Cohen 1993, Cor. 4.7.6, and enters as data). That it is a basis,that `β€[Ξ±] β M`, and the flags `M β© V_k = β€ + β€Οβ + β¦ + β€Ο_k` are proved. For `M = A` thehypothesis `dβ = 1` is Louboutin's Theorem 13. `Triang.ofData` realizes every datum, so thehypotheses are not contradictory. ## Main results * `Louboutin.Triang.quotient_equiv`: `M/β€[Ξ±] β+ β€/dβ Γ β€/dβ Γ β€/dβ`.* `Louboutin.Triang.quotient_equiv_T1`, `Louboutin.Triang.index_V2`: with `dβ = 1`, `A/β€[Ξ±] β+ β€/dβ Γ β€/dβ` and `[A β© Vβ : Lβ] = dβ`.* `Louboutin.Triang.T1_i_iff_ii`, `T1_ii_iff_iii`, `T1_iii_iff_iv`, `T1_iii_iff_v`, `Louboutin.Triang.prop_T1`: the five equivalent conditions.* `Louboutin.Triang.T1_mod_p`: `p β£ dβ` iff `1, Ξ±, Ξ±Β²` are dependent over `π½_p` in `A/pA`. ## 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 /-- `apow i = Ξ±β±` in the power basis. -/abbrev apow (i : Fin 4) : Fin 4 β β := Pi.single i 1 /-- Vβ = β + βΞ± + βΞ±Β². -/def V2 : AddSubgroup (Fin 4 β β) where carrier := {x | x 3 = 0} zero_mem' := rfl add_mem' := by intro a b ha hb simp only [Set.mem_ofPred_eq, Pi.add_apply] at * rw [ha, hb, add_zero] neg_mem' := by intro a ha simp only [Set.mem_ofPred_eq, Pi.neg_apply] at * rw [ha, neg_zero] /-- Lβ = β€ + β€Ξ± + β€Ξ±Β² = β€[Ξ±] β© Vβ. -/def L2 : AddSubgroup (Fin 4 β β) := Z4 β V2 /-- Οβ = (Ξ± + a)/d. -/def omega1 (d : β) (a : β€) : Fin 4 β β := ![a / d, 1 / d, 0, 0]/-- Οβ = (Ξ±Β² + bΞ± + a)/d. -/def omega2 (d : β) (a b : β€) : Fin 4 β β := ![a / d, b / d, 1 / d, 0]/-- Οβ = (Ξ±Β³ + cΞ±Β² + bΞ± + a)/d. -/def omega3 (d : β) (a b c : β€) : Fin 4 β β := ![a / d, b / d, c / d, 1 / d] /-- nβ + nβΟβ + nβΟβ + nβΟβ. -/def combOf (Οβ Οβ Οβ : Fin 4 β β) (n : Fin 4 β β€) : Fin 4 β β := n 0 β’ apow 0 + n 1 β’ Οβ + n 2 β’ Οβ + n 3 β’ Οβ /-- The triangular basis of the order `M` (cited, taken as data): `1, Οβ, Οβ, Οβ` with `Ο_k = (Ξ±α΅ + P_k(Ξ±))/d_k`, `P_k β β€[X]`, `deg P_k < k`, and `dβ β£ dβ β£ dβ`. -/structure Triang (M : AddSubgroup (Fin 4 β β)) where dβ : β dβ : β dβ : β dβ_pos : 0 < dβ dβ_pos : 0 < dβ dβ_pos : 0 < dβ dβ_dvd : dβ β£ dβ dβ_dvd : dβ β£ dβ pββ : β€ pββ : β€ pββ : β€ pββ : β€ pββ : β€ pββ : β€ one_mem : apow 0 β M Οβ_mem : omega1 dβ pββ β M Οβ_mem : omega2 dβ pββ pββ β M Οβ_mem : omega3 dβ pββ pββ pββ β M span : β x β M, β n : Fin 4 β β€, x = combOf (omega1 dβ pββ) (omega2 dβ pββ pββ) (omega3 dβ pββ pββ pββ) n namespace Triang variable {M : AddSubgroup (Fin 4 β β)} (B : Triang M) /-- `Οβ` of the triangular basis. -/def Οβ : Fin 4 β β := omega1 B.dβ B.pββ/-- `Οβ` of the triangular basis. -/def Οβ : Fin 4 β β := omega2 B.dβ B.pββ B.pββ/-- `Οβ` of the triangular basis. -/def Οβ : Fin 4 β β := omega3 B.dβ B.pββ B.pββ B.pββ/-- Coordinates in the basis `1, Οβ, Οβ, Οβ`. -/def comb (n : Fin 4 β β€) : Fin 4 β β := combOf B.Οβ B.Οβ B.Οβ n theorem dβ_q : (B.dβ : β) β 0 := by exact_mod_cast B.dβ_pos.ne'theorem dβ_q : (B.dβ : β) β 0 := by exact_mod_cast B.dβ_pos.ne'theorem dβ_q : (B.dβ : β) β 0 := by exact_mod_cast B.dβ_pos.ne' theorem comb_apply_zero (n : Fin 4 β β€) : B.comb n 0 = n 0 + n 1 * B.pββ / B.dβ + n 2 * B.pββ / B.dβ + n 3 * B.pββ / B.dβ := by simp [comb, combOf, Οβ, Οβ, Οβ, omega1, omega2, omega3] ring theorem comb_apply_one (n : Fin 4 β β€) : B.comb n 1 = n 1 / B.dβ + n 2 * B.pββ / B.dβ + n 3 * B.pββ / B.dβ := by simp [comb, combOf, Οβ, Οβ, Οβ, omega1, omega2, omega3] ring theorem comb_apply_two (n : Fin 4 β β€) : B.comb n 2 = n 2 / B.dβ + n 3 * B.pββ / B.dβ := by simp [comb, combOf, Οβ, Οβ, Οβ, omega1, omega2, omega3] ring theorem comb_apply_three (n : Fin 4 β β€) : B.comb n 3 = n 3 / B.dβ := by simp [comb, combOf, Οβ, Οβ, Οβ, omega1, omega2, omega3] ring /-- Auxiliary: if `k = n/d + q` with `k`, `q` integers, then `d β£ n`. -/theorem dvd_of_cast_eq {d : β} (hd : 0 < d) {n k q : β€} (h : (k : β) = n / d + q) : (d : β€) β£ n := by have hd0 : (d : β) β 0 := by exact_mod_cast hd.ne' refine β¨k - q, ?_β© have : (n : β) = d * (k - q) := by rw [h]; field_simp; ring exact_mod_cast this /-- Key lemma: `nβ + nβΟβ + nβΟβ + nβΟβ β β€[Ξ±] β dβ β£ nβ, dβ β£ nβ, dβ β£ nβ`. -/theorem comb_mem_Z4_iff (n : Fin 4 β β€) : B.comb n β Z4 β (B.dβ : β€) β£ n 1 β§ (B.dβ : β€) β£ n 2 β§ (B.dβ : β€) β£ n 3 := by have h1q := B.dβ_q have h2q := B.dβ_q have h3q := B.dβ_q constructor Β· intro h obtain β¨k3, h3β© := h 3 obtain β¨k2, h2β© := h 2 obtain β¨k1, h1β© := h 1 rw [B.comb_apply_three] at h3 rw [B.comb_apply_two] at h2 rw [B.comb_apply_one] at h1 have e3 : (B.dβ : β€) β£ n 3 := dvd_of_cast_eq B.dβ_pos (k := k3) (q := 0) (by rw [h3]; simp) obtain β¨m3, hm3β© := e3 have e2 : (B.dβ : β€) β£ n 2 := dvd_of_cast_eq B.dβ_pos (k := k2) (q := m3 * B.pββ) (by rw [h2, hm3]; push_cast; field_simp) obtain β¨m2, hm2β© := e2 have e1 : (B.dβ : β€) β£ n 1 := dvd_of_cast_eq B.dβ_pos (k := k1) (q := m2 * B.pββ + m3 * B.pββ) (by rw [h1, hm2, hm3]; push_cast; field_simp; ring) exact β¨e1, β¨m2, hm2β©, β¨m3, hm3β©β© Β· rintro β¨β¨a1, ha1β©, β¨a2, ha2β©, β¨a3, ha3β©β© i fin_cases i Β· refine β¨n 0 + a1 * B.pββ + a2 * B.pββ + a3 * B.pββ, ?_β© show _ = B.comb n 0 rw [B.comb_apply_zero, ha1, ha2, ha3]; push_cast; field_simp Β· refine β¨a1 + a2 * B.pββ + a3 * B.pββ, ?_β© show _ = B.comb n 1 rw [B.comb_apply_one, ha1, ha2, ha3]; push_cast; field_simp Β· refine β¨a2 + a3 * B.pββ, ?_β© show _ = B.comb n 2 rw [B.comb_apply_two, ha2, ha3]; push_cast; field_simp Β· refine β¨a3, ?_β© show _ = B.comb n 3 rw [B.comb_apply_three, ha3]; push_cast; field_simp theorem comb_add (n m : Fin 4 β β€) : B.comb (n + m) = B.comb n + B.comb m := by simp only [comb, combOf, Pi.add_apply, add_smul]; abel theorem comb_zero : B.comb 0 = 0 := by simp [comb, combOf] theorem comb_mem (n : Fin 4 β β€) : B.comb n β M := M.add_mem (M.add_mem (M.add_mem (M.zsmul_mem B.one_mem _) (M.zsmul_mem B.Οβ_mem _)) (M.zsmul_mem B.Οβ_mem _)) (M.zsmul_mem B.Οβ_mem _) /-- `comb` as a homomorphism `β€β΄ β M`. -/def combHom : (Fin 4 β β€) β+ M where toFun n := β¨B.comb n, B.comb_mem nβ© map_zero' := Subtype.ext B.comb_zero map_add' n m := Subtype.ext (B.comb_add n m) theorem combHom_surjective : Function.Surjective B.combHom := by rintro β¨x, hxβ© obtain β¨n, hnβ© := B.span x hx exact β¨n, Subtype.ext hn.symmβ© /-- `1, Οβ, Οβ, Οβ` are linearly independent: a `β€`-basis of `M`. -/theorem comb_injective : Function.Injective B.comb := by intro n m h have h1q := B.dβ_q have h2q := B.dβ_q have h3q := B.dβ_q have c3 := congrFun h 3 have c2 := congrFun h 2 have c1 := congrFun h 1 have c0 := congrFun h 0 rw [B.comb_apply_three, B.comb_apply_three] at c3 rw [B.comb_apply_two, B.comb_apply_two] at c2 rw [B.comb_apply_one, B.comb_apply_one] at c1 rw [B.comb_apply_zero, B.comb_apply_zero] at c0 have e3 : (n 3 : β) = m 3 := (div_left_inj' h3q).mp c3 rw [e3] at c2 c1 c0 have e2 : (n 2 : β) = m 2 := (div_left_inj' h2q).mp (add_right_cancel c2) rw [e2] at c1 c0 have e1 : (n 1 : β) = m 1 := (div_left_inj' h1q).mp (add_right_cancel (add_right_cancel c1)) rw [e1] at c0 have e0 : (n 0 : β) = m 0 := add_right_cancel (add_right_cancel (add_right_cancel c0)) funext i fin_cases i Β· exact_mod_cast e0 Β· exact_mod_cast e1 Β· exact_mod_cast e2 Β· exact_mod_cast e3 /-- Flags, `k = 2`: `M β© Vβ = β€ + β€Οβ + β€Οβ`. -/theorem inter_V2 {x : Fin 4 β β} (hx : x β M) (h3 : x 3 = 0) : β n : Fin 4 β β€, n 3 = 0 β§ x = B.comb n := by obtain β¨n, rflβ© := B.span x hx refine β¨n, ?_, rflβ© have h := h3 change B.comb n 3 = 0 at h rw [B.comb_apply_three, div_eq_zero_iff] at h rcases h with h | h Β· exact_mod_cast h Β· exact absurd h B.dβ_q /-- Flags, `k = 1`: `M β© Vβ = β€ + β€Οβ`. -/theorem inter_V1 {x : Fin 4 β β} (hx : x β M) (h3 : x 3 = 0) (h2 : x 2 = 0) : β n : Fin 4 β β€, n 3 = 0 β§ n 2 = 0 β§ x = B.comb n := by obtain β¨n, hn3, rflβ© := B.inter_V2 hx h3 refine β¨n, hn3, ?_, rflβ© have h := h2 change B.comb n 2 = 0 at h rw [B.comb_apply_two, hn3] at h simp only [Int.cast_zero, zero_mul, zero_div, add_zero, div_eq_zero_iff] at h rcases h with h | h Β· exact_mod_cast h Β· exact absurd h B.dβ_q include B in/-- β€[Ξ±] β M. -/theorem Z4_le : Z4 β€ M := by intro x hx choose k hk using hx -- `x` is the image of an explicit coefficient vector (triangular inversion) have h1q := B.dβ_q have h2q := B.dβ_q have h3q := B.dβ_q set m3 : β€ := B.dβ * k 3 set m2 : β€ := B.dβ * (k 2 - k 3 * B.pββ) set m1 : β€ := B.dβ * (k 1 - (k 2 - k 3 * B.pββ) * B.pββ - k 3 * B.pββ) set m0 : β€ := k 0 - (k 1 - (k 2 - k 3 * B.pββ) * B.pββ - k 3 * B.pββ) * B.pββ - (k 2 - k 3 * B.pββ) * B.pββ - k 3 * B.pββ have : x = B.comb ![m0, m1, m2, m3] := by funext i fin_cases i Β· show x 0 = B.comb _ 0 rw [B.comb_apply_zero, β hk 0]; simp [m0, m1, m2, m3]; field_simp; ring Β· show x 1 = B.comb _ 1 rw [B.comb_apply_one, β hk 1]; simp [m1, m2, m3]; field_simp; ring Β· show x 2 = B.comb _ 2 rw [B.comb_apply_two, β hk 2]; simp [m2, m3]; field_simp; ring Β· show x 3 = B.comb _ 3 rw [B.comb_apply_three, β hk 3]; simp [m3]; field_simp rw [this]; exact B.comb_mem _ theorem comb_zsmul (k : β€) (n : Fin 4 β β€) : B.comb (k β’ n) = k β’ B.comb n := by exact congrArg Subtype.val (map_zsmul B.combHom k n) theorem comb_nsmul (k : β) (n : Fin 4 β β€) : B.comb (k β’ n) = k β’ B.comb n := by exact congrArg Subtype.val (map_nsmul B.combHom k n) /-- `(M β© Vβ)/Lβ` is killed by `dβ`: `x β M`, `x β Vβ` β `dβ x β β€[Ξ±]`. -/theorem dβ_smul_mem {x : Fin 4 β β} (hx : x β M) (h3 : x 3 = 0) : (B.dβ : β€) β’ x β Z4 := by obtain β¨n, hn3, rflβ© := B.inter_V2 hx h3 rw [β B.comb_zsmul, B.comb_mem_Z4_iff] simp only [Pi.smul_apply, smul_eq_mul, hn3, mul_zero, dvd_zero, and_true] exact β¨Dvd.dvd.mul_right (Int.natCast_dvd_natCast.mpr B.dβ_dvd) _, dvd_mul_right _ _β© end Triang /-! ### The quotient `A/β€[Ξ±]` -/ /-- Auxiliary: `G β§Έ H β+ Q` if `f : P β G`, `g : P β Q` and `f n β H β g n = 0`. -/noncomputable def quotEquivOf {P G Q : Type*} [AddCommGroup P] [AddCommGroup G] [AddCommGroup Q] (H : AddSubgroup G) (f : P β+ G) (hf : Function.Surjective f) (g : P β+ Q) (hg : Function.Surjective g) (hker : β n, f n β H β g n = 0) : G β§Έ H β+ Q := let Ο : P β+ G β§Έ H := (QuotientAddGroup.mk' H).comp f have hΟ : Function.Surjective Ο := (QuotientAddGroup.mk'_surjective H).comp hf have hk : Ο.ker = g.ker := by ext n rw [AddMonoidHom.mem_ker, AddMonoidHom.mem_ker, β hker] exact QuotientAddGroup.eq_zero_iff (f n) (QuotientAddGroup.quotientKerEquivOfSurjective Ο hΟ).symm.trans ((QuotientAddGroup.quotientAddEquivOfEq hk).trans (QuotientAddGroup.quotientKerEquivOfSurjective g hg)) /-- n β¦ (nβ mod a, nβ mod b, nβ mod c). -/def red3 (a b c : β) : (Fin 4 β β€) β+ ZMod a Γ ZMod b Γ ZMod c where toFun n := ((n 1 : ZMod a), (n 2 : ZMod b), (n 3 : ZMod c)) map_zero' := by simp map_add' n m := by simp theorem red3_surjective {a b c : β} (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : Function.Surjective (red3 a b c) := by have : NeZero a := β¨ha.ne'β© have : NeZero b := β¨hb.ne'β© have : NeZero c := β¨hc.ne'β© rintro β¨x, y, zβ© refine β¨![0, (x.val : β€), (y.val : β€), (z.val : β€)], ?_β© simp [red3] theorem red3_eq_zero_iff (a b c : β) (n : Fin 4 β β€) : red3 a b c n = 0 β (a : β€) β£ n 1 β§ (b : β€) β£ n 2 β§ (c : β€) β£ n 3 := by simp only [red3, AddMonoidHom.coe_mk, ZeroHom.coe_mk, Prod.ext_iff, Prod.fst_zero, Prod.snd_zero, ZMod.intCast_zmod_eq_zero_iff_dvd] /-- n β¦ (nβ mod a, nβ mod b). -/def red2 (a b : β) : (Fin 4 β β€) β+ ZMod a Γ ZMod b where toFun n := ((n 1 : ZMod a), (n 2 : ZMod b)) map_zero' := by simp map_add' n m := by simp theorem red2_surjective {a b : β} (ha : 0 < a) (hb : 0 < b) : Function.Surjective (red2 a b) := by have : NeZero a := β¨ha.ne'β© have : NeZero b := β¨hb.ne'β© rintro β¨x, yβ© refine β¨![0, (x.val : β€), (y.val : β€), 0], ?_β© simp [red2] theorem red2_eq_zero_iff (a b : β) (n : Fin 4 β β€) : red2 a b n = 0 β (a : β€) β£ n 1 β§ (b : β€) β£ n 2 := by simp only [red2, AddMonoidHom.coe_mk, ZeroHom.coe_mk, Prod.ext_iff, Prod.fst_zero, Prod.snd_zero, ZMod.intCast_zmod_eq_zero_iff_dvd] namespace Triang variable {M : AddSubgroup (Fin 4 β β)} (B : Triang M) /-- `M/β€[Ξ±] β β€/dβ Γ β€/dβ Γ β€/dβ`. -/noncomputable def quotient_equiv : (M β§Έ Z4.addSubgroupOf M) β+ ZMod B.dβ Γ ZMod B.dβ Γ ZMod B.dβ := quotEquivOf _ B.combHom B.combHom_surjective (red3 B.dβ B.dβ B.dβ) (red3_surjective B.dβ_pos B.dβ_pos B.dβ_pos) (fun n => by rw [AddSubgroup.mem_addSubgroupOf, red3_eq_zero_iff] exact B.comb_mem_Z4_iff n) /-- With `dβ = 1`, `A/β€[Ξ±] β β€/dβ Γ β€/dβ`. -/theorem quotient_equiv_T1 (h1 : B.dβ = 1) : Nonempty ((M β§Έ Z4.addSubgroupOf M) β+ ZMod B.dβ Γ ZMod B.dβ) := by have e := B.quotient_equiv rw [h1] at e exact β¨e.trans AddEquiv.uniqueProdβ© /-- [A : β€[Ξ±]] = dβ dβ dβ. -/theorem index_eq : (Z4.addSubgroupOf M).index = B.dβ * B.dβ * B.dβ := by rw [AddSubgroup.index, Nat.card_congr B.quotient_equiv.toEquiv, Nat.card_prod, Nat.card_prod, Nat.card_zmod, Nat.card_zmod, Nat.card_zmod, mul_assoc] /-! ### [A β© Vβ : Lβ] = dβ -/ /-- `n β¦ nβ + nβΟβ + nβΟβ β M β© Vβ` (`nβ` is ignored). -/def combHom2 : (Fin 4 β β€) β+ (M β V2 : AddSubgroup (Fin 4 β β)) where toFun n := β¨B.comb ![n 0, n 1, n 2, 0], AddSubgroup.mem_inf.mpr β¨B.comb_mem _, by show B.comb _ 3 = 0 rw [B.comb_apply_three]; simpβ©β© map_zero' := by apply Subtype.ext show B.comb _ = 0 rw [β B.comb_zero]; congr 1; funext i; fin_cases i <;> rfl map_add' n m := by apply Subtype.ext show B.comb _ = B.comb _ + B.comb _ rw [β B.comb_add]; congr 1; funext i; fin_cases i <;> simp theorem combHom2_surjective : Function.Surjective B.combHom2 := by rintro β¨x, hxβ© obtain β¨hxM, hx3β© := AddSubgroup.mem_inf.mp hx obtain β¨n, hn3, rflβ© := B.inter_V2 hxM hx3 refine β¨n, Subtype.ext ?_β© show B.comb _ = B.comb _ congr 1; funext i; fin_cases i <;> simp [hn3] /-- (M β© Vβ)/Lβ β β€/dβ Γ β€/dβ. -/noncomputable def quotient_equiv_V2 : ((M β V2 : AddSubgroup (Fin 4 β β)) β§Έ L2.addSubgroupOf (M β V2)) β+ ZMod B.dβ Γ ZMod B.dβ := quotEquivOf _ B.combHom2 B.combHom2_surjective (red2 B.dβ B.dβ) (red2_surjective B.dβ_pos B.dβ_pos) (fun n => by rw [AddSubgroup.mem_addSubgroupOf, red2_eq_zero_iff] show B.comb _ β Z4 β V2 β _ rw [AddSubgroup.mem_inf, B.comb_mem_Z4_iff] have h3 : B.comb ![n 0, n 1, n 2, 0] β V2 := by show B.comb _ 3 = 0 rw [B.comb_apply_three]; simp simp [h3]) /-- [A β© Vβ : Lβ] = dβ dβ. -/theorem index_V2_eq : (L2.addSubgroupOf (M β V2)).index = B.dβ * B.dβ := by rw [AddSubgroup.index, Nat.card_congr B.quotient_equiv_V2.toEquiv, Nat.card_prod, Nat.card_zmod, Nat.card_zmod] /-- With `dβ = 1`, `dβ = [A β© Vβ : Lβ]`. -/theorem index_V2 (h1 : B.dβ = 1) : (L2.addSubgroupOf (M β V2)).index = B.dβ := by rw [B.index_V2_eq, h1, one_mul] end Triang /-! ### The five conditions -/ /-- 1Β·cβ + Ξ±Β·cβ + Ξ±Β²Β·cβ + ΟΒ·cβ. -/def lin (Ο : Fin 4 β β) (c : Fin 4 β β€) : Fin 4 β β := c 0 β’ apow 0 + c 1 β’ apow 1 + c 2 β’ apow 2 + c 3 β’ Ο /-- (i): `{1, Ξ±, Ξ±Β², Ο}` is a `β€`-basis of `M` (`Ο β M` and unique integer coordinates). -/def BasisWith (M : AddSubgroup (Fin 4 β β)) (Ο : Fin 4 β β) : Prop := Ο β M β§ β x β M, β! c : Fin 4 β β€, x = lin Ο c /-- (v): the set `{e β₯ 1 | eM β β€[Ξ±]}`. -/def expSet (M : AddSubgroup (Fin 4 β β)) : Set β := {e | 1 β€ e β§ β x β M, e β’ x β Z4} theorem lin_apply_three (Ο : Fin 4 β β) (c : Fin 4 β β€) : lin Ο c 3 = c 3 * Ο 3 := by simp [lin] theorem lin_apply_two (Ο : Fin 4 β β) (c : Fin 4 β β€) : lin Ο c 2 = c 2 + c 3 * Ο 2 := by simp [lin] theorem lin_apply_one (Ο : Fin 4 β β) (c : Fin 4 β β€) : lin Ο c 1 = c 1 + c 3 * Ο 1 := by simp [lin] theorem lin_apply_zero (Ο : Fin 4 β β) (c : Fin 4 β β€) : lin Ο c 0 = c 0 + c 3 * Ο 0 := by simp [lin] theorem lin_injective {Ο : Fin 4 β β} (hΟ : Ο 3 β 0) : Function.Injective (lin Ο) := by intro c c' h have c3 := congrFun h 3 have c2 := congrFun h 2 have c1 := congrFun h 1 have c0 := congrFun h 0 rw [lin_apply_three, lin_apply_three] at c3 rw [lin_apply_two, lin_apply_two] at c2 rw [lin_apply_one, lin_apply_one] at c1 rw [lin_apply_zero, lin_apply_zero] at c0 have e3 : (c 3 : β) = c' 3 := mul_right_cancelβ hΟ c3 rw [e3] at c2 c1 c0 have e2 : (c 2 : β) = c' 2 := add_right_cancel c2 have e1 : (c 1 : β) = c' 1 := add_right_cancel c1 have e0 : (c 0 : β) = c' 0 := add_right_cancel c0 funext i fin_cases i Β· exact_mod_cast e0 Β· exact_mod_cast e1 Β· exact_mod_cast e2 Β· exact_mod_cast e3 namespace Triang variable {M : AddSubgroup (Fin 4 β β)} (B : Triang M) include B in/-- (i) β (ii). -/theorem saturated_of_basis {Ο : Fin 4 β β} (hΟ : BasisWith M Ο) : Saturated M := by have hne : Ο 3 β 0 := by intro h0 obtain β¨c, hc, -β© := hΟ.2 _ B.Οβ_mem have := congrFun hc 3 rw [lin_apply_three, h0, mul_zero] at this simp [omega3] at this exact B.dβ_pos.ne' this intro x hx hx3 obtain β¨c, rfl, -β© := hΟ.2 x hx rw [lin_apply_three] at hx3 have hc3 : (c 3 : β) = 0 := (mul_eq_zero.mp hx3).resolve_right hne intro i fin_cases i Β· exact β¨c 0, by simp [lin, hc3]β© Β· exact β¨c 1, by simp [lin, hc3]β© Β· exact β¨c 2, by simp [lin, hc3]β© Β· exact β¨0, by simp [lin, hc3]β© /-- (ii) β (iii). -/theorem dβ_eq_one_of_saturated (hsat : Saturated M) : B.dβ = 1 := by have h := hsat _ B.Οβ_mem (by simp [omega2]) obtain β¨k, hkβ© := h 2 have hk' : (k : β) = ((1 : β€) : β) / B.dβ + ((0 : β€) : β) := by rw [hk]; simp [omega2] have := dvd_of_cast_eq B.dβ_pos hk' exact Nat.dvd_one.mp (by exact_mod_cast this) theorem dβ_eq_one_of_dβ (h2 : B.dβ = 1) : B.dβ = 1 := Nat.dvd_one.mp (h2 βΈ B.dβ_dvd) /-- (iii) β (i), with `Ο = Οβ`. -/theorem basis_of_dβ_eq_one (h2 : B.dβ = 1) : BasisWith M B.Οβ := by have h1 := B.dβ_eq_one_of_dβ h2 have hne : B.Οβ 3 β 0 := by simp [Οβ, omega3, B.dβ_q] refine β¨B.Οβ_mem, fun x hx => ?_β© obtain β¨n, rflβ© := B.span x hx refine β¨![n 0 + n 1 * B.pββ + n 2 * B.pββ, n 1 + n 2 * B.pββ, n 2, n 3], ?_, fun c hc => lin_injective hne (hc.symm.trans ?_)β© <;> Β· funext i fin_cases i <;> simp [lin, combOf, Οβ, omega1, omega2, omega3, h1, h2] include B in/-- (i) β (ii). -/theorem T1_i_iff_ii : (β Ο, BasisWith M Ο) β Saturated M := β¨fun β¨_, hβ© => B.saturated_of_basis h, fun h => β¨B.Οβ, B.basis_of_dβ_eq_one (B.dβ_eq_one_of_saturated h)β©β© /-- (ii) β (iii). -/theorem T1_ii_iff_iii : Saturated M β B.dβ = 1 := β¨B.dβ_eq_one_of_saturated, fun h => B.saturated_of_basis (B.basis_of_dβ_eq_one h)β© /-- (iii) β (iv). -/theorem T1_iii_iff_iv : B.dβ = 1 β IsAddCyclic (M β§Έ Z4.addSubgroupOf M) := by rw [B.quotient_equiv.isAddCyclic, AddGroup.isAddCyclic_prod_iff, AddGroup.isAddCyclic_prod_iff] simp only [Nat.card_prod, Nat.card_zmod, ZMod.instIsAddCyclic, true_and] constructor Β· intro h2 rw [B.dβ_eq_one_of_dβ h2, h2] exact β¨Nat.coprime_one_left _, Nat.coprime_one_left _β© Β· rintro β¨h23, -β© exact Nat.Coprime.eq_one_of_dvd h23 B.dβ_dvd /-- min{e β₯ 1 : eM β β€[Ξ±]} = dβ. -/theorem isLeast_expSet : IsLeast (expSet M) B.dβ := by refine β¨β¨B.dβ_pos, fun x hx => ?_β©, fun e β¨_, heβ© => ?_β© Β· obtain β¨n, rflβ© := B.span x hx show B.dβ β’ B.comb n β Z4 rw [β B.comb_nsmul, B.comb_mem_Z4_iff] simp only [Pi.smul_apply, nsmul_eq_mul] exact β¨Dvd.dvd.mul_right (Int.natCast_dvd_natCast.mpr (B.dβ_dvd.trans B.dβ_dvd)) _, Dvd.dvd.mul_right (Int.natCast_dvd_natCast.mpr B.dβ_dvd) _, dvd_mul_right _ _β© Β· obtain β¨k, hkβ© := he _ B.Οβ_mem 3 have hk' : (k : β) = ((e : β€) : β) / B.dβ + ((0 : β€) : β) := by rw [hk]; simp [omega3]; ring have := dvd_of_cast_eq B.dβ_pos hk' exact Nat.le_of_dvd (by omega) (by exact_mod_cast this) /-- (iii) β (v). -/theorem T1_iii_iff_v : B.dβ = 1 β IsLeast (expSet M) (Z4.addSubgroupOf M).index := by rw [B.index_eq] constructor Β· intro h2 rw [B.dβ_eq_one_of_dβ h2, h2, one_mul, one_mul] exact B.isLeast_expSet Β· intro h have h' := h.unique B.isLeast_expSet have : B.dβ * B.dβ = 1 := by have := B.dβ_pos have h'' : B.dβ * B.dβ * B.dβ = 1 * B.dβ := by rw [h', one_mul] exact Nat.eq_of_mul_eq_mul_right this h'' exact Nat.dvd_one.mp β¨B.dβ, by rw [β this, mul_comm]β© /-- `p β£ dβ` iff `1, Ξ±, Ξ±Β²` are linearly dependent over `π½_p` in `A/pA`, that is, there are `cβ, cβ, cβ β β€`, not all divisible by `p`, with `cβ + cβΞ± + cβΞ±Β² β pA`. -/theorem T1_mod_p {p : β} (hp : p.Prime) : p β£ B.dβ β β c : Fin 3 β β€, Β¬ (β i, (p : β€) β£ c i) β§ β y β M, c 0 β’ apow 0 + c 1 β’ apow 1 + c 2 β’ apow 2 = p β’ y := by have hp0 : (p : β) β 0 := by exact_mod_cast hp.ne_zero constructor Β· rintro β¨m, hmβ© have hm0 : (m : β) β 0 := by have := B.dβ_pos; rw [hm] at this; exact_mod_cast (Nat.pos_of_mul_pos_left this).ne' refine β¨![B.pββ, B.pββ, 1], fun h => ?_, (m : β€) β’ B.Οβ, M.zsmul_mem B.Οβ_mem _, ?_β© Β· have h2 := h 2 simp only [Matrix.cons_val_two, Matrix.tail_cons, Matrix.head_cons] at h2 exact hp.one_lt.ne' (Nat.dvd_one.mp (by exact_mod_cast h2)) Β· funext i fin_cases i <;> simp [Οβ, omega2, hm] <;> field_simp Β· rintro β¨c, hc, y, hy, heqβ© by_contra hnd have hy3 : y 3 = 0 := by have := congrFun heq 3 simp at this exact this.resolve_left hp.ne_zero have hd2y := B.dβ_smul_mem hy hy3 have hpy : (p : β€) β’ y β Z4 := by rw [natCast_zsmul, β heq] intro i fin_cases i Β· exact β¨c 0, by simpβ© Β· exact β¨c 1, by simpβ© Β· exact β¨c 2, by simpβ© Β· exact β¨0, by simpβ© have hcop : Nat.gcd p B.dβ = 1 := (Nat.Prime.coprime_iff_not_dvd hp).mpr hnd have huv := Nat.gcd_eq_gcd_ab p B.dβ rw [hcop, Nat.cast_one] at huv set u := Nat.gcdA p B.dβ set v := Nat.gcdB p B.dβ have hyZ : y β Z4 := by have : y = u β’ ((p : β€) β’ y) + v β’ ((B.dβ : β€) β’ y) := by rw [smul_smul, smul_smul, β add_smul, mul_comm u, mul_comm v, β huv, one_smul] rw [this] exact Z4.add_mem (Z4.zsmul_mem hpy u) (Z4.zsmul_mem hd2y v) apply hc intro i fin_cases i Β· obtain β¨k, hkβ© := hyZ 0 have := congrFun heq 0 simp only [Pi.add_apply, Pi.smul_apply, Pi.single_apply] at this simp at this rw [β hk] at this exact β¨k, by exact_mod_cast thisβ© Β· obtain β¨k, hkβ© := hyZ 1 have := congrFun heq 1 simp at this rw [β hk] at this exact β¨k, by exact_mod_cast thisβ© Β· obtain β¨k, hkβ© := hyZ 2 have := congrFun heq 2 simp at this rw [β hk] at this exact β¨k, by exact_mod_cast thisβ© /-- **The proposition**, for `M = A` with `dβ = 1` (Louboutin 2020, Thm. 13): `A/β€[Ξ±] β β€/dβ Γ β€/dβ`, `dβ = [A β© Vβ : Lβ]`, (i)β(v) equivalent, and the clause modulo `p`. -/theorem prop_T1 (h1 : B.dβ = 1) : Nonempty ((M β§Έ Z4.addSubgroupOf M) β+ ZMod B.dβ Γ ZMod B.dβ) β§ (L2.addSubgroupOf (M β V2)).index = B.dβ β§ [β Ο, BasisWith M Ο, Saturated M, B.dβ = 1, IsAddCyclic (M β§Έ Z4.addSubgroupOf M), IsLeast (expSet M) (Z4.addSubgroupOf M).index].TFAE β§ β p : β, p.Prime β (p β£ B.dβ β β c : Fin 3 β β€, Β¬ (β i, (p : β€) β£ c i) β§ β y β M, c 0 β’ apow 0 + c 1 β’ apow 1 + c 2 β’ apow 2 = p β’ y) := by refine β¨B.quotient_equiv_T1 h1, B.index_V2 h1, ?_, fun p hp => B.T1_mod_p hpβ© tfae_have 1 β 2 := B.T1_i_iff_ii tfae_have 2 β 3 := B.T1_ii_iff_iii tfae_have 3 β 4 := B.T1_iii_iff_iv tfae_have 3 β 5 := B.T1_iii_iff_v tfae_finish end Triang /-! ### Non-vacuity: every datum (`dβ β£ dβ β£ dβ`, `P_k`) is realized -/ /-- `combOf` as a homomorphism. -/def combOfHom (Οβ Οβ Οβ : Fin 4 β β) : (Fin 4 β β€) β+ (Fin 4 β β) where toFun := combOf Οβ Οβ Οβ map_zero' := by simp [combOf] map_add' n m := by simp only [combOf, Pi.add_apply, add_smul]; abel /-- For every `0 < dβ β£ dβ β£ dβ` and `P_k`, the `β€`-module generated by `1, Οβ, Οβ, Οβ` carries a `Triang` structure: the hypotheses of `Triang` are not contradictory, for any `dβ`. -/def Triang.ofData (dβ dβ dβ : β) (hβ : 0 < dβ) (hβ : 0 < dβ) (hβ : 0 < dβ) (hββ : dβ β£ dβ) (hββ : dβ β£ dβ) (pββ pββ pββ pββ pββ pββ : β€) : Triang (combOfHom (omega1 dβ pββ) (omega2 dβ pββ pββ) (omega3 dβ pββ pββ pββ)).range where dβ := dβ dβ := dβ dβ := dβ dβ_pos := hβ dβ_pos := hβ dβ_pos := hβ dβ_dvd := hββ dβ_dvd := hββ pββ := pββ pββ := pββ pββ := pββ pββ := pββ pββ := pββ pββ := pββ one_mem := β¨![1, 0, 0, 0], by simp [combOfHom, combOf]β© Οβ_mem := β¨![0, 1, 0, 0], by simp [combOfHom, combOf]β© Οβ_mem := β¨![0, 0, 1, 0], by simp [combOfHom, combOf]β© Οβ_mem := β¨![0, 0, 0, 1], by simp [combOfHom, combOf]β© span := fun _ β¨n, hnβ© => β¨n, hn.symmβ© end Louboutin