Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The ray class group of a modulus

Definition
TauCeti_NumberTheory_NumberField_Global_RayClass_Basic

by riccardo.brasca · Sep 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

number-theorytauceti-chebotarev

For a modulus m\mathfrak mm of a number field KKK, let I(m)I(\mathfrak m)I(m) be the group of fractional ideals prime to its finite part, and let P1(m)P_1(\mathfrak m)P1​(m) be the subgroup of principal ideals generated by elements congruent to one modulo m\mathfrak mm. Define

Cl⁡m(K)=I(m)/P1(m).\operatorname{Cl}_{\mathfrak m}(K)=I(\mathfrak m)/P_1(\mathfrak m).Clm​(K)=I(m)/P1​(m).

The bundle supplies the quotient map, ideal classes of coprime integral ideals, and the quotient universal property.

Formalization Note. These foundational declarations are transplanted from the Tau Ceti contributors' original source (Apache-2.0, commit 948fe4751b1fe528b6d580c522ca5d743d47f185), with compatibility adaptations for Lean 4.33.1. Mathematical proofs requiring separate theorem nodes are published separately.

Definition code
/- Transplanted from https://github.com/TauCetiProject/TauCeti at 948fe4751b1fe528b6d580c522ca5d743d47f185.
Original source copyright/license notices are retained below.
Generated exclusively from compiler declaration, command, and reference facts. -/
import Definitions.Def_TauCeti_NumberTheory_NumberField_Global_RayClass_Modulus
import Definitions.Def_TauCeti_NumberTheory_NumberField_Ideal_Away
import Definitions.Def_TauCeti_RingTheory_ClassGroup_Basic
import Definitions.Def_TauCeti_RingTheory_DedekindDomain_Factorization
import Definitions.Def_TauCeti_RingTheory_DedekindDomain_Ideal
import Mathlib.Algebra.Group.Subgroup.Ker
import Mathlib.Algebra.Order.Ring.Units
import Mathlib.Algebra.Ring.Int.Units
import Mathlib.Data.Nat.Prime.Basic
import Mathlib.Data.Nat.Prime.Defs
import Mathlib.GroupTheory.Index
import Mathlib.GroupTheory.IndexNormal
import Mathlib.GroupTheory.Solvable
import Mathlib.GroupTheory.Subgroup.Center
import Mathlib.NumberTheory.NumberField.Basic
import Mathlib.NumberTheory.NumberField.InfinitePlace.Basic
import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex
import Mathlib.RingTheory.ClassGroup.Basic
import Mathlib.RingTheory.DedekindDomain.AdicValuation
import Mathlib.RingTheory.DedekindDomain.Factorization
import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas
import Mathlib.RingTheory.Valuation.Discrete.IsDiscreteValuationRing
import Mathlib.Tactic.Group

section
set_option autoImplicit true
/-
Copyright (c) 2026 The Tau Ceti contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: The Tau Ceti contributors
-/
/-!
# The ray class group of a modulus

Let `𝔪` be a modulus of a number field `K`.  The **ray** of `𝔪` is the subgroup of principal
fractional ideals generated by the elements of `Kˣ` congruent to one modulo `𝔪`, and the **ray
class group** `RayClassGroup 𝔪` is the quotient of the group `idealsPrimeTo 𝔪` of invertible
fractional ideals prime to the finite part of `𝔪` by that ray.

The ray really is a subgroup of `idealsPrimeTo 𝔪`, and not merely of all invertible fractional
ideals: an element congruent to one is a unit at every prime dividing the finite part of `𝔪`
(`IsCongrOne.valuation_eq_one`), so its principal ideal has vanishing multiplicity there.  That is
the content of `TauCeti.GlobalNumberFields.rayHom`, from which the ray is obtained as a range.

