The narrow ideal class group and narrow class number of a number field
DefinitionClassNumberFormula_NarrowClassGroupFor a number field , an element is totally positive if it is positive under every real embedding . The narrow ideal class group of is the group of invertible fractional ideals of the ring of integers modulo the subgroup of principal ideals that admit a totally positive generator, and the narrow class number is its cardinality.
This is Mathlib's ClassGroup construction with the subgroup of all principal
ideals replaced by the subgroup of totally positive principal ideals. The quotient
is taken over , exactly as for
ClassGroup, so the forgetful map from the narrow class group to the ordinary
class group is the quotient map induced by the identity. For a field with no real
embeddings (for instance an imaginary quadratic field) the positivity condition is
vacuous and the narrow and ordinary class groups coincide; for a real quadratic
field the narrow class number is either the class number or twice it, according
to whether the field has a unit of norm .
This definition is the missing ingredient for the positive-discriminant case of Dirichlet's class number formula for binary quadratic forms: proper-equivalence classes of indefinite forms count narrow ideal classes, not ordinary ones.
Formalization Note The declarations live in the ClassNumberFormula
namespace: totallyPositive, totallyPositiveUnits, narrowPrincipalSubgroup,
NarrowClassGroup with its constructor NarrowClassGroup.mk, the forgetful map
NarrowClassGroup.toClassGroup (compatible with the two mk maps by rfl), and
narrowClassNumber, defined with Nat.card since no Fintype instance for the
narrow class group is available before its finiteness is proved.
import Mathlib
open scoped nonZeroDivisors NumberField
namespace ClassNumberFormula
variable (K : Type*) [Field K] [NumberField K]
/-- An element of a number field is *totally positive* if it is positive under every
real embedding `K →ₐ[ℚ] ℝ`. The condition is vacuous when `K` has no real embeddings;
below it is applied only to units, which are nonzero. -/
def totallyPositive (x : K) : Prop :=
∀ σ : K →ₐ[ℚ] ℝ, 0 < σ x
/-- The subgroup of units of `K` that are totally positive. -/
def totallyPositiveUnits : Subgroup Kˣ where
carrier := {x | totallyPositive K (x : K)}
one_mem' := by
intro σ
simp
mul_mem' := by
intro a b ha hb σ
have ha' := ha σ
have hb' := hb σ
simp only [Units.val_mul, map_mul]
exact mul_pos ha' hb'
inv_mem' := by
intro a ha σ
have ha' := ha σ
rw [Units.val_inv_eq_inv_val, map_inv₀]
exact inv_pos.mpr ha'
/-- The subgroup of principal fractional ideals of `𝓞 K` generated by totally positive
elements of `K`, transported to the fraction field `FractionRing (𝓞 K)` used by
Mathlib's `ClassGroup`. It is the image of `totallyPositiveUnits K` under the composite
`Kˣ → (FractionRing (𝓞 K))ˣ → (FractionalIdeal (𝓞 K)⁰ (FractionRing (𝓞 K)))ˣ`, where
the first map is induced by the canonical identification of the two fraction fields
of `𝓞 K` and the second is `toPrincipalIdeal`. -/
noncomputable def narrowPrincipalSubgroup :
Subgroup (FractionalIdeal (𝓞 K)⁰ (FractionRing (𝓞 K)))ˣ :=
(totallyPositiveUnits K).map
((toPrincipalIdeal (𝓞 K) (FractionRing (𝓞 K))).comp
(Units.map
(IsLocalization.algEquiv (𝓞 K)⁰ K (FractionRing (𝓞 K))).toRingEquiv.toMonoidHom))
instance : (narrowPrincipalSubgroup K).Normal :=
Subgroup.normal_of_isMulCommutative _
/-- The *narrow ideal class group* of a number field `K`: the group of invertible
fractional ideals of `𝓞 K` modulo the principal ideals generated by totally positive
elements. This is Mathlib's `ClassGroup` construction with the subgroup of all
principal ideals replaced by the subgroup of totally positive principal ideals.
Marked `noncomputable` because the subgroup is built from the canonical
identification of fraction fields, which is noncomputable. -/
noncomputable def NarrowClassGroup :=
(FractionalIdeal (𝓞 K)⁰ (FractionRing (𝓞 K)))ˣ ⧸ narrowPrincipalSubgroup K
noncomputable instance : CommGroup (NarrowClassGroup K) :=
QuotientGroup.Quotient.commGroup (narrowPrincipalSubgroup K)
noncomputable instance : Inhabited (NarrowClassGroup K) :=
⟨1⟩
/-- Send a nonzero fractional ideal of `𝓞 K`, viewed in `K`, to its narrow class.
This is `ClassGroup.mk` with the narrow quotient in place of the ordinary one. -/
noncomputable def NarrowClassGroup.mk : (FractionalIdeal (𝓞 K)⁰ K)ˣ →* NarrowClassGroup K :=
(QuotientGroup.mk' (narrowPrincipalSubgroup K)).comp
(Units.map (FractionalIdeal.canonicalEquiv (𝓞 K)⁰ K (FractionRing (𝓞 K))))
/-- The natural map from the narrow class group to the ordinary class group,
forgetting the positivity condition on principal generators. -/
noncomputable def NarrowClassGroup.toClassGroup : NarrowClassGroup K →* ClassGroup (𝓞 K) :=
QuotientGroup.map (narrowPrincipalSubgroup K)
(toPrincipalIdeal (𝓞 K) (FractionRing (𝓞 K))).range (MonoidHom.id _) (by
intro I hI
rw [Subgroup.mem_comap, MonoidHom.id_apply]
obtain ⟨α, -, hα⟩ := Subgroup.mem_map.mp hI
exact ⟨Units.map
(IsLocalization.algEquiv (𝓞 K)⁰ K (FractionRing (𝓞 K))).toRingEquiv.toMonoidHom α, hα⟩)
/-- The natural map to the ordinary class group sends the narrow class of a
fractional ideal to its ordinary class. -/
theorem NarrowClassGroup.toClassGroup_mk (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) :
NarrowClassGroup.toClassGroup K (NarrowClassGroup.mk K I) = ClassGroup.mk K I :=
rfl
/-- The *narrow class number* of a number field `K`: the cardinality of its narrow
class group. This parallels `NumberField.classNumber`, which is defined as
`Fintype.card (ClassGroup (𝓞 K))`; `Nat.card` is used here because no
`Fintype (NarrowClassGroup K)` instance is available until finiteness of the narrow
class group is proved. -/
noncomputable def narrowClassNumber : ℕ :=
Nat.card (NarrowClassGroup K)
end ClassNumberFormula