Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7361,6 +7361,7 @@ public import Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity
public import Mathlib.RingTheory.RootsOfUnity.Lemmas
public import Mathlib.RingTheory.RootsOfUnity.Minpoly
public import Mathlib.RingTheory.RootsOfUnity.PrimitiveRoots
public import Mathlib.RingTheory.RootsOfUnity.Quotient
public import Mathlib.RingTheory.SimpleModule.Basic
public import Mathlib.RingTheory.SimpleModule.InjectiveProjective
public import Mathlib.RingTheory.SimpleModule.IsAlgClosed
Expand Down
75 changes: 17 additions & 58 deletions Mathlib/NumberTheory/NumberField/Ideal/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Authors: Xavier Roblot
module

public import Mathlib.NumberTheory.NumberField.Cyclotomic.Ideal
public import Mathlib.RingTheory.RootsOfUnity.Quotient

/-!
# Basic results on integral ideals of a number field
Expand All @@ -14,11 +15,8 @@ We study results about integral ideals of a number field `K`.

## Main definitions and results

* `Ideal.rootsOfUnityMapQuot` : For `I` an integral ideal of `K`, the group morphism from the
group of roots of unity of `K` of order `n` to `(𝓞 K ⧸ I)ˣ`.

* `Ideal.rootsOfUnityMapQuot_injective`: If the ideal `I` is nontrivial and its norm is coprime
with `n`, then the map `Ideal.rootsOfUnityMapQuot` is injective.
* `Ideal.torsionMapQuot_injective`: If the ideal `I` is nontrivial and its norm is coprime
with `torsionOrder K`, then the map `Ideal.torsionMapQuot` is injective.

* `NumberField.torsionOrder_dvd_absNorm_sub_one`: If the norm of the (nonzero) prime ideal `P` is
coprime with the order of the torsion of `K`, then the norm of `P` is congruent to `1` modulo
Expand All @@ -37,6 +35,7 @@ variable {K : Type*} [Field K] {I : Ideal (𝓞 K)}

section torsionMapQuot