The class of an ideal is defined on the monoid `integralIdealsPrimeTo 𝔪` of nonzero integral ideals
prime to the finite part, never on all of `Ideal (𝓞 K)`: an ideal sharing a prime with the finite
part has no ray class, and carrying the coprimality proof in the argument makes multiplicativity
literally `map_mul`.

For the trivial modulus the congruence condition is empty, and the ray class group is the ordinary
class group (`oneEquivClassGroup`).

## Main definitions

* `TauCeti.GlobalNumberFields.principalIdealPrimeTo`: the principal fractional ideals whose
  generators are units at the finite part.
* `TauCeti.GlobalNumberFields.rayHom`, `TauCeti.GlobalNumberFields.ray`: the principal ideals of
  the elements congruent to one, and the subgroup they form.
* `TauCeti.GlobalNumberFields.idealsPrimeToClassGroup`: the ordinary ideal class of an invertible
  fractional ideal prime to a modulus.
* `TauCeti.GlobalNumberFields.RayClassGroup`: the quotient of `idealsPrimeTo 𝔪` by the ray, with
  `TauCeti.GlobalNumberFields.rayClassMk` and the universal property
  `TauCeti.GlobalNumberFields.rayClassLift`.
* `TauCeti.GlobalNumberFields.idealClass`: the ray class of an integral ideal prime to `𝔪`, as a
  monoid homomorphism out of `integralIdealsPrimeTo 𝔪`.
* `TauCeti.GlobalNumberFields.classMap`: the transition map, running from the ray class group of a
  larger modulus to that of a divisor of it.

## Main results

* `TauCeti.GlobalNumberFields.toPrincipalIdeal_mem_idealsPrimeTo_iff`: a principal fractional ideal
  is prime to the modulus exactly when its generator is a unit at every prime dividing the finite
  part, with `TauCeti.GlobalNumberFields.IsCongrOne.toPrincipalIdeal_mem_idealsPrimeTo` the
  consequence for an element congruent to one.
* `TauCeti.GlobalNumberFields.idealsPrimeTo_eq_top`: every invertible fractional ideal is prime
  to a modulus whose support is empty, so `TauCeti.GlobalNumberFields.idealsPrimeToEquiv`
  identifies the two carriers there.
* `TauCeti.GlobalNumberFields.idealClass_apply`: the ray class of an integral ideal is the ray
  class of the fractional ideal it generates.
* `TauCeti.GlobalNumberFields.idealClass_mul`: taking the ray class of an integral ideal respects
  multiplication.
* `TauCeti.GlobalNumberFields.idealClass_eq_one_iff`: an ideal has trivial ray class exactly when
  it is generated, as a fractional ideal, by an element of `Kˣ` congruent to one modulo `𝔪`.
* `TauCeti.GlobalNumberFields.classMap_comp_classMap` and
  `TauCeti.GlobalNumberFields.classMap_comp_idealClass`: the transition maps compose along a tower
  of moduli, and carry the class of an integral ideal to the class of the same ideal.  Both are
  equalities of homomorphisms, with the pointwise forms `classMap_classMap` and
  `classMap_idealClass` derived from them.  The transition map from a modulus to itself is the
  identity (`TauCeti.GlobalNumberFields.classMap_refl`).
* `TauCeti.GlobalNumberFields.oneEquivClassGroup`: at the trivial modulus the ray class group is
  the class group of `𝓞 K`, carrying a ray class to the class of the same fractional ideal
  (`TauCeti.GlobalNumberFields.oneEquivClassGroup_rayClassMk`).

## References

* J. Neukirch, *Algebraic Number Theory*, Chapter VI, §1.
* S. Lang, *Algebraic Number Theory*, Chapter VI, §1.
-/

 section

open IsDedekindDomain IsDedekindDomain.HeightOneSpectrum NumberField
open scoped nonZeroDivisors NumberField

namespace TauCeti.GlobalNumberFields

variable {K : Type*} [Field K] [NumberField K]

