Counting what symmetry hides
A jeweller in Jaipur threads six beads, each red or white, onto a loop of wire. There are ways to colour six labelled positions, but the bracelet can be turned and flipped over, and many of the 64 patterns are the same bracelet seen from a different side. How many genuinely different bracelets are there? Listing them by hand is error-prone. The answer, , drops out of a two-line formula once we understand the group of symmetries of a hexagon and how it acts on colourings.
The same kind of structure appears elsewhere. The moves of a Rubik's cube form a group with elements. The residues coprime to form a group under multiplication, and a single theorem about groups (Lagrange's) gives Fermat's little theorem, which underlies the RSA cryptosystem. The symmetries of a crystal form a group, and chemists classify molecules by them. When Évariste Galois asked which polynomial equations can be solved by radicals, the answer came out as a property of a group.
What these situations share is a set of transformations that can be composed, that include doing nothing, and that can each be undone. This lesson takes that structure seriously. Its three central results are Lagrange's theorem (the size of a subgroup divides the size of the group), the fact that kernels of homomorphisms are exactly the normal subgroups, and the orbit–stabiliser theorem with its counting corollary, Burnside's lemma.
The symmetries of a triangle
Cut an equilateral triangle out of card, label its corners , and trace its outline on the table. A symmetry is a way to pick the triangle up and put it back into its outline. There are exactly six: do nothing (), rotate anticlockwise by () or (), or flip over one of the three axes (, , ).
Doing one symmetry and then another is again a symmetry, so the six can be composed. Composition is associative because it is composition of functions. Every symmetry can be undone: the inverse of is , and each flip is its own inverse. But the order matters. Rotate and then flip, or flip and then rotate: the corner that ends up on top is different. In symbols, , and in fact .
Two more observations will grow into theorems.
- The rotations form a smaller group inside the six. The six symmetries split into two blocks of three: the rotations, and the rotations followed by . Every block has the same size as the subgroup. This is the idea behind Lagrange's theorem.
- Each corner can be sent to each of the three corners, and for each target there are exactly two symmetries that do it. So the group has elements. This is the orbit–stabiliser theorem in miniature.
Groups, subgroups, homomorphisms and actions
Definition— group
A group is a set with an operation , , such that
- the operation is associative: ;
- there is an identity with for all ;
- every has an inverse with .
is abelian if for all ; abelian groups are often written additively, with and . The order of is its number of elements, .
From algebraic structures we know that the identity and inverses are unique, that , and that we can cancel: implies . Powers are defined for all , with and , and .
Definition— order of an element
The order of is the least with , or if there is none. By the division algorithm, if then , and .
Definition— subgroup
A subgroup is a subset that contains and is closed under the operation and under inverses; it is then a group in its own right. Subgroup test: a non-empty is a subgroup if and only if for all . (Given : ; then ; then .) The cyclic subgroup generated by is , and is cyclic if for some .
If is finite, then and these powers are distinct, so . (If with , then with .)
Definition— homomorphism, kernel, image
A homomorphism is a map with for all . Its kernel is and its image is . A bijective homomorphism is an isomorphism (its inverse is automatically a homomorphism), and means that one exists.
Definition— cosets and index
For and , the left coset of containing is ; right cosets are defined similarly. The index is the number of left cosets.
Definition— normal subgroup
A subgroup is normal, written , if for every . Equivalently: for all , (applying this to gives the reverse inclusion); or again, for every .
Definition— group action
An action of on a set is a map , , with and . The orbit of is , its stabiliser is , and the fixed set of is .
Each acts by a bijection of , with inverse . So an action is the same thing as a homomorphism to the group of all bijections of .
A gallery of groups
Example— Numbers and remainders
is an infinite cyclic group, generated by (or by ). Its subgroups include . The integers modulo , under addition modulo , form a cyclic group of order . So do the complex -th roots of unity under multiplication, and is an isomorphism .
The units modulo , under multiplication, form an abelian group of order (Euler's totient), as shown in congruences. is cyclic, generated by (its powers are ). is not cyclic, because every element squares to .
Example— Dihedral groups
The dihedral group () is the group of symmetries of a regular -gon. Let be the rotation by and a reflection. Then
and the elements are (rotations) and (reflections). The relation lets us move every to the right, which is how products are computed: for instance , so every reflection has order . is not abelian for , since would force . (Some books write for this group of order .)
Example— Symmetric and alternating groups
The symmetric group consists of all bijections of , so . In cycle notation, sends . Every permutation is a product of disjoint cycles, uniquely up to order, and its order is the lcm of the cycle lengths. We compose like functions, right to left: means "first , then ". Then
so is not abelian for . (Check the first: , , .)
Every permutation is a product of transpositions. The sign , for any such product of transpositions, is well defined: multiplies the polynomial by when it permutes the variables. And is a homomorphism. A -cycle has sign . Its kernel, the alternating group of even permutations, has order for . For example consists of the identity, the three double transpositions and the eight 3-cycles.
Example— Matrix groups and the circle
, the invertible real matrices under multiplication, is a group; is a homomorphism by the product rule for determinants, and its kernel is . The orthogonal group consists of the matrices preserving lengths, and is the circle group of rotations of the plane. These infinite groups are the subject of matrix groups.
Example— The Klein four-group
with and . It is isomorphic to , to , to the symmetries of a non-square rectangle, and to the subgroup of . It is the smallest non-cyclic group. Any group in which every element squares to is abelian: .
Example— Non-examples
- : subtraction is not associative, as .
- : there is an identity, but has no inverse.
- under multiplication modulo : not closed, since .
- The odd permutations in : the product of two odd permutations is even, and the identity is even.
- The three reflections of the triangle: the product of two reflections is a rotation.
Cyclic groups
Theorem— Theorem 1 (subgroups of the integers)
Every subgroup of equals for exactly one integer .
Proof
Let . If , take . Otherwise contains a non-zero , and , so it contains a positive integer; let be the least. Closure gives . Conversely, for write with . Then , so by minimality of , and . The integer is determined by , as its least positive element (or ).
∎
Theorem— Theorem 2 (subgroups of cyclic groups)
Every subgroup of a cyclic group is cyclic.
Proof
Let . The map , , is a surjective homomorphism, since . If , then is a subgroup of , so it equals by Theorem 1. Since is surjective, .
∎
Theorem— Theorem 3 (classification of cyclic groups)
Let . If has infinite order then ; if then .
Proof
Use again. If , then forces and so . Thus is injective, hence an isomorphism. If , then . So , , is well defined ("") and injective (""). It is surjective because is, and it is a homomorphism because is.
∎
This argument is the first isomorphism theorem, , in one special case. The general theorem is proved in quotient groups and quotient rings.
Theorem— Proposition 4 (inside Z/nZ)
In : (a) the element has order ; (b) for every divisor of there is exactly one subgroup of order , namely , and there are no others; (c) has exactly generators, and .
Proof
(a) Let . Then iff iff , because . So the least such is .
(b) By Theorem 2 every subgroup is for some . Since for some integers , we get . Conversely is a multiple of . So . The subgroups are therefore exactly the for divisors of , and has order by (a). Distinct divisors give subgroups of distinct orders. Putting gives the statement.
(c) By (a), generates iff , and there are such in . Each element generates exactly one subgroup, of some order . By (b) that subgroup is the unique one of order , which is cyclic of order and so has generators. Counting all elements by the subgroup they generate gives .
∎
The identity is the key step in the proof that is cyclic, in number theory.
Cosets and Lagrange's theorem
Fix a subgroup .
Theorem— Lemma 5 (cosets are equivalence classes)
The relation is an equivalence relation on , and the class of is the coset . Hence two left cosets are either equal or disjoint, they cover , and .
Proof
Reflexive: . Symmetric: if then . Transitive: if then . The class of is . Equivalence classes partition the set, as in equivalence relations and partitions.
∎
Theorem— Lemma 6 (cosets have equal size)
For every , the map , , is a bijection. So .
Proof
It is surjective by the definition of , and injective by cancellation: implies . (Its inverse is .)
∎
Theorem— Theorem 7 (Lagrange)
If is finite and , then . In particular the order of every subgroup divides the order of the group.
Proof
By Lemma 5, is the disjoint union of its distinct left cosets, and by Lemma 6 each has elements.
∎
Theorem— Corollary 8
Let be a finite group.
- The order of every element divides .
- for every .
- A group of prime order is cyclic, and is generated by each of its non-identity elements.
- (Euler) If then . (Fermat) If is prime and then .
- If then .
Proof
(1) Apply Lagrange to , which has elements. (2) Write ; then . (3) If , then divides and is not , so it is and . (4) Apply (2) to the group of order ; for prime, . (5) .
∎
Lagrange's theorem says which orders are possible. It never says that a divisor occurs.
Theorem— Lemma 9 (index two)
If , then for every .
Proof
If this is closure. If , the two left cosets are and , so . If were in , say with , cancelling would give , a contradiction. So .
∎
Theorem— Theorem 10 (the converse of Lagrange fails)
The alternating group has order but no subgroup of order .
Proof
Suppose with . Then , so by Lemma 9, contains the square of every element of . Every 3-cycle is such a square: gives , and . There are eight 3-cycles in : choose the three points moved ( ways) and one of the two cyclic orders. So contains and eight 3-cycles, which is nine elements, more than six. This contradiction shows no such exists.
∎
Partial converses do hold. Cauchy's theorem gives an element of order for every prime dividing . The Sylow theorems give a subgroup of order for every prime power dividing . For cyclic groups, every divisor occurs (Proposition 4). The first experiment below finds all ten subgroups of and confirms that none has order .
Homomorphisms and normal subgroups
Theorem— Proposition 11 (kernels and images)
Let be a homomorphism and .
- , and .
- is a subgroup of , and is a normal subgroup of .
- . So the fibres of are the cosets of its kernel.
- is injective if and only if .
Proof
(1) ; cancel. Then . Powers follow by induction. (2) For the image, . If then , so is a subgroup. If and , then , so is normal. (3) , and Lemma 5 gives the rest. (4) By (3), is injective iff each coset of is a single point, iff .
∎
Example— Homomorphisms to know
- , with kernel .
- , with kernel .
- Reduction , with kernel .
- from to , with kernel and image the unit circle.
- , sending rotations to and reflections to (the determinant of the symmetry as a matrix), with kernel .
- Not a homomorphism: on , because it does not send to .
Example— Normal and not normal
- Every subgroup of an abelian group is normal.
- A subgroup of index is normal. Its left cosets are and , and so are its right cosets, so for every .
- The centre is normal.
- and , as kernels. The Klein group is normal in and in , because conjugation preserves cycle type.
- Not normal: in for . Indeed , which equals only if . In : .
So every kernel is normal. The converse is the third key result of the lesson. It needs no quotient group: only the set of cosets and the action of on it.
Theorem— Theorem 12 (kernels are exactly the normal subgroups)
A subgroup is normal if and only if for some homomorphism from to some group.
Proof
"If" is Proposition 11(2). For "only if", let and let act on the set of left cosets by . This is well defined: if then , so and . It is an action: and . So we have a homomorphism , and
Because is normal, every equals , and so .
∎
The same computation shows that for an arbitrary subgroup , the kernel of is , the largest normal subgroup of contained in (its normal core). In quotients, becomes a group in its own right, with ; this product is well defined precisely when is normal.
Actions, orbits and counting
Example— Actions everywhere
- acts on , on , and on the vertices of the -gon.
- acts on itself by left multiplication, (the regular action). It also acts by conjugation, . The orbits of the conjugation action are the conjugacy classes, and the stabiliser of is its centraliser .
- acts on the cosets by left multiplication, as in Theorem 12.
- The rotation group of a cube acts on its faces, vertices, edges and long diagonals.
- acts on by . The orbits are the sets , and " modulo this action" is a circle.
Theorem— Lemma 13
The orbits of an action partition , and each stabiliser is a subgroup of . Moreover , and .
Proof
" is in the orbit of " is an equivalence relation: ; if then ; if and then . Its classes are the orbits. Since , the stabiliser contains ; if then and . Next, . Finally .
∎
Theorem— Theorem 14 (orbit–stabiliser)
For every , the map , , is a well-defined bijection. Hence, for finite ,
Proof
By Lemma 13 and Lemma 5, . Read from right to left, this says the map is well defined; from left to right, that it is injective. It is surjective by the definition of the orbit. The formula then follows from Lagrange's theorem.
∎
Example— Counting symmetries
The rotations of a cube act transitively on the faces, and the stabiliser of a face consists of the quarter-turns about its axis. So the rotation group has elements. Faces, vertices and edges give the same answer: . For , the orbit of a vertex has elements and its stabiliser is , so .
Theorem— Corollary 15 (class equation; p-groups)
Let be finite, and let represent the conjugacy classes with more than one element. Then , and each term divides . Consequently, if with prime and , then .
Proof
The conjugacy classes partition . The one-element classes are the elements of , and the class of has elements by orbit–stabiliser. If , each is a power of greater than , so it is divisible by . Then divides , and , so .
∎
Theorem— Theorem 16 (Burnside's lemma; Cauchy–Frobenius)
If a finite group acts on a finite set , the number of orbits is
the average number of points fixed by an element of .
Proof
Count the set in two ways. Grouping by gives . Grouping by and using orbit–stabiliser gives
∎
Example— The jeweller's bracelets
A colouring of the six beads is fixed by a symmetry exactly when it is constant on each cycle of that symmetry on the beads. With colours, a symmetry with cycles fixes colourings.
| symmetry of the hexagon | how many | cycles on beads | fixed colourings each |
|---|---|---|---|
| identity | 1 | 6 | 64 |
| rotation by | 2 | 1 | 2 |
| rotation by | 2 | 2 | 4 |
| rotation by | 1 | 3 | 8 |
| reflection through two opposite beads | 3 | 4 | 16 |
| reflection through two opposite gaps | 3 | 3 | 8 |
Under rotations alone there are necklaces. With reflections too there are bracelets. The same reasoning for rotation by steps, which has cycles, gives the necklace formula for beads and colours.
Theorem— Theorem 17 (Cayley)
Every group is isomorphic to a subgroup of . In particular every group of order is isomorphic to a subgroup of .
Proof
The regular action gives a homomorphism . If then , so is injective, and .
∎
Cayley's embedding is usually wasteful: embeds in (through its action on the three corners) rather than only in . Its importance is conceptual. Abstract groups are no more general than groups of permutations, and every group is the symmetry group of something.
Groups in Lean and Mathlib
Mathlib's Group G class packages the axioms, and Subgroup G bundles a subset with its closure properties. Cardinalities are measured by Nat.card (which is for infinite types, so finiteness hypotheses appear only where needed). The quotient G ⧸ H of a group by a subgroup is the set of left cosets. It becomes a group only when Lean can find an instance H.Normal, exactly as in the lesson.
The two halves of the proof of Lagrange's theorem — Lemma 5 and Lemma 6 — proved here:
/-- "Lie in the same left coset of `H`" is an equivalence relation: `a ~ b ↔ a⁻¹ * b ∈ H`.
Reflexive because `a⁻¹ * a = 1 ∈ H`; symmetric because `(a⁻¹ * b)⁻¹ = b⁻¹ * a`; transitive
because `(a⁻¹ * b) * (b⁻¹ * c) = a⁻¹ * c`. Its classes are the left cosets `aH`. -/
theorem coset_relation {G : Type*} [Group G] (H : Subgroup G) :
Equivalence (fun a b : G => a⁻¹ * b ∈ H) where
refl a := by simp
symm {a b} h := by simpa [mul_inv_rev] using H.inv_mem h
trans {a b c} h₁ h₂ := by simpa [mul_assoc] using H.mul_mem h₁ h₂/-- Every left coset `gH` has exactly as many elements as `H`: the map `h ↦ g * h` from `H`
onto `gH` is injective, because `g * h = g * h'` forces `h = h'` (cancel `g`). -/
theorem card_coset {G : Type*} [Group G] (H : Subgroup G) (g : G) :
Nat.card ↥(g • (H : Set G)) = Nat.card H := by
rw [← Set.image_smul]
exact Nat.card_image_of_injective (fun a b h => mul_left_cancel h) _Lagrange's theorem and its precise form are in Mathlib (proved there by the same partition argument), and Corollary 8 follows:
/-- **Lagrange's theorem**: the order of a subgroup divides the order of the group.
This applies Mathlib's `Subgroup.card_subgroup_dvd_card`, whose proof is the lesson's: the
cosets partition `G` (`coset_relation`) into pieces of size `|H|` (`card_coset`). -/
theorem lagrange {G : Type*} [Group G] (H : Subgroup G) : Nat.card H ∣ Nat.card G :=
Subgroup.card_subgroup_dvd_card H/-- The precise form of Lagrange's theorem: `|G| = |H| · [G : H]`, where the index `[G : H]` is
the number of left cosets. This is Mathlib's `Subgroup.card_mul_index`. -/
theorem card_mul_index {G : Type*} [Group G] (H : Subgroup G) :
Nat.card H * H.index = Nat.card G :=
Subgroup.card_mul_index H/-- The order of an element divides the order of the group: apply Lagrange to the cyclic
subgroup `⟨g⟩`, which has `ord(g)` elements. This is Mathlib's `orderOf_dvd_natCard`. -/
theorem orderOf_dvd {G : Type*} [Group G] (g : G) : orderOf g ∣ Nat.card G :=
orderOf_dvd_natCard g/-- For every element of a group, `g ^ |G| = 1`. Write `|G| = ord(g) · k` (by `orderOf_dvd`);
then `g ^ |G| = (g ^ ord(g)) ^ k = 1 ^ k = 1`. For the group `(ℤ/pℤ)ˣ` of order `p - 1` this is
Fermat's little theorem. -/
theorem pow_card_eq_one {G : Type*} [Group G] (g : G) : g ^ Nat.card G = 1 := by
obtain ⟨k, hk⟩ := orderOf_dvd g
rw [hk, pow_mul, pow_orderOf_eq_one, one_pow]/-- A group of prime order `p` is cyclic: any element `g ≠ 1` has order dividing `p` and
different from `1`, so `⟨g⟩` is everything. This is Mathlib's `isCyclic_of_prime_card`. -/
theorem prime_order_cyclic {G : Type*} [Group G] {p : ℕ} [Fact p.Prime]
(h : Nat.card G = p) : IsCyclic G :=
isCyclic_of_prime_card h/-- Every subgroup of a cyclic group is cyclic (generated by the smallest positive power of the
generator that it contains). Mathlib provides this as the instance `Subgroup.isCyclic`. -/
theorem subgroup_cyclic {G : Type*} [Group G] [IsCyclic G] (H : Subgroup G) : IsCyclic H :=
inferInstanceCommutativity, and its failure in the triangle's group. Mathlib's DihedralGroup n has elements r i and sr i for i : ZMod n, and its multiplication table is computable, so decide checks the inequality:
/-- If every element squares to `1`, the group is abelian. Since `x * x = 1` means `x⁻¹ = x`:
`a * b = (a * b)⁻¹ = b⁻¹ * a⁻¹ = b * a`. Example: the Klein four-group `ℤ/2 × ℤ/2`. -/
theorem comm_of_sq_eq_one {G : Type*} [Group G] (h : ∀ x : G, x * x = 1) (a b : G) :
a * b = b * a := by
have inv_self : ∀ x : G, x⁻¹ = x := fun x => inv_eq_of_mul_eq_one_right (h x)
calc a * b = (a * b)⁻¹ := (inv_self (a * b)).symm
_ = b⁻¹ * a⁻¹ := mul_inv_rev a b
_ = b * a := by rw [inv_self a, inv_self b]/-- The symmetry group `D₃` of an equilateral triangle is not abelian: the rotation `r` by 120°
and the reflection `s` satisfy `r * s ≠ s * r`. Mathlib's `DihedralGroup 3` has elements `r i`
(rotations) and `sr i` (reflections); `decide` checks the multiplication table. -/
theorem dihedral_not_comm :
(DihedralGroup.r 1 : DihedralGroup 3) * DihedralGroup.sr 0 ≠
DihedralGroup.sr 0 * DihedralGroup.r 1 := by
decideThe converse of Lagrange fails (Lemma 9 and Theorem 10). The Lean proof of Lemma 9 is a variant of the human one: Mathlib characterises index by an element such that each satisfies exactly one of , . The count of squares in is checked by decide over all twelve elements, and the main proof is the lesson's counting argument.
/-- A subgroup of index 2 contains every square. Mathlib's `Subgroup.index_eq_two_iff` gives an
`a` such that, for every `b`, exactly one of `b * a` and `b` lies in `H`. If `g ∉ H` then
`g * a ∈ H`; if also `g² ∉ H` then `g² * a ∈ H`, and so `g = (g² * a) * (g * a)⁻¹ ∈ H`,
a contradiction. (Mathlib also has this as `Subgroup.sq_mem_of_index_two`.) -/
theorem sq_mem_of_index_two {G : Type*} [Group G] {H : Subgroup G} (h : H.index = 2) (g : G) :
g ^ 2 ∈ H := by
obtain ⟨a, ha⟩ := Subgroup.index_eq_two_iff.mp h
by_contra hsq
have hg : g ∉ H := fun hg => hsq (by rw [pow_two]; exact H.mul_mem hg hg)
have hga : g * a ∈ H := ((ha g).or).resolve_right hg
have hgga : g ^ 2 * a ∈ H := ((ha (g ^ 2)).or).resolve_right hsq
apply hg
have key : g = (g ^ 2 * a) * (g * a)⁻¹ := by group
rw [key]
exact H.mul_mem hgga (H.inv_mem hga)/-- The alternating group `A₄` of even permutations of four objects has `4!/2 = 12` elements.
Mathlib's `nat_card_alternatingGroup` gives `|Aₙ| = n!/2`; the rest is arithmetic. -/
theorem card_alternating_four : Nat.card (alternatingGroup (Fin 4)) = 12 := by
rw [nat_card_alternatingGroup]
simp [Nat.card_eq_fintype_card, Fintype.card_fin]
decide/-- In `A₄` exactly nine elements are squares: the identity and the eight 3-cycles (each 3-cycle
`c` is the square of `c²`), while the squares of the three double transpositions are `1`.
Checked by `decide` over all twelve elements. -/
theorem squares_alternating_four :
(Finset.univ.image (fun g : alternatingGroup (Fin 4) => g ^ 2)).card = 9 := by
decide/-- **The converse of Lagrange's theorem fails**: `A₄` has order 12, and 6 divides 12, but `A₄`
has no subgroup of order 6. Such a subgroup would have index 2 (`|G| = |H| · [G : H]`), so it
would contain all nine squares (`sq_mem_of_index_two`, `squares_alternating_four`) — too many
for a set of six elements. -/
theorem alternating_four_no_subgroup_of_order_six :
¬ ∃ H : Subgroup (alternatingGroup (Fin 4)), Nat.card H = 6 := by
rintro ⟨H, hH⟩
have hindex : H.index = 2 := by
have h := Subgroup.card_mul_index H
rw [hH, card_alternating_four] at h
omega
-- All nine squares lie in `H`, viewed as a finite set.
classical
have hsub : Finset.univ.image (fun g : alternatingGroup (Fin 4) => g ^ 2) ⊆
Finset.univ.filter (· ∈ H) := by
intro x hx
obtain ⟨g, -, rfl⟩ := Finset.mem_image.mp hx
simpa using sq_mem_of_index_two hindex g
have hcard := Finset.card_le_card hsub
rw [squares_alternating_four, ← Fintype.card_subtype, ← Nat.card_eq_fintype_card] at hcard
have h6 : Nat.card {x // x ∈ H} = 6 := hH
omegaTheorem 12, both directions. The second proof uses only the coset set G ⧸ N with Mathlib's action of G on it, mirroring the lesson:
/-- The kernel of a homomorphism is a normal subgroup: if `f n = 1` then
`f (g * n * g⁻¹) = f g * 1 * (f g)⁻¹ = 1`. (Mathlib records this as the instance
`MonoidHom.normal_ker`.) -/
theorem ker_normal {G H : Type*} [Group G] [Group H] (f : G →* H) : f.ker.Normal where
conj_mem n hn g := by
rw [MonoidHom.mem_ker] at hn ⊢
rw [map_mul, map_mul, hn, mul_one, map_inv, mul_inv_cancel]/-- **Every normal subgroup is a kernel.** `G` acts on the set `G ⧸ N` of left cosets by
`g · aN = (g * a)N`, giving a homomorphism `G → Perm (G ⧸ N)`. Its kernel is exactly `N`:
`g` fixes every coset `aN` iff `a⁻¹ * g * a ∈ N` for all `a`, which for normal `N` says `g ∈ N`.
No quotient *group* is needed — only the set of cosets. -/
theorem ker_coset_action {G : Type*} [Group G] (N : Subgroup G) [hN : N.Normal] :
(MulAction.toPermHom G (G ⧸ N)).ker = N := by
ext g
rw [MonoidHom.mem_ker]
constructor
· intro h
-- `g` fixes the coset `1 · N`, so `gN = N`.
have h1 : g • (QuotientGroup.mk 1 : G ⧸ N) = QuotientGroup.mk 1 := by
have := congrArg (fun σ : Perm (G ⧸ N) => σ (QuotientGroup.mk 1)) h
simpa using this
rw [MulAction.Quotient.smul_mk, QuotientGroup.eq] at h1
simpa using h1
· intro hg
ext x
induction x using QuotientGroup.induction_on with
| H a =>
show g • (QuotientGroup.mk a : G ⧸ N) = QuotientGroup.mk a
rw [MulAction.Quotient.smul_mk, QuotientGroup.eq]
-- `(g * a)⁻¹ * a = a⁻¹ * g⁻¹ * a`, a conjugate of `g⁻¹ ∈ N`.
have := hN.conj_mem g⁻¹ (N.inv_mem hg) a⁻¹
simpa [mul_assoc] using thisOrbit–stabiliser and Burnside's lemma are in Mathlib, proved through an explicit bijection and a sum over orbits; Cayley's theorem is proved here:
/-- **Orbit–stabiliser**: for a finite group acting on `X`, `|G · x| · |Gₓ| = |G|`.
This applies Mathlib's `MulAction.card_orbit_mul_card_stabilizer_eq_card_group`, proved (as in
the lesson) from the bijection `G ⧸ Gₓ ≃ G · x`, `gGₓ ↦ g · x`. -/
theorem orbit_stabilizer {G X : Type*} [Group G] [MulAction G X] [Fintype G] (x : X)
[Fintype (MulAction.orbit G x)] [Fintype (MulAction.stabilizer G x)] :
Fintype.card (MulAction.orbit G x) * Fintype.card (MulAction.stabilizer G x) =
Fintype.card G :=
MulAction.card_orbit_mul_card_stabilizer_eq_card_group G x/-- **Burnside's lemma** (Cauchy–Frobenius): the number of orbits times `|G|` is the total number
of fixed points, `Σ_g |Fix(g)|`. This is Mathlib's
`MulAction.sum_card_fixedBy_eq_card_orbits_mul_card_group`; here `Ω` is the set of orbits. -/
theorem burnside {G X : Type*} [Group G] [MulAction G X] [Fintype G]
[∀ g : G, Fintype (MulAction.fixedBy X g)] [Fintype (MulAction.orbitRel.Quotient G X)] :
∑ g : G, Fintype.card (MulAction.fixedBy X g) =
Fintype.card (MulAction.orbitRel.Quotient G X) * Fintype.card G :=
MulAction.sum_card_fixedBy_eq_card_orbits_mul_card_group G X/-- **Cayley's theorem**: every group is isomorphic to a group of permutations. The left
regular action `g · x = g * x` gives a homomorphism `G → Perm G`, and it is injective: if `g`
and `h` act alike, then `g = g * 1 = h * 1 = h`. -/
theorem cayley {G : Type*} [Group G] : Function.Injective (MulAction.toPermHom G G) := by
intro g h hgh
have := congrArg (fun σ : Perm G => σ 1) hgh
simpa using thisWhat is and is not formalised. Proved independently here: Lemmas 5, 6 and 9, Corollary 8(2), Theorem 10 (the converse of Lagrange fails for ), both directions of Theorem 12, Cayley's theorem, and the facts about the Klein-type groups and . Cited from Mathlib: Lagrange's theorem, Corollary 8(1, 3), Theorem 2, orbit–stabiliser and Burnside's lemma. Not formalised here: Theorem 1 and Proposition 4 (Mathlib has them, e.g. Int.subgroup_cyclic and IsCyclic.card_orderOf_eq_totient), the class equation (Mathlib's Group.card_center_add_sum_card_noncenter_eq_card) and the bracelet count, which the second experiment checks by computer.
Every subgroup, and every orbit, by machine
A finite group given by permutations can be explored completely. The first program generates , , , and the cyclic group , and finds every subgroup. Every subgroup is the join of its cyclic subgroups, so starting from the cyclic subgroups and repeatedly forming the subgroup generated by two known ones is exhaustive. It then checks Lagrange's theorem on all of them, counts normal subgroups and reports divisors of with no subgroup.
"""Every subgroup of five small groups, found by machine, with Lagrange checked.
Permutations are tuples of images, and a subgroup is generated by closure. Every
subgroup of a finite group is the join of its cyclic subgroups, so starting from
the cyclic subgroups and repeatedly forming the subgroup generated by two known
subgroups finds *all* subgroups. For each group the program lists the subgroup
orders, counts the normal subgroups, checks Lagrange's theorem and reports the
divisors of |G| that are not the order of any subgroup (for A4: 6). This is an
exact, exhaustive computation for these five groups and proves nothing beyond.
"""
from collections import Counter
from math import lcm
def compose(p, q):
"""Return the permutation 'first q, then p' (p after q), as a tuple."""
return tuple(p[i] for i in q)
def inverse(p):
"""Return the inverse permutation of p."""
inv = [0] * len(p)
for i, image in enumerate(p):
inv[image] = i
return tuple(inv)
def closure(gens, n):
"""The subgroup of S_n generated by gens, as a frozenset of tuples.
In a finite group every inverse is a positive power, so closing the identity
under multiplication by the generators gives the whole generated subgroup.
"""
identity = tuple(range(n))
elements = {identity}
frontier = [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 order(p):
"""The order of a permutation: the lcm of its cycle lengths."""
seen, result = set(), 1
for start in range(len(p)):
length, i = 0, start
while i not in seen:
seen.add(i)
i = p[i]
length += 1
if length:
result = lcm(result, length)
return result
def all_subgroups(group, n):
"""Every subgroup of a finite permutation group, as frozensets.
Begin with the cyclic subgroups; join each newly found subgroup with every
known one until nothing new appears. A subgroup H is the join of the <h>,
h in H, built one cyclic subgroup at a time, so H is eventually found.
"""
gens = {}
for g in sorted(group):
gens.setdefault(closure([g], n), [g])
frontier = list(gens)
while frontier:
found = []
for h in frontier:
for k in list(gens):
if h <= k or k <= h:
continue
join = closure(gens[h] + gens[k], n)
if join not in gens:
gens[join] = gens[h] + gens[k]
found.append(join)
frontier = found
return list(gens)
def is_normal(sub, group):
"""True when g h g^-1 lies in sub for all g in group and h in sub."""
return all(compose(compose(g, h), inverse(g)) in sub
for g in group for h in sub)
def census(group, n):
"""Return (subgroup-order counts, number normal, missing divisors)."""
subs = all_subgroups(group, n)
counts = Counter(len(s) for s in subs)
normal = sum(is_normal(s, group) for s in subs)
size = len(group)
divisors = [d for d in range(1, size + 1) if size % d == 0]
missing = [d for d in divisors if d not in counts]
return counts, normal, missing
def examples():
"""The five groups, as (name, degree n, generators)."""
return [
("S3", 3, [(1, 0, 2), (1, 2, 0)]),
("D4", 4, [(1, 2, 3, 0), (0, 3, 2, 1)]),
("A4", 4, [(1, 2, 0, 3), (1, 0, 3, 2)]),
("S4", 4, [(1, 0, 2, 3), (1, 2, 3, 0)]),
("C12", 12, [tuple((i + 1) % 12 for i in range(12))]),
]
def main():
print("group |G| subgroups normal subgroup orders: order(how many)")
total, lagrange_ok = 0, True
for name, n, gen in examples():
group = closure(gen, n)
counts, normal, missing = census(group, n)
total += sum(counts.values())
lagrange_ok &= all(len(group) % d == 0 for d in counts)
shown = " ".join(f"{d}({c})" for d, c in sorted(counts.items()))
print(f"{name:<5} {len(group):>3} {sum(counts.values()):>9} {normal:>6}"
f" {shown}")
if missing:
print(f" divisors of {len(group)} with no subgroup: {missing}")
print(f"Lagrange (subgroup order divides |G|) holds for all {total} "
f"subgroups: {lagrange_ok}")
a4 = closure(examples()[2][2], 4)
hist = sorted(Counter(order(p) for p in a4).items())
print(f"A4 element orders (order: how many): {hist}")
print("(Index 2 would force a subgroup of order 6 to contain all nine")
print("squares in A4: the identity and the eight 3-cycles.)")
print()
print("Epistemic status: exact and exhaustive for these five groups. The")
print("A4 row is a genuine counterexample to the converse of Lagrange's")
print("theorem; the other rows are evidence, not proofs of general laws.")
if __name__ == "__main__":
main()The row is a genuine counterexample: an exhaustive search is a proof that no subgroup of order exists, independent of (and agreeing with) Theorem 10. The other rows are exact facts about five particular groups, not general laws. Note also that the cyclic group has exactly one subgroup for each of the six divisors of , as Proposition 4 predicts.
The second program counts necklaces and bracelets in two ways, by Burnside's formula and by brute-force enumeration of orbits, and does the same for colourings of a cube's faces under its rotations.
"""Counting patterns up to symmetry: Burnside's lemma against brute force.
A necklace is a ring of n coloured beads up to rotation; a bracelet is the same up
to rotation and reflection (the dihedral group). Burnside's lemma counts orbits as
the average number of fixed colourings, and a permutation with c cycles fixes
exactly k**c colourings with k colours. The program compares that formula with a
brute-force count of orbits (one canonical representative per orbit) for small n,
and does the same for colourings of the six faces of a cube under its 24
rotations, which it generates from two quarter turns. Exact and exhaustive for
the sizes shown.
"""
from itertools import product
def compose(p, q):
"""Return the permutation 'first q, then p'."""
return tuple(p[i] for i in q)
def closure(gens):
"""The permutation group generated by gens (all 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 elements
def cyclic_group(n):
"""Rotations of n beads: i -> i + k (mod n)."""
return [tuple((i + k) % n for i in range(n)) for k in range(n)]
def dihedral_group(n):
"""Rotations and reflections of n beads: i -> +-i + k (mod n)."""
reflections = [tuple((k - i) % n for i in range(n)) for k in range(n)]
return sorted(set(cyclic_group(n) + reflections))
def cycle_count(p):
"""Number of cycles of the permutation p (fixed points count as cycles)."""
seen, cycles = set(), 0
for start in range(len(p)):
if start not in seen:
cycles += 1
i = start
while i not in seen:
seen.add(i)
i = p[i]
return cycles
def burnside(group, k):
"""Number of orbits on k-colourings: average of k**cycles over the group."""
total = sum(k ** cycle_count(g) for g in group)
if total % len(group):
raise ArithmeticError("Burnside sum not divisible by |G|")
return total // len(group)
def brute_force(group, k):
"""Count orbits directly: keep the least colouring in each orbit."""
n = len(group[0])
reps = set()
for colouring in product(range(k), repeat=n):
images = (tuple(colouring[g[i]] for i in range(n)) for g in group)
reps.add(min(images))
return len(reps)
def cube_rotations():
"""The 24 rotations of a cube as permutations of its faces U D F B L R."""
quarter_vertical = (0, 1, 5, 4, 2, 3) # F->R->B->L->F, U and D fixed
quarter_front = (5, 4, 2, 3, 0, 1) # U->R->D->L->U, F and B fixed
return sorted(closure([quarter_vertical, quarter_front]))
def main():
print("Orbits = average over the group of k^(number of cycles)")
print("beads necklaces k=2 bracelets k=2 necklaces k=3 bracelets k=3")
agree = True
for n in range(1, 9):
row = []
for k in (2, 3):
for group in (cyclic_group(n), dihedral_group(n)):
value = burnside(group, k)
agree &= value == brute_force(group, k)
row.append(value)
print(f"{n:>5} {row[0]:>13} {row[1]:>13} {row[2]:>13} {row[3]:>13}")
print(f"Burnside agrees with brute force in every case checked: {agree}")
cube = cube_rotations()
print(f"Cube: {len(cube)} rotations generated from two quarter turns")
for k in (2, 3):
print(f" face colourings with {k} colours up to rotation: "
f"Burnside {burnside(cube, k)}, brute force {brute_force(cube, k)}")
print()
print("Epistemic status: exact, exhaustive counts for the sizes shown.")
print("Agreement here is evidence; the proof that Burnside's formula")
print("always counts orbits is in the lesson, by counting the pairs (g, x)")
print("with g . x = x in two ways.")
if __name__ == "__main__":
main()Agreement in every row is evidence that the formula is right. It is not a proof: the proof is Theorem 16. The computation also shows why the formula matters. Brute force must look at all colourings, while Burnside's formula needs only the cycle structure of the symmetries.
Explore: a Cayley graph, non-commuting matrices and clock arithmetic
The Cayley graph of with respect to the generators and has a vertex for each element, and joins to and to . Here the outer triangle and the inner triangle are -edges, and the three spokes are -edges. Edges are drawn without arrows, so read each triangle in the direction of increasing powers of . Every closed walk from spells out a word in and that equals — a relation. In the Walks tab, find the closed walk of length (the relation ) and a closed walk of length that alternates spokes and triangle edges, such as : it records , which is the relation . In the Matrix tab, the diagonal entries of count the closed walks of length .
The Cayley graph of D₃
Outer and inner triangles: multiplication by r. Spokes: multiplication by s.
No walk yet.
6 vertices have odd degree: e, r, r2, s, rs, r2s.
So no Euler trail is possible. A trail enters and leaves each vertex in its middle in pairs, so only its two ends can have odd degree, and this graph has 6 such vertices.
The symmetry group of the square, , sits inside . Compose the rotation by with the reflection in the -axis in both orders and watch the flag. The two composites are different reflections, so is not abelian.
Rotate then reflect, or reflect then rotate?
Apply A and then B, or B and then A, and compare the results.
- image of the grid
- image of the unit square
- image of the flag
- before the transformation
- after the first step
AB ≠ BA: the order matters.
BA means “apply A first, then B”: products of transformations are read from right to left.
det(AB) = det(BA) = det A · det B = 1 · −1 = −1 The area scale factor is the same in either order.
Finally, is the group of a -hour clock. In the addition tab, repeatedly adding a step visits exactly the multiples of : the cyclic subgroup of Proposition 4. In the multiplication tab, the numbers with a partner form the unit group .
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. Groups
Warm-upHumanWhat is the order of the permutation in ?
2. Groups
Warm-upHumanWhat is the order of the element in the additive group ?
3. Groups
CoreHumanA group has order . Which of the following cannot be the order of a subgroup of ? (Select all that are impossible.)
4. Groups
CoreHumanA student writes: “ and , so by Lagrange's theorem has an element of order .” What is the best assessment?
5. Groups
CoreHumanWhich of these subgroups of are normal? (Select all that apply.)
6. Groups
CoreHumanUse the orbit–stabiliser theorem: how many rotational symmetries does a regular dodecahedron (12 regular pentagonal faces) have?
7. Groups
StretchHumanEach face of a cube is painted black or white. How many colourings are different up to rotation of the cube? (Use Burnside's lemma with the rotations.)
8. Groups
CoreFormalWhich Lean statement correctly formalises “a subgroup of index contains the square of every element of the group”? (G is a group and H : Subgroup G.)
9. Groups
StretchComputationalA permutation of is given as a tuple p with p[i] the image of i. Write perm_order(p) returning its order, by finding the lengths of its disjoint cycles and taking their least common multiple. (You may use math.lcm.)
Common misconceptions
Misconception
"If divides , then has a subgroup of order ." This is the converse of Lagrange's theorem, and it is false: has order and no subgroup of order (Theorem 10). It does hold for cyclic groups, for prime (Cauchy), for prime powers (Sylow) and for all finite abelian groups.
Misconception
"Every subgroup is normal." This is true in abelian groups, but in general it is false. In , conjugating by gives , so is not normal. Normality is not even transitive. In , (both have index ), but is not normal in .
Misconception
"Groups are commutative." Numbers taught us to expect , but symmetries, permutations and matrices do not behave that way: while . Write proofs without silently commuting factors. For example, , and holds for all only in abelian groups.
Misconception
" means for every ." Normality is an equality of sets. In , as sets, but does not commute with . Elementwise commuting would put in the centraliser of , which is a much stronger condition.
Misconception
"The order of is determined by the orders of and ." In the transpositions and both have order , but their product has order . Two reflections of the plane in lines meeting at angle compose to a rotation of order , and two reflections in parallel lines compose to a translation of infinite order.
Misconception
"Permutations are composed left to right." Some books and software do this. This lesson, Lean and most algebra texts compose right to left, like functions. The same symbols denote in one convention and in the other. State your convention.
Many ways of seeing
Geometry— Every group is a symmetry group
Felix Klein's Erlangen programme (1872) defines a geometry by its group of transformations: Euclidean geometry studies the invariants of the isometry group, affine geometry those of the affine group, projective geometry those of the projective group (see transformation geometry). Conversely, every group is a symmetry group. A group is the symmetry group of its Cayley graph with coloured, directed edges, and by Frucht's theorem (1939) every finite group is the full automorphism group of some ordinary graph.
Geometry also constrains groups. In the crystallographic restriction, a rotation preserving a lattice in the plane has order , , , or . In a lattice basis it has an integer matrix, so its trace is an integer, and that forces . This restriction is the first step in the classification of the wallpaper groups (Fedorov 1891, Pólya 1924). Geometric group theory goes further and treats the Cayley graph of a finitely generated group, with its word metric, as a geometric object in its own right (geometric group theory).
Topology— Groups from spaces, spaces from groups
Loops in a space up to deformation form its fundamental group, and every group arises this way, as the fundamental group of a 2-dimensional cell complex built from a presentation. Group actions give quotient spaces: acting on by translation gives the circle, acting on gives the torus, and the deck transformations of a covering space form a group acting freely on it. Topological groups add continuity. has two connected components, distinguished by the sign of the determinant: the kernel of , , is the identity component. This is the topological meaning of orientation. The rotation group has fundamental group , a fact you can feel with a belt or a plate held in your hand (the "plate trick").
Number theory— Lagrange's theorem as arithmetic
Applied to , Lagrange's theorem is Euler's theorem . It underlies the RSA cryptosystem, where decryption works because (for coprime to ; the general case follows from the Chinese remainder theorem). The finer structure is number theory proper. is cyclic for every prime (a generator is a primitive root), while is not. That is the starting point of number theory. Diffie–Hellman key exchange uses a large cyclic group in which computing is fast but recovering from (the discrete logarithm) is believed to be hard; elliptic-curve cryptography uses the group of points on an elliptic curve (cryptography). This hardness is a belief supported by decades of failed attacks, not a theorem.
Combinatorics— Counting up to symmetry
Burnside's lemma is the first step of Pólya enumeration (Redfield 1927, Pólya 1937). Record each symmetry by its cycle type in the cycle index , where is the number of -cycles of . Then substituting counts colourings by how many beads of each colour they use. For the cube's faces , and setting every gives the two-colourings counted in the exercises. Pólya used this to count chemical isomers; it is a staple of enumerative combinatorics.
Physics— Symmetry in physical law
Physical laws are often stated by their symmetry groups. Galilean or Lorentz symmetry constrains the form of the equations of motion. By Noether's theorem (1918), each continuous symmetry of a Lagrangian system gives a conserved quantity: time translation gives energy, space translation momentum, rotation angular momentum. These are Lie groups, the continuous cousins of the groups here (Lie groups). Finite groups classify crystals: there are crystallographic point groups and space groups (Fedorov and Schoenflies, 1891). In quantum mechanics a symmetry group acts on the space of states, and Eugene Wigner (1931) showed how its representations organise atomic spectra. These applications rest on physical models; the group theory within them is proved mathematics, while the claim that nature has a given symmetry is an empirical one.
Category theory— A group is a one-object category
A group is a category with one object , an arrow for each element, composition given by the group operation, and every arrow invertible. Homomorphisms are exactly the functors . An action of on a set is exactly a functor sending to , and maps of -sets are natural transformations (functors). In this language Cayley's theorem is an instance of the Yoneda lemma. The representable functor is the set with acting by left multiplication; Yoneda identifies its automorphisms as a -set with , acting by right multiplications ; and forgetting the action embeds this copy of (anti-isomorphic to , hence isomorphic to it via ) in .
Wonder Trails
These optional trails approach the group idea from below — undoing an operation, and arithmetic on a clock.
Wonder Trail · Optional · never gradedInverses and structureEvery integer can be added to another integer to get . So why can almost no integer be multiplied by another integer to get ?Follow the trail 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 trailHistory and global context
- Before the definition. Craft traditions across the world explored symmetry in practice long before it was formalised: Islamic geometric ornament, Chinese lattice windows, and the textiles and carvings of many African, American and Pacific peoples display a wide variety of symmetry types. Dorothy Washburn and Donald Crowe (1988) describe how to classify such patterns by their symmetry groups.
- Permutations of roots. In 1770–71, Joseph-Louis Lagrange studied how expressions in the roots of a polynomial change when the roots are permuted. He proved a special case of the theorem now named after him. Paolo Ruffini (1799, with gaps) and Niels Henrik Abel (1824) used permutations to show that the general quintic cannot be solved by radicals. Augustin-Louis Cauchy developed the calculus of permutations (1815, 1844–46) and proved the theorem on elements of prime order that bears his name.
- Galois. Évariste Galois (1830–32, published by Joseph Liouville in 1846) introduced the word groupe, recognised normal subgroups, and tied solvability by radicals to the structure of a group. See fields and Galois theory.
- Abstraction. Carl Friedrich Gauss's Disquisitiones Arithmeticae (1801) worked, without the word, with the cyclic groups of residues. Arthur Cayley (1854) gave the first abstract definition of a finite group by a multiplication table, together with the theorem now named after him. Camille Jordan's Traité des substitutions (1870) systematised permutation groups, Ludwig Sylow proved his theorems in 1872, and Klein's Erlangen programme (1872) and Sophus Lie's continuous groups carried groups into geometry and analysis.
- Counting orbits. The lemma named after William Burnside was known to Cauchy and proved by Georg Frobenius (1887). Burnside's 1897 textbook made it widely known, hence Peter Neumann's phrase "the lemma that is not Burnside's" (1979).
- Symmetry in science. Evgraf Fedorov and Arthur Schoenflies independently classified the crystallographic space groups in 1891. Emmy Noether proved her theorem on symmetries and conservation laws in 1918, and Eugene Wigner and Hermann Weyl brought group theory into quantum mechanics around 1930.
- The landscape today. The classification of finite simple groups — every finite simple group is cyclic of prime order, alternating, of Lie type, or one of sporadic groups — was the work of more than a hundred mathematicians across several continents. It was announced in the early 1980s, and its last gap was closed by Michael Aschbacher and Stephen Smith in 2004.
Further reading
- Michael Artin, Algebra (1991; 2nd edition 2011), chapters 2 and 6–7 — groups, symmetry and group actions.
- David S. Dummit and Richard M. Foote, Abstract Algebra (3rd edition, 2004), chapters 1–4.
- M. A. Armstrong, Groups and Symmetry (1988) — a geometric first course.
- Nathan Carter, Visual Group Theory (2009) — Cayley graphs and pictures throughout.
- Joseph J. Rotman, An Introduction to the Theory of Groups (4th edition, 1995) — for going further (Sylow theory, solvable groups, presentations).
- Dorothy K. Washburn and Donald W. Crowe, Symmetries of Culture: Theory and Practice of Plane Pattern Analysis (1988).