MATH-323 · Lesson 3 of 12 · 22 min

Integral domains and fields

The integers have a property so familiar that it is easy to overlook: if a product of two integers is zero, one of the factors is zero. This property is what lets us solve \(x^2 - 5x + 6 = 0\) by factoring it as \((x - 2)(x - 3) = 0\) and concluding \(x = 2\) or \(x = 3\). In \(\mathbb{Z}_{12}\) the same equation has more solutions, because \((x - 2)(x - 3)\) can be 0 without either factor being 0. This lesson gives the property a name, studies the rings that have it, the integral domains, and the special domains in which every nonzero element can be inverted, the fields. It ends with the characteristic of a ring, a number that records how the integers sit inside it.

Zero divisors

Definition. A nonzero element \(a\) of a commutative ring \(R\) is a zero divisor if there is a nonzero \(b \in R\) with \(ab = 0\).

In \(\mathbb{Z}_n\) the zero divisors are exactly the nonzero classes \(a\) with \(\gcd(a, n) > 1\). If \(d = \gcd(a, n) > 1\), then \(b = n/d\) is nonzero modulo \(n\), and \(ab = (a/d) \cdot n \equiv 0\). Conversely, if \(\gcd(a, n) = 1\) then \(a\) is a unit, and a unit is never a zero divisor: \(ab = 0\) gives \(b = a^{-1}ab = 0\). So every nonzero element of \(\mathbb{Z}_n\) is either a unit or a zero divisor, never both. That dichotomy holds in every finite commutative ring with unity, as we prove below, but not in infinite rings: \(2 \in \mathbb{Z}\) is neither.

Other examples. In \(\mathbb{Z} \times \mathbb{Z}\), \((1, 0)(0, 1) = (0, 0)\). In the ring of real functions, \(f = \max(x, 0)\) and \(g = \min(x, 0)\) are both nonzero but \(fg = 0\) everywhere. In \(M_2(\mathbb{R})\), which is not commutative, \(\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}^2 = 0\). An element with \(a^k = 0\) for some \(k\) is called nilpotent; in \(\mathbb{Z}_{12}\), 6 is nilpotent since \(36 \equiv 0\), and in \(\mathbb{Z}_8\), 2, 4 and 6 are nilpotent.

Three rows of circles labeled Z12, Z7 and Z15. In each row the nonzero classes are drawn as circles: units in green and zero divisors in red. Z12 has units 1, 5, 7, 11 and seven zero divisors. Z7 has all six nonzero classes green. Z15 has eight units and six zero divisors.
Every nonzero class of Z_n is a unit (green) or a zero divisor (red); when n is prime, there are no zero divisors and Z_n is a field

Integral domains

Definition. An integral domain is a commutative ring with unity \(1 \ne 0\) and no zero divisors.

The name comes from the integers, the model example, and \(\mathbb{Z}\), \(\mathbb{Q}\), \(\mathbb{R}\), \(\mathbb{C}\), \(\mathbb{Z}[i]\), \(\mathbb{Z}[\sqrt d]\) and \(\mathbb{Z}_p\) for prime \(p\) are all integral domains. So is the polynomial ring \(D[x]\) over any integral domain \(D\): if \(f\) and \(g\) are nonzero with leading coefficients \(a\) and \(b\), the leading coefficient of \(fg\) is \(ab \ne 0\). The rings \(\mathbb{Z}_n\) for composite \(n\), \(\mathbb{Z} \times \mathbb{Z}\) and function rings are not.

The point of the definition is the cancellation law.

Theorem. A commutative ring \(R\) with unity \(1 \ne 0\) is an integral domain if and only if cancellation holds: whenever \(a \ne 0\) and \(ab = ac\), then \(b = c\).

Proof: suppose \(R\) is a domain and \(ab = ac\) with \(a \ne 0\). Then \(a(b - c) = 0\), and since \(a\) is not a zero divisor, \(b - c = 0\). Conversely, if cancellation holds and \(ab = 0 = a \cdot 0\) with \(a \ne 0\), canceling \(a\) gives \(b = 0\), so \(a\) is not a zero divisor.

Cancellation is the reason high-school algebra works. A polynomial of degree \(n\) over an integral domain has at most \(n\) roots; lesson 6 proves this. Over \(\mathbb{Z}_{12}\), the polynomial \(x^2 - 1\) of degree 2 has four roots, 1, 5, 7 and 11, because \(x^2 - 1 = (x - 1)(x + 1)\) can vanish when neither factor does.