/-- **A principal fractional ideal is prime to the modulus exactly when its generator is a unit at
every prime dividing the finite part.** -/
theorem toPrincipalIdeal_mem_idealsPrimeTo_iff {𝔪 : Modulus K} {x : Kˣ} :
    toPrincipalIdeal (𝓞 K) K x ∈ idealsPrimeTo 𝔪 ↔ x ∈ primeToSubgroup 𝔪 := by
  rw [NumberFieldArithmetic.mem_idealsAway_iff, mem_primeToSubgroup]
  refine ⟨fun h v hv ↦ ?_, fun h v hv ↦ ?_⟩
  · have hcount := h v ((Modulus.mem_support_iff _ _).mpr hv)
    rw [FractionalIdeal.count_toPrincipalIdeal_eq_neg_log_valuation K v x, neg_eq_zero] at hcount
    have hne : v.valuation K (x : K) ≠ 0 := (Valuation.ne_zero_iff _).mpr x.ne_zero
    rw [← WithZero.exp_log hne, hcount, WithZero.exp_zero]
  · rw [FractionalIdeal.count_toPrincipalIdeal_eq_neg_log_valuation K v x,
      h v ((Modulus.mem_support_iff _ _).mp hv), WithZero.log_one, neg_zero]

/-- **The principal ideal of an element congruent to one is prime to the modulus.**  At a prime
dividing the finite part such an element is a unit, so the multiplicity of its principal ideal
vanishes there. -/
theorem IsCongrOne.toPrincipalIdeal_mem_idealsPrimeTo {𝔪 : Modulus K} {x : Kˣ}
    (hx : IsCongrOne 𝔪 x) : toPrincipalIdeal (𝓞 K) K x ∈ idealsPrimeTo 𝔪 :=
  toPrincipalIdeal_mem_idealsPrimeTo_iff.mpr
    (congruenceSubgroup_le_primeToSubgroup 𝔪 (mem_congruenceSubgroup.mpr hx))

/-- The principal fractional ideal of an element that is a unit at every prime dividing the
finite part of `m`, viewed as an element of `idealsPrimeTo m`. -/
noncomputable def principalIdealPrimeTo (m : Modulus K) :
    primeToSubgroup m →* idealsPrimeTo m :=
  MonoidHom.codRestrict
    ((toPrincipalIdeal (RingOfIntegers K) K).comp (primeToSubgroup m).subtype)
    (idealsPrimeTo m) fun x ↦ toPrincipalIdeal_mem_idealsPrimeTo_iff.mpr x.2

/-- `principalIdealPrimeTo` does not change the underlying principal fractional ideal. -/
@[simp] theorem coe_principalIdealPrimeTo (m : Modulus K) (x : primeToSubgroup m) :
    ((principalIdealPrimeTo m x : idealsPrimeTo m) :
        (FractionalIdeal (RingOfIntegers K)⁰ K)ˣ) =
      toPrincipalIdeal (RingOfIntegers K) K (x : Kˣ) := by
  simp only [principalIdealPrimeTo, MonoidHom.codRestrict_apply, MonoidHom.comp_apply,
    Subgroup.subtype_apply]

/-- The homomorphism sending an element of `Kˣ` congruent to one modulo `𝔪` to its principal
fractional ideal, viewed inside the ideals prime to `𝔪`. -/
noncomputable def rayHom (𝔪 : Modulus K) :
    congruenceSubgroup 𝔪 →* idealsPrimeTo 𝔪 :=
  MonoidHom.codRestrict ((toPrincipalIdeal (𝓞 K) K).comp (congruenceSubgroup 𝔪).subtype) _
    fun x ↦ (mem_congruenceSubgroup.mp x.2).toPrincipalIdeal_mem_idealsPrimeTo

