Congruence-Class Arithmetic in Polynomial Rings

The congruence classes modulo a polynomial p(x) as a ring F[x]/(p(x)). The proof that adding and multiplying classes through representatives is well defined, rules that look reasonable and are not, the ring laws, the copy of F inside, and the class of x as a new element that satisfies p. The complex numbers as R[x]/(x^2 + 1) and Q(sqrt 2) as Q[x]/(x^2 - 2), units found by Bezout's identity, zero divisors from a reducible modulus, and two rings with sixteen elements side by side.

For a field $F$ and $p(x) \in F[x]$ of degree $d \ge 1$, the congruence classes modulo $p(x)$, added and multiplied through representatives, form a commutative ring with identity, $F[x]/(p(x))$: the operations are well defined, the ring contains a copy of $F$, and each element is $a_0 + a_1\alpha + \cdots + a_{d-1}\alpha^{d-1}$ for unique $a_i \in F$, where $\alpha = [x]$ satisfies $p(\alpha) = 0$. Over a field with $q$ elements the ring has $q^d$ elements. Evaluation at a root identifies $\mathbb{R}[x]/(x^2 + 1)$ with $\mathbb{C}$ and $\mathbb{Q}[x]/(x^2 - 2)$ with $\mathbb{Q}(\sqrt 2)$. A class $[h]$ is a unit exactly when $\gcd(h, p) = 1$, with the inverse given by Bezout's identity, and every other nonzero class is a zero divisor. For example, $\mathbb{Z}_3[x]/(x^4 + x^3 + 2x^2 + x + 1)$ has 48 units and 32 zero divisors.

Multiply $3 + 2i$ by $1 - 4i$ by the usual rules: expand, and replace $i^2$ by $-1$.

$$(3 + 2i)(1 - 4i) = 3 - 12i + 2i - 8i^2 = 11 - 10i.$$

Now multiply the polynomials $3 + 2x$ and $1 - 4x$ in $\mathbb{R}[x]$ and divide by $x^2 + 1$:

$$(3 + 2x)(1 - 4x) = -8x^2 - 10x + 3 = (x^2 + 1)(-8) + (11 - 10x).$$

The remainder is the complex product with $x$ in place of $i$. Why should a remainder on division by $x^2 + 1$ know how to multiply complex numbers?

The reason is that replacing $i^2$ by $-1$ is the same as discarding multiples of $x^2 + 1$, which is congruence modulo $x^2 + 1$. So the complex numbers can be described as the congruence classes modulo $x^2 + 1$, added and multiplied through representatives. In general, the classes modulo $p(x)$ form a ring, written $F[x]/(p(x))$. The same construction with $x^2 - 2$ over the rationals produces the numbers $a + b\sqrt{2}$. With other moduli it produces number systems that were not known in advance, including finite fields.

This article follows the integers modulo $n$ step by step. First we prove that the operations on classes are well defined and obey the ring laws. Then comes what is new: a copy of $F$ and the class of $x$, which satisfies the modulus as an equation and identifies two of these rings with $\mathbb{C}$ and $\mathbb{Q}(\sqrt 2)$. Finally, Bezout's identity decides which classes have inverses, as it did for units in $\mathbb{Z}_n$, and a reducible modulus produces zero divisors.

The article assumes the previous one, Congruence Modulo a Polynomial; the running quartic $f(x) = (x^2 - 2)(x^2 + x + 1)$ returns as a modulus. This is the second article of Congruence in Polynomial Rings and Field Extensions in the MTH 532 notes. It covers §5.2 of the course text (Hungerford, 2014). Throughout, $F$ is a field and $p(x) \in F[x]$ is a polynomial of degree $d \ge 1$.

The set $F[x]/(p(x))$

Definition. $F[x]/(p(x))$ is the set of congruence classes of $F[x]$ modulo $p(x)$.

The notation, read "$F[x]$ modulo $p(x)$", says how the set was made, as $\mathbb{Z}/n\mathbb{Z}$ does for the integers modulo $n$; the parentheses around $p(x)$ stand for the set of its multiples. By the theorem on classes, each class contains exactly one polynomial that is 0 or of degree less than $d$, so

$$F[x]/(p(x)) = \{\, [a_0 + a_1 x + \cdots + a_{d-1}x^{d-1}] : a_0, \ldots, a_{d-1} \in F \,\},$$

with different coefficient lists giving different classes. Over a field with $q$ elements the set has $q^d$ elements; over $\mathbb{Q}$, $\mathbb{R}$ or $\mathbb{C}$ it is infinite. As with $\mathbb{Z}_n$, the elements are sets of polynomials, and $[x^2] = [-1]$ in $\mathbb{R}[x]/(x^2 + 1)$ is a true equation between sets, though $x^2 \neq -1$ as polynomials.

Adding and multiplying classes

To compute with classes we need operations on them. The definitions are the ones used for integers:

$$[f(x)] + [g(x)] = [f(x) + g(x)], \qquad [f(x)] \cdot [g(x)] = [f(x)g(x)].$$

Each says: choose a representative of each class, combine the representatives in $F[x]$, and take the class of the result. The choice must not matter. In the opening example, $[3 + 2x]$ is also the class of $x^3 + 3x + 3$ (add $x(x^2 + 1)$), and $[1 - 4x]$ is also the class of $-5x^2 - 4x - 4$ (subtract $5(x^2 + 1)$). The product of these representatives is the degree 5 polynomial

$$-5x^5 - 4x^4 - 19x^3 - 27x^2 - 24x - 12,$$

and the script finds its remainder on division by $x^2 + 1$ to be $11 - 10x$ again.

The operations are well defined

The idea: two representatives of one class are congruent, and congruences survive sums and products.

Theorem. If $[f] = [f']$ and $[g] = [g']$ in $F[x]/(p(x))$, then $[f + g] = [f' + g']$ and $[fg] = [f'g']$. Consequently the rules above define an addition and a multiplication on $F[x]/(p(x))$.

Proof. Equal classes have congruent representatives, so $f \equiv f'$ and $g \equiv g' \pmod p$. By the theorem on sums and products of congruences in Congruence Modulo a Polynomial, $f + g \equiv f' + g'$ and $fg \equiv f'g'$, and congruent polynomials have equal classes. $\blacksquare$

This is Hungerford's Theorem 5.6, and it is the integer proof with the integer theorem on congruences replaced by its polynomial twin. It has the same practical meaning: arithmetic in $F[x]/(p(x))$ can be carried out on the remainders, reducing modulo $p(x)$ after each step.

Rules that are not well defined

