Subrings and Direct Products of Rings

Two ways to get new rings from old. Subrings are subsets that are rings under the same operations, recognized by a three-condition subring test proved in full and applied to the Eisenstein integers, a commutative ring of upper triangular matrices, and rings of functions; subrings can have a different identity from the whole ring. Direct products combine two rings coordinatewise; their identity, units and zero divisors are found, and Z_3 x Z_7 is compared with Z_21 and Z_4 x Z_6 with Z_24.

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. When is a subset of a ring a ring in its own right, and how can two rings be combined into one?

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 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

  1. $0_R \in S$;
  2. $a - b \in S$ whenever $a, b \in S$ (closure under subtraction);
  3. $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.

Check your understanding. Consider the Gaussian integers $a + bi$ whose real part $a$ is even. Which conditions of the test hold?

Conditions (1) and (2) hold: $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. 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$, 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.$$

Now apply the test in $\mathbb{C}$.

  1. $0 = 0 + 0\omega \in \mathbb{Z}[\omega]$.
  2. $(a + b\omega) - (c + d\omega) = (a - c) + (b - d)\omega$, with integer coefficients.
  3. 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.

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)$; 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$. 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.

  1. $R \times S$ is a ring, with zero $(0_R, 0_S)$ and $-(r, s) = (-r, -s)$.
  2. $R \times S$ is commutative if and only if $R$ and $S$ are both commutative.
  3. $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$. In the same way $(r, s) + (0_R, 0_S) = (r, s)$, and $(r, s) + (-r, -s) = (0_R, 0_S)$. Closure holds because the coordinates of a sum or product lie in $R$ and $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$. The same argument with pairs $(0_R, s)$ applies to $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$, and similarly $re = r$. So $e$ is an identity of $R$, and in the same way $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, $R_1 \times R_2 \times \cdots \times R_k$, with the same proof.

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

Which elements of a product can be inverted, and which multiply to zero? Both questions reduce to the 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$$

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. 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.

The 21 elements of Z21 placed in a 3 x 7 grid by their remainders: a goes in row a mod 3 and column a mod 7. Notice that every cell receives exactly one element, so the remainder pair determines a. The 12 units of Z21 (blue, bold) fill exactly the cells with both coordinates nonzero, which are the units of Z3 x Z7; the 8 zero divisors (orange) fill row 0 and column 0.
The 21 elements of Z_21 placed in a 3 x 7 grid by their remainders: a goes in row a mod 3 and column a mod 7. Notice that every cell receives exactly one element, so the remainder pair determines a. The 12 units of Z_21 (blue, bold) fill exactly the cells with both coordinates nonzero, which are the units of Z_3 x Z_7; the 8 zero divisors (orange) fill row 0 and column 0.

Check your understanding. Find the inverse of $(2, 5)$ in $\mathbb{Z}_3 \times \mathbb{Z}_7$. Which element of $\mathbb{Z}_{21}$ should be the inverse of 5?

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.

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$.

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 always has zero divisors. 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 turns out to be 1. Why, and what does that make possible? Its first article, Fermat's Little Theorem, answers both questions.

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