@[simp] theorem coe_rayHom (𝔪 : Modulus K) (x : congruenceSubgroup 𝔪) :
    ((rayHom 𝔪 x : idealsPrimeTo 𝔪) : (FractionalIdeal (𝓞 K)⁰ K)ˣ) =
      toPrincipalIdeal (𝓞 K) K (x : Kˣ) := (rfl)

/-- **The ray of a modulus**: the subgroup of `idealsPrimeTo 𝔪` consisting of the principal
fractional ideals of the elements of `Kˣ` congruent to one modulo `𝔪`. -/
noncomputable def ray (𝔪 : Modulus K) : Subgroup (idealsPrimeTo 𝔪) :=
  (rayHom 𝔪).range

@[simp] theorem mem_ray_iff {𝔪 : Modulus K} {I : idealsPrimeTo 𝔪} :
    I ∈ ray 𝔪 ↔ ∃ x : Kˣ, IsCongrOne 𝔪 x ∧
      toPrincipalIdeal (𝓞 K) K x = (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) := by
  rw [ray, MonoidHom.mem_range]
  refine ⟨fun ⟨x, hx⟩ ↦ ⟨x, mem_congruenceSubgroup.mp x.2, ?_⟩, fun ⟨x, hx, hxI⟩ ↦ ?_⟩
  · rw [← coe_rayHom 𝔪 x, hx]
  · exact ⟨⟨x, mem_congruenceSubgroup.mpr hx⟩, Subtype.ext (Units.ext (by rw [coe_rayHom, hxI]))⟩

/-- **The ordinary ideal class of an invertible fractional ideal prime to a modulus.** This is the
canonical map from `idealsPrimeTo 𝔪` to the ordinary class group; it descends to the right-hand
transition in the ray-class exact sequence. -/
noncomputable def idealsPrimeToClassGroup (𝔪 : Modulus K) :
    idealsPrimeTo 𝔪 →* ClassGroup (𝓞 K) :=
  (ClassGroup.mk K).comp (idealsPrimeTo 𝔪).subtype

@[simp] theorem idealsPrimeToClassGroup_apply (𝔪 : Modulus K) (I : idealsPrimeTo 𝔪) :
    idealsPrimeToClassGroup 𝔪 I =
      ClassGroup.mk K (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) :=
  by simp only [idealsPrimeToClassGroup, MonoidHom.comp_apply, Subgroup.subtype_apply]

/-- The principal fractional ideals prime to a modulus are exactly the kernel of the map to the
ordinary ideal class group. -/
theorem range_principalIdealPrimeTo (m : Modulus K) :
    (principalIdealPrimeTo m).range = (idealsPrimeToClassGroup m).ker := by
  ext I
  rw [MonoidHom.mem_range, MonoidHom.mem_ker, idealsPrimeToClassGroup_apply,
    ClassGroup.mk_eq_one_iff_exists]
  constructor
  · rintro ⟨x, rfl⟩
    exact ⟨(x : Kˣ), coe_principalIdealPrimeTo m x⟩
  · rintro ⟨x, hx⟩
    refine ⟨⟨x, toPrincipalIdeal_mem_idealsPrimeTo_iff.mp (hx ▸ I.2)⟩, ?_⟩
    apply Subtype.ext
    apply Units.ext
    rw [coe_principalIdealPrimeTo, hx]

/-- **The ray class group of a modulus**: the invertible fractional ideals prime to the finite part
of `𝔪`, modulo the principal ideals of the elements congruent to one modulo `𝔪`. -/
def RayClassGroup (𝔪 : Modulus K) : Type _ :=
  idealsPrimeTo 𝔪 ⧸ ray 𝔪

noncomputable instance (𝔪 : Modulus K) : CommGroup (RayClassGroup 𝔪) :=
  inferInstanceAs (CommGroup (idealsPrimeTo 𝔪 ⧸ ray 𝔪))

noncomputable instance (𝔪 : Modulus K) : Inhabited (RayClassGroup 𝔪) := ⟨1⟩

