Skip to content

Lesson 25 ยท 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