A subset $S$ of a ring $R$ is a subring, a ring under the operations of $R$, exactly when it contains $0_R$ and is closed under subtraction and multiplication (the subring test). A subring shares the zero of $R$ but not necessarily its identity. By the test, the Eisenstein integers, a commutative ring of upper triangular $2 \times 2$ matrices and the continuous functions are subrings. The direct product $R \times S$, computed coordinatewise, is commutative exactly when both factors are and has the identity $(1_R, 1_S)$ exactly when both have one. Its units are the pairs of units, and it has zero divisors whenever both factors have a nonzero element. Reading remainders matches $\mathbb{Z}_{21}$ with $\mathbb{Z}_3 \times \mathbb{Z}_7$ (12 units and 8 zero divisors each), but not $\mathbb{Z}_{24}$ with $\mathbb{Z}_4 \times \mathbb{Z}_6$ (8 units against 4).
The Gaussian integers sit inside the complex numbers, and $(2 + 3i)(4 - i) = 11 + 10i$ whether the factors are read as Gaussian integers or as complex numbers. In the other direction, an element of $\mathbb{Z}_{21}$ can be read through its remainders modulo 3 and modulo 7, like a pair of clocks with 3 and 7 hours: 5 reads as $(2, 5)$, 11 as $(2, 4)$, and their product $55 = 13$ reads as $(1, 6)$, the product of the readings. Each observation is an instance of a general construction.
A ring found inside a larger ring, with the same operations, is a subring: the integers inside the rationals, the Gaussian integers inside $\mathbb{C}$, the continuous functions inside all functions. Two rings computed side by side, coordinate by coordinate, form their direct product. A direct product of two nonzero rings always has zero divisors, and comparing $\mathbb{Z}_3 \times \mathbb{Z}_7$ with $\mathbb{Z}_{21}$ gives a first look at the Chinese remainder theorem.
First we define subrings, then prove a three-condition test for recognizing them and apply it. Next we define direct products and find their identity, units and zero divisors. Finally we compare $\mathbb{Z}_3 \times \mathbb{Z}_7$ with $\mathbb{Z}_{21}$, where the counts agree, and $\mathbb{Z}_4 \times \mathbb{Z}_6$ with $\mathbb{Z}_{24}$, where they do not.
This is the last article of Rings. It covers the subrings and products of §3.1 of the course text (Theorems 3.1 and 3.2) and the subring test of §3.2 (Theorem 3.6) (Hungerford, 2014). It uses the units and zero divisors of Basic Properties of Rings and the integral domains of Integral Domains and Fields.
Subrings
Definition. Let $R$ be a ring. A subset $S$ of $R$ is a subring of $R$ if $S$ is a ring under the addition and multiplication of $R$, restricted to elements of $S$.
The phrase "the same operations" carries the content. A common misreading is that any ring whose elements can be listed inside another ring is a subring. The set $\{0, 1\}$ of symbols can be listed inside $\{0, 1, 2\}$, but $\mathbb{Z}_2$ is not a subring of $\mathbb{Z}_3$. In $\mathbb{Z}_2$, $1 + 1 = 0$, while in $\mathbb{Z}_3$, $1 + 1 = 2$. So the subset $\{0, 1\}$ of $\mathbb{Z}_3$ is not even closed under the addition of $\mathbb{Z}_3$. The elements of $\mathbb{Z}_2$ are classes of integers modulo 2, a different kind of object from the classes modulo 3, and the shared names hide that.
A subring has its own zero element, which must be the zero of $R$. The idea is that a zero is an element equal to its own double, and in $R$ only $0_R$ is. If $z$ is the zero of $S$, then $z + z = z$ in $S$, hence in $R$. So $z + z = z + 0_R$, and additive cancellation in $R$ gives $z = 0_R$. Negatives agree too. If $a + b = 0_R$ with $a$ and $b$ in $S$, then $b$ is the additive inverse of $a$ in $R$, which is unique, so it is the element $-a$ of $R$. The identity is different, as a later section shows.
The subring test
Checking all eight ring axioms for every candidate would be tedious. Do they all need checking?
Most of them come for free. Associativity, commutativity of addition and distributivity are equations that hold for all elements of $R$, so they hold in particular for elements of $S$. What can fail is that the operations or the inverses lead out of $S$. The test checks only that.
Theorem (subring test). Let $R$ be a ring and $S$ a subset of $R$. Then $S$ is a subring of $R$ if and only if
- $0_R \in S$;
- $a - b \in S$ whenever $a, b \in S$ (closure under subtraction);
- $ab \in S$ whenever $a, b \in S$ (closure under multiplication).
Here is the plan of the proof. A subring clearly passes the test. For the converse, subtraction is enough to produce negatives ($0 - a$) and then sums ($a - (-b)$), and the equational axioms are inherited from $R$.
Proof. Suppose $S$ is a subring. Its zero is $0_R$, as shown above, so (1) holds. If $a, b \in S$, then $-b \in S$, because $S$ contains the additive inverse of each of its elements and that inverse is the $-b$ of $R$. Then $a + (-b) \in S$ by closure under addition. So (2) holds, and (3) is closure under multiplication.
Conversely, suppose (1) to (3) hold. Check the axioms for $S$ in turn.
- Additive inverses. If $a \in S$, then $-a = 0_R - a \in S$ by (1) and (2), and $a + (-a) = 0_R$.
- Closure under addition. If $a, b \in S$, then $-b \in S$ by the previous step, and $a + b = a - (-b) \in S$ by (2).
- Zero. $0_R \in S$ by (1), and $a + 0_R = a$ for every $a$ in $S$, since it holds for every $a$ in $R$.
- Closure under multiplication is (3).
- Associativity of both operations, commutativity of addition and the distributive laws hold for all elements of $R$, hence for all elements of $S$.
So $S$ is a ring under the operations of $R$. $\blacksquare$
The course text proves the test in two stages. First it takes closure under addition, the zero and negatives as separate conditions (Theorem 3.2), and then it gives the subtraction form for a nonempty set (Theorem 3.6). Judson (2026, Proposition 16.1.10) states the subtraction form. Requiring $0_R \in S$ instead of "nonempty" changes nothing, because a nonempty $S$ closed under subtraction contains $a - a = 0_R$ for any of its elements $a$.
Condition (2) cannot be weakened to closure under addition. In the polynomial ring $\mathbb{Z}[x]$, the polynomials whose coefficients are all nonnegative contain 0 and are closed under addition and multiplication. But they are not a subring, because they lack negatives: $x$ and $1$ belong to the set, and $x - 1$ does not.
Example (closed under subtraction but not under multiplication). Consider the Gaussian integers $a + bi$ whose real part $a$ is even. Conditions (1) and (2) of the test hold, and condition (3) fails. For (1) and (2): $0$ has real part 0, and a difference of two such elements has real part (even) $-$ (even), which is even. Condition (3) fails. The element $i = 0 + 1i$ belongs to the set, but $i \cdot i = -1$ has odd real part. So the set is not a subring. Closure under multiplication is a real condition, not a formality.
Examples
Number systems. Each of $\mathbb{Z} \subseteq \mathbb{Q} \subseteq \mathbb{R} \subseteq \mathbb{C}$ is a subring of the next, and so of every later one. A subring of a subring of $R$ is a subring of $R$, since the conditions of the test refer only to the operations, which are the same throughout.
Functions. In the ring $F(\mathbb{R})$ of all functions $\mathbb{R} \to \mathbb{R}$ (Rings: Definition and Examples), the continuous functions form a subring. The zero function is continuous, and differences and products of continuous functions are continuous, as calculus shows. Inside them, the differentiable functions form a subring by the difference and product rules for derivatives, and the polynomial functions form a subring inside those: the zero function is a polynomial function, and differences and products of polynomial functions are polynomial functions. Each is a ring with the identity of $F(\mathbb{R})$, the constant function 1.
The Eisenstein integers. Let
$$\omega = \frac{-1 + \sqrt{-3}}{2} = -\frac{1}{2} + \frac{\sqrt{3}}{2}\, i,$$
a complex number with $\omega^3 = 1$ and $\lvert \omega \rvert = 1$ (both are checked below), and let $\mathbb{Z}[\omega] = \{\, a + b\omega : a, b \in \mathbb{Z} \,\}$, the Eisenstein integers. To multiply two of them, the value of $\omega^2$ is needed:
$$\omega^2 = \frac{(-1 + \sqrt{-3})^2}{4} = \frac{1 - 2\sqrt{-3} - 3}{4} = \frac{-1 - \sqrt{-3}}{2} = -1 - \omega.$$
It follows that $\omega^3 = \omega \cdot \omega^2 = -\omega - \omega^2 = -\omega + (1 + \omega) = 1$. Also $\lvert \omega \rvert^2 = \frac{1}{4} + \frac{3}{4} = 1$. Now apply the test in $\mathbb{C}$.
- $0 = 0 + 0\omega \in \mathbb{Z}[\omega]$.
- $(a + b\omega) - (c + d\omega) = (a - c) + (b - d)\omega$, with integer coefficients.
- Using $\omega^2 = -1 - \omega$,
$$(a + b\omega)(c + d\omega) = ac + (ad + bc)\omega + bd\,\omega^2 = (ac - bd) + (ad + bc - bd)\omega,$$
again with integer coefficients.
So $\mathbb{Z}[\omega]$ is a subring of $\mathbb{C}$. It contains $1$, so by the proposition in Integral Domains and Fields it is an integral domain. For example $(2 + 3\omega)(1 - \omega) = 5 + 4\omega$, which the script confirms in complex arithmetic. The script also searches for units and finds six, $\pm 1$, $\pm \omega$ and $\pm(1 + \omega)$, where $1 + \omega = -\omega^2$. These are the sixth roots of unity, against four units in the Gaussian integers.
The six are all the units, by the norm argument used for the Gaussian integers in Basic Properties of Rings. The complex conjugate of $\omega$ is $\bar\omega = \frac{-1 - \sqrt{-3}}{2} = \omega^2$, so $\omega + \bar\omega = -1$ and $\omega\bar\omega = \omega^3 = 1$. For $z = a + b\omega$ let $N(z) = z\bar z = \lvert z \rvert^2$. Then
$$N(z) = (a + b\omega)(a + b\bar\omega) = a^2 + ab(\omega + \bar\omega) + b^2\omega\bar\omega = a^2 - ab + b^2,$$
a nonnegative integer, and $N(zw) = zw\,\bar z\,\bar w = N(z)N(w)$. If $zw = 1$ in $\mathbb{Z}[\omega]$, then $N(z)N(w) = 1$, so $N(z) = 1$. Multiplying $a^2 - ab + b^2 = 1$ by 4 gives
$$(2a - b)^2 + 3b^2 = 4,$$
which forces $b$ to be $-1$, 0 or 1. For $b = 0$, $a = \pm 1$. For $b = 1$, $(2a - 1)^2 = 1$, so $a = 1$ or $a = 0$. For $b = -1$, $(2a + 1)^2 = 1$, so $a = 0$ or $a = -1$. The six solutions are $\pm 1$, $1 + \omega$, $\omega$, $-\omega$ and $-1 - \omega$. Each is a unit: $1 \cdot 1 = (-1)(-1) = 1$, and $\omega \cdot \omega^2 = 1 = (-\omega)(-\omega^2)$, where $\omega^2 = -1 - \omega$ and $-\omega^2 = 1 + \omega$ lie in $\mathbb{Z}[\omega]$. Each has sixth power 1, since $\omega^6 = (\omega^3)^2 = 1$ and $(\omega^2)^6 = (\omega^3)^4 = 1$, and a sign disappears in an even power.
A commutative ring of matrices. In the noncommutative ring $M_2(\mathbb{R})$, let
$$T = \left\{ \begin{pmatrix} a & b \\ 0 & a \end{pmatrix} : a, b \in \mathbb{R} \right\},$$
the upper triangular matrices with equal diagonal entries, and write $M(a, b)$ for the matrix with entries $a$ and $b$ shown. The zero matrix is $M(0, 0)$, and $M(a, b) - M(c, d) = M(a - c, b - d)$. For products,
$$\begin{pmatrix} a & b \\ 0 & a \end{pmatrix}\begin{pmatrix} c & d \\ 0 & c \end{pmatrix} = \begin{pmatrix} ac & ad + bc \\ 0 & ac \end{pmatrix} = M(ac, ad + bc).$$
So $T$ is a subring by the test. The product formula is symmetric in $(a, b)$ and $(c, d)$, so $T$ is a commutative ring sitting inside a noncommutative one, and it contains the identity $I = M(1, 0)$. It is not an integral domain: $\varepsilon = M(0, 1)$ is nonzero, but $\varepsilon^2 = M(0, 0)$. An element $M(a, b)$ is a unit of $T$ exactly when $a \neq 0$, with inverse $M(1/a, -b/a^2)$. If $a \neq 0$, the product formula gives $M(a, b)M(1/a, -b/a^2) = M(1, -b/a + b/a) = M(1, 0)$. If $a = 0$, then $M(0, b)M(c, d) = M(0, bc)$ is never $M(1, 0)$. For example $M(2, 3)^{-1} = M(1/2, -3/4)$. Computing in $T$ amounts to computing with expressions $a + b\varepsilon$ subject to the rule $\varepsilon^2 = 0$.
A subset that fails. The singular matrices in $M_2(\mathbb{R})$, those with determinant 0, contain the zero matrix. They are closed under multiplication, since $\det(XY) = \det X \det Y$. They are not closed under subtraction: $E_{11} = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$ and $-E_{22} = \begin{pmatrix} 0 & 0 \\ 0 & -1 \end{pmatrix}$ are singular, but $E_{11} - (-E_{22}) = I$ is not. So they do not form a subring.
The identity of a subring
A subring shares the zero of the larger ring. Does it share the identity? Not necessarily. It may contain the identity of $R$, as $\mathbb{Z}$ does in $\mathbb{Q}$ and $T$ in $M_2(\mathbb{R})$. It may have no identity at all, as the even integers in $\mathbb{Z}$. It may even have an identity of its own that differs from $1_R$. In $\mathbb{Z}_6$, the subset $\{0, 2, 4\}$ of classes of even integers passes the subring test, because the difference and the product of two even integers are even. Its identity is 4, not 1: $4 \cdot 2 = 8 = 2$ and $4 \cdot 4 = 16 = 4$ in $\mathbb{Z}_6$. So when a theorem needs a subring to share the identity of $R$, as the proposition on subrings of fields in Integral Domains and Fields does, the hypothesis has to say so.
Subfields
A subring of a field that is itself a field is a subfield, and the larger field is an extension field of the smaller. The chain $\mathbb{Q} \subseteq \mathbb{R} \subseteq \mathbb{C}$ consists of subfields. Constructing extension fields in which a given equation has a solution, as $\mathbb{C}$ extends $\mathbb{R}$ with a solution of $x^2 = -1$, is the purpose of the unit on Building Fields from Irreducible Polynomials.
Direct products
Subrings look inside a ring. The second construction goes the other way, from two rings to a larger one: back to the pair of clocks.
Definition. Let $R$ and $S$ be rings. The direct product $R \times S$ is the set of ordered pairs $(r, s)$ with $r \in R$ and $s \in S$, with the coordinatewise operations
$$(r, s) + (r', s') = (r + r', \, s + s'), \qquad (r, s)(r', s') = (rr', \, ss').$$
In each coordinate the operation is that of the ring the coordinate comes from. In $\mathbb{Z}_3 \times \mathbb{Z}_7$, for example,
$$(2, 5) + (2, 4) = (4, 9) = (1, 2), \qquad (2, 5)(2, 4) = (4, 20) = (1, 6),$$
with the first coordinates reduced modulo 3 and the second modulo 7.
Theorem. Let $R$ and $S$ be rings.
- $R \times S$ is a ring, with zero $(0_R, 0_S)$ and $-(r, s) = (-r, -s)$.
- $R \times S$ is commutative if and only if $R$ and $S$ are both commutative.
- $R \times S$ has an identity if and only if $R$ and $S$ both have identities, and then $1_{R \times S} = (1_R, 1_S)$.
The idea: the coordinates never interact, so each law for pairs splits into the same law in $R$ and in $S$. For the converses, pairs with a zero coordinate isolate one ring.
Proof. (1) Each axiom is an equation, or an existence claim, about pairs, and the operations act on each coordinate separately. So each axiom for $R \times S$ reduces to the same axiom in $R$ for the first coordinates and in $S$ for the second. For example, the left distributive law reads
$$\begin{aligned} (r, s)\big((r', s') + (r'', s'')\big) &= \big(r(r' + r''), \, s(s' + s'')\big) = (rr' + rr'', \, ss' + ss'') \\ &= (r, s)(r', s') + (r, s)(r'', s''), \end{aligned}$$
where the middle step is the distributive law in $R$ and in $S$. The other axioms, written out:
- Closure. The coordinates of a sum or product of pairs lie in $R$ and in $S$.
- Associativity of addition. $\big((r, s) + (r', s')\big) + (r'', s'') = \big((r + r') + r'', \, (s + s') + s''\big) = \big(r + (r' + r''), \, s + (s' + s'')\big) = (r, s) + \big((r', s') + (r'', s'')\big)$.
- Commutativity of addition. $(r, s) + (r', s') = (r + r', \, s + s') = (r' + r, \, s' + s) = (r', s') + (r, s)$.
- Zero and negatives. $(r, s) + (0_R, 0_S) = (r + 0_R, \, s + 0_S) = (r, s)$, and $(r, s) + (-r, -s) = (0_R, 0_S)$.
- Associativity of multiplication. $\big((r, s)(r', s')\big)(r'', s'') = \big((rr')r'', \, (ss')s''\big) = \big(r(r'r''), \, s(s's'')\big) = (r, s)\big((r', s')(r'', s'')\big)$.
- Right distributive law. $\big((r, s) + (r', s')\big)(r'', s'') = \big((r + r')r'', \, (s + s')s''\big) = (rr'' + r'r'', \, ss'' + s's'') = (r, s)(r'', s'') + (r', s')(r'', s'')$.
(2) If $R$ and $S$ are commutative, then $(r, s)(r', s') = (rr', ss') = (r'r, s's) = (r', s')(r, s)$. Conversely, suppose $R \times S$ is commutative and $r, r' \in R$. Then $(rr', 0_S) = (r, 0_S)(r', 0_S) = (r', 0_S)(r, 0_S) = (r'r, 0_S)$, so $rr' = r'r$. For $s, s' \in S$, $(0_R, ss') = (0_R, s)(0_R, s') = (0_R, s')(0_R, s) = (0_R, s's)$, so $ss' = s's$.
(3) If $R$ and $S$ have identities, then $(1_R, 1_S)(r, s) = (r, s) = (r, s)(1_R, 1_S)$ for every pair. Conversely, suppose $(e, f)$ is an identity of $R \times S$. For any $r$ in $R$, $(e, f)(r, 0_S) = (er, 0_S)$ must equal $(r, 0_S)$, so $er = r$. Also $(r, 0_S)(e, f) = (re, 0_S)$ must equal $(r, 0_S)$, so $re = r$. So $e$ is an identity of $R$. For any $s$ in $S$, the products $(e, f)(0_R, s) = (0_R, fs)$ and $(0_R, s)(e, f) = (0_R, sf)$ must both equal $(0_R, s)$. So $fs = s = sf$, and $f$ is an identity of $S$. $\blacksquare$
This is the course text's Theorem 3.1, with the converses added. The construction extends to any number of factors. The $k$-tuples $(r_1, \ldots, r_k)$ with $r_j$ in $R_j$, under coordinatewise operations, form a ring $R_1 \times R_2 \times \cdots \times R_k$. Each line of the proof of (1) verifies an axiom one coordinate at a time, and it reads as written with $k$ coordinates in place of two.
A familiar case: a function from the set $\{1, 2, \ldots, k\}$ to $\mathbb{R}$ is the same thing as the list of its $k$ values. The pointwise operations of rings of functions are then the coordinatewise operations on lists. So the ring of functions from a $k$-element set to $\mathbb{R}$ is $\mathbb{R}^k = \mathbb{R} \times \cdots \times \mathbb{R}$. The ring $F(\mathbb{R})$ of all real functions is a product of copies of $\mathbb{R}$, one for each real number.
Zero divisors and units
The units and the zero divisors of a product are found from its coordinates.
Proposition. If $R$ and $S$ each have a nonzero element, then $R \times S$ has zero divisors. In particular, a direct product of two integral domains, even of two fields, is never an integral domain.
The idea: a pair that is nonzero only in the first coordinate times a pair that is nonzero only in the second has nothing nonzero left.
Proof. Let $r \neq 0_R$ and $s \neq 0_S$. Then $(r, 0_S)$ and $(0_R, s)$ are nonzero, and
$$(r, 0_S)(0_R, s) = (r0_R, \, 0_S s) = (0_R, 0_S). \qquad \blacksquare$$
An integral domain has $1 \neq 0$, so it has a nonzero element, and the proposition applies to any two integral domains. In $\mathbb{R} \times \mathbb{R}$, $(1, 0)(0, 1) = (0, 0)$. This is the same phenomenon as the zero divisors among functions in Basic Properties of Rings. Two functions that are nonzero at different points multiply to zero, just as two pairs that are nonzero in different coordinates do.
Proposition. Let $R$ and $S$ be rings with identity. An element $(r, s)$ of $R \times S$ is a unit if and only if $r$ is a unit of $R$ and $s$ is a unit of $S$. So $(R \times S)^\times = R^\times \times S^\times$.
The idea: an inverse pair must invert each coordinate, and inverting each coordinate is enough.
Proof. If $r$ and $s$ are units, then $(r, s)(r^{-1}, s^{-1}) = (1_R, 1_S) = (r^{-1}, s^{-1})(r, s)$. Conversely, if $(r, s)(r', s') = (1_R, 1_S) = (r', s')(r, s)$, then comparing coordinates gives $rr' = 1_R = r'r$ and $ss' = 1_S = s's$. $\blacksquare$
For example, the units of $\mathbb{Z} \times \mathbb{Z}$ are the four pairs $(\pm 1, \pm 1)$, and the number of units of a finite product is the product of the numbers of units of the factors.
$\mathbb{Z}_3 \times \mathbb{Z}_7$ and $\mathbb{Z}_{21}$
Back to the pair of clocks. The ring $\mathbb{Z}_3 \times \mathbb{Z}_7$ has $3 \cdot 7 = 21$ elements, as many as $\mathbb{Z}_{21}$. Its units are the pairs with both coordinates nonzero, since every nonzero element of the fields $\mathbb{Z}_3$ and $\mathbb{Z}_7$ is a unit: there are $2 \cdot 6 = 12$ of them. The other 8 nonzero pairs have exactly one coordinate equal to 0, and each is a zero divisor by the proof above. The integers modulo 21 have the same counts, 12 units and 8 zero divisors.
The agreement is not an accident. Send each $a$ in $\mathbb{Z}_{21}$ to the pair of its remainders,
$$a \longmapsto (a \bmod 3, \; a \bmod 7).$$
This is well defined, because changing $a$ by a multiple of 21 changes it by a multiple of 3 and of 7. It respects both operations. By the definition of the sum and product of classes in The Integers Modulo n, the class of $a + b$ modulo 3 is the sum of the classes of $a$ and $b$ modulo 3, and the class of $ab$ is their product; the same holds modulo 7.
It is also a one-to-one correspondence between the 21 elements of each ring. Suppose $a$ and $b$ have the same pair of remainders. Then $3 \mid a - b$ and $7 \mid a - b$. Write $a - b = 3k$. Since $7 \mid 3k$ and $\gcd(7, 3) = 1$, it follows that $7 \mid k$, by the theorem in Divisibility and the Euclidean Algorithm on a divisor relatively prime to one factor of a product. So $21 \mid a - b$, and $a = b$ in $\mathbb{Z}_{21}$. The 21 elements of $\mathbb{Z}_{21}$ therefore go to 21 different pairs, and there are only 21 pairs, so every pair is reached exactly once. The script checks that it is a one-to-one correspondence between the 21 elements of each ring and that it respects both operations. The computation above is an instance: $5 \mapsto (2, 5)$ and $11 \mapsto (2, 4)$, while $5 + 11 = 16 \mapsto (1, 2)$ and $5 \cdot 11 = 55 = 13 \mapsto (1, 6)$, the sum and product found coordinatewise. Arithmetic modulo 21 is arithmetic modulo 3 and modulo 7 carried out side by side.
Example (inverting through the coordinates). The inverse of $(2, 5)$ in $\mathbb{Z}_3 \times \mathbb{Z}_7$ is $(2, 3)$, and it corresponds to 17, the inverse of 5 in $\mathbb{Z}_{21}$. Invert each coordinate: $2 \cdot 2 = 4 = 1$ in $\mathbb{Z}_3$ and $5 \cdot 3 = 15 = 1$ in $\mathbb{Z}_7$, so $(2, 5)^{-1} = (2, 3)$. The element of $\mathbb{Z}_{21}$ with remainders $(2, 3)$ is 17, the inverse of 5 found in Units and Zero Divisors in the Integers Modulo n. Indeed $5 \cdot 17 = 85 = 4 \cdot 21 + 1$. The correspondence turns inverting modulo 21 into inverting modulo 3 and modulo 7 separately.
The same comparison fails for $\mathbb{Z}_4 \times \mathbb{Z}_6$ and $\mathbb{Z}_{24}$, which also have equal sizes. The product has $2 \cdot 2 = 4$ units, $(1, 1)$, $(1, 5)$, $(3, 1)$ and $(3, 5)$, while $\mathbb{Z}_{24}$ has 8, the classes $1, 5, 7, 11, 13, 17, 19, 23$. The remainder reading also misses pairs. No integer leaves remainder 1 on division by 4 and remainder 0 on division by 6, because the first condition makes it odd and the second makes it even, so the pair $(1, 0)$ is never read. The map $a \mapsto (a \bmod 4, a \bmod 6)$ sends both 0 and 12 to $(0, 0)$, and its image has only 12 elements. Indeed $a$ and $a + 12$ always have the same remainders modulo 4 and modulo 6, so the 24 elements reach at most 12 pairs. They reach exactly 12. If $a$ and $b$ have the same pair of remainders, then $4 \mid a - b$ and $3 \mid a - b$, the second because $6 \mid a - b$. Write $a - b = 4k$. Since $3 \mid 4k$ and $\gcd(3, 4) = 1$, $3 \mid k$, so $12 \mid a - b$. So the classes of $0, 1, \ldots, 11$ go to 12 different pairs.
The difference between the two cases is that 3 and 7 are relatively prime while 4 and 6 are not. Making that precise needs the language of ring homomorphisms and isomorphisms, and the general statement is the Chinese remainder theorem. Judson (2026, Theorem 9.2.9) proves the corresponding fact for addition alone: $\mathbb{Z}_m \times \mathbb{Z}_n$ and $\mathbb{Z}_{mn}$ are isomorphic groups exactly when $\gcd(m, n) = 1$.
Worked problems
Problems 1 to 6 are from the course's assignment on subrings, and Problems 7 to 9 are from its assignment on §4.1, §5.1 and §5.2. Each is solved in full from the results of this unit. The problems on quotient rings in the assignment on subrings belong to a later unit.
Problem 1. Decide whether the set $\{1, -1, i, -i\}$ is a subring of $\mathbb{C}$.
It is not a subring. It fails condition (1) of the subring test, because it does not contain 0. It also fails condition (2): $1$ and $-1$ belong to the set, and $1 - (-1) = 2$ does not. Condition (3) does hold. The four elements are the units of the Gaussian integers, found in Basic Properties of Rings, and a product of units is a unit. So a set can be closed under multiplication and still fail to be a subring.
Problem 2. Let $T$ be a ring and let $R$ and $S$ be subrings of $T$. Then the intersection $R \cap S$ is a subring of $T$.
The idea: each condition of the subring test holds in $R$ and in $S$ separately, so it holds for the elements they share.
Proof. By the subring test, $R$ and $S$ each satisfy conditions (1) to (3), and it is enough to show that $R \cap S$ does.
- $0_T \in R$ and $0_T \in S$, so $0_T \in R \cap S$.
- Let $a, b \in R \cap S$. Then $a, b \in R$, so $a - b \in R$. Also $a, b \in S$, so $a - b \in S$. Hence $a - b \in R \cap S$.
- Let $a, b \in R \cap S$. Then $ab \in R$ because $a, b \in R$, and $ab \in S$ because $a, b \in S$. Hence $ab \in R \cap S$.
By the subring test, $R \cap S$ is a subring of $T$. $\blacksquare$
The proof did not use that there are only two subrings. If $a$ and $b$ lie in every member of a nonempty family of subrings of $T$, then so do $0_T$, $a - b$ and $ab$. So the intersection of any nonempty family of subrings is a subring. An example in $\mathbb{Z}$: $2\mathbb{Z} \cap 3\mathbb{Z} = 6\mathbb{Z}$. A multiple of 6 is a multiple of 2 and of 3. Conversely, if $2 \mid c$ and $3 \mid c$, write $c = 2k$; since $3 \mid 2k$ and $\gcd(3, 2) = 1$, $3 \mid k$ by the theorem of Divisibility and the Euclidean Algorithm used above for 3 and 7, so $6 \mid c$.
Problem 3. Give two subrings $R$ and $S$ of $\mathbb{Z}$ whose union $R \cup S$ is not a subring of $\mathbb{Z}$.
Take $R = 2\mathbb{Z}$ and $S = 3\mathbb{Z}$. For every integer $n$, the set $n\mathbb{Z}$ of multiples of $n$ is a subring of $\mathbb{Z}$ by the subring test: $0 = n \cdot 0$, $na - nb = n(a - b)$ and $(na)(nb) = n(nab)$. So $R$ and $S$ are subrings. The union $R \cup S$ consists of the integers that are multiples of 2 or of 3. It contains 3 and 2, but not $3 - 2 = 1$, which is a multiple of neither. So $R \cup S$ fails condition (2) of the test and is not a subring. It does contain 0 and it is closed under multiplication, since a multiple of 2 or of 3 times any integer is again one.
Problem 4. Give two different subrings $R$ and $S$ of $\mathbb{Z}$ whose union is a subring of $\mathbb{Z}$. Determine in general when the union of two subrings is a subring.
Take $R = 2\mathbb{Z}$ and $S = 4\mathbb{Z}$. Both are subrings by Problem 3. They are different, because 2 lies in $R$ and not in $S$. Every multiple of 4 is a multiple of 2, since $4k = 2(2k)$, so $S \subseteq R$ and $R \cup S = R = 2\mathbb{Z}$, a subring.
That is the only way it can happen.
Claim. Let $R$ and $S$ be subrings of a ring $T$. Then $R \cup S$ is a subring of $T$ if and only if $R \subseteq S$ or $S \subseteq R$.
Proof. If $R \subseteq S$, then $R \cup S = S$, a subring. If $S \subseteq R$, then $R \cup S = R$, a subring.
Conversely, suppose that neither subring contains the other. Then there are an element $r$ of $R$ that is not in $S$ and an element $s$ of $S$ that is not in $R$. Both lie in $R \cup S$. Suppose $R \cup S$ were a subring. Then $r - s \in R \cup S$ by the subring test. If $r - s \in R$, then $s = r - (r - s) \in R$, because $R$ is closed under subtraction. That contradicts the choice of $s$. If $r - s \in S$, then $r = (r - s) + s \in S$, because $S$ is closed under addition. That contradicts the choice of $r$. So $R \cup S$ is not a subring. $\blacksquare$
For subrings of the form $m\mathbb{Z}$ and $n\mathbb{Z}$ with $m$ and $n$ positive, $m\mathbb{Z} \subseteq n\mathbb{Z}$ exactly when $n \mid m$. If $m\mathbb{Z} \subseteq n\mathbb{Z}$, then $m$ is a multiple of $n$. If $m = nq$, then $mk = n(qk)$ for every $k$. So $m\mathbb{Z} \cup n\mathbb{Z}$ is a subring exactly when one of $m$ and $n$ divides the other. That happens for 2 and 4, and not for 2 and 3.
Problem 5. Let $R$ be a commutative ring with identity and let $t \in R$. Prove that the set of multiples of $t$,
$$tR = \{\, tr : r \in R \,\},$$
is a subring of $R$.
The assignment calls this set the cyclic subring $(t)$, and the course defines that as the multiples $tr$ by elements of $R$. It has to mean that: the other possible reading, the integer multiples $nt$, is not always a subring, as shown after the proof. In $\mathbb{Z}$, and in every $\mathbb{Z}_n$, the two readings give the same set; in $\mathbb{Z}$ it is the subring $t\mathbb{Z}$ of Problem 3.
Proof. Apply the subring test.
- $0 = t \cdot 0$ by the proposition on multiplying by zero, so $0 \in tR$.
- For $tr$ and $ts$ in $tR$, the rules of signs give $tr - ts = t(r - s)$, which is in $tR$.
- For $tr$ and $ts$ in $tR$, associativity gives $(tr)(ts) = t\big(r(ts)\big)$, which is in $tR$ because $r(ts) \in R$.
So $tR$ is a subring of $R$. $\blacksquare$
The proof used neither hypothesis on $R$, so $tR$ is a subring of any ring $R$. The hypotheses give two more facts. Because $R$ has an identity, $t = t \cdot 1$ belongs to $tR$. Because $R$ is commutative, a multiple of $t$ times any element $x$ of $R$, on either side, is a multiple of $t$: $(tr)x = t(rx)$ and $x(tr) = (xt)r = (tx)r = t(xr)$. Subrings with that property are the ideals of Ideals and Principal Ideal Domains.
The multiples in $tR$ are products with elements of $R$, not the integer multiples $nt$ of Basic Properties of Rings. The integer multiples of $t$ need not form a subring. In the Gaussian integers, the integer multiples of $i$ are the numbers $ni$. They include $i$ but not $i \cdot i = -1$. By contrast $i\mathbb{Z}[i]$ is all of $\mathbb{Z}[i]$, because every Gaussian integer $z$ is $i \cdot (-iz)$.
Problem 6. Find every cyclic subring of $\mathbb{Z}_{12}$ with exactly 3 elements.
There is exactly one, $\{0, 4, 8\}$. It is generated by 4 and by 8, and it is the only subring of $\mathbb{Z}_{12}$ of any kind with 3 elements.
The multiples of 4 are $4 \cdot 0 = 0$, $4 \cdot 1 = 4$, $4 \cdot 2 = 8$ and $4 \cdot 3 = 12 = 0$. After that they repeat, because $4(r + 3) = 4r + 12 = 4r$. So $4\mathbb{Z}_{12} = \{0, 4, 8\}$. Listing the multiples $t \cdot 0, t \cdot 1, \ldots, t \cdot 11$ for each $t$ gives every cyclic subring of $\mathbb{Z}_{12}$:
| Generator $t$ | $t\mathbb{Z}_{12}$ | Elements |
|---|---|---|
| 0 | $\{0\}$ | 1 |
| 1, 5, 7, 11 | $\mathbb{Z}_{12}$ | 12 |
| 2, 10 | $\{0, 2, 4, 6, 8, 10\}$ | 6 |
| 3, 9 | $\{0, 3, 6, 9\}$ | 4 |
| 4, 8 | $\{0, 4, 8\}$ | 3 |
| 6 | $\{0, 6\}$ | 2 |
For example the multiples of 8 are $0, 8, 16 = 4, 24 = 0$, and the multiples of 10 are $0, 10, 20 = 8, 30 = 6, 40 = 4, 50 = 2, 60 = 0$. The generators 1, 5, 7 and 11 are the units of $\mathbb{Z}_{12}$, and a unit $t$ generates the whole ring, since every $r$ is $t(t^{-1}r)$. So the cyclic subrings with 3 elements are $4\mathbb{Z}_{12} = 8\mathbb{Z}_{12} = \{0, 4, 8\}$.
No other subring has 3 elements, cyclic or not.
Proof. Let $S = \{0, a, b\}$ be a subring of $\mathbb{Z}_{12}$ with three different elements; it contains 0 by the subring test. The negative $-a = 0 - a$ lies in $S$ and is not 0, so $-a = a$ or $-a = b$. Likewise $-b = 0 - b$ lies in $S$ and is not 0, so $-b = b$ or $-b = a$.
Suppose $-a = a$. Then $-b \neq a$, since $-b = a$ would give $b = -a = a$. So $-b = b$. Then $2a = 0$ and $2b = 0$ in $\mathbb{Z}_{12}$. The only nonzero class $x$ with $2x = 0$ is 6, so $a = b = 6$, which is impossible. Hence $-a = b$.
The element $a + a = a - (-a) = a - b$ lies in $S$. It is not $a$, since $a \neq 0$. It is not 0, since $a + a = 0$ would give $a = -a = b$. So $a + a = b = -a$, and therefore $3a = 0$ in $\mathbb{Z}_{12}$. Then 12 divides $3a$, so 4 divides $a$, and $a$ is 4 or 8. In both cases $S = \{0, a, -a\} = \{0, 4, 8\}$. $\blacksquare$
This subring has an identity of its own, the class 4: $4 \cdot 4 = 16 = 4$ and $4 \cdot 8 = 32 = 8$. With that identity it is a field with three elements, since $8 \cdot 8 = 64 = 4$ makes 8 its own inverse. Its identity differs from the identity 1 of $\mathbb{Z}_{12}$.
Problem 7. Write the addition and multiplication tables of $\mathbb{Z}_2 \times \mathbb{Z}_3$.
The ring has $2 \cdot 3 = 6$ elements, the pairs $(a, b)$ with $a$ in $\mathbb{Z}_2$ and $b$ in $\mathbb{Z}_3$. In the tables the pair $(a, b)$ is written $ab$, so that 12 stands for $(1, 2)$. First coordinates are added and multiplied modulo 2, second coordinates modulo 3. For example $(1, 2) + (1, 2) = (2, 4) = (0, 1)$ and $(1, 2)(1, 2) = (1, 4) = (1, 1)$. The entry in the row of $u$ and the column of $v$ is $u + v$ in the first table and $uv$ in the second.
| $+$ | 00 | 01 | 02 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|
| 00 | 00 | 01 | 02 | 10 | 11 | 12 |
| 01 | 01 | 02 | 00 | 11 | 12 | 10 |
| 02 | 02 | 00 | 01 | 12 | 10 | 11 |
| 10 | 10 | 11 | 12 | 00 | 01 | 02 |
| 11 | 11 | 12 | 10 | 01 | 02 | 00 |
| 12 | 12 | 10 | 11 | 02 | 00 | 01 |
| $\cdot$ | 00 | 01 | 02 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|
| 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 01 | 00 | 01 | 02 | 00 | 01 | 02 |
| 02 | 00 | 02 | 01 | 00 | 02 | 01 |
| 10 | 00 | 00 | 00 | 10 | 10 | 10 |
| 11 | 00 | 01 | 02 | 10 | 11 | 12 |
| 12 | 00 | 02 | 01 | 10 | 12 | 11 |
Both tables are symmetric about the diagonal, since the ring is commutative. The row of 00 in the first table and the row of 11 in the second repeat the column headings: the zero is $(0, 0)$ and the identity is $(1, 1)$, as the theorem on direct products says.
Problem 8. Find all the units and all the zero divisors of $\mathbb{Z}_2 \times \mathbb{Z}_3$.
The assignment asks for two units and three zero divisors. Those are all there are: the units are $(1, 1)$ and $(1, 2)$, and the zero divisors are $(0, 1)$, $(0, 2)$ and $(1, 0)$.
Units. By the proposition on units of a product, $(r, s)$ is a unit exactly when $r$ is a unit of $\mathbb{Z}_2$ and $s$ is a unit of $\mathbb{Z}_3$. The only unit of $\mathbb{Z}_2$ is 1, and the units of $\mathbb{Z}_3$ are 1 and 2, since $2 \cdot 2 = 4 = 1$. So the units are $(1, 1)$ and $(1, 2)$. Each is its own inverse: $(1, 2)(1, 2) = (1, 4) = (1, 1)$. In the multiplication table, these are the only two rows that contain the identity 11.
Zero divisors. The other three nonzero elements each have a zero coordinate, and
$$(0, 1)(1, 0) = (0, 0), \qquad (0, 2)(1, 0) = (0, 0).$$
So $(0, 1)$, $(0, 2)$ and $(1, 0)$ are zero divisors. The list is complete, because the two remaining nonzero elements are units, and a unit is not a zero divisor. In the table, the rows of 01, 02 and 10 are the nonzero rows with a 00 outside the first column.
Every nonzero element is a unit or a zero divisor, as in $\mathbb{Z}_n$. The correspondence $a \mapsto (a \bmod 2, a \bmod 3)$ matches the two rings: the units 1 and 5 of $\mathbb{Z}_6$ go to $(1, 1)$ and $(1, 2)$, and the zero divisors 2, 3 and 4 go to $(0, 2)$, $(1, 0)$ and $(0, 1)$.
Problem 9. Decide whether $\mathbb{Z}_2 \times \mathbb{Z}_3$ is a field, an integral domain, neither or both.
It is neither. It is a commutative ring with identity $(1, 1) \neq (0, 0)$, but it has zero divisors by Problem 8, for instance $(0, 1)(1, 0) = (0, 0)$. So it is not an integral domain. Every field is an integral domain, so it is not a field either; directly, the nonzero element $(1, 0)$ has no inverse. This is an instance of the proposition above: a direct product of two rings that each have a nonzero element always has zero divisors.
The choice "both" describes every field, since a field is also an integral domain. "Integral domain only" describes rings such as $\mathbb{Z}$. No ring is a field without being an integral domain.
Where it leads
- Maps between rings that respect both operations, such as $a \mapsto (a \bmod 3, a \bmod 7)$ and the projections $(r, s) \mapsto r$ of a product onto its factors, are the ring homomorphisms. The Chinese remainder theorem identifies $\mathbb{Z}_{mn}$ with $\mathbb{Z}_m \times \mathbb{Z}_n$ when $\gcd(m, n) = 1$.
- Subrings that absorb multiplication by every element of the ring, such as the even integers in $\mathbb{Z}$, are the ideals of Ideals and Principal Ideal Domains, and they are the subsets one can work modulo.
- A ring contains its constant polynomials as a subring of the polynomial ring, and fields are enlarged to extension fields in Building Fields from Irreducible Polynomials.
- The subring test has a counterpart for groups, the subgroup test of Subgroups and Cyclic Groups, with the same shape: contain the identity and be closed under the operation and inverses.
What we have learned
A subset of a ring is a subring when it contains 0 and is closed under subtraction and multiplication; the other axioms are inherited. A subring shares the zero of the larger ring, but not necessarily its identity. The direct product $R \times S$ computes in both rings at once; its units are the pairs of units, and it has zero divisors whenever both factors have a nonzero element. Reading $\mathbb{Z}_{21}$ through remainders modulo 3 and 7 matched it with $\mathbb{Z}_3 \times \mathbb{Z}_7$, operations and all, while the same reading of $\mathbb{Z}_{24}$ modulo 4 and 6 failed.
That completes the rings unit. The next unit, Public-Key Cryptography, puts the field $\mathbb{Z}_p$ and the units of $\mathbb{Z}_n$ to work. In $\mathbb{Z}_{13}$, the twelfth power of every nonzero element is 1. Its first article, Fermat's Little Theorem, proves that the same happens modulo every prime, and the unit builds the RSA cryptosystem on that theorem.
References
- Hungerford, T. W. (2014). Abstract Algebra: An Introduction (3rd ed.), §3.1 and §3.2. Brooks/Cole, Cengage Learning. The course text: the direct product $R \times S$ is a ring, commutative if $R$ and $S$ are and with identity if both have one (Theorem 3.1); subrings and subfields, and the subring test with closure under addition and multiplication, the zero and negatives (Theorem 3.2); the subring test for a nonempty subset closed under subtraction and multiplication (Theorem 3.6). record · 44 pages
- Judson, T. W. (2026). Abstract Algebra: Theory and Applications (annual edition, August 2026). Free online at judsonbooks.org. §16.1 (subrings; Proposition 16.1.10, the subring criterion; the chain $\mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R} \subset \mathbb{C}$, Example 16.1.9); Theorem 9.2.9 ($\mathbb{Z}_m \times \mathbb{Z}_n \cong \mathbb{Z}_{mn}$ as groups if and only if $\gcd(m, n) = 1$). record · 44 pages
Reviewed: verified, 16 Nov 2026 · editorial review, 23 Nov 2026 · 6 revisions