/-- The ray class of an invertible fractional ideal prime to the modulus. -/
noncomputable def rayClassMk (𝔪 : Modulus K) :
    idealsPrimeTo 𝔪 →* RayClassGroup 𝔪 :=
  QuotientGroup.mk' (ray 𝔪)

theorem rayClassMk_surjective (𝔪 : Modulus K) : Function.Surjective (rayClassMk 𝔪) :=
  QuotientGroup.mk'_surjective _

@[simp] theorem rayClassMk_eq_one_iff {𝔪 : Modulus K} {I : idealsPrimeTo 𝔪} :
    rayClassMk 𝔪 I = 1 ↔ I ∈ ray 𝔪 :=
  QuotientGroup.eq_one_iff I

/-- **The universal property of the ray class group.**  A homomorphism out of the invertible
fractional ideals prime to `𝔪` which is trivial on the ray factors, uniquely, through the ray
class group. -/
noncomputable def rayClassLift {M : Type*} [Monoid M] {𝔪 : Modulus K} (φ : idealsPrimeTo 𝔪 →* M)
    (h : ray 𝔪 ≤ φ.ker) : RayClassGroup 𝔪 →* M :=
  QuotientGroup.lift (ray 𝔪) φ h







/-- **The ray class of an integral ideal prime to the modulus.**  The domain is the monoid of
nonzero integral ideals prime to the finite part of `𝔪`, never `Ideal (𝓞 K)`: an ideal sharing a
prime with the finite part, or the zero ideal, has no ray class, and a version totalized over
arbitrary ideals would hand back a junk class there.  Carrying the coprimality proof in the
argument also makes multiplicativity `map_mul` rather than a law with side conditions. -/
noncomputable def idealClass (𝔪 : Modulus K) :
    integralIdealsPrimeTo 𝔪 →* RayClassGroup 𝔪 :=
  (rayClassMk 𝔪).comp (NumberFieldArithmetic.integralIdealsAwayHom 𝔪.support)





/-- **The intrinsic triviality criterion for a ray class.**  An integral ideal prime to `𝔪` has
trivial ray class exactly when it is generated as a *fractional* ideal by an element of `Kˣ` that
is congruent to one modulo `𝔪`; the congruence already carries both the finite conditions and the
positivity at the real places of `𝔪`. -/
@[simp] theorem idealClass_eq_one_iff {𝔪 : Modulus K} (I : integralIdealsPrimeTo 𝔪) :
    idealClass 𝔪 I = 1 ↔ ∃ x : Kˣ, IsCongrOne 𝔪 x ∧
      ((I : Ideal (𝓞 K)) : FractionalIdeal (𝓞 K)⁰ K) =
        FractionalIdeal.spanSingleton (𝓞 K)⁰ (x : K) := by
  rw [idealClass, MonoidHom.comp_apply, rayClassMk_eq_one_iff, mem_ray_iff]
  refine exists_congr fun x ↦ and_congr_right fun _ ↦ ?_
  rw [Units.ext_iff, coe_toPrincipalIdeal,
    NumberFieldArithmetic.coe_integralIdealsAwayHom 𝔪.support I]
  exact eq_comm

/-! ### The transition map between ray class groups -/

/-- **The transition map between ray class groups.**  For `𝔪 ∣ 𝔫` it runs from the *larger* modulus
to the smaller one: an invertible fractional ideal prime to `𝔫` is prime to `𝔪`, and an element
congruent to one modulo `𝔫` is congruent to one modulo `𝔪`, so the ray of `𝔫` lands in the ray
of `𝔪`. -/
noncomputable def classMap {𝔪 𝔫 : Modulus K} (h : 𝔪 ∣ 𝔫) :
    RayClassGroup 𝔫 →* RayClassGroup 𝔪 :=
  QuotientGroup.map (ray 𝔫) (ray 𝔪)
    (NumberFieldArithmetic.idealsAwayInclusion (Modulus.support_mono h)) <| by
      intro J hJ
      obtain ⟨x, hx, hxJ⟩ := mem_ray_iff.mp hJ
      refine Subgroup.mem_comap.mpr (mem_ray_iff.mpr ⟨x, IsCongrOne.mono h hx, ?_⟩)
      rw [NumberFieldArithmetic.coe_idealsAwayInclusion, hxJ]