Several natural operations on polynomials ignore this test and fail it. Modulo $x^2 + 1$ in $\mathbb{R}[x]$, the polynomials $x^2 + 1$ and $0$ lie in the same class, and so do $x^2$ and $-1$.

  • Evaluation at a number. The rule $[h] \mapsto h(0)$ assigns the value $1$ to the class of $x^2 + 1$ and the value $0$ to the class of $0$, which is the same class. Evaluation at $1$ fails the same way on $x^2$ and $-1$.
  • The derivative. The rule $[h] \mapsto [h']$ sends $[x^2 + 1]$ to $[2x]$ and $[0]$ to $[0]$, and $2x \not\equiv 0$.
  • The degree. The class of $x^2$ contains polynomials of every degree from 0 (namely $-1$) upward, so "the degree of a class" means nothing, although the degree of its standard representative does.

Each rule fails because it does not ignore multiples of $p(x)$.

Example (evaluation at a root). Evaluation at 0 and at 1 failed modulo $x^2 + 1$, and among all numbers $c$, real or complex, the rule $[h] \mapsto h(c)$ is well defined exactly for the roots $c = \pm i$ of the modulus $p(x) = x^2 + 1$. If $p(c) = 0$, every multiple $k(x)p(x)$ has the value $k(c) \cdot 0 = 0$ at $c$, so all representatives $h + kp$ of a class agree at $c$. If $p(c) \neq 0$, then $p$ and $0$ lie in one class but take different values at $c$. No real number qualifies. That observation is the source of the two isomorphisms later in this article.

The laws of arithmetic

Which laws do the operations obey? All the laws of a commutative ring with identity. The idea: sending a polynomial to its class turns sums into sums and products into products, so every law of $F[x]$ carries over.

Theorem. $F[x]/(p(x))$, with the operations above, is a commutative ring with identity $[1]$, and $[1] \neq [0]$.

Proof. Closure holds because each operation produces a class. For the other laws, let $\pi(h) = [h]$ be the map from $F[x]$ to $F[x]/(p(x))$ that sends each polynomial to its class. The definitions of the operations, now known to be well defined, say exactly that

$$\pi(f + g) = \pi(f) + \pi(g), \qquad \pi(fg) = \pi(f)\,\pi(g).$$

Every law of a commutative ring with identity is an equation between expressions built from elements with sums and products, such as $[f]([g] + [h]) = [f][g] + [f][h]$. Applying the two rules from the inside out turns each side into $\pi$ of the corresponding expression in $F[x]$, here $\pi(f(g + h))$ and $\pi(fg + fh)$. These are equal, because the law holds in $F[x]$, which is a commutative ring with identity. The zero, the identity and the negatives are $[0]$, $[1]$ and $[-f]$, because $f + 0 = f$, $f \cdot 1 = f$ and $f + (-f) = 0$ in $F[x]$. Law by law, for all $f, g, h \in F[x]$:

  • addition is associative: $([f] + [g]) + [h] = [(f + g) + h] = [f + (g + h)] = [f] + ([g] + [h])$;
  • addition is commutative: $[f] + [g] = [f + g] = [g + f] = [g] + [f]$;
  • $[0]$ is the zero: $[f] + [0] = [f + 0] = [f]$;
  • $[-f]$ is the negative of $[f]$: $[f] + [-f] = [f + (-f)] = [0]$;
  • multiplication is associative: $([f][g])[h] = [(fg)h] = [f(gh)] = [f]([g][h])$;
  • multiplication is commutative: $[f][g] = [fg] = [gf] = [g][f]$;
  • $[1]$ is the identity: $[f][1] = [f \cdot 1] = [f]$, and $[1][f] = [f]$ by commutativity;
  • multiplication distributes over addition: $[f]([g] + [h]) = [f(g + h)] = [fg + fh] = [f][g] + [f][h]$, and $([g] + [h])[f] = [g][f] + [h][f]$ follows by commutativity.

In each line the outer equalities are the definitions of the operations, and the middle equality is the law in $F[x]$. Finally, $1$ and $0$ are different polynomials of degree less than $d$ (here $d \ge 1$ is used), so their classes are different. $\blacksquare$

The argument is the one given for $\mathbb{Z}_n$ in The Integers Modulo n: any identity among sums and products that holds in $F[x]$ holds among the classes. The theorem is the first half of Hungerford's Theorem 5.7. For the two sixteen-element rings in the last section, the script also checks commutativity, associativity and distributivity on every pair and on all 4,096 triples of elements.

A copy of $F$, and the class of $x$

Does the new ring still contain $F$, and what does it add? It contains a copy of $F$, and it adds the class of $x$. The constants of $F$ sit inside $F[x]$, and their classes behave exactly like the constants. The idea: two different constants differ by a nonzero constant, too small to be a multiple of $p$.

Proposition. The map $\iota(c) = [c]$ from $F$ to $F[x]/(p(x))$ is one-to-one and satisfies $\iota(a + b) = \iota(a) + \iota(b)$ and $\iota(ab) = \iota(a)\,\iota(b)$. Its image $\{[c] : c \in F\}$ is a subring isomorphic to $F$.

Proof. The two equations are the definitions of the operations applied to constant polynomials. For one-to-one: if $[a] = [b]$, then $p \mid a - b$, and $a - b$ is a constant, so it is 0 or has degree 0; a nonzero polynomial divisible by $p$ has degree at least $d \ge 1$. So $a - b = 0$. The image passes the subring test. It contains $[0] = \iota(0)$. A difference of two of its elements is $[a] - [b] = [a] + [-b] = [a - b] = \iota(a - b)$, and a product is $[a][b] = \iota(ab)$; both lie in the image. So the image is a subring, and $\iota$ is a bijection from $F$ onto it that respects both operations. That is the meaning of isomorphic here: there is a bijection between the two rings that respects both operations (Ring Homomorphisms and Isomorphisms treats isomorphisms in general). $\blacksquare$

This is the second half of Hungerford's Theorem 5.7. It allows a convention like the one for $\mathbb{Z}_n$: write $c$ for the class $[c]$, and regard $F$ as a subset of $F[x]/(p(x))$. In $\mathbb{Z}_3[x]/(p(x))$, for instance, $[2] + [2] = [1]$ and $[2][2] = [1]$, just as $2 + 2 = 1$ and $2 \cdot 2 = 1$ in $\mathbb{Z}_3$, so nothing is lost by dropping the brackets. With this convention $F[x]/(p(x))$ is a ring containing $F$ (Hungerford's Theorem 5.8).

The class of $x$ is the one genuinely new element, and it pays to give it a name. Let

$$\alpha = [x].$$

By the definition of the operations, $[a_0 + a_1 x + \cdots + a_k x^k] = a_0 + a_1\alpha + \cdots + a_k\alpha^k$, so every element of $F[x]/(p(x))$ is a polynomial expression in $\alpha$ with coefficients in $F$, and the standard representatives give each element exactly one expression

$$a_0 + a_1\alpha + \cdots + a_{d-1}\alpha^{d-1}, \qquad a_i \in F.$$

The same calculation applied to the modulus itself gives

$$p(\alpha) = [p(x)] = [0] = 0,$$

since $p(x) \equiv 0 \pmod{p(x)}$. So $\alpha$ is a root of $p$ in the new ring, whether or not $p$ has a root in $F$. That one line is the heart of the third article, where it becomes Kronecker's theorem. For computing it gives the reduction rule: if $p(x) = x^d + c_{d-1}x^{d-1} + \cdots + c_0$ is monic, then $\alpha^d = -(c_{d-1}\alpha^{d-1} + \cdots + c_0)$, the rule "replace $x^2$ by 2" of the previous article now written as an equation.

Two familiar fields

$\mathbb{R}[x]/(x^2 + 1)$ and the complex numbers

Here $\alpha^2 = -1$, and the elements are $a + b\alpha$ with $a, b \in \mathbb{R}$. Multiplying and replacing $\alpha^2$,

$$(a + b\alpha)(c + d\alpha) = ac + (ad + bc)\alpha + bd\alpha^2 = (ac - bd) + (ad + bc)\alpha,$$

which is the rule for multiplying complex numbers, with $\alpha$ in the role of $i$. Sums agree as well: $(a + b\alpha) + (c + d\alpha) = (a + c) + (b + d)\alpha$, the rule for adding complex numbers. Each element of the ring has exactly one expression $a + b\alpha$, and each complex number has exactly one expression $a + bi$. So the map $a + b\alpha \mapsto a + bi$ is a bijection from $\mathbb{R}[x]/(x^2 + 1)$ onto $\mathbb{C}$ that respects both operations: the two rings are the same up to the names of their elements. Hungerford (2014, §5.3) and Judson (2026, Example 21.1.14) both make this identification, and the course text adds that one could take it as the definition of $\mathbb{C}$, which removes any doubt about whether a number whose square is $-1$ exists: the class of $x$ is one.

$\mathbb{Q}[x]/(x^2 - 2)$ and $\mathbb{Q}(\sqrt 2)$

Here $\alpha^2 = 2$, the elements are $a + b\alpha$ with $a, b \in \mathbb{Q}$, and

$$(a + b\alpha)(c + d\alpha) = (ac + 2bd) + (ad + bc)\alpha.$$

The opening computation of Congruence Modulo a Polynomial, $(1 + \alpha)^5 = 41 + 29\alpha$, took place in this ring. The comparison is now with the set of real numbers

$$\mathbb{Q}(\sqrt 2) = \{\, a + b\sqrt 2 : a, b \in \mathbb{Q} \,\}.$$

Both identifications are cases of one argument, based on the example above (evaluation at a root): evaluation at a root of the modulus is well defined, and it loses no information when no smaller polynomial vanishes at the root.

Proposition. Let $F$ be a subfield of a field $E$, and let $c \in E$ be a root of $p(x)$. Then

$$\varphi([h(x)]) = h(c)$$

is a well-defined map from $F[x]/(p(x))$ to $E$ that respects sums and products. If no nonzero polynomial over $F$ of degree less than $d$ has $c$ as a root, then $\varphi$ is one-to-one, and its image is $\{a_0 + a_1 c + \cdots + a_{d-1}c^{d-1} : a_i \in F\}$.

Proof. Well defined: if $[h] = [h']$, then $h' = h + kp$ for some $k$, and $h'(c) = h(c) + k(c)p(c) = h(c)$. Evaluation at $c$ respects sums and products of polynomials (evaluation needs only that $E$ is commutative), so $\varphi([f] + [g]) = \varphi([f + g]) = (f + g)(c) = f(c) + g(c) = \varphi([f]) + \varphi([g])$, and $\varphi([f][g]) = \varphi([fg]) = (fg)(c) = f(c)\,g(c) = \varphi([f])\,\varphi([g])$. For the second statement, write a class through its standard representative $r$, which is 0 or of degree less than $d$. If $\varphi([r]) = r(c) = 0$ with $r \neq 0$, then $r$ is a nonzero polynomial of degree less than $d$ with root $c$, which the hypothesis excludes. So $\varphi([r]) = 0$ only for $[r] = 0$. Now suppose $\varphi([r]) = \varphi([s])$ for standard representatives $r$ and $s$. Then $r - s$ is 0 or of degree less than $d$, and $(r - s)(c) = r(c) - s(c) = 0$, so $r - s = 0$ by the hypothesis, and $[r] = [s]$. The image consists of the values $r(c)$, which are the listed expressions. $\blacksquare$

For $\mathbb{R}[x]/(x^2 + 1)$, take $E = \mathbb{C}$ and $c = i$. A nonzero real polynomial of degree less than 2 is $a + bx$ with $a$ and $b$ not both 0, and $a + bi = 0$ forces $a = b = 0$; so $\varphi$ is one-to-one, and its image is all of $\mathbb{C}$.

For $\mathbb{Q}[x]/(x^2 - 2)$, take $E = \mathbb{R}$ and $c = \sqrt 2$. If $a + b\sqrt 2 = 0$ with $a, b$ rational and not both 0, then $b \neq 0$ (if $b = 0$, then $a = 0$ as well) and $\sqrt 2 = -a/b$ would be rational, which the rational root test rules out, since $x^2 - 2$ has no rational roots. So $\varphi$ is a bijection from $\mathbb{Q}[x]/(x^2 - 2)$ onto $\mathbb{Q}(\sqrt 2)$ that respects both operations. In the language of a later unit, $\varphi$ is a ring homomorphism, and both identifications are instances of the first isomorphism theorem (Judson, 2026, Proposition 21.1.12).

Under $\varphi$, the running example $f(x) = (x^2 - 2)(x^2 + x + 1)$ of the previous unit has the class $[f] = 0$ in $\mathbb{Q}[x]/(x^2 - 2)$, which says that $f(\sqrt 2) = 0$. In floating point the script gets about $1.3 \times 10^{-15}$, zero up to rounding.

Units

In $\mathbb{C}$ every nonzero element has an inverse. Is that so for every modulus? It is not: a class has an inverse exactly when its representatives are relatively prime to the modulus. In $\mathbb{Z}_n$ the class $[a]$ has an inverse exactly when $\gcd(a, n) = 1$, by Bezout's identity. The same holds here, with the same idea: $hu + pv = 1$ says exactly that $[h][u] = [1]$.

Theorem. Let $h(x) \in F[x]$. The class $[h(x)]$ is a unit of $F[x]/(p(x))$ if and only if $\gcd(h(x), p(x)) = 1$.

Proof. If $\gcd(h, p) = 1$, Bezout's identity gives $u$ and $v$ with $hu + pv = 1$. Then $hu \equiv 1 \pmod p$, so $[h][u] = [1]$.

Conversely, if $[h][u] = [1]$, then $hu - 1 = pv$ for some $v$, that is, $hu - pv = 1$. Every common divisor of $h$ and $p$ divides $1$, so it is a nonzero constant, and the monic gcd is 1. $\blacksquare$

The first half is Hungerford's Theorem 5.9; the converse is the integer argument again. The proof finds the inverse: run the extended Euclidean algorithm on $h$ and $p$ and read off $u$.

In $\mathbb{Q}[x]/(x^3 - 2)$, where $\alpha = [x]$ satisfies $\alpha^3 = 2$, take $h = x + 1$. One division, $x^3 - 2 = (x + 1)(x^2 - x + 1) - 3$, leaves the nonzero constant remainder $-3$, so $\gcd(x + 1, x^3 - 2) = 1$ and

$$(x + 1)(x^2 - x + 1) - (x^3 - 2) = 3, \qquad \text{hence} \qquad (x + 1) \cdot \tfrac{1}{3}(x^2 - x + 1) \equiv 1 \pmod{x^3 - 2},$$

and $[x + 1]^{-1} = \tfrac{1}{3} - \tfrac{1}{3}\alpha + \tfrac{1}{3}\alpha^2$. The real cube root $c = \sqrt[3]{2}$ is a root of $x^3 - 2$, so evaluation at $c$ is well defined and respects products, by the first part of the proposition above. It carries the equation $[x + 1][u] = [1]$, with $u = \tfrac{1}{3}(x^2 - x + 1)$, to $(1 + c)\,u(c) = 1$, that is,

$$\frac{1}{1 + \sqrt[3]{2}} = \frac{1 - \sqrt[3]{2} + \sqrt[3]{4}}{3},$$

a rationalization that multiplying by a conjugate, the trick for square roots, does not reach. The script confirms both sides numerically, $0.4424933\ldots$ in each case.

In $\mathbb{Q}[x]/(f(x))$, with the running example itself as the modulus, the class of $x$ is a unit. The monic polynomial $\gcd(x, f)$ divides $x$, so it is 1 or $x$, and $x$ does not divide $f$, because $f(0) = -2 \neq 0$ (the factor theorem). So the gcd is 1. Here the inverse can be read off directly: $f(x) = x(x^3 + x^2 - x - 2) - 2$, so $x \cdot \tfrac{1}{2}(x^3 + x^2 - x - 2) \equiv 1 \pmod f$.

Example (units decided without the Euclidean algorithm). In $\mathbb{Q}[x]/(f(x))$, $[x - 1]$ is a unit and $[x^2 + x + 1]$ is not, and no division is needed to see it. The monic polynomial $\gcd(x - 1, f)$ divides $x - 1$, so it is 1 or $x - 1$. By the factor theorem, $x - 1$ divides $f$ only if $f(1) = 0$, and the rational root test found $f(1) = -3$; so $\gcd(x - 1, f) = 1$. But $x^2 + x + 1$ is a monic factor of $f$, so it is its own gcd with $f$, and that gcd is not 1. Only gcds were needed, not inverses.

Zero divisors and a reducible modulus

What happens to the classes that are not units? Each nonzero one is a zero divisor, as this section proves. The class $[x^2 - 2]$ in $\mathbb{Q}[x]/(f(x))$ is not a unit, since $\gcd(x^2 - 2, f) = x^2 - 2$. It is something worse:

$$[x^2 - 2]\,[x^2 + x + 1] = [f(x)] = 0,$$

although neither factor is 0, because neither $x^2 - 2$ nor $x^2 + x + 1$ is divisible by $f$, which has larger degree. A factorization of the modulus becomes a pair of zero divisors, just as $4 \cdot 6 = 24$ became $[4][6] = 0$ in $\mathbb{Z}_{24}$. As for $\mathbb{Z}_n$, every nonzero class is one or the other.

Theorem. Every nonzero element of $F[x]/(p(x))$ is either a unit or a zero divisor, and not both.

The idea: a non-unit $h$ shares a factor $d$ with $p$, and multiplying $h$ by the rest of $p$ completes a multiple of $p$, as $x^2 + x + 1$ did for $x^2 - 2$ above.

Proof. Let $[h] \neq 0$ be a non-unit, so $d = \gcd(h, p) \neq 1$ by the previous theorem. Since $d$ is monic and not 1, it is not a constant, so $\deg d \ge 1$. Write $p = dp'$ and $h = dh'$. Then

$$h\,p' = d h' p' = h'\,p \equiv 0 \pmod p,$$

so $[h][p'] = 0$. And $[p'] \neq 0$: $p'$ is nonzero with $\deg p' = \deg p - \deg d < \deg p$, so $p$ does not divide it. Hence $[h]$ is a zero divisor. A unit is never a zero divisor: if $[h][u] = 1$ and $[h][g] = 0$, then $[g] = [u][h][g] = 0$. $\blacksquare$

For a check, reducing the running example modulo 3 gives a ring small enough to search completely. In $\mathbb{Z}_3[x]$,

$$\bar f(x) = x^4 + x^3 + 2x^2 + x + 1 = (x + 2)^2 (x^2 + 1),$$

so $\mathbb{Z}_3[x]/(\bar f)$ has $3^4 = 81$ elements. The script sorts them: 48 units (the classes of polynomials sharing no factor with $\bar f$), 32 zero divisors, and the zero class, with no nonzero element in both groups or in neither. For example $[x + 2]\,[(x + 2)(x^2 + 1)] = 0$, where $(x + 2)(x^2 + 1) = x^3 + 2x^2 + x + 2$, and $[x]$ is a unit with inverse $[2x^3 + 2x^2 + x + 2]$. The count of units mirrors Euler's $\varphi$ function: $81 \cdot (1 - \tfrac{1}{3})(1 - \tfrac{1}{9}) = 48$, where $3$ and $9$ are the sizes of $\mathbb{Z}_3[x]$ modulo the distinct irreducible factors $x + 2$ and $x^2 + 1$. The reason is the same as for $\varphi$, the Chinese remainder theorem, whose polynomial form splits this ring into pieces modulo $(x + 2)^2$ and $x^2 + 1$.

The count can also be made by hand. A class $[h]$ fails to be a unit exactly when $\gcd(h, \bar f) \neq 1$. A monic common divisor of positive degree has an irreducible factor, and by unique factorization an irreducible factor of $\bar f$ is an associate of $x + 2$ or of $x^2 + 1$. So $[h]$ is a non-unit exactly when $x + 2$ or $x^2 + 1$ divides $h$. Take $h$ among the 81 remainders, that is, 0 and the polynomials of degree less than 4.

  • The multiples of $x + 2$ are the products $(x + 2)k$ with $k$ zero or of degree less than 3. There are $3^3 = 27$.
  • The multiples of $x^2 + 1$ are the products $(x^2 + 1)k$ with $k$ zero or of degree less than 2. There are $3^2 = 9$.
  • A remainder divisible by both is divisible by their product. Indeed, if $h = (x + 2)k$ and $x^2 + 1$ divides $h$, then $x^2 + 1$ divides $k$ by the cancellation theorem, since $x^2 + 1$ is irreducible and does not divide $x + 2$. These are the products $(x + 2)(x^2 + 1)k$ with $k$ constant, and there are 3.

So $27 + 9 - 3 = 33$ classes are not units: the zero class and 32 zero divisors. The other $81 - 33 = 48$ are units, which agrees with the script.

Two rings with sixteen elements

How much does factoring matter when everything else is equal? Over $\mathbb{Z}_2$, every quartic modulus gives a ring with $2^4 = 16$ elements, and whether the modulus factors changes everything. For two of them, the gcd theorem predicts the units before any product is computed.

The modulus $x^4 + 1$ is as reducible as a quartic can be: over $\mathbb{Z}_2$, $(x + 1)^2 = x^2 + 1$, so $(x + 1)^4 = (x^2 + 1)^2 = x^4 + 1$. By unique factorization, the monic divisors of $(x + 1)^4$ are the powers $(x + 1)^j$ with $0 \le j \le 4$, so $\gcd(h, x^4 + 1) = 1$ exactly when $x + 1$ does not divide $h$. A class $[h]$ is therefore a unit exactly when $x + 1$ does not divide $h$, that is, by the factor theorem, when $h(1) = 1$, which says that $h$ has an odd number of terms. Of the 16 remainders, 8 have an odd number of terms. That predicts 8 units and, leaving out the zero class, 7 zero divisors, and the count mirrors Euler's $\varphi$ again: $16 \cdot (1 - \tfrac{1}{2}) = 8$, with 2 the size of $\mathbb{Z}_2[x]$ modulo the one irreducible factor $x + 1$. For instance $[x][x^3] = [x^4] = [1]$, while $[x + 1][x^3 + x^2 + x + 1] = [(x + 1)^4] = 0$, and $[x^2 + 1] = [x + 1]^2$ is a nonzero element whose square is zero.

The modulus $x^4 + x^3 + 1$ does not factor: the previous unit proved it irreducible over $\mathbb{Z}_2$, as the reduction modulo 2 of $x^4 + 3x^3 + 1$. Being irreducible, its only monic divisors are 1 and itself, and it does not divide a nonzero polynomial of degree less than 4. So its gcd with every nonzero remainder is 1, and the gcd theorem predicts that all 15 nonzero classes are units, without computing a single inverse.

Where the products are 0 and 1 in the multiplication tables of \mathbb{Z}_2[x]/(x^4 + x^3 + 1) (left) and \mathbb{Z}_2[x]/(x^4 + 1) (right). Each class is labeled by the four coefficients of its representative of degree less than 4, so 1011 is x^3 + x + 1; the other products are left blank. Notice where the zeros fall. Left: only in the row and column of 0, and every other row has exactly one 1. Right: zeros inside the table as well, in exactly the 7 nonzero rows whose label has an even number of 1s, and those rows contain no 1, as the theorem on units and zero divisors predicts.
Where the products are 0 and 1 in the multiplication tables of $\mathbb{Z}_2[x]/(x^4 + x^3 + 1)$ (left) and $\mathbb{Z}_2[x]/(x^4 + 1)$ (right). Each class is labeled by the four coefficients of its representative of degree less than 4, so 1011 is $x^3 + x + 1$; the other products are left blank. Notice where the zeros fall. Left: only in the row and column of 0, and every other row has exactly one 1. Right: zeros inside the table as well, in exactly the 7 nonzero rows whose label has an even number of 1s, and those rows contain no 1, as the theorem on units and zero divisors predicts.

The script confirms both predictions by brute force: 15 units on the left, and on the right 8 units, exactly the classes with an odd number of terms. A nonzero element whose square is 0, such as $[x^2 + 1]$ on the right, cannot occur in a field, because a field has no zero divisors (Integral Domains and Fields). The next article proves that the left-hand ring is a field.

Parallels with the integers

$\mathbb{Z}_n = \mathbb{Z}/(n)$ $F[x]/(p(x))$
$n$ elements, represented by $0, \ldots, n - 1$ represented by the polynomials of degree less than $d$ (and 0); $q^d$ elements over a field with $q$ elements
operations well defined by the theorem on congruences the same theorem for polynomials
every element is a sum $[1] + \cdots + [1]$ every element is a polynomial expression in $\alpha = [x]$ over $F$, and $p(\alpha) = 0$
$[a]$ a unit if and only if $\gcd(a, n) = 1$ $[h]$ a unit if and only if $\gcd(h, p) = 1$
zero divisors from a factorization of $n$ zero divisors from a factorization of $p(x)$

Worked problems

This problem is from the course's assignment on subrings and quotient rings. It is solved in full from the results of this unit. The assignment writes the indeterminate as $t$; here it is $x$, as on the rest of the page.

Problem 1. How many elements are in the ring $\mathbb{Z}_2[x]/(x^3 + 1)$? List them. Prove that the ring is not an integral domain by finding two nonzero elements whose product is zero. The assignment asks for one such pair; we also find every zero divisor, with a partner, and every unit, with its inverse.

The ring has $2^3 = 8$ elements, because the modulus has degree 3 and each class has exactly one representative $a_0 + a_1 x + a_2 x^2$ with coefficients in $\mathbb{Z}_2$. Write $\alpha = [x]$. Then $\alpha^3 + 1 = 0$, that is, $\alpha^3 = -1 = 1$, and the elements are

$$0, \quad 1, \quad \alpha, \quad \alpha + 1, \quad \alpha^2, \quad \alpha^2 + 1, \quad \alpha^2 + \alpha, \quad \alpha^2 + \alpha + 1.$$

A pair with product zero. Multiplying out and using $2 = 0$,

$$(\alpha + 1)(\alpha^2 + \alpha + 1) = \alpha^3 + 2\alpha^2 + 2\alpha + 1 = \alpha^3 + 1 = 0.$$

Both factors are nonzero, since $x + 1$ and $x^2 + x + 1$ are nonzero polynomials of degree less than 3. So the ring has zero divisors and is not an integral domain.

Why the pair exists. The same multiplication in $\mathbb{Z}_2[x]$ gives the factorization

$$x^3 + 1 = (x + 1)(x^2 + x + 1),$$

and the pair is this factorization read in the ring, as in the section on zero divisors. Both factors are irreducible: $x + 1$ has degree 1, and $x^2 + x + 1$ is a quadratic with the values 1 and 1 at 0 and 1, so it has no root in $\mathbb{Z}_2$. By unique factorization, an irreducible divisor of $x^3 + 1$ is one of these two.

All units and all zero divisors. By the theorem on units, $[h]$ is a unit exactly when $\gcd(h, x^3 + 1) = 1$, that is, when neither $x + 1$ nor $x^2 + x + 1$ divides $h$. Take $h$ among the seven nonzero remainders.

  • By the factor theorem, $x + 1$ divides $h$ exactly when $h(1) = 0$, that is, when $h$ has an even number of terms. Those are $x + 1$, $x^2 + 1$ and $x^2 + x$.
  • A nonzero multiple of $x^2 + x + 1$ of degree less than 3 is $x^2 + x + 1$ times a nonzero constant, and the only nonzero constant is 1. So the only such $h$ is $x^2 + x + 1$ itself.

So the units are $1$, $\alpha$ and $\alpha^2$. Since $\alpha \cdot \alpha^2 = \alpha^3 = 1$, the inverses are $1^{-1} = 1$, $\alpha^{-1} = \alpha^2$ and $(\alpha^2)^{-1} = \alpha$. The other four nonzero elements are zero divisors, by the theorem that every nonzero element is one or the other. Each has a partner:

  • $(\alpha + 1)(\alpha^2 + \alpha + 1) = 0$, computed above;
  • $(\alpha^2 + 1)(\alpha^2 + \alpha + 1) = (\alpha + 1) \cdot (\alpha + 1)(\alpha^2 + \alpha + 1) = 0$, because $(\alpha + 1)^2 = \alpha^2 + 2\alpha + 1 = \alpha^2 + 1$;
  • $(\alpha^2 + \alpha)(\alpha^2 + \alpha + 1) = \alpha \cdot (\alpha + 1)(\alpha^2 + \alpha + 1) = 0$;
  • $\alpha^2 + \alpha + 1$ has all three of $\alpha + 1$, $\alpha^2 + 1$ and $\alpha^2 + \alpha$ as partners.

The full multiplication table of the nonzero elements confirms the list. Each element is labeled by its three coefficients, so $abc$ stands for $a\alpha^2 + b\alpha + c$, and 011 is $\alpha + 1$.

$\cdot$ 001 010 011 100 101 110 111
001 001 010 011 100 101 110 111
010 010 100 110 001 011 101 111
011 011 110 101 101 110 011 000
100 100 001 101 010 110 011 111
101 101 011 110 110 011 101 000
110 110 101 011 011 101 110 000
111 111 111 000 111 000 000 111

The entry 000 appears six times, and only where one factor is 111 and the other is 011, 101 or 110. The entry 001 appears only in the rows of 001, 010 and 100, the three units. The script recomputes every entry.

Where it leads

What we have learned

The classes modulo $p(x)$ form a commutative ring with identity, $F[x]/(p(x))$, built exactly as $\mathbb{Z}_n$ was. It contains a copy of $F$ and the class $\alpha = [x]$, with $p(\alpha) = 0$. Evaluation at a root identifies $\mathbb{R}[x]/(x^2 + 1)$ with $\mathbb{C}$, which is why the opening product came out complex. A class is a unit exactly when it is relatively prime to the modulus, and every other nonzero class is a zero divisor.

The sixteen-element ring with the irreducible modulus had no zero divisors at all. That is true for every irreducible modulus: the next article, Building Fields from Irreducible Polynomials, proves that the ring is then a field, and uses it to give polynomials roots they did not have.

References

  • Hungerford, T. W. (2014). Abstract Algebra: An Introduction (3rd ed.), §5.2 and the end of §5.3. Brooks/Cole, Cengage Learning. The course text: the operations on classes are well defined (Theorem 5.6); $F[x]/(p(x))$ is a commutative ring with identity containing a subring isomorphic to $F$ (Theorem 5.7), identified with $F$ (Theorem 5.8); classes relatively prime to the modulus are units (Theorem 5.9); $\mathbb{R}[x]/(x^2 + 1)$ and $\mathbb{C}$. record · 44 pages
  • Judson, T. W. (2026). Abstract Algebra: Theory and Applications (annual edition, August 2026). Proposition 21.1.12 ($F(\alpha) \cong F[x]/\langle p(x) \rangle$ for the minimal polynomial $p(x)$ of $\alpha$, by the evaluation homomorphism and the first isomorphism theorem) and Example 21.1.14 ($\mathbb{R}[x]/\langle x^2 + 1 \rangle$ identified with $\mathbb{C}$). Free online at judsonbooks.org. record · 44 pages

Reviewed: verified, 16 Nov 2026 · editorial review, 23 Nov 2026 · 6 revisions