Orders $1$, $2$, and $3$ each had exactly one group, and filling in multiplication tables was enough to prove it. From order $4$ on, there's real variety, and this page meets the groups that make it up: the Klein 4-group, direct products, the dihedral groups, and the quaternion group. By the end we'll have a complete list of every group with at most $8$ elements. Several of the classification results need tools we haven't built yet (mostly Lagrange's theorem), so for now we'll state them and come back to the proofs later.
The Spicy Bonus on Groups of Order 1–3 proved the theorem below by filling in tables: either some element squares to something other than $e$ (and you get $C_4$), or every element squares to $e$.
Suppose $G$ is a group with $|G| = 4$. Then it turns out that there are only two possibilities.
If $|G| = 4$, then $G$ is isomorphic to one of the following two groups:
(There are $2$ groups of order $4$, up to isomorphism.)
$C_4$ we've met. The other one is the group where every element squares to $e$, and it gets a name.
The Klein 4-group is $V_4 = \{e, a, b, c\}$, with multiplication table
$$\begin{array}{c|cccc} \cdot & e & a & b & c \\ \hline e & e & a & b & c \\ a & a & e & c & b \\ b & b & c & e & a \\ c & c & b & a & e \end{array}$$
Three things are worth reading straight off that table.
(Note: $C_4 \not\cong V_4$.)
You've already met $V_4$ in disguise. On Modular Arithmetic, $(\mathbb{Z}/8\mathbb{Z})^\times = \{1, 3, 5, 7\}$ and $(\mathbb{Z}/12\mathbb{Z})^\times = \{1, 5, 7, 11\}$ both had every element squaring to $1$, so both are $\cong V_4$.
The reason $C_4 \not\cong V_4$ is that diagonal. In $C_4 = \langle x \rangle$, $x \cdot x = x^2 \neq e$, and relabeling the elements can't turn a non-identity entry on the diagonal into $e$. Try it yourself.
Write out the multiplication table of $C_4 = \langle x \rangle = \{e, x, x^2, x^3\}$. Explain exactly why no relabeling of its elements turns it into the table of $V_4$.
$$\begin{array}{c|cccc} \cdot & e & x & x^2 & x^3 \\ \hline e & e & x & x^2 & x^3 \\ x & x & x^2 & x^3 & e \\ x^2 & x^2 & x^3 & e & x \\ x^3 & x^3 & e & x & x^2 \end{array}$$
The diagonal of this table holds the squares: $e, x^2, e, x^2$. Two of them are not the identity. In $V_4$ the whole diagonal is $e$. A relabeling $\varphi$ that turned one table into the other would have to send the identity to the identity, and it would send each square to a square: $\varphi(g)^2 = \varphi(g^2)$. So $\varphi(x)^2 = \varphi(x^2) \neq \varphi(e) = e$, but every element of $V_4$ squares to $e$. Contradiction. So $C_4 \not\cong V_4$.
Writing out a $4 \times 4$ table is fine, but it won't scale. Here's a far more compact way to pin down a group.
$$V_4 = \langle a, b \mid a^2 = b^2 = e, ab = ba \rangle$$
An expression like this is a presentation for the group. It indicates that:
Part (ii) is the powerful half. Any fact about $V_4$ has to follow from the three relations. For example, here's why $c = ab$ squares to $e$, without looking at the table.
"Gen. assoc." is Property 4 on Groups & Basic Properties: in a product, the brackets can go anywhere you like, so we can regroup $(ab)(ab)$ as $a(ba)b$.
Use the presentation of $V_4$ to show that $(ab)^2 = e$.
$$\begin{align*} (ab)^2 &= (ab)(ab) \\ &= a(ba)b \quad \text{(gen. assoc.)} \\ &= a(ab)b \quad \text{(relation: } ab = ba \text{)} \\ &= a^2 b^2 \quad \text{(gen. assoc.)} \\ &= e e \quad \text{(relations: } a^2 = e, b^2 = e \text{)} \\ &= e. \end{align*}$$
There's a standard way to build a new group out of two old ones: pair them up and do both operations at once, one in each slot.
$G \times H$ is the Cartesian product from Sets: all ordered pairs $(g, h)$ with $g \in G$ and $h \in H$. The new part is the operation on those pairs.
If $(G, *)$ and $(H, \cdot)$ are groups, then their direct product is the group $(G \times H, \circ)$ defined by: $$(g_1, h_1) \circ (g_2, h_2) = (g_1 * g_2, h_1 \cdot h_2), \quad \forall (g_1, h_1), (g_2, h_2) \in G \times H.$$
Notation: $G \times H$.
The definition calls it a group, so that needs checking. Each axiom holds in each slot separately, so it holds for the pairs. (We suppress the notation for the binary operations in $G$ and $H$.)
Proof that $G \times H$ is a group.
The smallest interesting example takes two copies of $C_2$. Give each pair a short name and fill in the table.
Let $G = C_2 = \langle x \rangle = \{e_G, x\}$ and $H = C_2 = \langle y \rangle = \{e_H, y\}$. Find the multiplication table of $G \times H$.
$$G \times H = \{ \underbrace{(e_G, e_H)}_{e}, \underbrace{(x, e_H)}_{a}, \underbrace{(e_G, y)}_{b}, \underbrace{(x, y)}_{c} \}$$
$$\begin{array}{c|cccc} \circ & e & a & b & c \\ \hline e & e & a & b & c \\ a & a & e & c & b \\ b & b & c & e & a \\ c & c & b & a & e \end{array}$$
(For example, $ab = (x, e_H)(e_G, y) = (x, y) = c$, and $c^2 = (x^2, y^2) = (e_G, e_H) = e$.)
That's exactly the table of $V_4$, entry for entry.
$V_4 \cong C_2 \times C_2$.
Nothing stops at two factors.
If $G_1, \dots, G_n$ are groups, then their direct product $G_1 \times \dots \times G_n$ is their Cartesian product, together with the binary operation defined by: $$(g_1, \dots, g_n)(g'_1, \dots, g'_n) = (g_1 g'_1, g_2 g'_2, \dots, g_n g'_n)$$
A direct product is a grid: rows for $G$, columns for $H$. To decide whether $G \times H$ is cyclic, pick one pair and multiply by it over and over. Does its walk ever cover every cell?
The Remainder Grid on Modular Arithmetic was this exact picture: $x \mapsto (x \bmod n_1, x \bmod n_2)$ walks diagonally through $\mathbb{Z}/n_1\mathbb{Z} \times \mathbb{Z}/n_2\mathbb{Z}$, and it covers every cell exactly when $(n_1, n_2) = 1$.
Choose $G$ and $H$, tap a pair $(g, h)$, then multiply by it again and again. If its powers fill the whole grid, $G \times H$ is cyclic.
The pattern: $(g, h)^k = (g^k, h^k)$, so a pair returns to $(e, e)$ only when both slots do at the same time. That's why $C_2 \times C_4$ never makes it to $8$.
Show that $C_2 \times C_4$ is not cyclic. (So it is not $\cong C_8$, even though it has $8$ elements.)
Proof. Write $C_2 = \langle x \rangle$ and $C_4 = \langle y \rangle$, so $x^2 = e$ and $y^4 = e$. Every element of $C_2 \times C_4$ has the form $(g, h)$ with $g^4 = (g^2)^2 = e$ and $h^4 = e$. So $$(g, h)^4 = (g^4, h^4) = (e, e).$$ The powers of any $(g, h)$ therefore repeat every $4$ steps, and $\langle (g, h) \rangle = \{(g, h)^0, (g, h)^1, (g, h)^2, (g, h)^3\}$ has at most $4$ elements. No single element generates all $8$, so $C_2 \times C_4$ is not cyclic. $\blacksquare$
A later page, Direct Products, turns this into a tool. Many groups split as a product of smaller pieces, and you can read their properties off the pieces.
Order $5$ is quick: no choices at all.
Suppose $G$ is a group with $|G| = 5$. Then $G \cong C_5$.
That's no accident about $5$. The same thing happens for every prime.
The proof comes from Lagrange's theorem: the number of distinct powers of an element always divides $|G|$. If $|G| = p$ is prime, any $g \neq e$ has more than one power, so it must have all $p$ of them. So $G = \langle g \rangle$.
If $G$ is a group with $|G| = p$, where $p$ is prime, then $G \cong C_p$.
$6$ isn't prime, and the choice comes back.
Suppose $G$ is a group with $|G| = 6$. Then $G \cong C_6$ or $G \cong D_6$. (Note: $C_6 \not\cong D_6$.)
That raises some "obvious" questions:
Question 2 is the one we can settle right now. You may have already found the generator in Product Walk.
Show that $C_2 \times C_3 \cong C_6$.
Write $C_2 = \langle x \rangle$ and $C_3 = \langle y \rangle$. Then $$C_2 \times C_3 = \{(e_2, e_3), (e_2, y), (e_2, y^2), (x, e_3), (x, y), (x, y^2)\},$$ and note that: $$\begin{align*} (x, y)^1 &= (x, y) \\ (x, y)^2 &= (x^2, y^2) = (e_2, y^2) \\ (x, y)^3 &= (e_2, y^2)(x, y) = (x, y^3) = (x, e_3) \\ (x, y)^4 &= (x^4, y^4) = (e_2, y) \\ (x, y)^5 &= (x^5, y^5) = (x, y^2) \\ (x, y)^6 &= (x^6, y^6) = (e_2, e_3) \end{align*}$$
All six elements show up. Therefore, $C_2 \times C_3 = \langle (x, y) \rangle \cong C_6$.
The two slots cycle with periods $2$ and $3$, and they only line up again after $6$ steps. That's why it works here and failed for $C_2 \times C_4$.
This is the Chinese remainder theorem from Modular Arithmetic in group form: $\mathbb{Z}/6\mathbb{Z} \cong \mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/3\mathbb{Z}$, because $(2, 3) = 1$. And $(\mathbb{Z}/9\mathbb{Z})^\times = \langle 2 \rangle$ was another $C_6$.
$S_3$ is the group of all rearrangements of $\{1, 2, 3\}$. Each symmetry of a triangle rearranges its three corners, and that's the isomorphism $D_6 \cong S_3$. The Permutation Groups page has the details.
Now for the new group, $D_6$. It comes from a family, built from the symmetries of regular polygons.
Let $n \ge 3$. The collection of all rigid motions preserving a regular $n$-gon centered at the origin in the plane, with the binary operation of composition of maps, forms a group, $D_{2n}$, called the dihedral group of order $2n$.
The subscript counts elements, not sides: the triangle's group is $D_6$ and the square's is $D_8$.
Half the textbooks call this group $D_6$ and the other half call it $D_3$. Mathematicians agreeing on notation: not a group. No identity element.
Other books, and plenty of professors, write $D_n$ for the symmetries of the $n$-gon (counting sides), so the square's group is $D_4$ there and $D_8$ here. Same group, different label. When you see a dihedral group anywhere else, check which convention it uses before trusting a fact like "$D_4$ has $4$ elements." On this site, $D_{2n}$ always has $2n$ elements.
What's a "rigid motion"?
"Rigid motions" = "isometries" (maps that preserve distances between points). The rigid motions of the plane are:
A rigid motion that preserves an $n$-gon centered at the origin has to keep the center where it is, so it's never a translation. Only rotations about the origin and reflections across lines through the origin survive.
Checking the group axioms is quick, because composition of functions does most of the work.
Check that $D_{2n}$ is a group:
(Composition of two motions that preserve the $n$-gon still preserves it, so $\circ$ really is a binary operation on $D_{2n}$.) Two motions generate everything: $r$, the rotation by $2\pi/n$, and $s$, a reflection across a fixed line through the origin. Composition is read right to left, like functions: $rs$ means "do $s$, then $r$."
Press $r$ to rotate and $s$ to reflect across the dashed line. Each press is done after everything before it. The caption keeps your motion written as $s^a r^b$.
Every motion you can reach is either a rotation $r^k$ or a reflection $sr^k$, so there are exactly $2n$ of them. Here are the source's three examples.
1) $n = 3$
$D_6 = \{e, r, r^2, s, sr, sr^2\}$
Note: $r^3 = e$ ($r^2 r = e \implies r^{-1} = r^2$), $s^2 = e$ ($s^{-1} = s$), $rs = sr^2 = sr^{-1}$.
$$D_6 = \langle r, s \mid r^3 = s^2 = e, rs = sr^{-1} \rangle.$$
Also: $rs \neq sr \implies D_6$ is non-Abelian.
That last line is why $C_6 \not\cong D_6$: one is Abelian and the other isn't. The square works the same way with one more rotation.
2) $n = 4$
$D_8 = \{e, r, r^2, r^3, s, sr, sr^2, sr^3\}$
$$D_8 = \langle r, s \mid r^4 = s^2 = e, rs = sr^{-1} \rangle.$$
And the whole family at once.
3) In general, for $n \ge 3$
$D_{2n} = \{e, r, \dots, r^{n-1}, s, sr, \dots, sr^{n-1}\}$ $\quad (|D_{2n}| = 2n)$.
$$D_{2n} = \langle r, s \mid r^n = s^2 = e, rs = sr^{-1} \rangle.$$
($r =$ rotation by $2\pi/n$, $s =$ reflection about a line through the origin at a fixed angle.)
($rs = sr^{-1} = sr^{n-1} \neq sr \implies D_{2n}$ is non-Abelian.)
The relation $rs = sr^{-1}$ is the one that does all the work: it lets you slide every $s$ to the front of a product, which is how the widget keeps everything in the form $s^a r^b$. Use it once yourself.
In $D_6 = \langle r, s \mid r^3 = s^2 = e, rs = sr^{-1} \rangle$, use only the relations to show that $(sr)^2 = e$. (So $sr$ is a reflection, not a rotation.)
$$\begin{align*} (sr)^2 &= (sr)(sr) \\ &= s(rs)r \quad \text{(gen. assoc.)} \\ &= s(sr^{-1})r \quad \text{(relation: } rs = sr^{-1} \text{)} \\ &= s^2 (r^{-1} r) \quad \text{(gen. assoc.)} \\ &= e \cdot e = e \quad \text{(relation: } s^2 = e \text{)}. \quad \blacksquare \end{align*}$$
The same computation works for every $sr^k$ in every $D_{2n}$ (use $r^k s = sr^{-k}$, which follows from applying $rs = sr^{-1}$ $k$ times). So the $n$ elements $sr^k$ are all reflections.
$7$ is prime, so this one is free.
Suppose $G$ is a group with $|G| = 7$. Then $G \cong C_7$. ($7$ is prime; see the general fact from before.)
Then order $8$ breaks the pattern wide open.
Order 7: one group. Order 8: five groups. Order 16: fourteen. I'm stopping here.
Suppose $G$ is a group with $|G| = 8$. Then $G$ is isomorphic to one of the following five (non-isomorphic) groups:
Four of those are built from pieces we already have. The fifth is new.
The quaternion group $Q_8$ is $Q_8 = \{1, -1, i, -i, j, -j, k, -k\}$, with (multiplicative) binary operation determined by:
Hamilton was so excited about $i^2 = j^2 = k^2 = ijk = -1$ that he carved it into a bridge in Dublin. Vandalism, but for math.
The last two lines are easier to remember as a circle. Put $i$, $j$, $k$ around it. Multiplying two of them in the direction of the arrows gives the third, and going against the arrows gives its negative.
The minus signs follow the rule $(-1)x = x(-1) = -x$, and they can be pulled out front and collected.
Compute $(-i)^2$.
$$(-i)^2 = (-i)(-i) = (i(-1))((-1)i) = i((-1)(-1))i = i^2 = -1.$$
Similarly: $(-j)^2 = (-k)^2 = -1$.
So $Q_8$ has six square roots of $-1$, and only $-1$ itself squares to $1$. Order matters, too: $ij = k$ but $ji = -k$, so $Q_8$ is non-Abelian.
$Q_8$ is strange in another way: every one of its subgroups is normal, even though it isn't Abelian. The Normal Subgroups page explores it with the $Q_8$ Explorer.
In $Q_8$, compute $ijk$ and $kji$.
$ijk = (ij)k = k \cdot k = k^2 = -1$.
$kji = k(ji) = k(-k) = -k^2 = -(-1) = 1$.
Reversing the order of three elements changed the answer from $-1$ to $1$.
How can we be sure those five groups really are different? An isomorphism only relabels elements, so it can't change how many steps an element takes to get back to $e$. Call the smallest $k \ge 1$ with $g^k = e$ the order of $g$ (the Cyclic Groups page will make this official). Count how many elements have each order, and you get a fingerprint. Groups with different fingerprints can't be isomorphic.
Choose a group, then tap its elements to find each one's order. The bars count how many elements have each order.
All five fingerprints of order $8$ are different, so the five groups are pairwise non-isomorphic. Two shortcuts to notice: a group is cyclic exactly when some element's order equals $|G|$, and $C_2 \times C_2 \times C_2$ is the only one where everything squares to $e$.
Putting this page together with Groups of Order 1–3:
$$\begin{array}{|c|l|} \hline n & \textbf{Groups} \\ \hline 1 & C_1 \\ \hline 2 & C_2 \\ \hline 3 & C_3 \\ \hline 4 & C_4, \; V_4 \cong C_2 \times C_2 \\ \hline 5 & C_5 \\ \hline 6 & C_6 \cong C_2 \times C_3, \quad D_6 \cong S_3 \\ \hline 7 & C_7 \\ \hline 8 & C_8, \; C_2 \times C_4, \; C_2 \times C_2 \times C_2, \quad D_8, \; Q_8 \\ \hline \end{array}$$
Every prime order has exactly one group. Every Abelian group on the list is a direct product of cyclic groups. Both of those turn out to be true far beyond $8$, and proving them is a big part of what's coming.
$C_2 \times C_3$ was cyclic and $C_2 \times C_4$ wasn't. Here's the rule that decides it, in general.
Let $m, n \in \mathbb{N}$, $C_m = \langle x \rangle$, and $C_n = \langle y \rangle$. Prove that $C_m \times C_n$ is cyclic (so $C_m \times C_n \cong C_{mn}$) if and only if $(m, n) = 1$.
You may use the fact from Groups of Order 1–3 that $x^a = x^b$ exactly when $a \equiv b \pmod m$.
Proof. ($\Leftarrow$) Suppose $(m, n) = 1$. We show the $mn$ powers $(x, y)^0, (x, y)^1, \dots, (x, y)^{mn - 1}$ are all different. Suppose $(x, y)^k = (x, y)^l$ with $0 \le l < k \le mn - 1$. Then $(x^k, y^k) = (x^l, y^l)$, so $x^k = x^l$ and $y^k = y^l$, which gives $m \mid (k - l)$ and $n \mid (k - l)$. So $k - l$ is a common multiple of $m$ and $n$, and $\text{lcm}(m, n) \mid (k - l)$. Since $(m, n) = 1$, $\text{lcm}(m, n) = mn$, so $mn \mid (k - l)$. But $0 < k - l < mn$, a contradiction. So $\langle (x, y) \rangle$ has $mn = |C_m \times C_n|$ elements, which means $C_m \times C_n = \langle (x, y) \rangle$ is cyclic of order $mn$, and $C_m \times C_n \cong C_{mn}$.
($\Rightarrow$) Suppose $d = (m, n) > 1$, and let $L = \text{lcm}(m, n) = \frac{mn}{d} < mn$. Take any element $(x^a, y^b)$. Since $m \mid L$ and $n \mid L$, $$(x^a, y^b)^L = ((x^L)^a, (y^L)^b) = (e, e).$$ So the powers of $(x^a, y^b)$ repeat every $L$ steps, and $\langle (x^a, y^b) \rangle$ has at most $L < mn$ elements. No element generates $C_m \times C_n$, so it is not cyclic. $\blacksquare$
So $C_2 \times C_3 \cong C_6$, $C_3 \times C_4 \cong C_{12}$, and $C_3 \times C_5 \cong C_{15}$, while $C_2 \times C_2$, $C_2 \times C_4$, and $C_3 \times C_3$ are not cyclic.