/-! ### Moduli with unit finite part -/

/-- **Every invertible fractional ideal is prime to a modulus with empty support**: no prime
divides the finite part, so no multiplicity is required to vanish.  The trivial modulus and the
narrow modulus are the two moduli of this kind. -/
theorem idealsPrimeTo_eq_top {𝔪 : Modulus K} (h : 𝔪.support = ∅) : idealsPrimeTo 𝔪 = ⊤ :=
  Subgroup.eq_top_iff' _ |>.mpr fun _ ↦
    NumberFieldArithmetic.mem_idealsAway_iff.mpr fun v hv ↦
      absurd (h ▸ hv) (Finset.notMem_empty v)

/-- The ideals prime to a modulus with empty support are all the invertible fractional ideals. -/
noncomputable def idealsPrimeToEquiv {𝔪 : Modulus K} (h : 𝔪.support = ∅) :
    idealsPrimeTo 𝔪 ≃* (FractionalIdeal (𝓞 K)⁰ K)ˣ :=
  (MulEquiv.subgroupCongr (idealsPrimeTo_eq_top h)).trans Subgroup.topEquiv

@[simp] theorem idealsPrimeToEquiv_apply {𝔪 : Modulus K} (h : 𝔪.support = ∅)
    (I : idealsPrimeTo 𝔪) :
    idealsPrimeToEquiv h I = (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) := (rfl)



/-! ### The trivial modulus -/

/-- The ray of the trivial modulus is the group of all principal fractional ideals. -/
theorem map_ray_one :
    Subgroup.map (idealsPrimeToEquiv (Modulus.support_one (K := K)) :
        idealsPrimeTo (Modulus.one K) →* (FractionalIdeal (𝓞 K)⁰ K)ˣ)
      (ray (Modulus.one K)) = (toPrincipalIdeal (𝓞 K) K).range := by
  ext I
  rw [Subgroup.mem_map, MonoidHom.mem_range]
  refine ⟨fun ⟨J, hJ, hJI⟩ ↦ ?_, fun ⟨x, hx⟩ ↦ ?_⟩
  · obtain ⟨x, _, hxJ⟩ := mem_ray_iff.mp hJ
    exact ⟨x, by rw [hxJ, ← hJI, MonoidHom.coe_coe, idealsPrimeToEquiv_apply]⟩
  · exact ⟨⟨I, idealsPrimeTo_eq_top (Modulus.support_one (K := K)) ▸ Subgroup.mem_top I⟩,
      mem_ray_iff.mpr ⟨x, isCongrOne_one x, hx⟩, rfl⟩

/-- **At the trivial modulus the ray class group is the ordinary class group.**  This is a named
equivalence, not a definitional equality: the ray class group is a quotient of the ideals prime to
the empty set of primes, and the class group is a quotient of all invertible fractional ideals. -/
noncomputable def oneEquivClassGroup :
    RayClassGroup (Modulus.one K) ≃* ClassGroup (𝓞 K) :=
  (QuotientGroup.congr (ray (Modulus.one K)) (toPrincipalIdeal (𝓞 K) K).range
    (idealsPrimeToEquiv Modulus.support_one) map_ray_one).trans
    (ClassGroup.equiv (K := K)).symm



end TauCeti.GlobalNumberFields

end
end
Source
https://github.com/TauCetiProject/TauCeti/blob/948fe4751b1fe528b6d580c522ca5d743d47f185/TauCeti/NumberTheory/NumberField/Global/RayClass/Basic.lean

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me