Fields

Definition. A field is a commutative ring with unity \(1 \ne 0\) in which every nonzero element is a unit.

Equivalently, a field is a set in which addition, subtraction, multiplication and division by nonzero elements are all possible and obey the usual laws. \(\mathbb{Q}\), \(\mathbb{R}\), \(\mathbb{C}\) and \(\mathbb{Z}_p\) for prime \(p\) are fields; so is \(\mathbb{Q}(\sqrt 2) = \{a + b\sqrt 2 : a, b \in \mathbb{Q}\}\), in which \((a + b\sqrt 2)^{-1} = \frac{a - b\sqrt 2}{a^2 - 2b^2}\), the denominator being nonzero because \(\sqrt 2\) is irrational.

Every field is an integral domain, since a unit is never a zero divisor. The converse is false, \(\mathbb{Z}\) being a domain whose only units are \(\pm 1\). But for finite rings the converse is true, and the proof is one of the most elegant arguments in elementary algebra.

Theorem. Every finite integral domain is a field.

Proof: let \(D\) be a finite integral domain and \(a \ne 0\). Consider the map \(\lambda_a : D \to D\), \(x \mapsto ax\). By cancellation it is injective: \(ax = ay\) implies \(x = y\). An injective map from a finite set to itself is surjective. So some \(x\) has \(ax = 1\), and \(a\) is a unit.

