Forgetting on purpose
A clock forgets. At o'clock, adding hours gives , not , because the clock treats multiples of as if they were . The arithmetic that results, , is not a part of . It is seen through a lens that cannot tell from . Gauss built the theory of congruences on this idea in 1801, and it is everywhere in computing, from check digits to cryptography.
The same move creates new number systems. Take the real polynomials and declare . Every polynomial collapses to a remainder , and behaves exactly like : the result is . Augustin-Louis Cauchy defined the complex numbers this way in 1847. Take polynomials over and declare : the result is a field with four elements, used in error-correcting codes. Take the symmetries of a square and ignore the difference between a symmetry and its composite with the half-turn: the eight symmetries collapse to four.
Each time we form a quotient: we declare a whole subgroup to be the identity, or a whole ideal to be zero, and keep the operations. The question this lesson answers is when this is legitimate. A coset cannot be multiplied by multiplying representatives unless the answer is independent of the representatives chosen. For groups this happens exactly when the subgroup is normal, and for rings exactly when the subgroup is an ideal. Once quotients exist, the isomorphism theorems identify them, and the correspondence " is a field is maximal" becomes a machine for building fields.
Collapsing a subgroup to a point
In , collapse the subgroup to . Every integer becomes equivalent to its remainder, and the integers fall into three remainder families: , , . Adding families by adding representatives works: "(remainder 1) + (remainder 2) = (remainder 0)" holds however the representatives are chosen.
Now try the same thing in the symmetric group with the subgroup . Its three left cosets are
Try to define . Take or , both in , and . Then lies in , but lies in . The "product" of and depends on which representative of we picked, so it is not defined at all. The subgroup is not normal, and the first experiment below confirms for every subgroup of three small groups that this is the only obstruction.
Ideals play the same role for rings. Collapsing an additive subgroup to always gives a well-defined addition, since addition is commutative. For multiplication to survive, must absorb products: if then , so .
Quotient groups and quotient rings
Recall from groups that the left cosets of a subgroup partition , with , and that is normal () if for all . Recall from rings that rings have a , homomorphisms preserve it, and an ideal is an additive subgroup absorbing multiplication.
Definition— quotient group
For , the quotient group is the set of left cosets of with the product . The quotient map is , . Its order is .
Definition— quotient ring
For a two-sided ideal of a ring , the quotient ring is the set of cosets with and . The quotient map is . We write when .
Definition— commutator subgroup and simple group
The commutator subgroup is the subgroup generated by all commutators . The quotient is the abelianisation of . A non-trivial group is simple if its only normal subgroups are and , that is, if it has no non-trivial quotients.
Note
is not a subgroup of . Its elements are subsets of (cosets), and it is the image of under , not a part of . has no subgroup of order , yet has order .
A gallery of quotients
The identifications below are justified by the first isomorphism theorem (Theorem 3 and Theorem 7). In each case we name the surjective homomorphism whose kernel is the subgroup or ideal.
| quotient | is isomorphic to | via the homomorphism |
|---|---|---|
| the integers modulo | reduction modulo | |
| the circle group | ||
| () | the sign | |
| rotation , reflection | ||
| the Klein four-group | (Example below) | |
| the determinant | ||
| action on the three pairings of | ||
| , |
Example— The determinant and the special linear group
is a homomorphism, and it is surjective: . Its kernel is , which is therefore normal, and . Two matrices lie in the same coset exactly when they have the same determinant: the quotient remembers only the determinant.
Example— Dihedral quotients
In , the half-turn commutes with everything, so is normal (it is the centre). has four elements, , and each squares to the identity: and . So is the Klein four-group. By contrast only records whether a symmetry flips the square over.
Example— Rings with nilpotents and with idempotents
is the ring of dual numbers with . Here , and for every polynomial , which gives automatic differentiation. looks similar but has idempotents and is isomorphic to , by the Chinese remainder theorem below. Which quotient you get depends delicately on the polynomial, which is why the theorems that follow matter.
Quotient groups and the isomorphism theorems
Theorem— Theorem 1 (when cosets multiply)
Let . The rule is well defined — independent of the representatives — if and only if is normal. In that case is a group with identity and inverses , and is a surjective homomorphism with kernel .
Proof
Normal implies well defined. Suppose and , i.e. and . Then
The first factor is a conjugate of an element of , hence in by normality, and the second factor is in . So .
Well defined implies normal. Let and . Since , well-definedness gives , that is, . So .
Group axioms. Associativity, the identity and inverses are inherited: however we bracket, , and . By definition , is surjective, and iff .
∎
In particular every normal subgroup is the kernel of a homomorphism, namely . (The groups lesson proved this differently, through the action on cosets.)
Theorem— Theorem 2 (universal property)
Let and let be a homomorphism with . Then there is exactly one homomorphism with , namely . Its image is , and its kernel is .
Proof
Uniqueness. Any such must satisfy , and every element of is some . Existence. If then , so : the formula is well defined. It is a homomorphism because . Its image is clearly , and .
∎
Theorem— Theorem 3 (first isomorphism theorem)
For every homomorphism , , via .
Proof
Apply Theorem 2 with . The induced has kernel , which is trivial, so it is injective. Its image is .
∎
For example, maps onto the circle with kernel , so . Reduction has kernel , which recovers the classification of cyclic groups from the groups lesson.
Theorem— Theorem 4 (second isomorphism theorem)
Let and . Then is a subgroup of , , and .
Proof
is a subgroup: and , by normality of . Also . The map , , is a homomorphism. It is surjective because , and its kernel is . Apply Theorem 3.
∎
Theorem— Theorem 5 (correspondence and third isomorphism theorems)
Let . Then is an inclusion-preserving bijection from subgroups of containing to subgroups of , with inverse . It matches normal subgroups with normal subgroups. If are both normal in , then
Proof
is a subgroup containing , and since is surjective. For , we have . Both maps preserve inclusion. Normality corresponds because and is surjective. For the third theorem, the map , , is well defined because (Theorem 2 applied to ). It is surjective, and its kernel is . Apply Theorem 3.
∎
Theorem— Proposition 6 (abelian quotients)
For , the quotient is abelian if and only if . In particular is normal, is the largest abelian quotient of , and every quotient of an abelian group is abelian.
Proof
. So is abelian iff every commutator lies in , iff . is normal because a conjugate of a commutator is a commutator: .
∎
For example, for , so . The groups () are simple and have no non-trivial quotients at all. That fact is the group-theoretic core of the insolubility of the quintic in Galois theory.
Quotient rings, the Chinese remainder theorem, and fields
From here on is commutative, except in Theorem 7, which holds for two-sided ideals in any ring.
Theorem— Theorem 7 (quotient rings)
Let be an additive subgroup of a ring . The rule is well defined if and only if is a two-sided ideal. In that case is a ring, is a surjective ring homomorphism with kernel , and the universal property and the first isomorphism theorem hold exactly as for groups.
Proof
Addition is well defined because is abelian, so is normal in it. If is an ideal and , then . Conversely, if multiplication is well defined and , compare with : since , we get , so ; similarly . The ring axioms are inherited from , and is a homomorphism by construction. The universal property is proved as in Theorem 2, with every step now also respecting multiplication.
∎
So the kernels of ring homomorphisms are exactly the two-sided ideals. One direction was proved in the rings lesson; the other is . As before, the correspondence theorem identifies the ideals of with the ideals of containing .
Example— The complex numbers as a quotient
Let , . It is surjective, since . Its kernel is . Clearly ; conversely, if , divide with . Then forces . Hence , and the coset of is . In the same way .
Theorem— Theorem 8 (Chinese remainder theorem)
If are ideals of with , then , via . In particular, for coprime , as rings.
Proof
The map , , is a ring homomorphism with kernel . It is surjective: write with , . Given , let . Then and . Apply the first isomorphism theorem. For : if , Bézout gives , and .
∎
Taking unit groups gives , so Euler's function is multiplicative. Without coprimality the theorem fails: , since the first has an element of additive order . The theorem is named after the Sunzi Suanjing (3rd–5th century), which asks for a number leaving remainders on division by ; the answer is , unique modulo .
Theorem— Theorem 9 (fields and domains as quotients)
Let be commutative and an ideal. Then is a field if and only if is maximal, and is an integral domain if and only if is prime. Consequently every maximal ideal is prime.
Proof
Field. is the zero ring iff , so assume . By the correspondence theorem, the ideals of correspond to the ideals with . A commutative ring with is a field iff its only ideals are and itself (rings lesson, Proposition 3). So is a field iff the only ideals containing are and , iff is maximal.
Domain. iff , and means . So "no zero divisors" in says exactly: or . Finally, a field is a domain, so maximal ideals are prime.
∎
Theorem— Corollary 10 (building fields)
(a) () is a field iff is prime. (b) For a field and of degree , the quotient is a vector space over with basis . It is a field iff is irreducible. If , it has elements.
Proof
(a) The ideals of containing are the with , so is maximal iff is prime. (b) Division with remainder writes every uniquely as with . So every coset has exactly one representative , which gives the basis and the count . In the PID , is maximal iff is irreducible: the ideals containing are the with (rings lesson, Proposition 4), and is all of iff is a unit, and equals iff is an associate of . Apply Theorem 9.
∎
Example— The fields with four and nine elements
Over , has no root, since its values at and are both . A polynomial of degree or with no root has no linear factor, so it is irreducible. Hence with , and its multiplication table is
Every non-zero element has an inverse, and generates the multiplicative group (cyclic of order ). Over , has no root ( are the values takes, and none is ), so with : "complex numbers modulo ". By contrast, is not a field, because over , so is a non-zero nilpotent. And , which also has four elements, is not a field at all ().
Quotients in Lean and Mathlib
In Mathlib, G ⧸ N is defined for any subgroup as the type of left cosets (a quotient type by the relation ). It receives a group structure only when an instance N.Normal is available, which is exactly Theorem 1. Likewise R ⧸ I for an ideal I is a ring. QuotientGroup.mk' N : G →* G ⧸ N is the quotient map, and QuotientGroup.lift is the universal property. AdjoinRoot f is Mathlib's name for .
Theorem 1, both directions, proved here:
/-- **Coset multiplication is well defined when `N` is normal.** If `aN = a'N` and `bN = b'N`
(that is, `a⁻¹a' ∈ N` and `b⁻¹b' ∈ N`), then `abN = a'b'N`:
`(ab)⁻¹(a'b') = (b⁻¹ (a⁻¹a') b) (b⁻¹b')`, a conjugate of an element of `N` times an element
of `N`. -/
theorem coset_mul_well_defined {G : Type*} [Group G] (N : Subgroup G) [hN : N.Normal]
{a a' b b' : G} (ha : a⁻¹ * a' ∈ N) (hb : b⁻¹ * b' ∈ N) : (a * b)⁻¹ * (a' * b') ∈ N := by
have hconj : b⁻¹ * (a⁻¹ * a') * b ∈ N := by
simpa using hN.conj_mem _ ha b⁻¹
have key : (a * b)⁻¹ * (a' * b') = (b⁻¹ * (a⁻¹ * a') * b) * (b⁻¹ * b') := by group
rw [key]
exact N.mul_mem hconj hb/-- **Conversely, if coset multiplication is well defined, the subgroup is normal.** Given
`n ∈ H` and `g`, compare the products `1 · g⁻¹` and `n · g⁻¹`: since `1H = nH`, well-definedness
gives `g⁻¹H = ng⁻¹H`, i.e. `(g⁻¹)⁻¹ (n g⁻¹) = g n g⁻¹ ∈ H`. -/
theorem normal_of_coset_mul_well_defined {G : Type*} [Group G] (H : Subgroup G)
(h : ∀ a a' b b' : G, a⁻¹ * a' ∈ H → b⁻¹ * b' ∈ H → (a * b)⁻¹ * (a' * b') ∈ H) :
H.Normal where
conj_mem n hn g := by
have := h 1 n g⁻¹ g⁻¹ (by simpa using hn) (by simp)
simpa [mul_assoc] using thisThe kernel of the quotient map, and the universal property (existence from Mathlib's lift, uniqueness proved here):
/-- The kernel of the quotient map `G → G ⧸ N` is exactly `N` — so every normal subgroup is a
kernel. This is Mathlib's `QuotientGroup.ker_mk'`. -/
theorem ker_mk {G : Type*} [Group G] (N : Subgroup G) [N.Normal] :
(QuotientGroup.mk' N).ker = N :=
QuotientGroup.ker_mk' N/-- **Universal property of the quotient.** A homomorphism `φ : G → H` with `N ⊆ ker φ` factors
through the quotient map by exactly one homomorphism `ψ : G ⧸ N → H`, namely `ψ(gN) = φ(g)`.
Existence is Mathlib's `QuotientGroup.lift`; uniqueness holds because every element of `G ⧸ N`
is some `gN` (`QuotientGroup.monoidHom_ext`). -/
theorem universal_property {G H : Type*} [Group G] [Group H] (N : Subgroup G) [N.Normal]
(φ : G →* H) (hN : N ≤ φ.ker) :
∃! ψ : G ⧸ N →* H, ψ.comp (QuotientGroup.mk' N) = φ := by
refine ⟨QuotientGroup.lift N φ hN, ?_, ?_⟩
· ext g
simp
· intro ψ hψ
apply QuotientGroup.monoidHom_ext
rw [hψ]
ext g
simpThe three isomorphism theorems, cited from Mathlib (each is an explicit MulEquiv; we record that one exists):
/-- **First isomorphism theorem**: `G ⧸ ker φ ≅ im φ`. This applies Mathlib's
`QuotientGroup.quotientKerEquivRange`, built (as in the lesson) from the universal property and
the fact that the induced map has trivial kernel. -/
theorem first_iso {G H : Type*} [Group G] [Group H] (φ : G →* H) :
Nonempty (G ⧸ φ.ker ≃* φ.range) :=
⟨QuotientGroup.quotientKerEquivRange φ⟩/-- **Second isomorphism theorem**: for `H ≤ G` and `N` normal, `H/(H ∩ N) ≅ HN/N`. Mathlib
writes `H ∩ N` as `N.subgroupOf H` (viewed inside `H`) and `HN` as `H ⊔ N`. This is
`QuotientGroup.quotientInfEquivProdNormalQuotient`. -/
theorem second_iso {G : Type*} [Group G] (H N : Subgroup G) [N.Normal] :
Nonempty (H ⧸ N.subgroupOf H ≃* (H ⊔ N : Subgroup G) ⧸ N.subgroupOf (H ⊔ N)) :=
⟨QuotientGroup.quotientInfEquivProdNormalQuotient H N⟩/-- **Third isomorphism theorem**: for normal `N ≤ M`, `(G/N)/(M/N) ≅ G/M`. Here `M/N` is the
image of `M` under the quotient map. This is `QuotientGroup.quotientQuotientEquivQuotient`. -/
theorem third_iso {G : Type*} [Group G] (N M : Subgroup G) [N.Normal] [M.Normal] (h : N ≤ M) :
Nonempty ((G ⧸ N) ⧸ M.map (QuotientGroup.mk' N) ≃* G ⧸ M) :=
⟨QuotientGroup.quotientQuotientEquivQuotient N M h⟩/-- A quotient of an abelian group is abelian: `(aN)(bN) = abN = baN = (bN)(aN)`. (The converse
fails: `S₃/A₃` is abelian although `S₃` is not.) -/
theorem quotient_comm {G : Type*} [CommGroup G] (N : Subgroup G) (x y : G ⧸ N) :
x * y = y * x := by
induction x using QuotientGroup.induction_on with
| H a =>
induction y using QuotientGroup.induction_on with
| H b => rw [← QuotientGroup.mk_mul, ← QuotientGroup.mk_mul, mul_comm]Theorem 7 for commutative rings, both directions, and the first isomorphism theorem for rings:
/-- **Multiplication of residues is well defined modulo an ideal.** If `a ≡ a'` and `b ≡ b'`
modulo `I`, then `ab - a'b' = a(b - b') + (a - a')b' ∈ I`. -/
theorem ideal_mul_well_defined {R : Type*} [CommRing R] (I : Ideal R) {a a' b b' : R}
(ha : a - a' ∈ I) (hb : b - b' ∈ I) : a * b - a' * b' ∈ I := by
have key : a * b - a' * b' = a * (b - b') + (a - a') * b' := by ring
rw [key]
exact I.add_mem (I.mul_mem_left a hb) (I.mul_mem_right b' ha)/-- **Conversely, only ideals work.** If `I` is an additive subgroup for which multiplication of
residues is well defined, then `I` absorbs multiplication: for `x ∈ I`, compare `r · x` with
`r · 0` (since `x ≡ 0`), giving `r * x - r * 0 = r * x ∈ I`. -/
theorem ideal_of_mul_well_defined {R : Type*} [CommRing R] (I : AddSubgroup R)
(h : ∀ a a' b b' : R, a - a' ∈ I → b - b' ∈ I → a * b - a' * b' ∈ I)
(r x : R) (hx : x ∈ I) : r * x ∈ I := by
have := h r r x 0 (by simp) (by simpa using hx)
simpa using this/-- **First isomorphism theorem for rings**: `R ⧸ ker f ≅ im f`. Mathlib's
`RingHom.quotientKerEquivRange`. -/
theorem ring_first_iso {R S : Type*} [CommRing R] [CommRing S] (f : R →+* S) :
Nonempty (R ⧸ RingHom.ker f ≃+* f.range) :=
⟨RingHom.quotientKerEquivRange f⟩and the Chinese remainder theorem:
/-- `ℤ ⧸ (n)` is the ring `ZMod n` of residues modulo `n` — by the first isomorphism theorem for
the reduction map `ℤ → ZMod n`, whose kernel is `(n)`. Mathlib's `Int.quotientSpanEquivZMod`. -/
theorem int_quotient_zmod (n : ℕ) : Nonempty (ℤ ⧸ Ideal.span {(n : ℤ)} ≃+* ZMod n) :=
⟨Int.quotientSpanEquivZMod n⟩/-- **Chinese remainder theorem**: for coprime `m` and `n`, `ℤ/mnℤ ≅ ℤ/mℤ × ℤ/nℤ` as rings.
Mathlib's `ZMod.chineseRemainder`, proved from the first isomorphism theorem for
`x ↦ (x mod m, x mod n)`. -/
theorem crt {m n : ℕ} (h : m.Coprime n) : Nonempty (ZMod (m * n) ≃+* ZMod m × ZMod n) :=
⟨ZMod.chineseRemainder h⟩Theorem 9 (from Mathlib) and Corollary 10(a) (proved here, by producing a zero divisor when is composite):
/-- For a commutative ring `R`, `R ⧸ I` is a field exactly when `I` is a maximal ideal.
Mathlib's `Ideal.Quotient.maximal_ideal_iff_isField_quotient`. -/
theorem maximal_iff_field {R : Type*} [CommRing R] (I : Ideal R) :
I.IsMaximal ↔ IsField (R ⧸ I) :=
Ideal.Quotient.maximal_ideal_iff_isField_quotient I/-- `R ⧸ I` is an integral domain exactly when `I` is a prime ideal.
Mathlib's `Ideal.Quotient.isDomain_iff_prime`. -/
theorem prime_iff_domain {R : Type*} [CommRing R] (I : Ideal R) :
IsDomain (R ⧸ I) ↔ I.IsPrime :=
Ideal.Quotient.isDomain_iff_prime I/-- `ℤ/nℤ` (for `n > 1`) is a field exactly when `n` is prime. If `n` is prime, Mathlib's field
structure on `ZMod n` applies. If `n = m * k` with `1 < m, k < n`, then `m · k = 0` in `ZMod n`
with `m ≠ 0`; an inverse `b` of `m` would give `k = b · (m · k) = 0`, but `0 < k < n`. -/
theorem zmod_isField_iff (n : ℕ) (hn : 1 < n) : IsField (ZMod n) ↔ n.Prime := by
constructor
· intro hF
by_contra hp
obtain ⟨m, hmn, hm1, hmn'⟩ : ∃ m, m ∣ n ∧ m ≠ 1 ∧ m ≠ n := by
by_contra hcon
simp only [not_exists, not_and, ne_eq, not_not] at hcon
exact hp (Nat.prime_def.mpr ⟨hn, fun m hm => by
by_cases h1 : m = 1
· exact Or.inl h1
· exact Or.inr (hcon m hm h1)⟩)
obtain ⟨k, rfl⟩ := hmn
have hm0 : 0 < m := Nat.pos_of_ne_zero (by rintro rfl; simp at hn)
have hk0 : 0 < k := Nat.pos_of_ne_zero (by rintro rfl; simp at hn)
have hmlt : m < m * k := by
rcases Nat.lt_or_ge 1 k with h | h
· exact lt_mul_of_one_lt_right hm0 h
· exact absurd (by nlinarith : k = 1) (by rintro rfl; simp at hmn')
have hklt : k < m * k := by
rcases Nat.lt_or_ge 1 m with h | h
· exact lt_mul_of_one_lt_left hk0 h
· omega
have hmz : (m : ZMod (m * k)) ≠ 0 := by
rw [Ne, ZMod.natCast_eq_zero_iff]
exact fun hd => absurd (Nat.le_of_dvd hm0 hd) (by omega)
obtain ⟨b, hb⟩ := hF.mul_inv_cancel hmz
have hk : (k : ZMod (m * k)) = 0 := by
calc (k : ZMod (m * k)) = (m * b) * k := by rw [hb, one_mul]
_ = b * ((m * k : ℕ) : ZMod (m * k)) := by push_cast; ring
_ = 0 := by rw [ZMod.natCast_self, mul_zero]
rw [ZMod.natCast_eq_zero_iff] at hk
exact absurd (Nat.le_of_dvd hk0 hk) (by omega)
· intro hp
have := Fact.mk hp
exact Field.toIsField (ZMod n)/-- `ℤ/4ℤ` is not a field — not even a domain: `2 · 2 = 0`. (Compare `𝔽₄` below, the field with
four elements, which is a different ring.) -/
theorem zmod_four_not_domain : (2 : ZMod 4) * 2 = 0 ∧ (2 : ZMod 4) ≠ 0 := by
decideFinally, as a quotient. The irreducibility of over ZMod 2 is proved by checking both elements; once it is recorded as an instance, Lean finds the field structure on the quotient by itself:
/-- `X² + X + 1` is irreducible over `𝔽₂ = ZMod 2`: it has degree 2 and no root, since its
values at `0` and `1` are `1` and `3 = 1`. (Mathlib's
`Polynomial.irreducible_of_degree_le_three_of_not_isRoot` turns "no root" into irreducibility for
degrees 2 and 3.) -/
theorem f4_irreducible : Irreducible (X ^ 2 + X + 1 : (ZMod 2)[X]) := by
apply Polynomial.irreducible_of_degree_le_three_of_not_isRoot
· have : (X ^ 2 + X + 1 : (ZMod 2)[X]).natDegree = 2 := by compute_degree!
rw [this]
decide
· intro x hx
rw [IsRoot.def, eval_add, eval_add, eval_pow, eval_X, eval_one] at hx
revert hx
fin_cases x <;> decide/-- The field with four elements, built as the quotient `𝔽₂[X] ⧸ (X² + X + 1)`
(`AdjoinRoot f` is Mathlib's name for `K[X] ⧸ (f)`). -/
abbrev F4 : Type := AdjoinRoot (X ^ 2 + X + 1 : (ZMod 2)[X])/-- Record the irreducibility proof as an instance, so that Lean can find the field structure
`AdjoinRoot.instField` on `F4`. -/
instance f4_fact : Fact (Irreducible (X ^ 2 + X + 1 : (ZMod 2)[X])) :=
⟨f4_irreducible⟩/-- `F4` is a field: the ideal generated by an irreducible polynomial over a field is maximal
(`AdjoinRoot.span_maximal_of_irreducible`), so the quotient is a field. -/
theorem f4_isField : IsField F4 :=
Field.toIsField F4What is and is not formalised. Proved independently here: both directions of Theorem 1 and of Theorem 7 (commutative case), the uniqueness half of the universal property, the commutativity of quotients of abelian groups, Corollary 10(a), and the irreducibility behind . Cited from Mathlib: the three isomorphism theorems for groups, the first for rings, ZMod n, the Chinese remainder theorem for , and Theorem 9. Not formalised here: the correspondence theorem (Mathlib has it as the order isomorphism QuotientGroup.comapMk'OrderIso), , the general Chinese remainder theorem for coprime ideals (Mathlib's Ideal.quotientInfRingEquivPiQuotient), and the count .
Testing well-definedness, and building fields
The first program tests, for every subgroup of , and , whether "multiply representatives" gives a well-defined product of cosets, and separately whether the subgroup is normal. It lists the quotient groups and prints a witness of failure.
"""When is "multiply the cosets" a well-defined operation?
For every subgroup H of the groups S3, D4 and A4 (as permutation groups), the
program tests the rule (aH)(bH) = abH against every choice of representatives,
and separately tests whether H is normal (gHg^-1 = H for all g). The two tests
always agree, as the lesson proves. For each normal subgroup it reports the
order of the quotient group G/H and the orders of its elements; for each
non-normal one it prints a witness showing the rule depends on the choice of
representative. Exact and exhaustive for these three groups.
"""
from collections import Counter
def compose(p, q):
"""The permutation 'first q, then p'."""
return tuple(p[i] for i in q)
def inverse(p):
"""Inverse permutation."""
inv = [0] * len(p)
for i, image in enumerate(p):
inv[image] = i
return tuple(inv)
def closure(gens):
"""The group generated by a list of permutations of the same degree."""
identity = tuple(range(len(gens[0])))
elements, frontier = {identity}, [identity]
while frontier:
new = []
for x in frontier:
for g in gens:
y = compose(g, x)
if y not in elements:
elements.add(y)
new.append(y)
frontier = new
return frozenset(elements)
def subgroups(group):
"""All subgroups, as iterated joins of cyclic subgroups (exhaustive)."""
found = {closure([g]) for g in group}
frontier = list(found)
while frontier:
new = []
for h in frontier:
for k in list(found):
join = closure(sorted(h | k))
if join not in found:
found.add(join)
new.append(join)
frontier = new
return sorted(found, key=lambda s: (len(s), sorted(s)))
def coset(a, sub):
"""The left coset aH as a frozenset."""
return frozenset(compose(a, h) for h in sub)
def is_normal(sub, group):
"""gHg^-1 = H for every g in the group."""
return all(compose(compose(g, h), inverse(g)) in sub
for g in group for h in sub)
def product_witness(sub, group):
"""Return (a, a2, b) with aH = a2H but abH != a2bH, or None if the
coset product is well defined. Left factors are varied; right factors
are fixed, which already detects every failure (see the lesson)."""
for a in sorted(group):
for h in sorted(sub):
a2 = compose(a, h)
for b in sorted(group):
if coset(compose(a, b), sub) != coset(compose(a2, b), sub):
return a, a2, b
return None
def quotient_orders(sub, group):
"""Orders of the elements of G/N, computed on cosets."""
cosets = {coset(g, sub) for g in group}
identity = frozenset(sub)
orders = []
for c in cosets:
rep = next(iter(c))
power, k = rep, 1
while coset(power, sub) != identity:
power, k = compose(rep, power), k + 1
orders.append(k)
return sorted(Counter(orders).items())
def groups():
"""The three groups, as (name, generators)."""
return [
("S3", [(1, 0, 2), (1, 2, 0)]),
("D4", [(1, 2, 3, 0), (0, 3, 2, 1)]),
("A4", [(1, 2, 0, 3), (1, 0, 3, 2)]),
]
def main():
agree = True
witness_shown = False
for name, gens in groups():
group = closure(gens)
print(f"{name} (order {len(group)}): |H| normal product defined G/H")
for sub in subgroups(group):
normal = is_normal(sub, group)
witness = product_witness(sub, group)
agree &= normal == (witness is None)
info = f"order {len(group) // len(sub)}, orders "
info += str(quotient_orders(sub, group)) if normal else "-"
print(f" {len(sub):>3} {str(normal):<6} {str(witness is None):<15}"
f" {info if normal else 'not a group'}")
if witness and not witness_shown:
witness_shown = True
a, a2, b = witness
print(f" e.g. a={a}, a'={a2} lie in one coset, but ab and")
print(f" a'b lie in different cosets (b={b})")
print(f"'product well defined' agrees with 'normal' every time: {agree}")
print()
print("Epistemic status: exact and exhaustive for every subgroup of S3, D4")
print("and A4. It illustrates the theorem (well defined <=> normal), which")
print("the lesson proves for all groups; the witnesses are genuine proofs")
print("that those particular subgroups are not normal.")
if __name__ == "__main__":
main()The two columns always agree, as Theorem 1 says they must. Note the quotient with three elements of order (the Klein group) and . A witness of failure is a complete proof that that particular subgroup is not normal. The agreement on all subgroups is evidence, and the proof is Theorem 1.
The second program builds for several and , searches every element for an inverse, compares with an exhaustive irreducibility test, and looks for a generator of the multiplicative group.
"""Building finite fields as quotients F_p[x]/(f), and watching some fail.
Elements of F_p[x]/(f), for f of degree n, are the p^n polynomials of degree
below n, multiplied by reducing modulo f. The program checks, exhaustively,
whether every non-zero element has an inverse (so the quotient is a field) and
whether f has a root or factors, and confirms in each case: field exactly when f
is irreducible. For the fields it finds an element whose powers give every
non-zero element (the multiplicative group is cyclic), and it checks the
Chinese remainder isomorphism Z/12 = Z/3 x Z/4 against Z/4 versus Z/2 x Z/2.
"""
from itertools import product
def poly_mulmod(a, b, f, p):
"""Multiply coefficient lists a, b (lowest degree first) modulo f and p.
f is monic of degree n; the result has length n."""
n = len(f) - 1
prod = [0] * (2 * n)
for i, x in enumerate(a):
for j, y in enumerate(b):
prod[i + j] = (prod[i + j] + x * y) % p
for k in range(2 * n - 1, n - 1, -1): # reduce using x^n = -(lower terms)
c = prod[k]
if c:
for t in range(n + 1):
prod[k - n + t] = (prod[k - n + t] - c * f[t]) % p
return tuple(prod[:n])
def elements(p, n):
"""All p^n residues: coefficient tuples of length n."""
return [tuple(c) for c in product(range(p), repeat=n)]
def units(f, p):
"""Residues with a multiplicative inverse modulo f."""
n = len(f) - 1
one = tuple([1] + [0] * (n - 1))
elems = elements(p, n)
return [a for a in elems if any(poly_mulmod(a, b, f, p) == one for b in elems)]
def has_root(f, p):
"""True when f has a root in F_p."""
return any(sum(c * pow(x, k, p) for k, c in enumerate(f)) % p == 0
for x in range(p))
def is_irreducible(f, p):
"""Exhaustive: f (monic, degree n) has no monic factor of degree 1..n//2."""
n = len(f) - 1
for d in range(1, n // 2 + 1):
for tail in product(range(p), repeat=d):
g = list(tail) + [1]
# long division of f by g over F_p
r = list(f)
for k in range(n - d, -1, -1):
c = r[k + d]
for t in range(d + 1):
r[k + t] = (r[k + t] - c * g[t]) % p
if not any(r[:d]):
return False
return True
def generator(f, p):
"""A residue whose powers run through all non-zero residues, or None."""
n = len(f) - 1
one = tuple([1] + [0] * (n - 1))
size = p ** n - 1
for g in elements(p, n):
if not any(g):
continue
power, k = g, 1
while power != one and k <= size:
power, k = poly_mulmod(power, g, f, p), k + 1
if k == size:
return g
return None
def show_poly(f):
"""Coefficients listed lowest degree first, as text: [1, 1, 0, 1] -> x^3+x+1."""
terms = []
for k in range(len(f) - 1, -1, -1):
c = f[k]
if not c:
continue
mono = "" if k == 0 else ("x" if k == 1 else f"x^{k}")
coef = str(c) if (c != 1 or k == 0) else ""
terms.append(coef + mono)
return "+".join(terms) if terms else "0"
def crt_is_isomorphism(m, n):
"""x -> (x mod m, x mod n) is a bijective ring map Z/mn -> Z/m x Z/n."""
images = {(x % m, x % n) for x in range(m * n)}
mult = all(((x * y) % m, (x * y) % n) == ((x % m) * (y % m) % m,
(x % n) * (y % n) % n)
for x in range(m * n) for y in range(m * n))
return len(images) == m * n and mult
CASES = [(2, [1, 1, 1]), (2, [1, 0, 1]), (3, [1, 0, 1]), (3, [1, 1, 1]),
(2, [1, 1, 0, 1]), (2, [1, 1, 0, 0, 1]), (5, [2, 0, 1])]
def main():
print(" p f irreducible root units / non-zero field generator")
for p, f in CASES:
n = len(f) - 1
u = units(f, p)
field = len(u) == p ** n - 1
g = generator(f, p) if field else None
print(f"{p:>2} {show_poly(f):<12} {str(is_irreducible(f, p)):<12} "
f"{str(has_root(f, p)):<5} {len(u):>5} / {p ** n - 1:<9} "
f"{str(field):<6} {show_poly(g) if g else '-'}")
print("Field <=> f irreducible in every case:",
all((len(units(f, p)) == p ** (len(f) - 1) - 1) == is_irreducible(f, p)
for p, f in CASES))
print(f"CRT: Z/12 -> Z/3 x Z/4 is an isomorphism: {crt_is_isomorphism(3, 4)}")
print(f" Z/4 -> Z/2 x Z/2 is an isomorphism: {crt_is_isomorphism(2, 2)}")
print()
print("Epistemic status: exact and exhaustive for the seven quotients and")
print("the two maps shown. That k[x]/(f) is a field exactly when f is")
print("irreducible, and that the unit group of a finite field is cyclic,")
print("are theorems; these computations illustrate them, they do not prove")
print("them.")
if __name__ == "__main__":
main()Two rows deserve attention. over has a root (), and the quotient has zero divisors. over gives , and here "no root" alone would not have been enough evidence of irreducibility: also has no root in but is reducible. That is why the program tests all factors up to degree . That a generator always exists — the multiplicative group of a finite field is cyclic — is proved in number theory for and in fields and Galois theory in general.
Explore: are the families well behaved?
Choose a modulus and two remainder families, then draw random representatives and add them. However you choose, the sum always lands in the same family. That is the statement that addition on is well defined, the abelian case of Theorem 1 (every subgroup of an abelian group is normal). Ask yourself why the same experiment for products also always works: is an ideal of (Theorem 7).
Remainder families
Colour each integer by its remainder after dividing by k. Every integer lands in exactly one family.
- [0]{ …, −15, −12, −9, −6, −3, 0, … }
- [1]{ …, −14, −11, −8, −5, −2, 1, … }
- [2]{ …, −13, −10, −7, −4, −1, 2, … }
Add a member of one family to a member of another…
The clock is the quotient group made visible. In the multiplication tab, the residues with partners are the units. For prime they are all the non-zero residues, which is Corollary 10(a).
The clock laboratory
On a clock with k hours, counting wraps around. Explore adding and multiplying.
9 + 5 = 14 ≡ 2 (mod 12)
14 hours forward on a 12-hour clock lands on 2: the remainder when 14 is divided by 12.
Exercises
1. Quotient groups and quotient rings
Warm-upHumanThe Klein four-group is normal in . What is the order of the quotient group ?
2. Quotient groups and quotient rings
Warm-upHumanLet , a subgroup of . What is the order of the element in the quotient group ?
3. Quotient groups and quotient rings
CoreHumanTo show that is well defined, suppose and and write . At which point is the normality of needed?
4. Quotient groups and quotient rings
CoreHumanWhich of these quotient rings are fields? (Select all that apply.)
5. Quotient groups and quotient rings
CoreHumanWhich homomorphism, combined with the first isomorphism theorem, proves ?
6. Quotient groups and quotient rings
StretchHumanHow many residues satisfy ? (Use the Chinese remainder theorem.)
7. Quotient groups and quotient rings
CoreFormalWhich Lean statement formalises “for a commutative ring and an ideal , the quotient is a field if and only if is maximal”?
8. Quotient groups and quotient rings
Warm-upHumanA student says: “ is a subgroup of , namely .” What is wrong?
9. Quotient groups and quotient rings
StretchComputationalWrite cosets(n, k) returning the cosets of the subgroup of , as a list of sorted lists, ordered by their smallest element. Then write coset_sum(n, k, a, b) returning the coset (as a sorted list) of . Check that the coset of does not change when or is replaced by another element of its coset.
Common misconceptions
Misconception
" is a subgroup of ." Its elements are cosets, which are subsets of , and it is the image of under the quotient map. is not isomorphic to any subgroup of , since has no elements of finite order other than . Quotients and subgroups are dual notions: images versus subsets.
Misconception
"Define the operation on representatives and you are done." An operation on cosets defined through representatives must be checked to be independent of the choice. For the check fails (see the intuition section); for normal subgroups and ideals it succeeds (Theorems 1 and 7). The same caution applies to maps out of a quotient: is well defined only if .
Misconception
"Every non-zero is a field." Only for prime . has , and has . The field with four elements is , a different ring from .
Misconception
"A quotient of a non-abelian group is non-abelian." is abelian, and so is every quotient by a subgroup containing (Proposition 6). What is true is the other direction: quotients of abelian groups are abelian.
Misconception
"If then ." In , the subgroups and both have order . The quotients are and , which are not isomorphic. The quotient depends on how sits inside , not just on .
Misconception
"The first isomorphism theorem says ." It says . A group need not split as a product of a normal subgroup and the quotient: has the subgroup with quotient , but .
Many ways of seeing
Topology— Quotient spaces
Topologists form quotients by gluing. The real line modulo the action of by translations is the circle: the quotient group and the quotient space (with ) are the same object, a topological group. The plane modulo is the torus, and a square with opposite sides glued is the same picture. More generally, if a group acts freely and properly discontinuously on a simply connected space , then is a covering map and (see the fundamental group). Under the Galois correspondence for coverings, normal subgroups of correspond to regular coverings, whose deck group is the quotient group. So normality is not only an algebraic accident: it is the condition for the intermediate covering to be symmetric.
Geometry— Homogeneous spaces
If acts transitively on a space , and is the stabiliser of a point, then orbit–stabiliser identifies with . For example, the rotation group acts transitively on the sphere with stabiliser , so ; and the hyperbolic plane is . These coset spaces are geometric objects, not groups, unless is normal. Projective space is a quotient too: , lines through the origin. Klein's Erlangen programme reads a geometry as a pair . Quotients by discrete groups of isometries produce new spaces: by the uniformisation theorem, every closed surface is a quotient of the sphere, the Euclidean plane or the hyperbolic plane by such a group — flat tori are -type quotients, and surfaces of genus at least are quotients of the hyperbolic plane by surface groups (transformation geometry).
Number theory— Residue rings and residue fields
is the stage of elementary number theory, and the Chinese remainder theorem reduces it to prime powers . In a ring of algebraic integers , a non-zero prime ideal is maximal, and is a finite residue field. In , for example, while . How a prime of behaves in is read off from the quotient , which is a product of residue fields by the Chinese remainder theorem. The prime splits, stays inert or ramifies according to whether that quotient looks like , like , or has nilpotents, like . In : splits, is inert and ramifies. See algebraic number theory.
Category theory— Quotients are coequalisers
In the category of groups, the quotient map is the coequaliser of two homomorphisms : the inclusion and the trivial map. Theorem 2 is exactly the universal property that defines a coequaliser: every map out of that equalises them (kills ) factors uniquely through . The first isomorphism theorem says that in every homomorphism factors as a regular epimorphism followed by a monomorphism, a property shared by all regular categories. In an abelian category, every epimorphism is the cokernel of its kernel. Quotients are colimits, as subgroups and kernels are limits (limits and colimits). Rings work the same way, with the coequaliser of a pair being modulo the ideal generated by all .
Logic— Quotients as a way of building mathematics
Much of mathematics is built by quotients. is pairs of natural numbers modulo , is fractions modulo cross-multiplication, and is Cauchy sequences of rationals modulo null sequences (see constructing ℤ, ℚ and ℝ). In logic, the Lindenbaum–Tarski algebra of a theory is the set of formulas modulo provable equivalence; it is a Boolean algebra, and the completeness theorem can be read through its quotients by maximal filters. Lean has quotient types built into its foundations, with the rule that a function on representatives descends to the quotient only when accompanied by a proof that it respects the relation. That rule is the formal version of "check that the operation is well defined", and it is why the Lean proofs above must supply normality.
Wonder Trails
Quotients begin with clocks and remainder families. These optional trails revisit them at a gentler pace.
Wonder Trail · Optional · never gradedClock arithmeticIt's 9 o'clock. What time will it be in 5 hours — and in 29 hours? Can a clock teach us a whole new kind of arithmetic?Follow the trail Wonder Trail · Optional · never gradedRemainder familiesSort every integer — positive, negative and zero — into families by its remainder after dividing by 3. If you add a member of one family to a member of another, does the family of the answer depend on which members you chose?Follow the trailHistory and global context
- Remainders. The Sunzi Suanjing (China, 3rd–5th century) posed the remainder problem behind the Chinese remainder theorem. Āryabhaṭa (499) gave the kuṭṭaka ("pulveriser") method for linear congruences, and Qin Jiushao's Mathematical Treatise in Nine Sections (1247) gave a general algorithm (dayan) for simultaneous congruences. Gauss's Disquisitiones Arithmeticae (1801) introduced the notation and made congruence classes into objects of calculation.
- New numbers from quotients. Cauchy (1847) defined the complex numbers as real polynomials computed modulo . Leopold Kronecker (1887) showed in general how to adjoin a root of any polynomial by computing modulo an irreducible factor. That is Corollary 10, and it is the modern construction of finite fields.
- Quotient groups. Galois (1830–32) recognised the importance of what we call normal subgroups ("proper decompositions"). Camille Jordan (1870) studied composition series, and Otto Hölder (1889) introduced the quotient group (Faktorgruppe) explicitly in proving the Jordan–Hölder theorem.
- Ideals and isomorphism theorems. Dedekind's ideals (1871) and their quotients were developed by Hilbert, Lasker and Macaulay. Emmy Noether's papers of 1921 and 1927 gave the isomorphism theorems their modern general form, and B. L. van der Waerden's Moderne Algebra (1930–31), based on lectures by Noether and Emil Artin, made them standard.
Further reading
- David S. Dummit and Richard M. Foote, Abstract Algebra (3rd edition, 2004), §3.1–3.3 (quotient groups and isomorphism theorems) and §7.3–7.6 (quotient rings, the Chinese remainder theorem, maximal and prime ideals).
- Michael Artin, Algebra (2nd edition, 2011), the sections on quotient groups and on adjoining elements to rings.
- Joseph J. Rotman, Advanced Modern Algebra (2nd edition, 2010) — isomorphism and correspondence theorems in groups, rings and modules.
- Rudolf Lidl and Harald Niederreiter, Introduction to Finite Fields and their Applications (revised edition, 1994) — finite fields built as polynomial quotients, with applications to coding.
- Emily Riehl, Category Theory in Context (2016), chapter 3 — quotients as colimits.