The eight rotations of a stop sign form a group by themselves: a rotation followed by a rotation is a rotation, and every rotation is undone by a rotation. They sit inside the octagon's full symmetry group $D_8$ of 16 elements, with the same operation. So do other groups: the two-element group of the identity and one reflection, and the four rotations through multiples of 90 degrees. Which subsets of $D_8$ are groups in their own right, and how can we be sure we have found them all?
A group sitting inside another and using its operation is a subgroup. Other examples are the even permutations inside $S_n$, the moves that turn only the up and down faces inside the Rubik's cube group, and the multiples of 4 inside the integers modulo 36. Subgroups are to groups what subrings are to rings, and the test for recognizing them has the same shape. The most important subgroups are the simplest: those made of the powers of one element. Such a subgroup is cyclic, and a group that is cyclic as a whole is completely understood.
First we define subgroups and prove the tests that recognize them quickly, and meet the center. Then we study cyclic subgroups and cyclic groups. Their subgroups correspond to the divisors of the order, as the ideals of $\mathbb{Z}_n$ correspond to the divisors of $n$, and their generators are counted by Euler's $\varphi$ function. Finally we generate subgroups from several elements and draw the complete subgroup diagrams of $\mathbb{Z}_{36}$ and of $D_8$, which has 19 subgroups.
This is the sixth article of Groups. It covers §7.3 of the course text (Hungerford, 2014), with Judson (2026, §3.3 and §4.1) as a free companion. It uses the rules for powers and orders proved in Basic Properties of Groups. It is the home of subgroups, the center and cyclic groups; later articles build on them.
Subgroups
Definition. A subset $H$ of a group $G$ is a subgroup of $G$, written $H \le G$, if $H$ is a group under the operation of $G$, restricted to elements of $H$.
Every group $G$ has the trivial subgroup $\{e\}$ and $G$ itself as subgroups; a subgroup other than these is proper and nontrivial. Some examples:
- The rotations $\{1, r, \ldots, r^7\}$ form a subgroup of $D_8$ of order 8 (Dihedral Groups).
- The alternating group $A_n$ of even permutations is a subgroup of $S_n$ of order $n!/2$ (Symmetric Groups and Permutations).
- $\{1, 8\}$ and $\{1, 4, 7\}$ are subgroups of $U(9)$: $8 \cdot 8 = 64 = 1$, and $4 \cdot 4 = 7$, $4 \cdot 7 = 1$, $7 \cdot 7 = 4$ modulo 9.
- $\mathbb{Z} \le \mathbb{Q} \le \mathbb{R} \le \mathbb{C}$ under addition, and $\{1, -1\} \le \mathbb{Q}^\times \le \mathbb{R}^\times$ under multiplication.
As with subrings, "the operation of $G$" carries the content. A tempting mistake is to call any subset that is a group "somehow" a subgroup.
- The set $\{0, 1, 2\}$ is $\mathbb{Z}_3$ as a set of symbols, but it is not a subgroup of $\mathbb{Z}_{36}$: there $2 + 2 = 4$, which is not in the set.
- $\mathbb{Z}_{36}$ is not a subgroup of $\mathbb{Z}$. Its elements are classes modulo 36, not integers, and its addition is a different operation.
- $\mathbb{R}^\times$ is not a subgroup of $\mathbb{R}$, though it is a subset: the operations differ.
Two subsets of $U(9)$ that fail: $\{1, 2, 4\}$ is not closed, since $2 \cdot 4 = 8$; and $\{1, 2, 4, 8\}$ is not closed either, since $2 \cdot 8 = 7$.
A subgroup must contain the identity of $G$, not merely some identity of its own. The idea: an identity $f$ of $H$ satisfies $ff = f$, and in a group only $e$ does that. If $f$ is the identity of $H$, then $ff = f$ in $H$, hence in $G$. So $ff = fe$, and left cancellation in $G$ (Basic Properties of Groups) gives $f = e$. Inverses agree too: if $a \in H$ has inverse $b$ in $H$, then $ab = e$, so $b$ is the inverse $a^{-1}$ of $a$ in $G$.
The subgroup tests
Checking all four group axioms for every candidate would be slow. Which of them can actually fail? Associativity holds in $H$ automatically, since it holds for all elements of $G$. What can fail is that products or inverses lead out of $H$.
Theorem (subgroup test). A subset $H$ of a group $G$ is a subgroup if and only if
- $e \in H$;
- $ab \in H$ whenever $a, b \in H$;
- $a^{-1} \in H$ whenever $a \in H$.
Proof. If $H$ is a subgroup, it contains its own identity, which is $e$. It contains the inverse in $H$ of each of its elements, which is the inverse in $G$. And it is closed under the operation by the closure axiom. Conversely, suppose (1) to (3) hold. Then $H$ is closed by (2), and its operation is associative because that of $G$ is. The element $e \in H$ satisfies $ea = a = ae$ for every $a$ in $H$, and each $a \in H$ has the inverse $a^{-1} \in H$ by (3). So $H$ satisfies the group axioms. $\blacksquare$
The course text states the test with "$H$ is nonempty" in place of (1) (Theorem 7.11), which is equivalent: a nonempty $H$ satisfying (2) and (3) contains some $a$, then $a^{-1}$, then $aa^{-1} = e$. Conditions (2) and (3) can be merged into one, because "multiply by an inverse" covers both.
Theorem (one-step test). A subset $H$ of $G$ is a subgroup if and only if $H$ is nonempty and $ab^{-1} \in H$ whenever $a, b \in H$.
Proof. A subgroup is nonempty and closed under products and inverses, so it contains $ab^{-1}$. Conversely, let $H$ be nonempty with the property. Pick $a \in H$; then $e = aa^{-1} \in H$. For $b \in H$, $b^{-1} = eb^{-1} \in H$. For $a, b \in H$, $b^{-1} \in H$, so $ab = a(b^{-1})^{-1} \in H$. By the subgroup test, $H$ is a subgroup. $\blacksquare$
In additive notation the condition reads $a - b \in H$, which is the subring test without its condition on products. So a subring is exactly a subgroup of the additive group that is also closed under multiplication, and every subring and every ideal of a ring is in particular an additive subgroup. Judson states the one-step test as Proposition 3.3.8.
For example, the multiples of 4 in $\mathbb{Z}_{36}$, $H = \{0, 4, 8, \ldots, 32\}$, form a subgroup. If $a = 4i$ and $b = 4j$, then $a - b = 4(i - j)$ reduced modulo 36 is again a multiple of 4, since $4 \mid 36$. In $\mathbb{Z}$, the set $n\mathbb{Z}$ of multiples of $n$ is a subgroup for the same reason. Closure under the operation alone is not enough in an infinite group. In the group $\mathbb{Q}^\times$ of nonzero rationals under multiplication, the powers $1, 2, 4, 8, \ldots$ of 2 with exponent $k \ge 0$ are closed under multiplication, since $2^j 2^k = 2^{j+k}$, and they even contain the identity 1. But they do not contain $2^{-1} = \tfrac12$, so they are not a subgroup. The powers of 2 never repeat, and that is exactly what the next proof needs a finite set for.
Finite subsets
For finite subsets, closure is enough. The idea: in a finite set the powers of an element must repeat, so some power is $e$, and the power just before it is the inverse.
Theorem (finite subgroup test). A nonempty finite subset $H$ of a group $G$ that is closed under the operation of $G$ is a subgroup.
Proof. Let $a \in H$. All positive powers $a, a^2, a^3, \ldots$ lie in $H$ by closure. Since $H$ is finite, two of them coincide, so by part (1) of the theorem on orders $a$ has some finite order $n \ge 1$. Then $e = a^n \in H$, and $a^{-1} = a^{n-1}$, which is in $H$ (for $n = 1$, $a = e$ and $a^{-1} = e = a$). So $H$ contains $e$ and the inverse of each of its elements, and the subgroup test applies. $\blacksquare$
This is the course text's Theorem 7.12. It is why the rotations of $D_8$, the even permutations, and the sets $\{1, 8\}$ and $\{1, 4, 7\}$ in $U(9)$ could be recognized as subgroups by checking products alone. For $\{1, 4, 7\}$, the products $4 \cdot 4 = 7$, $4 \cdot 7 = 1$ and $7 \cdot 7 = 4$ already supply the inverses $4^{-1} = 7$ and $7^{-1} = 4$, as the proof predicts. The reflections of $D_8$ are not closed, since $s \cdot rs = r^7$ is a rotation, and they do not contain the identity.
The center
The tests verify a candidate quickly, and every group offers one candidate: the elements that commute with everything. The idea of the proof: commuting with $g$ survives products and inverses.
Definition. The center of a group $G$ is
$$Z(G) = \{\, z \in G : zg = gz \text{ for every } g \in G \,\}.$$
Theorem. $Z(G)$ is a subgroup of $G$, and $Z(G) = G$ exactly when $G$ is abelian.
Proof. Use the one-step test. $Z(G)$ is nonempty, since $eg = g = ge$ for every $g$. Let $y, z \in Z(G)$. First $z^{-1}$ commutes with every $g$. Since $z$ commutes with $g^{-1}$, the elements $zg^{-1}$ and $g^{-1}z$ are equal, so their inverses are equal. By the reversal rule those inverses are $gz^{-1}$ and $z^{-1}g$. Then for every $g$,
$$(yz^{-1})g = y(z^{-1}g) = y(gz^{-1}) = (yg)z^{-1} = (gy)z^{-1} = g(yz^{-1}),$$
so $yz^{-1} \in Z(G)$. The last statement is the definition of abelian: every element commutes with every element. $\blacksquare$
The center measures how close a group comes to being abelian. Its elements can be moved freely through any product, so a central element $z$ satisfies $zxz^{-1} = x$ for every $x$. The superflip of the Rubik's cube is a central element. The script checks that it commutes with all six face turns, and an element commuting with a set of generators commutes with every product of them.
Check your understanding. Back to the stop sign. Which symmetries of the octagon commute with all 16 symmetries of $D_8$?
Only the identity and the half turn $r^4$, so $Z(D_8) = \{1, r^4\}$. A reflection $r^i s$ does not commute with $r$, since $r^i s \cdot r = r^{i-1}s$ while $r \cdot r^i s = r^{i+1}s$. And $r^k$ commutes with $s$ only when $r^k = r^{-k}$, that is, $k = 0$ or 4. The script computes the center directly and finds $\{1, r^4\}$.
Proposition. The center of $GL_2(\mathbb{R})$ consists of the scalar matrices $cI$ with $c \neq 0$.
The idea: a central matrix must commute with two simple shears in particular, and those two equations already force it to be scalar.
Proof. A scalar matrix $cI$ commutes with every matrix, since $(cI)X = cX = X(cI)$, and it is invertible for $c \neq 0$. Conversely, let $X = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$ be central. It commutes in particular with the two invertible matrices
$$P = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, \qquad Q = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}.$$
Computing both products,
$$XP = \begin{pmatrix} a & a + b \\ c & c + d \end{pmatrix}, \qquad PX = \begin{pmatrix} a + c & b + d \\ c & d \end{pmatrix}.$$
Comparing the entries in the first row gives $a = a + c$, so $c = 0$, and $a + b = b + d$, so $a = d$. In the same way $XQ = QX$ forces $b = 0$. So $X = aI$, with $a \neq 0$ because $X$ is invertible. $\blacksquare$
Two well-chosen elements were enough to pin down the center. The same argument works over any field. The script confirms it in $GL_2(\mathbb{Z}_5)$, a group of 480 matrices whose center consists of the four scalar matrices $cI$, $c = 1, 2, 3, 4$. In that group, the only matrices that commute with both $P$ and $Q$ are those four.
Cyclic subgroups
The center is one subgroup every group has. Another comes from any single element. The smallest subgroup containing a given element must contain all its powers, and the powers already form a subgroup.
Theorem. Let $a \in G$. The set of powers
$$\langle a \rangle = \{\, a^k : k \in \mathbb{Z} \,\}$$
is a subgroup of $G$, the cyclic subgroup generated by $a$. It is contained in every subgroup of $G$ that contains $a$. If $a$ has finite order $n$, then $\langle a \rangle = \{e, a, a^2, \ldots, a^{n-1}\}$ has exactly $n$ elements; if $a$ has infinite order, $\langle a \rangle$ is infinite and its elements $a^k$ are all different.
The idea: the laws of exponents make the powers closed under "multiply by an inverse", and the theorem on orders counts them.
Proof. $\langle a \rangle$ contains $a^0 = e$, and for powers $a^i$, $a^j$ the laws of exponents give $a^i (a^j)^{-1} = a^i a^{-j} = a^{i - j}$, again a power. By the one-step test it is a subgroup. A subgroup containing $a$ contains $a^{-1}$ and, by closure, every positive power of $a$ and of $a^{-1}$, so it contains $\langle a \rangle$. The statements about size are the theorem on orders: an element of order $n$ has exactly the $n$ different powers $e, a, \ldots, a^{n-1}$, and an element of infinite order has all its powers different. $\blacksquare$
So the two meanings of "order" agree: the order of an element is the order of the cyclic subgroup it generates, $\lvert a \rvert = \lvert \langle a \rangle \rvert$. This is the course text's Theorems 7.14 and 7.15. In additive notation $\langle a \rangle = \{ka : k \in \mathbb{Z}\}$, the multiples of $a$. Examples:
- In $U(9)$: $\langle 2 \rangle = U(9)$, $\langle 4 \rangle = \{1, 4, 7\}$, $\langle 8 \rangle = \{1, 8\}$, and $\langle 7 \rangle = \{1, 7, 4\} = \langle 4 \rangle$. Different elements can generate the same subgroup.
- In $D_8$: $\langle r \rangle$ is the rotation subgroup, $\langle r^2 \rangle = \{1, r^2, r^4, r^6\}$, and each reflection generates a subgroup of order 2, such as $\langle rs \rangle = \{1, rs\}$.
- In $S_8$: the running example $\sigma = (1\;5\;2\;8)(3\;6\;7)$ of Symmetric Groups and Permutations has order 12, so $\langle \sigma \rangle$ has 12 elements; that article tabulates several of these powers.
- On the cube: $\langle RU \rangle$ has 105 elements.
- In $\mathbb{Z}$: $\langle n \rangle = n\mathbb{Z}$, and $\langle -n \rangle = n\mathbb{Z}$ as well.
- In $\mathbb{C}^\times$: $1 + i$ has infinite order, since $\lvert (1+i)^k \rvert^2 = 2^k$ (the script lists $2, 4, 8, \ldots, 256$ for $k = 1, \ldots, 8$). Its powers spiral outward from the unit circle, each a rotation by 45 degrees and a stretch by $\sqrt 2$ of the one before, and they are all different.
Check your understanding. How many elements does $\langle \sigma^3 \rangle$ have, for the running example $\sigma$ of order 12?
Four. By the formula for the order of a power, $\lvert \sigma^3 \rvert = 12/\gcd(12, 3) = 4$, and the order of an element is the size of the subgroup it generates. Indeed $\sigma^3 = (1 \; 8 \; 2 \; 5)$ is a 4-cycle (Symmetric Groups and Permutations).
Cyclic groups
When one element's powers fill the whole group, the group is as simple as a group can be.
Definition. A group $G$ is cyclic if $G = \langle a \rangle$ for some $a \in G$; such an $a$ is a generator of $G$.
$\mathbb{Z} = \langle 1 \rangle$ and $\mathbb{Z}_n = \langle 1 \rangle$ are cyclic. So is $U(9) = \langle 2 \rangle$, as the powers of 2 in Groups: Definition and First Examples showed, and so are the $n$th roots of unity $\mu_n = \langle e^{2\pi i/n} \rangle$, the rotations of $D_n$, and the group $\mathbb{Z}_5 \times U(9)$, which Basic Properties of Groups showed is generated by $(3, 2)$. A finite group $G$ is cyclic exactly when it has an element of order $\lvert G \rvert$, since that element's powers then fill the group.
The first consequence is that powers of one element always commute with each other.
Theorem. Every cyclic group is abelian.
Proof. If $G = \langle a \rangle$, any two elements are powers $a^i$ and $a^j$, and $a^i a^j = a^{i+j} = a^j a^i$ by the laws of exponents. $\blacksquare$
So no nonabelian group is cyclic: not $D_8$, not $S_n$ for $n \ge 3$, not the cube group. A tempting converse is that every abelian group is cyclic, and it is false. The pairs of integers $\mathbb{Z} \times \mathbb{Z}$, added coordinate by coordinate, form an abelian group. Suppose some $(a, b)$ generated it. Then $(1, 0) = k(a, b)$ and $(0, 1) = j(a, b)$ for some integers $k$ and $j$. The first gives $ka = 1$ and $kb = 0$, so $k \neq 0$ and $b = 0$; but then the second coordinate of $j(a, b)$ is $jb = 0$, not 1. So no single pair generates. Which products of finite cyclic groups are cyclic is settled below, once the subgroups of a cyclic group are known.
Subgroups of a cyclic group
A cyclic group is understood once its subgroups are known. Can they be listed? The subgroups of $\mathbb{Z}$ and of $\mathbb{Z}_n$ were found, as ideals, in Ideals and Principal Ideal Domains: every ideal of $\mathbb{Z}$ is $(d)$ for some $d \ge 0$. The same division argument works in any cyclic group. Here is the idea in one sentence: take the smallest positive power of the generator in the subgroup, and the division algorithm shows that every other power in it is a power of that one.
Theorem. Every subgroup of a cyclic group is cyclic. More precisely, if $G = \langle a \rangle$ and $H \le G$ with $H \neq \{e\}$, then $H = \langle a^m \rangle$, where $m$ is the least positive integer with $a^m \in H$.
Proof. Since $H \neq \{e\}$, it contains some $a^k \neq e$, and then also $a^{-k}$. One of $k$ and $-k$ is positive, so $H$ contains a positive power of $a$. By the well-ordering principle there is a least positive $m$ with $a^m \in H$. Then $\langle a^m \rangle \subseteq H$. Conversely, let $a^k \in H$. By the division algorithm, $k = mq + r$ with $0 \le r < m$, and
$$a^r = a^{k - mq} = a^k (a^m)^{-q} \in H,$$
since $a^k$ and $(a^m)^{-q}$ lie in $H$. By the choice of $m$, $r$ cannot be positive, so $r = 0$ and $a^k = (a^m)^q \in \langle a^m \rangle$. $\blacksquare$
This is the course text's Theorem 7.17 and Judson's Theorem 4.1.10. For $G = \mathbb{Z}$ it says that every subgroup of $\mathbb{Z}$ is $d\mathbb{Z}$ for some $d \ge 0$ (Judson, Corollary 4.1.11), the additive form of the theorem that $\mathbb{Z}$ is a principal ideal domain. For finite cyclic groups it gives a complete list. Here is the plan. Part (1) shows that a power $a^k$ generates the same subgroup as $a^{\gcd(n, k)}$, by comparing sizes. The other parts read off the subgroups, generators and inclusions from that.
Theorem. Let $G = \langle a \rangle$ be cyclic of order $n$.
- For every integer $k$, $\langle a^k \rangle = \langle a^d \rangle$ with $d = \gcd(n, k)$, and this subgroup has order $n/d$.
- For each positive divisor $c$ of $n$, $G$ has exactly one subgroup of order $c$, namely $\langle a^{n/c} \rangle$. These are all the subgroups of $G$, so $G$ has exactly as many subgroups as $n$ has positive divisors.
- $a^k$ generates $G$ if and only if $\gcd(n, k) = 1$. So $G$ has exactly $\varphi(n)$ generators.
- For divisors $d$ and $d'$ of $n$, $\langle a^{d'} \rangle \subseteq \langle a^d \rangle$ if and only if $d \mid d'$.
Proof. (1) Let $d = \gcd(n, k)$. Since $d \mid k$, $a^k = (a^d)^{k/d} \in \langle a^d \rangle$, so $\langle a^k \rangle \subseteq \langle a^d \rangle$. By the formula for the order of a power, $a^k$ has order $n/\gcd(n, k) = n/d$. And $a^d$ has order $n/\gcd(n, d) = n/d$, since $d$ divides $n$. So the finite sets $\langle a^k \rangle$ and $\langle a^d \rangle$ both have $n/d$ elements, and the first is contained in the second; hence they are equal.
(2) Every subgroup is cyclic, generated by some $a^k$. By (1) it equals $\langle a^d \rangle$ for a positive divisor $d$ of $n$ (with $d = n$ for the trivial subgroup), and has order $n/d$. Different divisors $d$ give subgroups of different orders $n/d$. So the subgroups correspond one to one with the positive divisors $d$ of $n$, and the subgroup of order $c$ is the one with $d = n/c$.
(3) $a^k$ generates $G$ exactly when $\lvert a^k \rvert = n$, that is, when $n/\gcd(n, k) = n$. The exponents $k$ with $0 \le k < n$ give the $n$ different elements of $G$, and those with $\gcd(n, k) = 1$ number $\varphi(n)$.
(4) If $d \mid d'$, then $a^{d'} = (a^d)^{d'/d} \in \langle a^d \rangle$. Conversely, if $a^{d'} \in \langle a^d \rangle$, then $a^{d'} = a^{dt}$ for some integer $t$, so $d' \equiv dt \pmod n$ by the theorem on orders; that is, $d' = dt + nq$ for some integer $q$. Since $d$ divides $n$, it divides $d'$. $\blacksquare$
The course text and Judson prove parts of this in the text (Judson, Theorem 4.1.13 and Corollary 4.1.14, the generators of $\mathbb{Z}_n$) and leave the rest to their readers; it is stated here in full because the next units use all of it.
When is $\mathbb{Z}_m \times \mathbb{Z}_n$ cyclic?
Part (2) gives a test for recognizing groups that are not cyclic: a cyclic group has only one subgroup of each order. The idea of the next proof: when $m$ and $n$ share no factor, the Chinese remainder theorem reaches every pair from $(1, 1)$; when they share a prime $p$, each factor contributes its own subgroup of order $p$.
Theorem. For positive integers $m$ and $n$, the group $\mathbb{Z}_m \times \mathbb{Z}_n$ is cyclic if and only if $\gcd(m, n) = 1$.
Proof. Suppose $\gcd(m, n) = 1$, and let $(u, v)$ be any element. By the Chinese remainder theorem there is an integer $k$ with $k \equiv u \pmod m$ and $k \equiv v \pmod n$. Then $k(1, 1) = (k, k) = (u, v)$, so every element is a multiple of $(1, 1)$, and the group is cyclic.
Suppose instead that $\gcd(m, n) > 1$, and let $p$ be a prime dividing both. The element $(m/p, 0)$ has order $p$, since its multiples $(jm/p, 0)$ return to $(0, 0)$ first at $j = p$. So it generates a subgroup $\{(jm/p, 0)\}$ of order $p$. In the same way $(0, n/p)$ generates a subgroup $\{(0, jn/p)\}$ of order $p$. These two subgroups share only $(0, 0)$, so they are different subgroups of the same order $p$. A cyclic group of order $mn$ has exactly one subgroup of order $p$, by part (2) of the theorem above, so $\mathbb{Z}_m \times \mathbb{Z}_n$ is not cyclic. $\blacksquare$
Judson proves the equivalent statement $\mathbb{Z}_m \times \mathbb{Z}_n \cong \mathbb{Z}_{mn}$ if and only if $\gcd(m, n) = 1$ (Theorem 9.2.9), and the The Chinese Remainder Theorem article gives the ring isomorphism $\mathbb{Z}_{45} \cong \mathbb{Z}_5 \times \mathbb{Z}_9$, which in particular matches the additive groups. The theorem is the group form of that ring statement. The script confirms it for every $m$ and $n$ from 1 to 12 by computing the largest order of an element.
The subgroups of $\mathbb{Z}_{36}$
Now the theorem can be checked on a whole group. In $\mathbb{Z}_{36} = \langle 1 \rangle$ the power $a^k$ is the multiple $k \cdot 1 = k$. So the theorem says that the subgroups are $\langle d \rangle$ for the nine divisors $d$ of 36, with $\langle d \rangle$ of order $36/d$, and that $\langle k \rangle = \langle \gcd(k, 36) \rangle$.
Check your understanding. Before reading the table, predict how many elements of $\mathbb{Z}_{36}$ have order 4, and which they are.
Two, namely 9 and 27. The elements of order 4 are the generators of the one subgroup of order 4, which is $\langle 9 \rangle = \{0, 9, 18, 27\}$, and part (3) gives it $\varphi(4) = 2$ generators. The script lists exactly 9 and 27.
The same reasoning sorts all 36 elements at once. Each element $k$ generates exactly one subgroup, $\langle \gcd(k, 36) \rangle$. For instance $\langle 10 \rangle = \langle \gcd(10, 36) \rangle = \langle 2 \rangle$, the 18 even classes. The generators of the subgroup of order $c$ are exactly the elements of order $c$, and part (3), applied to that cyclic subgroup, says there are $\varphi(c)$ of them. Every element is counted once, under the order $c$ of the subgroup it generates, so
$$36 = \sum_{c \mid 36} \varphi(c) = \varphi(1) + \varphi(2) + \varphi(3) + \varphi(4) + \varphi(6) + \varphi(9) + \varphi(12) + \varphi(18) + \varphi(36),$$
which is $1 + 1 + 2 + 2 + 2 + 6 + 4 + 6 + 12$. The script confirms each term by computing the order of every element. The same count in a cyclic group of any order $n$, such as $\mathbb{Z}_n$, proves the identity $\sum_{c \mid n} \varphi(c) = n$ for every positive integer $n$.
The diagram is a subgroup lattice: subgroups ordered by inclusion, with a line from each to the largest subgroups it contains. For a cyclic group it is the divisor diagram of $n$. It is drawn in the same way as the ideal diagram of $\mathbb{Z}_{45}$ (a $3 \times 2$ grid, since $45 = 3^2 \cdot 5$) in Ideals and Principal Ideal Domains. The reason is that in $\mathbb{Z}_n$ the subgroups and the ideals are the same sets: every subgroup $\langle d \rangle$ of $\mathbb{Z}_n$ is closed under multiplication by any element, since $x \cdot kd = (xk)d$. The subgroups of a cyclic group of order $36$ in any other notation have the same lattice. For example, by the theorem on $\mathbb{Z}_m \times \mathbb{Z}_n$, $\mathbb{Z}_4 \times \mathbb{Z}_9$ is cyclic of order 36.
The group $U(9) = \langle 2 \rangle$ of order 6 has four subgroups, one for each divisor of 6: $\{1\}$, $\langle 2^3 \rangle = \{1, 8\}$, $\langle 2^2 \rangle = \{1, 4, 7\}$, and $U(9)$ itself, with the $\varphi(6) = 2$ generators 2 and 5.
Groups of units modulo a prime
The groups $U(n)$ are sometimes cyclic and sometimes not. The course text proves that every finite subgroup of the nonzero elements of $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$ or $\mathbb{Z}_p$ is cyclic (Theorem 7.16; the same holds in every field). In particular $U(p) = \mathbb{Z}_p^\times$ is cyclic for every prime $p$, and a generator of $U(p)$ is a primitive root modulo $p$. For $p = 23$, the script finds that 5 has order 22 and so generates $U(23)$, and by the theorem there are $\varphi(22) = 10$ generators.
Subgroups generated by several elements
The stop sign's group $D_8$ is not cyclic, so no single element generates it. What is the smallest subgroup containing two or more given elements?
Definition. For a subset $S$ of a group $G$, let $\langle S \rangle$ be the set of all finite products $s_1 s_2 \cdots s_k$ ($k \ge 0$) in which each $s_i$ is an element of $S$ or the inverse of an element of $S$, with the empty product ($k = 0$) equal to $e$. This is the subgroup generated by $S$; if $\langle S \rangle = G$, then $S$ generates $G$.
The idea: any subgroup containing $S$ must contain all such products, and the products already form a subgroup.
Theorem. $\langle S \rangle$ is a subgroup of $G$ containing $S$, and it is contained in every subgroup that contains $S$.
Proof. It contains $e$ (the empty product) and each element of $S$ (a product of one factor). A product of two such products is a longer product of the same kind. By the reversal rule the inverse of $s_1 \cdots s_k$ is $s_k^{-1} \cdots s_1^{-1}$. That is again of the same kind, since the inverse of an inverse of an element of $S$ is that element. By the subgroup test, $\langle S \rangle$ is a subgroup. Any subgroup containing $S$ contains the inverses of elements of $S$ and, by closure, all their products. $\blacksquare$
This is the course text's Theorem 7.18. For $S = \{a\}$ it gives $\langle a \rangle$, because products of $a$'s and $a^{-1}$'s are powers of $a$. In an abelian group the factors can be sorted, so $\langle a, b \rangle = \{a^i b^j : i, j \in \mathbb{Z}\}$. In a nonabelian group the order of the factors matters and the words can be long. Examples:
- The dihedral group. $D_8 = \langle r, s \rangle$, since every element is $r^a$ or $r^a s$ (Dihedral Groups). Two reflections also generate it: $\langle s, rs \rangle = D_8$, because $(rs)s = r$. But $\langle s, r^2 s \rangle$ has only 8 elements; it contains $(r^2 s)s = r^2$ and equals $\langle r^2, s \rangle$.
- The cube. The cube group is generated by its six face turns. Its subgroup $\langle U, D \rangle$ consists of the 16 moves $U^i D^j$ with $0 \le i, j \le 3$, because $U$ and $D$ commute (The Rubik's Cube Group) and each has order 4, and these 16 products are different because $U$ and $D$ move disjoint sets of stickers.
- Permutations. $S_n$ is generated by its transpositions (Symmetric Groups and Permutations).
- Integers. In $\mathbb{Z}_{36}$, $\langle 8, 30 \rangle = \{8i + 30j\} = \langle 2 \rangle$, because the combinations of 8, 30 and 36 are the multiples of $\gcd(8, 30, 36) = 2$, by Bezout's identity. The ideals of $\mathbb{Z}_{45}$ generated by two elements were reduced to one generator in the same way.
The subgroups of $D_8$
Back to the question of the opening: which subsets of the stop sign's group are subgroups? A nonabelian group has a richer lattice. The script finds 19 subgroups of $D_8$:
- one of order 1;
- nine of order 2;
- five of order 4;
- three of order 8;
- $D_8$ itself.
They follow a pattern that holds in every dihedral group. Here is the idea of the proof: the rotations in a subgroup form a subgroup of the cyclic rotation group, and any two reflections in it differ by one of those rotations.
Proposition. Every subgroup of $D_n$ is of one of the forms
$$\langle r^d \rangle \qquad \text{or} \qquad \langle r^d, \, r^i s \rangle,$$
where $d$ is a positive divisor of $n$ and $0 \le i < d$. The first has order $n/d$, consists of rotations, and is cyclic; the second has order $2n/d$ and contains the $n/d$ reflections $r^{i + jd}s$.
Proof. Let $H \le D_n$. Its rotations $H \cap \langle r \rangle$ form a subgroup of the cyclic group $\langle r \rangle$ of order $n$ (the intersection of two subgroups passes the one-step test). So by the theorem on cyclic groups it is $\langle r^d \rangle$ for a divisor $d$ of $n$. If $H$ contains no reflection, $H = \langle r^d \rangle$. Otherwise let $r^i s \in H$. For any reflection $r^j s \in H$, the product $(r^j s)(r^i s) = r^{j - i}$ lies in $H$ and is a rotation, so $r^{j-i} \in \langle r^d \rangle$ and $j \equiv i \pmod d$. Conversely, every $r^{i + kd}s = (r^d)^k (r^i s)$ lies in $H$. So the reflections of $H$ are exactly the $r^{i + kd}s$, $n/d$ of them, and the exponent $i$ can be reduced modulo $d$. Hence $H = \langle r^d, r^i s \rangle$, with $n/d$ rotations and $n/d$ reflections. $\blacksquare$
Conversely, every pair $(d, i)$ with $d \mid n$ and $0 \le i < d$ gives a subgroup. The set $\{r^{jd}\} \cup \{r^{i + jd}s\}$ is closed under products, by the rules
$$r^{jd} \cdot r^{i+kd}s = r^{i + (j+k)d}s, \qquad r^{i+kd}s \cdot r^{jd} = r^{i + (k-j)d}s, \qquad r^{i+jd}s \cdot r^{i+kd}s = r^{(j-k)d}.$$
So it is a subgroup by the finite subgroup test, and it is $\langle r^d, r^i s \rangle$. Different pairs give different subgroups, since the rotations determine $d$ and the reflections then determine $i$. So the subgroups containing reflections correspond to the pairs $(d, i)$, and there are $d$ of them for each divisor $d$.
For $D_8$, the divisors $d = 1, 2, 4, 8$ give four rotation subgroups and $1 + 2 + 4 + 8 = 15$ subgroups containing reflections, 19 in all. In general $D_n$ has $\tau(n) + \sigma(n)$ subgroups, where $\tau(n)$ counts the divisors of $n$ and $\sigma(n)$ adds them up. The script confirms this count for $n = 3$ to 12. For the heptagon, $D_7$ has $2 + 8 = 10$ subgroups: the trivial one, seven of order 2 generated by the reflections, the rotations, and $D_7$.
Check your understanding. How many subgroups does $D_{10}$, the group of the regular decagon, have?
The divisors of 10 are 1, 2, 5 and 10, so $\tau(10) = 4$ and $\sigma(10) = 18$, and $D_{10}$ has 22 subgroups. The script lists the subgroups of $D_{10}$ directly and counts 22.
Unlike the lattice of $\mathbb{Z}_{36}$, this one has several subgroups of the same order: nine of order 2, five of order 4, three of order 8. That alone shows $D_8$ is not cyclic, since a cyclic group has exactly one subgroup of each order dividing $n$. Among the subgroups of order 4, $\langle r^2 \rangle$ is cyclic. Each $\langle r^4, r^i s \rangle = \{1, r^4, r^i s, r^{i+4}s\}$ consists of the identity and three elements of order 2, so it is not. Every order in the diagram, 1, 2, 4, 8 and 16, divides 16; that this must happen in every finite group is Lagrange's theorem.
Where it leads
- Maps between groups that respect the operation send subgroups to subgroups, and their kernels are subgroups; Group Homomorphisms and Isomorphisms develops them and shows that every cyclic group is a copy of $\mathbb{Z}$ or of some $\mathbb{Z}_n$.
- Every finite group is a subgroup of a symmetric group, by Cayley's theorem.
- The orders of subgroups of a finite group divide the order of the group, and the subgroups split the group into cosets of equal size: Cosets and Lagrange's Theorem.
- The subgroups one can "work modulo", as with ideals in rings, are the normal subgroups.
What we have learned
A subgroup is a subset that is a group under the same operation; checking closure under products and inverses is enough, and for a finite subset products alone. The center and each $\langle a \rangle$ are subgroups, with $\lvert a \rvert = \lvert \langle a \rangle \rvert$. A cyclic group of order $n$ has one subgroup for each divisor of $n$, while the stop sign's group $D_8$ has 19.
When are two groups the same group with different names, as $U(9)$ and $\mathbb{Z}_6$ appeared to be? The next article, Group Homomorphisms and Isomorphisms, makes that precise.
References
- Hungerford, T. W. (2014). Abstract Algebra: An Introduction (3rd ed.), §7.3. Brooks/Cole, Cengage Learning. The course text: subgroups; the subgroup test for nonempty subsets closed under products and inverses (Theorem 7.11) and for finite subsets closed under products (Theorem 7.12); the center is a subgroup (Theorem 7.13); the cyclic subgroup $\langle a \rangle$ (Theorem 7.14) and its order (Theorem 7.15); finite subgroups of the nonzero elements of $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$ or $\mathbb{Z}_p$ are cyclic (Theorem 7.16); subgroups of cyclic groups are cyclic (Theorem 7.17); the subgroup generated by a set (Theorem 7.18). record · 44 pages
- Judson, T. W. (2026). Abstract Algebra: Theory and Applications (annual edition, August 2026). Free online at judsonbooks.org. §3.3 (subgroups; Proposition 3.3.7, the subgroup test; Proposition 3.3.8, the one-step test); §4.1 (Theorem 4.1.3, $\langle a \rangle$ is the smallest subgroup containing $a$; Theorem 4.1.9, cyclic groups are abelian; Theorem 4.1.10, subgroups of cyclic groups are cyclic; Corollary 4.1.11, the subgroups of $\mathbb{Z}$ are the $n\mathbb{Z}$; Theorem 4.1.13 and Corollary 4.1.14, orders of elements and generators of a cyclic group); §9.2 (Theorem 9.2.9, $\mathbb{Z}_m \times \mathbb{Z}_n \cong \mathbb{Z}_{mn}$ exactly when $\gcd(m, n) = 1$). record · 44 pages