Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 37 · Rings and Ideals

Units, Zero Divisors and Integral Domains

Find the units and zero divisors of Z_n, learn when a ring is an integral domain or a field, and verify the rules with Python.

In a ring you can always add, subtract and multiply. Division is another matter. Whether you can divide depends on which elements have inverses, and whether you can cancel a factor depends on whether the ring has zero divisors. This lesson sorts the nonzero elements of a ring into types and uses them to define two important kinds of ring.

Units

An element u of a ring R is a unit if it has a multiplicative inverse: there is v in R with u v = v u = 1. The set of units is written R× (or U(R)) and it is a group under multiplication.

Examples:

  • In ℤ, the only units are 1 and -1.
  • In ℚ, every nonzero element is a unit.
  • In ℤₙ, the unit a must satisfy gcd(a, n) = 1. Then ℤₙ× has φ(n) elements, where φ is Euler's totient function.

Why gcd? By Bézout's identity, gcd(a, n) = 1 means there are integers x, y with ax + ny = 1, so ax ≡ 1 (mod n). If gcd(a, n) = d > 1, then a x ≡ 1 would force d to divide 1, which is impossible.

Zero divisors

A nonzero element a is a zero divisor if there is a nonzero b with a b = 0 (or b a = 0). In ℤ₆, 2 · 3 = 6 ≡ 0, so both 2 and 3 are zero divisors.

A unit can never be a zero divisor: if u v = 0 then v = u⁻¹ u v = u⁻¹ · 0 = 0.

Zero divisors break cancellation. In ℤ₆, 2 · 1 = 2 · 4 = 2, but you cannot "cancel the 2" to conclude 1 = 4. In a ring with no zero divisors, a b = a c with a ≠ 0 implies b = c, because a (b - c) = 0 forces b - c = 0.

Types of ring

A commutative ring with 1 ≠ 0 and no zero divisors is an integral domain. Examples: ℤ, ℚ, ℝ[x], and ℤₚ for prime p.

A commutative ring with 1 ≠ 0 in which every nonzero element is a unit is a field. Examples: ℚ, ℝ, ℂ, ℤₚ for prime p.

flowchart LR
    A["Commutative rings"] --> B["Integral domains<br/>(no zero divisors)"]
    B --> C["Fields<br/>(every nonzero element is a unit)"]

Every field is an integral domain, and every integral domain is a commutative ring. The reverse arrows are false: ℤ is a domain but not a field.

Every field is an integral domain by the argument above. Every finite integral domain is a field: multiplication by a nonzero a is injective by cancellation, so on a finite set it is also surjective, and 1 is hit. That gives an inverse.

Classifying the elements of Z_n

Here is a classifier for ℤₙ: for each element it tells you whether it is 0, a unit or a zero divisor. It also verifies that every nonzero element is one or the other (never both).

Python Units and zero divisors in Z_n

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For n = 5 there are no zero divisors, so ℤ₅ is a field. For the others there are zero divisors. In ℤₙ, a nonzero element is a unit if its gcd with n is 1 and a zero divisor otherwise.

When is Z_n a field?

Theorem. ℤₙ is an integral domain ⇔ ℤₙ is a field ⇔ n is prime.

If n = r s with 1 < r, s < n, then r s ≡ 0 and r, s are zero divisors. If n = p is prime, every a in 1..p-1 has gcd(a, p) = 1 and hence an inverse. Fermat's little theorem even gives it: a⁻¹ = a^(p-2) mod p.

The second program finds inverses for ℤ₁₃ with Python's three-argument pow, and tabulates the group of units of a composite modulus.

Python Inverses in Z13 and the unit group of Z15

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that no unit of ℤ₁₅ has order 8, so the unit group (of order 8) is not cyclic. That distinguishes ℤ₁₅× from ℤ₁₃×, which is cyclic of order 12.

The word "unit" has two meanings in everyday math ("unit of measurement", "unit vector"). In ring theory it only means "has a multiplicative inverse". The number 1 is always a unit, but not every unit equals 1.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Which elements of Z12 are units?

    a is a unit mod 12 exactly when gcd(a, 12) = 1.
  2. 2. Which statement is true for every ring?

    If u is a unit and u v = 0, multiplying by the inverse gives v = 0.
  3. 3. For which n is Z_n a field?

    Z_n is a field exactly when n is prime.
  4. 4. Which ring is an integral domain but not a field?

    Z has no zero divisors, but 2 has no inverse in Z. Z6 has zero divisors.

Summary

  • A unit has a multiplicative inverse; the units form a group R×.
  • A zero divisor is a nonzero element a with a b = 0 for some nonzero b; units are never zero divisors.
  • An integral domain is a commutative ring with 1 ≠ 0 and no zero divisors; a field is a commutative ring in which every nonzero element is a unit.
  • In ℤₙ, a is a unit iff gcd(a, n) = 1, and ℤₙ is a field iff n is prime.
  • Finite integral domains are fields.

Next: Ideals