@[deprecated "use `IsPrimitiveRoot.not_coprime_absNorm_of_mk_eq_one`" (since := "2026-10-07")]
theorem IsPrimitiveRoot.not_coprime_norm_of_mk_eq_one [NumberField K] (hI : absNorm I ≠ 1) {n : ℕ}
{ζ : K} (hn : 2 ≤ n) (hζ : IsPrimitiveRoot ζ n)
(h : letI _ : NeZero n := NeZero.of_gt hn; Ideal.Quotient.mk I hζ.toInteger = 1) :
Expand All @@ -49,58 +48,21 @@ theorem IsPrimitiveRoot.not_coprime_norm_of_mk_eq_one [NumberField K] (hI : absN
exact hζ.prime_dvd_of_dvd_norm_sub_one hn <|
Int.dvd_trans (Int.natCast_dvd_natCast.mpr h₂) (absNorm_dvd_norm_of_mem h)

variable (I)

/--
For `I` an integral ideal of `K`, the group morphism from the group of roots of unity of `K`
of order `n` to `(𝓞 K ⧸ I)ˣ`.
-/
def Ideal.rootsOfUnityMapQuot (n : ℕ) : (rootsOfUnity n (𝓞 K)) →* ((𝓞 K) ⧸ I)ˣ :=
(Units.map (Ideal.Quotient.mk I).toMonoidHom).domRestrict _

@[simp]
theorem Ideal.rootsOfUnityMapQuot_apply (n : ℕ) {x : (𝓞 K)ˣ} (hx : x ∈ rootsOfUnity n (𝓞 K)) :
rootsOfUnityMapQuot I n ⟨x, hx⟩ = Ideal.Quotient.mk I x := rfl
variable [NumberField K]

variable (I) in
/--
For `I` an integral ideal of `K`, the group morphism from the torsion of `K` to `(𝓞 K ⧸ I)ˣ`.
-/
def Ideal.torsionMapQuot : (Units.torsion K) →* ((𝓞 K) ⧸ I)ˣ :=
(Units.map (Ideal.Quotient.mk I).toMonoidHom).domRestrict (torsion K)
noncomputable def Ideal.torsionMapQuot : (Units.torsion K) →* ((𝓞 K) ⧸ I)ˣ :=
(rootsOfUnityMapQuot I (torsionOrder K)).comp
(MulEquiv.subgroupCongr (rootsOfUnity_eq_torsion K).symm).toMonoidHom

variable (I) in
@[simp]
theorem Ideal.torsionMapQuot_apply {x : (𝓞 K)ˣ} (hx : x ∈ torsion K) :
torsionMapQuot I ⟨x, hx⟩ = Ideal.Quotient.mk I x := rfl

variable {I} [NumberField K]

theorem Ideal.rootsOfUnityMapQuot_injective (n : ℕ) [NeZero n] (hI₁ : absNorm I ≠ 1)
(hI₂ : (absNorm I).Coprime n) :
Function.Injective (rootsOfUnityMapQuot I n) := by
refine (injective_iff_map_eq_one _).mpr fun ⟨ζ, hζ⟩ h ↦ ?_
obtain ⟨t, ht₀, ht, hζ⟩ := isPrimitiveRoot_of_mem_rootsOfUnity hζ
suffices ¬ (2 ≤ t) by
simpa [show t = 1 by grind] using hζ
intro ht'
let μ : K := ζ.val
have hμ : IsPrimitiveRoot μ t :=
(IsPrimitiveRoot.coe_units_iff.mpr hζ).map_of_injective RingOfIntegers.coe_injective
rw [Units.ext_iff, rootsOfUnityMapQuot_apply, Units.val_one] at h
refine hμ.not_coprime_norm_of_mk_eq_one hI₁ ht' h ?_
exact Nat.dvd_one.mp (hI₂ ▸ Nat.gcd_dvd_gcd_of_dvd_right (absNorm I) ht)

theorem Ideal.rootsOfUnityMapQuot_inj (n : ℕ) [NeZero n] (hI₁ : absNorm I ≠ 1)
(hI₂ : (absNorm I).Coprime n) {x y : rootsOfUnity n (𝓞 K)} :
rootsOfUnityMapQuot I n x = rootsOfUnityMapQuot I n y ↔ x = y :=
(rootsOfUnityMapQuot_injective n hI₁ hI₂).eq_iff

theorem IsPrimitiveRoot.idealQuotient_mk {n : ℕ} [NeZero n] {ζ : (𝓞 K)} (hζ : IsPrimitiveRoot ζ n)
(hI₁ : absNorm I ≠ 1) (hI₂ : (absNorm I).Coprime n) :
IsPrimitiveRoot (Ideal.Quotient.mk I ζ) n := by
have h : IsPrimitiveRoot hζ.toRootsOfUnity n :=
IsPrimitiveRoot.coe_submonoidClass_iff.mp <| IsPrimitiveRoot.coe_units_iff.mp hζ
exact IsPrimitiveRoot.coe_units_iff.mpr <|
h.map_of_injective <| Ideal.rootsOfUnityMapQuot_injective n hI₁ hI₂
torsionMapQuot I ⟨x, hx⟩ = Ideal.Quotient.mk I x := by
simp [torsionMapQuot]

/--
If the ideal `I` is nontrivial and its norm is coprime with `torsionOrder K`, then the map
Expand All @@ -111,11 +73,8 @@ is replaced by `I` being unramified over `ℤ`.
-/
theorem Ideal.torsionMapQuot_injective (hI₁ : absNorm I ≠ 1)
(hI₂ : (absNorm I).Coprime (torsionOrder K)) :
Function.Injective (torsionMapQuot I) := by
intro ⟨x, hx⟩ ⟨y, hy⟩ h
rw [← rootsOfUnity_eq_torsion] at hx hy
rw [Subtype.mk_eq_mk, ← Subtype.mk_eq_mk (h := hx) (h' := hy)]
exact rootsOfUnityMapQuot_injective (torsionOrder K) hI₁ hI₂ h
Function.Injective (torsionMapQuot I) :=
(rootsOfUnityMapQuot_injective _ hI₁ hI₂).comp (MulEquiv.injective _)

theorem Ideal.torsionMapQuot_inj (hI₁ : absNorm I ≠ 1)
(hI₂ : (absNorm I).Coprime (torsionOrder K)) {x y : torsion K} :
Expand All @@ -141,9 +100,9 @@ theorem Ideal.torsionMapQuot_injective' {P : Ideal (𝓞 K)} [hP : P.IsPrime]
refine ⟨orderOf ζ, ?_, IsPrimitiveRoot.coe_coe_iff.mpr (IsPrimitiveRoot.orderOf ζ)⟩
rw [Nat.two_le_iff, orderOf_ne_zero_iff]
exact ⟨hζ₀, by simpa using hζ₂⟩
have h_cpr := hζ₃.not_coprime_norm_of_mk_eq_one
(absNorm_eq_one_iff.not.mpr <| IsPrime.ne_top hP) hn
(by rwa [Units.ext_iff, torsionMapQuot_apply, val_one] at hζ₁)
have h_cpr := (hζ₃.of_map_of_injective RingOfIntegers.coe_injective)
|>.not_coprime_absNorm_of_mk_eq_one hn (absNorm_eq_one_iff.not.mpr <| IsPrime.ne_top hP)
(by simpa [Units.ext_iff] using hζ₁)
let p := (Ideal.under ℤ P).absNorm
have hp := Nat.absNorm_under_prime P
have : Fact p.Prime := ⟨hp⟩
Expand Down
114 changes: 114 additions & 0 deletions Mathlib/RingTheory/RootsOfUnity/Quotient.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/-
Copyright (c) 2026 Xavier Roblot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Xavier Roblot
-/
module

public import Mathlib.RingTheory.Ideal.Norm.AbsNorm
public import Mathlib.RingTheory.RootsOfUnity.CyclotomicUnits

/-!
# Roots of unity in a quotient ring

For `I` an ideal of a commutative ring `R`, reduction modulo `I` sends the `n`-th roots of unity
of `R` to `n`-th roots of unity of `R ⧸ I`.

## Main definitions and results

* `Ideal.rootsOfUnityMapQuot`: the group homomorphism from the `n`-th roots of unity of `R` to
`(R ⧸ I)ˣ` induced by the quotient map.

* `Ideal.rootsOfUnityMapQuot_injective_of_notMem`: if `R` is a domain and `(n : R) ∉ I`, then
the map `Ideal.rootsOfUnityMapQuot` is injective.

* `Ideal.rootsOfUnityMapQuot_injective`: if the absolute norm of `I` is different from `1` and
coprime with `n`, then the map `Ideal.rootsOfUnityMapQuot` is injective.

* `IsPrimitiveRoot.idealQuotient_mk`: if the absolute norm of `I` is different from `1` and
coprime with `n`, then the reduction modulo `I` of a primitive `n`-th root of unity is a
primitive `n`-th root of unity.

* `IsPrimitiveRoot.not_coprime_absNorm_of_mk_eq_one`: if a primitive `n`-th root of unity, with
`2 ≤ n`, is `1` modulo a proper ideal `I`, then the absolute norm of `I` is not coprime with `n`.

-/

public section

variable {R : Type*} [CommRing R] (I : Ideal R)

namespace Ideal

/-- The group homomorphism from the `n`-th roots of unity of `R` to `(R ⧸ I)ˣ` induced by the
quotient map `R → R ⧸ I`. -/
def rootsOfUnityMapQuot (n : ℕ) : rootsOfUnity n R →* (R ⧸ I)ˣ :=
(rootsOfUnity n (R ⧸ I)).subtype.comp (restrictRootsOfUnity (Ideal.Quotient.mk I) n)
Comment thread
xroblot marked this conversation as resolved.
Resolved

@[deprecated "use `rootsOfUnityMapQuot_coe_apply`" (since := "2026-10-07")]
theorem rootsOfUnityMapQuot_apply (n : ℕ) {x : Rˣ} (hx : x ∈ rootsOfUnity n R) :
rootsOfUnityMapQuot I n ⟨x, hx⟩ = Ideal.Quotient.mk I x := by rfl

@[simp]
theorem rootsOfUnityMapQuot_coe_apply (n : ℕ) (ζ : rootsOfUnity n R) :
(I.rootsOfUnityMapQuot n ζ : R ⧸ I) = Ideal.Quotient.mk I (ζ : Rˣ) := by
rfl

/-- If `R` is a domain and `(n : R) ∉ I`, then reduction modulo `I` is injective on the `n`-th
roots of unity. -/
theorem rootsOfUnityMapQuot_injective_of_notMem [IsDomain R] {n : ℕ} (hn : (n : R) ∉ I) :
Function.Injective (I.rootsOfUnityMapQuot n) := by
refine (injective_iff_map_eq_one _).mpr fun ζ h ↦ ?_
by_contra hζ
obtain ⟨c, hc⟩ := sub_one_dvd_natCast_of_pow_eq_one ((mem_rootsOfUnity' n _).mp ζ.prop)
(fun h₁ ↦ hζ (Subtype.ext (Units.ext h₁)))
refine hn (hc ▸ I.mul_mem_right c ?_)
rw [← Ideal.Quotient.eq_zero_iff_mem, map_sub, map_one, sub_eq_zero]
exact congr_arg Units.val h

end Ideal

section absNorm

variable [IsDedekindDomain R] {I}

namespace Ideal

/-- If the absolute norm of `I` is different from `1` and coprime with `n`, then reduction modulo
`I` is injective on the `n`-th roots of unity. -/
theorem rootsOfUnityMapQuot_injective (n : ℕ) (hI₁ : absNorm I ≠ 1)
(hI₂ : (absNorm I).Coprime n) :
Function.Injective (rootsOfUnityMapQuot I n) := by
refine rootsOfUnityMapQuot_injective_of_notMem I fun hn ↦ hI₁ <| absNorm_eq_one_iff.mpr <|
I.eq_top_iff_one.mpr ?_
obtain ⟨u, v, h⟩ := hI₂.cast (R := R)
exact h ▸ I.add_mem (I.mul_mem_left u (absNorm_mem I)) (I.mul_mem_left v hn)

theorem rootsOfUnityMapQuot_inj (n : ℕ) (hI₁ : absNorm I ≠ 1)
(hI₂ : (absNorm I).Coprime n) {x y : rootsOfUnity n R} :
rootsOfUnityMapQuot I n x = rootsOfUnityMapQuot I n y ↔ x = y :=
(rootsOfUnityMapQuot_injective n hI₁ hI₂).eq_iff

end Ideal

/-- If the absolute norm of `I` is different from `1` and coprime with `n`, then the reduction
modulo `I` of a primitive `n`-th root of unity is a primitive `n`-th root of unity. -/
theorem IsPrimitiveRoot.idealQuotient_mk {n : ℕ} {ζ : R} (hζ : IsPrimitiveRoot ζ n)
(hI₁ : Ideal.absNorm I ≠ 1) (hI₂ : (Ideal.absNorm I).Coprime n) :
IsPrimitiveRoot (Ideal.Quotient.mk I ζ) n := by
have : NeZero n := ⟨by
rintro rfl
exact hI₁ (Nat.coprime_zero_right _ |>.mp hI₂)⟩
have h : IsPrimitiveRoot hζ.toRootsOfUnity n :=
IsPrimitiveRoot.coe_submonoidClass_iff.mp <| IsPrimitiveRoot.coe_units_iff.mp hζ
simpa using IsPrimitiveRoot.coe_units_iff.mpr <|
h.map_of_injective <| Ideal.rootsOfUnityMapQuot_injective n hI₁ hI₂

/-- If a primitive `n`-th root of unity, with `2 ≤ n`, is `1` modulo a proper ideal `I`, then the
absolute norm of `I` is not coprime with `n`. -/
theorem IsPrimitiveRoot.not_coprime_absNorm_of_mk_eq_one {n : ℕ} {ζ : R}
(hζ : IsPrimitiveRoot ζ n) (hn : 2 ≤ n) (hI : Ideal.absNorm I ≠ 1)
(h : Ideal.Quotient.mk I ζ = 1) : ¬ (Ideal.absNorm I).Coprime n := fun hc ↦
(hζ.idealQuotient_mk hI hc).ne_one hn h

end absNorm