Corollary. \(\mathbb{Z}_n\) is a field if and only if \(n\) is prime. If \(n = p\) is prime, \(\mathbb{Z}_p\) has no zero divisors because \(p \mid ab\) implies \(p \mid a\) or \(p \mid b\) (Euclid's lemma), so it is a finite domain, hence a field. If \(n = rs\) with \(1 < r, s < n\), then \(rs \equiv 0\) and \(\mathbb{Z}_n\) has zero divisors.

The same argument shows that in a finite commutative ring with unity, a nonzero element that is not a zero divisor is a unit, because multiplication by it is injective. This is the dichotomy noticed above for \(\mathbb{Z}_n\).

For noncommutative rings, the analog of a field is a division ring, in which every nonzero element has a two-sided inverse; Hamilton's quaternions are the classic example. Joseph Wedderburn proved in 1905 that a finite division ring is automatically commutative, so it is a field. The proof is harder than the theorem on finite domains, and uses the class equation of group theory together with cyclotomic polynomials. One consequence is that there are no finite analogues of the quaternions: every finite structure in which division is possible is a finite field, and lesson 11 shows that these are completely classified by their size.

Fields of fractions

Every integral domain sits inside a field. The construction copies the passage from \(\mathbb{Z}\) to \(\mathbb{Q}\): a fraction \(a/b\) is an equivalence class of pairs \((a, b)\) with \(b \ne 0\), where \((a, b) \sim (c, d)\) when \(ad = bc\), and we add and multiply by the usual rules \(\frac{a}{b} + \frac{c}{d} = \frac{ad + bc}{bd}\), \(\frac{a}{b} \cdot \frac{c}{d} = \frac{ac}{bd}\). Being a domain is exactly what is needed: \(bd \ne 0\) so the results are fractions, and transitivity of \(\sim\) uses cancellation. The result is the field of fractions of \(D\), the smallest field containing it. The field of fractions of \(\mathbb{Z}[i]\) is \(\mathbb{Q}(i)\), and that of \(\mathbb{Q}[x]\) is the field \(\mathbb{Q}(x)\) of rational functions.

Characteristic

Definition. The characteristic of a ring \(R\) is the least positive integer \(n\) such that \(n \cdot a = a + a + \cdots + a = 0\) for all \(a \in R\). If no such \(n\) exists, the characteristic is 0.

For a ring with unity, it is enough to look at 1: if \(n \cdot 1 = 0\) then \(n \cdot a = (n \cdot 1)a = 0\) for every \(a\). So the characteristic is the additive order of 1, or 0 if that order is infinite. \(\mathbb{Z}\), \(\mathbb{Q}\), \(\mathbb{R}\), \(\mathbb{C}\) have characteristic 0; \(\mathbb{Z}_n\) has characteristic \(n\); \(\mathbb{Z}_m \times \mathbb{Z}_n\) has characteristic \(\operatorname{lcm}(m, n)\).

Theorem. The characteristic of an integral domain is 0 or a prime.

Proof: suppose 1 has finite additive order \(n\), and \(n = rs\) with \(1 < r, s < n\). Then \(0 = n \cdot 1 = (r \cdot 1)(s \cdot 1)\), and since \(D\) is a domain, \(r \cdot 1 = 0\) or \(s \cdot 1 = 0\), contradicting the minimality of \(n\).

In a ring of prime characteristic \(p\) a surprising identity holds, sometimes called the freshman's dream: \((a + b)^p = a^p + b^p\) in any commutative ring of characteristic \(p\). The reason is that the binomial coefficients \(\binom{p}{k}\) for \(0 < k < p\) are divisible by \(p\), since \(p\) appears in the numerator of \(\frac{p!}{k!(p - k)!}\) and not in the denominator. The map \(a \mapsto a^p\) therefore respects addition as well as multiplication. It is the Frobenius map, which returns as the main symmetry of finite fields in lesson 11.

Computing in small rings

The program classifies every nonzero element of \(\mathbb{Z}_n\) as a unit, a zero divisor or a nilpotent, for a few values of \(n\), and verifies the freshman's dream in \(\mathbb{Z}_7\) and its failure in \(\mathbb{Z}_6\) and \(\mathbb{Z}_9\) when the exponent is not the characteristic.

Units, zero divisors and nilpotents in Z_n, and the freshman’s dream
from math import gcd, comb

def classify(n):
    units = [a for a in range(1, n) if gcd(a, n) == 1]
    zd = [a for a in range(1, n) if any(a * b % n == 0 for b in range(1, n))]
    nil = [a for a in range(1, n) if any(pow(a, k, n) == 0 for k in range(1, n + 1))]
    return units, zd, nil

for n in (7, 8, 12, 15):
    u, z, nl = classify(n)
    kind = "field" if not z else "not a domain"
    print(f"Z_{n}: units={u}")
    print(f"      zero divisors={z} nilpotent={nl} ({kind})")

def dream(n, p):
    return all(pow(a + b, p, n) == (pow(a, p, n) + pow(b, p, n)) % n
               for a in range(n) for b in range(n))

for n, p in ((7, 7), (6, 6), (9, 3), (9, 9)):
    print(f"(a+b)^{p} = a^{p} + b^{p} in Z_{n}: {dream(n, p)}")
print("binomial(7, k) for k = 1..6:", [comb(7, k) for k in range(1, 7)])
Output
Z_7: units=[1, 2, 3, 4, 5, 6]
      zero divisors=[] nilpotent=[] (field)
Z_8: units=[1, 3, 5, 7]
      zero divisors=[2, 4, 6] nilpotent=[2, 4, 6] (not a domain)
Z_12: units=[1, 5, 7, 11]
      zero divisors=[2, 3, 4, 6, 8, 9, 10] nilpotent=[6] (not a domain)
Z_15: units=[1, 2, 4, 7, 8, 11, 13, 14]
      zero divisors=[3, 5, 6, 9, 10, 12] nilpotent=[] (not a domain)
(a+b)^7 = a^7 + b^7 in Z_7: True
(a+b)^6 = a^6 + b^6 in Z_6: False
(a+b)^3 = a^3 + b^3 in Z_9: False
(a+b)^9 = a^9 + b^9 in Z_9: False
binomial(7, k) for k = 1..6: [7, 21, 35, 35, 21, 7]

The output confirms that \(\mathbb{Z}_7\) has no zero divisors. In \(\mathbb{Z}_8\) every zero divisor is nilpotent, because 8 is a prime power; in \(\mathbb{Z}_{12}\) only 6 is, and in \(\mathbb{Z}_{15}\), whose modulus is squarefree, there are zero divisors but no nonzero nilpotents. The identity \((a + b)^p = a^p + b^p\) holds in \(\mathbb{Z}_7\) with \(p = 7\). In \(\mathbb{Z}_9\), of characteristic 9, it fails for \(p = 3\) and even for \(p = 9\), since 9 is not prime: \(\binom{9}{3} = 84\) is not a multiple of 9.

Worked problem

Solving a quadratic in a domain and in a ring with zero divisors

Solve \(x^2 - 5x + 6 = 0\) in \(\mathbb{Z}_7\) and in \(\mathbb{Z}_{12}\).

Show solution
  1. In both rings, \(x^2 - 5x + 6 = (x - 2)(x - 3)\), since \(-2 - 3 = -5\) and \((-2)(-3) = 6\).
  2. \(\mathbb{Z}_7\) is a field, so \((x - 2)(x - 3) = 0\) forces \(x = 2\) or \(x = 3\). These are the only solutions.
  3. In \(\mathbb{Z}_{12}\), the product can vanish when \(x - 2\) and \(x - 3\) are zero divisors. Test all 12 classes: \(x = 2, 3\) work, and so do \(x = 6\) (giving \(4 \cdot 3 = 12\)) and \(x = 11\) (giving \(9 \cdot 8 = 72\)).
  4. No other class works; for instance \(x = 7\) gives \(5 \cdot 4 = 20 \equiv 8\).

Answer: Two solutions, \(\{2, 3\}\), in \(\mathbb{Z}_7\); four solutions, \(\{2, 3, 6, 11\}\), in \(\mathbb{Z}_{12}\). A degree-2 polynomial has at most two roots only over a domain.

Common mistakes

  • MistakeCalling every ring without units other than \(\pm 1\) a non-domain.

    Instead\(\mathbb{Z}\) has only two units but is a domain. Domain means no zero divisors, not many units.

  • MistakeThinking \(\mathbb{Z}_n\) is a field whenever \(n\) is odd.

    Instead\(\mathbb{Z}_9\) has \(3 \cdot 3 = 0\). Only prime \(n\) gives a field.

  • MistakeUsing \((a + b)^p = a^p + b^p\) in characteristic 0.

    InsteadIn \(\mathbb{R}\), \((1 + 1)^2 = 4 \ne 2\). The identity needs characteristic \(p\).

  • MistakeSaying a nilpotent element is a unit.

    InsteadIf \(a^k = 0\) with \(a\) a unit, then \(1 = a^{-k}a^k = 0\). Nonzero nilpotents are zero divisors.

  • MistakeClaiming the characteristic of \(\mathbb{Z}_4 \times \mathbb{Z}_6\) is 24.

    InsteadIt is \(\operatorname{lcm}(4, 6) = 12\).

Summary and key terms

  • A zero divisor is a nonzero \(a\) with \(ab = 0\) for some nonzero \(b\).
  • An integral domain is a commutative ring with \(1 \ne 0\) and no zero divisors; cancellation holds exactly in domains.
  • A field is a commutative ring with \(1 \ne 0\) in which every nonzero element is a unit.
  • Every field is a domain, and every finite domain is a field; \(\mathbb{Z}_n\) is a field exactly when \(n\) is prime.
  • Every domain embeds in its field of fractions.
  • The characteristic of a domain is 0 or prime, and in characteristic \(p\), \((a + b)^p = a^p + b^p\).
zero divisor
A nonzero \(a\) with \(ab = 0\) for some nonzero \(b\).
nilpotent
An element with \(a^k = 0\) for some \(k \ge 1\).
integral domain
A commutative ring with unity, \(1 \ne 0\), and no zero divisors.
field
A commutative ring with unity in which every nonzero element is a unit.
field of fractions
The smallest field containing a given domain, built from pairs \(a/b\).
characteristic
The least \(n > 0\) with \(n \cdot 1 = 0\), or 0 if none exists.
Frobenius map
\(a \mapsto a^p\) in characteristic \(p\).

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. List the zero divisors of \(\mathbb{Z}_{20}\).

    Show answer

    The nonzero classes not coprime to 20: 2, 4, 5, 6, 8, 10, 12, 14, 15, 16, 18.

  2. Find the inverse of 5 in \(\mathbb{Z}_{13}\).

    Show answer

    \(5 \cdot 8 = 40 = 39 + 1\), so \(5^{-1} = 8\).

  3. Is \(\mathbb{Z}[x]\) a field? A domain?

    Show answer

    A domain, since \(\mathbb{Z}\) is; not a field, since \(x\) has no inverse.

  4. What is the characteristic of \(\mathbb{Z}_2[x]\)?

    Show answer

    2, because \(1 + 1 = 0\) in the coefficients.

  5. Find all nilpotent elements of \(\mathbb{Z}_{72}\).

    Show answer

    \(72 = 2^3 \cdot 3^2\); \(a\) is nilpotent iff \(6 \mid a\): 0, 6, 12, ..., 66.

  6. Show that \(\mathbb{Q}(\sqrt 3)\) is a field by finding \((2 + \sqrt 3)^{-1}\).

    Show answer

    \((2 + \sqrt 3)(2 - \sqrt 3) = 1\), so the inverse is \(2 - \sqrt 3\).

  7. Solve \(x^2 = x\) in \(\mathbb{Z}_{10}\).

    Show answer

    \(x(x - 1) = 0\): \(x \in \{0, 1, 5, 6\}\).

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz