Dihedral Group

lean4-proofgroup-theoryvisualization
Dn=r,srn=s2=(rs)2=1,Dn=2nD_n = \langle r, s \mid r^n = s^2 = (rs)^2 = 1 \rangle,\quad |D_n| = 2n

Statement

The dihedral group DnD_n is the group of symmetries of a regular nn-gon, consisting of nn rotations and nn reflections. It has presentation

Dn=r,srn=1,  s2=1,  (rs)2=1,D_n = \langle r, s \mid r^n = 1,\; s^2 = 1,\; (rs)^2 = 1 \rangle,

equivalently srs1=r1srs^{-1} = r^{-1} (the reflection reverses rotation direction). The order is Dn=2n|D_n| = 2n.

The elements are {rk:0k<n}{srk:0k<n}\{r^k : 0 \leq k < n\} \cup \{sr^k : 0 \leq k < n\}, with multiplication rules:

rjrk=rj+kmodn,rjsrk=srkjmodn,srjrk=srj+kmodn,srjsrk=rkjmodn.r^j \cdot r^k = r^{j+k \bmod n}, \quad r^j \cdot sr^k = sr^{k-j \bmod n}, \quad sr^j \cdot r^k = sr^{j+k \bmod n}, \quad sr^j \cdot sr^k = r^{k-j \bmod n}.

Visualization

D4D_4 (symmetries of the square), D4=8|D_4| = 8:

Elements:   1, r, r², r³  (rotations by 0°, 90°, 180°, 270°)
            s, rs, r²s, r³s  (reflections across 4 axes)

Cayley table (partial):

     ·   |   1    r   r²   r³    s   rs  r²s  r³s
─────────┼────────────────────────────────────────
     1   |   1    r   r²   r³    s   rs  r²s  r³s
     r   |   r   r²   r³    1   rs  r²s  r³s    s
    r²   |  r²   r³    1    r  r²s  r³s    s   rs
    r³   |  r³    1    r   r²  r³s    s   rs  r²s
     s   |   s  r³s  r²s   rs    1   r³   r²    r
    rs   |  rs    s  r³s  r²s    r    1   r³   r²
   r²s   | r²s   rs    s  r³s   r²    r    1   r³
   r³s   | r³s  r²s   rs    s   r³   r²    r    1

Key identity: sr=r3s=r1ss \cdot r = r^3 s = r^{-1} s — reflecting then rotating equals rotating backward then reflecting.

Subgroup lattice of D4D_4:

D_4  (order 8)
├── ⟨r⟩ = Z/4  (order 4, index 2, normal)
├── {1, r², s, r²s} ≅ Z/2×Z/2  (order 4, index 2, normal)
├── {1, r², rs, r³s} ≅ Z/2×Z/2  (order 4, index 2, normal)
├── ⟨r²⟩ = {1, r²}  (order 2, index 4, normal — central)
├── ⟨s⟩, ⟨r²s⟩, ⟨rs⟩, ⟨r³s⟩  (order 2, not normal)
└── {1}

Proof Sketch

  1. Label vertices of the nn-gon 1,,n1, \ldots, n. Rotations rkr^k send vertex ii to i+kmodni+k \bmod n. Reflection ss sends ii to imodn-i \bmod n.
  2. The composition srrn1s1=r1sr \cdot r^{n-1} \cdot s^{-1} = r^{-1} confirms srs=r1srs = r^{-1}, so DnD_n is presented as above.
  3. Counting: nn distinct rotations (since rr has order exactly nn) and nn distinct reflections srksr^k (checking srj=srkj=ksr^j = sr^k \Rightarrow j = k by cancellation), giving 2n2n elements total.
  4. Uniqueness: any symmetry of the nn-gon is determined by where vertex 1 goes (n choices) and the orientation (2 choices).

Connections

DnD_n is the simplest non-abelian group for n3n \geq 3 and a prototypical example for Lagrange's TheoremLagrange's TheoremH  divides  G|H| \;\text{divides}\; |G|Subgroup order divides group orderRead more → (8 divides into {1,2,4,8}\{1, 2, 4, 8\}-order subgroups). The Sylow TheoremsSylow TheoremspkG    HG,  H=pkp^k \mid |G| \implies \exists H \leq G,\; |H| = p^kPrime-power subgroups always exist, are conjugate, and their count is constrainedRead more → determine DnD_n's Sylow subgroups precisely. D4D_4's non-commutativity (rssrrs \neq sr) makes it a standard counterexample in group theory, and its Conjugation ActionConjugation Actioncg(h)=ghg1,conj:GAut(G)c_g(h) = g h g^{-1},\quad \mathrm{conj} : G \to \mathrm{Aut}(G)Every group acts on itself by conjugation; orbits are conjugacy classesRead more → has kernel Z(D4)={1,r2}Z(D_4) = \{1, r^2\} for n=4n = 4.

Lean4 Proof

import Mathlib.GroupTheory.SpecificGroups.Dihedral

/-- |Dₙ| = 2n.
    Mathlib: `DihedralGroup.card` (for Fintype cardinality, needs [NeZero n])
    in `Mathlib.GroupTheory.SpecificGroups.Dihedral`. -/
theorem dihedral_card (n : ) [NeZero n] :
    Fintype.card (DihedralGroup n) = 2 * n :=
  DihedralGroup.card

/-- The Nat.card version holds without NeZero (returns 0 for n = 0). -/
theorem dihedral_nat_card (n : ) :
    Nat.card (DihedralGroup n) = 2 * n :=
  DihedralGroup.nat_card