Integral Domains

Integral domains are the rings that behave most like $\mathbb{Z}$: commutative, a $1$, and you can cancel. This page asks two questions about them. First, can you always build fractions, the way $\mathbb{Q}$ is built from $\mathbb{Z}$? (Yes.) Second, does every element factor uniquely into "primes," the way integers do? (Not always, and finding out exactly when is the story of the second half.)

ID = integral domain = commutative ring with identity $1 \neq 0$ and no zero divisors.

Fields of Fractions

$\mathbb{Z}$ isn't a field, but it sits inside one, $\mathbb{Q}$, and $\mathbb{Q}$ is the smallest field that does. Every integral domain gets the same treatment.

Suppose $R$ is an ID. Then there is a field $F$, called the field of fractions of $R$, satisfying:

  1. $F$ contains an isomorphic copy of $R$,
  2. Any field $K$ which contains an isomorphic copy of $R$, also contains an isomorphic copy of $F$.

Part (ii) is what "smallest" means: you can't have $R$ without having all of $F$. The construction copies exactly what you learned about fractions in grade school. A fraction is a pair (numerator, denominator), and two pairs are the same fraction when they cross-multiply to the same thing.

The field of fractions of an ID $R$ is $F = \{(a, b) \in R \times R : b \neq 0\} / \sim$, where $\sim$ is the equivalence relation defined by:

$$(a, b) \sim (a', b') \iff a'b = ab'.$$

Define: $\forall (a, b), (c, d) \in F$,

$$(a, b) + (c, d) = (ad + bc, bd), \qquad (a, b)(c, d) = (ac, bd).$$

$F$ is the set of equivalence classes from Logic & Equivalence Classes. Proving $\sim$ is transitive is where "no zero divisors" earns its keep: from $a'b = ab'$ and $a''b' = a'b''$ you get $b'(a''b - ab'') = 0$, and you need to cancel $b' \neq 0$.

Think of $(a, b)$ as $\frac{a}{b}$, and the two formulas are just how you add and multiply fractions. The operations are well-defined (they don't depend on the choice of representative from each equivalence class), and $bd \neq 0$ because $R$ has no zero divisors.

Here's a picture of $\sim$ for $R = \mathbb{Z}$. Plot the pair $(a, b)$ as a point. Then $(a, b) \sim (a', b')$ says $\frac{b}{a} = \frac{b'}{a'}$ (when $a, a' \neq 0$): same slope. Each fraction is a line through the origin. Tap two points to add or multiply their fractions, and check that the answer never depends on which point of each line you tapped.

Fractions Are Lines

What is the field of fractions of $\mathbb{Z}[i] = \{a + bi : a, b \in \mathbb{Z}\}$?


$\mathbb{Q}(i) = \{x + yi : x, y \in \mathbb{Q}\}$. It's a field containing $\mathbb{Z}[i]$, and any field containing $\mathbb{Z}[i]$ contains every $\frac{a}{n}$ and $\frac{b}{n}i$, hence all of $\mathbb{Q}(i)$. (Clear denominators: $x + yi = \frac{a + bi}{n}$ for a common denominator $n$.)

Irreducible and Prime Elements

Now factoring. In $\mathbb{Z}$, "prime" has two descriptions that happen to agree: "can't be broken into smaller pieces" and "if it divides a product, it divides a factor." In a general integral domain they come apart, so they get separate names. Units don't count as pieces (you can always write $6 = (-1)(-6)$), so they're set aside.

If $R$ is an ID then a non-zero element $a \in R \setminus R^\times$ is irreducible if $a$ is not a product of non-units: whenever $a = bc$, $b$ or $c$ is a unit.

The other non-units get the opposite word.

A non-zero non-unit $a$ that is not irreducible is called reducible.

The second description of "prime" uses ideals.

A nonzero element $a \in R \setminus R^\times$ is a prime element if $(a)$ is a prime ideal.

Unpacking, $(a)$ prime means: if $a \mid bc$ then $a \mid b$ or $a \mid c$. That's Euclid's lemma, now promoted to a definition.

If $a \in R$ is prime then it is irreducible (in an ID).

Proof. Suppose $a$ is prime and $a = bc$. Then $bc \in (a) \implies b \in (a)$ or $c \in (a)$. W.L.O.G. suppose $b \in (a)$. Then $b = ad$ for some $d \in R$. Then $a = bc = adc \implies dc = 1$ (cancel $a \neq 0$; $R$ is an ID) $\implies c$ is a unit. So $a$ is irreducible. $\blacksquare$

The converse is not true in general. To see a counterexample, and to talk about uniqueness of factorizations, we need to say when two factorizations are "the same."

For $a, b \in R$, we say that $a$ and $b$ are associates if $\exists u \in R^\times$ s.t. $a = ub$.

In $\mathbb{Z}$, $3$ and $-3$ are associates; $2 \cdot 3$ and $(-2)(-3)$ are "the same" factorization of $6$. Now the main definition.

We say that an ID $R$ is a unique factorization domain (UFD) if every nonzero element $a \in R \setminus R^\times$ can be written in the form $a = u p_1 p_2 \cdots p_k$, where $u \in R^\times$, $p_i \in R$ are irreducible elements, and this representation is unique up to associates and order of factors.

These are some UFDs: $\mathbb{Z}$, $\mathbb{Z}[x]$, $\mathbb{Q}[x]$, $\mathbb{Z}[\sqrt{-1}] = \{a + b\sqrt{-1} : a, b \in \mathbb{Z}\}$ (the Gaussian integers, $\mathbb{Z}[i]$).


$\mathbb{Z}$ is the Fundamental Theorem of Arithmetic. The others will follow from the theorems below. In $\mathbb{Z}[i]$, the prime $2$ of $\mathbb{Z}$ stops being irreducible: $2 = (1 + i)(1 - i)$, and both factors are non-units.

Here's the standard example of a ring where unique factorization fails.

$\mathbb{Z}[\sqrt{-5}] = \{a + b\sqrt{-5} : a, b \in \mathbb{Z}\}$ is not a UFD.


To see this: $6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5})$.

Claim: (i) $2$, $3$, $1+\sqrt{-5}$, and $1-\sqrt{-5}$ are irreducible. (ii) $2$ is not an associate of $1+\sqrt{-5}$ or $1-\sqrt{-5}$.

To prove this, use the fact that the map $N : \mathbb{Z}[\sqrt{-5}] \rightarrow \mathbb{Z}_{\ge 0}$ defined by $N(a + b\sqrt{-5}) = a^2 + 5b^2$ satisfies $N(\alpha\beta) = N(\alpha)N(\beta)$.

$N(2) = 4$, $N(3) = 9$, $N(1+\sqrt{-5}) = 6$, $N(1-\sqrt{-5}) = 6$.

Also: multiplicativity $\implies N(u) = 1$ if $u$ is a unit (from $N(u)N(u^{-1}) = N(1) = 1$).

These facts verify both parts of the claim:

The whole argument comes down to "nothing in $\mathbb{Z}[\sqrt{-5}]$ has norm $2$ or $3$." Here's why. Draw $a + b\sqrt{-5}$ at the point $(a, b\sqrt{5})$; then $N$ is the squared distance from the origin, and the elements of norm $N$ live on a circle of radius $\sqrt{N}$. Slide $N$ and see which circles catch lattice points. Then compare the Gaussian integers.

Norm Circles

$6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5})$. Two completely different prime factorizations of six. Imagine telling a fifth grader that. Actually, don't.

The same ring shows that irreducible elements don't have to be prime.

Show that irreducible $\not\Rightarrow$ prime in general.


Let $R = \mathbb{Z}[\sqrt{-5}]$. Then $9 = 3 \cdot 3 = (2 + \sqrt{-5})(2 - \sqrt{-5})$.

All of $3$, $2+\sqrt{-5}$, $2-\sqrt{-5}$ are irreducible (each has norm $9$, and nothing has norm $3$). But $3 \nmid (2+\sqrt{-5})$ and $3 \nmid (2-\sqrt{-5})$ (since $\frac{2 \pm \sqrt{-5}}{3} \notin \mathbb{Z}[\sqrt{-5}]$), even though $3$ divides their product. So $(3)$ is not prime.

Euclidean Domains

How do you prove a ring is a UFD? The cleanest route goes through division with remainder, the engine behind gcds in $\mathbb{Z}$.

An integral domain $R$ is called a Euclidean domain (ED) if there is a function $\phi : R \setminus \{0\} \rightarrow \mathbb{N} \cup \{0\}$ with the property that $\forall a, b \in R$ with $b \neq 0$, $\exists q, r \in R$ s.t. $a = bq + r$ and ($r = 0$ or $\phi(r) < \phi(b)$).

$\phi$ measures size, and the remainder always has to be smaller than what you divided by. Together with PIDs from the last page, this gives a chain of four kinds of integral domains.

We have the following sequence of implications:

$$\text{(ED)} \implies \text{(PID)} \implies \text{(UFD)} \implies \text{(ID)}.$$

The first implication is the Spicy Bonus at the end of this page; the second is harder and we'll take it on faith. Here's the map, with an example living in each region.

Where do our favorite integral domains live?


  1. $R = \mathbb{Z}$ is an ED, with $\phi(n) = |n|$. (Division algorithm.)
  2. $R = \mathbb{Z}[i]$ is an ED with $\phi(a+bi) = a^2 + b^2$ (proof below).
  3. $R = \mathbb{Z}[\sqrt{-5}]$ is not a UFD, so it's also not a PID or an ED.
  4. Let $F$ be a field. Then $R = F[x]$ is an ED, with $\phi(f) = \deg f$. So if $F$ is a field, $F[x]$ is an ED, PID, and UFD.
  5. $\mathbb{Z}[x]$ is not a PID, because $(2, x)$ is not a principal ideal. So $\mathbb{Z}[x]$ is not an ED. However, $\mathbb{Z}[x]$ is a UFD (Gauss's Lemma).
  6. Example (without proof) of a PID which is not an ED: $\mathbb{Z}\left[\frac{1+\sqrt{-19}}{2}\right]$.

Item 4 is the division algorithm for polynomials you learned in precalculus, now over any field.

$\forall f, g \in F[x]$, $g(x) \neq 0$, $\exists q, r \in F[x]$ s.t. $f(x) = g(x)q(x) + r(x)$, $\deg r < \deg g$ (or $r = 0$).

Idea of proof: Use induction on $\deg(f)$. Write $f = a_n x^n + \dots + a_0$, $a_n \neq 0$, and $g = b_m x^m + \dots + b_0$, $b_m \neq 0$.

The one step that needs a field is dividing by $b_m$. Over $\mathbb{Z}$ you can't divide $x^2$ by $2x$ and keep integer coefficients, which is a hint that $\mathbb{Z}[x]$ isn't an ED.

Item 2 deserves a real proof, because it's a lovely geometric argument. The idea: divide in $\mathbb{Q}(i)$, then round to the nearest Gaussian integer.

$\mathbb{Z}[i]$ is a Euclidean domain with $\phi(a + bi) = a^2 + b^2$.

Show proof

Proof. Write $N(z) = |z|^2$, so $\phi = N$ on $\mathbb{Z}[i]$ and $N(zw) = N(z)N(w)$. Let $a, b \in \mathbb{Z}[i]$ with $b \neq 0$. In the field $\mathbb{Q}(i)$, $\frac{a}{b} = x + yi$ for some $x, y \in \mathbb{Q}$. Choose integers $m, n$ with $|x - m| \le \frac12$ and $|y - n| \le \frac12$, and let $q = m + ni \in \mathbb{Z}[i]$. Set $r = a - bq \in \mathbb{Z}[i]$. Then

$$N(r) = N(b)\, N\!\left(\tfrac{a}{b} - q\right) = N(b)\left((x - m)^2 + (y - n)^2\right) \le N(b)\left(\tfrac14 + \tfrac14\right) < N(b). \quad \blacksquare$$

Geometrically: the multiples $bq$ of $b$ form a square grid, tilted and stretched by $b$. Every Gaussian integer $a$ sits inside one of its squares, so it's within half a diagonal of some corner. Drag $a$ and $b$.

Dividing Gaussian Integers

Irreducible Means Prime in a PID

We saw that in $\mathbb{Z}[\sqrt{-5}]$, irreducible elements can fail to be prime. In a PID they can't. This is the key fact that makes factorizations unique in a PID.

If $R$ is a PID then $a \in R$ is irreducible if and only if it is prime.

Proof. We already know that prime $\implies$ irreducible. So suppose $a$ is irreducible, and let $M$ be a maximal ideal containing $(a)$ (it exists since $a$ is not a unit, so $(a)$ is proper). Since $R$ is a PID, $M = (b)$. Then $(a) \subseteq (b) \implies a = bc$ for some $c \in R$. Since $a$ is irreducible and $b$ is not a unit ($M \neq R$), $c$ is a unit. Then $(a) = (b) = M$. So $(a)$ is maximal $\implies (a)$ is prime. $\checkmark$ $\blacksquare$

Look at what the proof actually showed: an irreducible element generates a maximal ideal. That gives a bonus.

In a PID, non-zero prime ideals are maximal.

Proof. A nonzero prime ideal is $(p)$ for some $p \neq 0$, and $p$ is a prime element, so it's irreducible. The proof above shows $(p)$ is maximal. $\blacksquare$

$\mathbb{Z}[x]$ had the nonzero prime ideal $(x) \subsetneq (2, x)$ on Prime & Maximal Ideals, which wasn't maximal. By this corollary, that alone proves $\mathbb{Z}[x]$ isn't a PID.

Exercises

Norms make short work of units.

Find all units of $\mathbb{Z}[i]$.

Show answer

If $u$ is a unit then $N(u)N(u^{-1}) = N(1) = 1$, and norms are nonnegative integers, so $N(u) = a^2 + b^2 = 1$. That forces $(a, b) = (\pm 1, 0)$ or $(0, \pm 1)$. All four of $\pm 1, \pm i$ are units ($i \cdot (-i) = 1$). So $\mathbb{Z}[i]^\times = \{1, -1, i, -i\}$, a cyclic group of order $4$.

Prove that "is an associate of" is an equivalence relation on an integral domain $R$.

Show proof

Proof. Reflexive: $a = 1 \cdot a$. Symmetric: if $a = ub$ with $u \in R^\times$ then $b = u^{-1}a$. Transitive: if $a = ub$ and $b = vc$ then $a = (uv)c$, and $uv \in R^\times$ since $R^\times$ is a group. $\blacksquare$

Show that $3$ is irreducible in $\mathbb{Z}[i]$, but $5$ is not.

Show answer

$N(3) = 9$. A factorization into non-units would need a factor of norm $3$, i.e. $a^2 + b^2 = 3$, which has no integer solutions (squares are $0, 1, 4, \dots$). So $3$ is irreducible.

$5 = (2 + i)(2 - i)$, and each factor has norm $5 \neq 1$, so neither is a unit. So $5$ is reducible. (Norm Circles shows this: the circle of radius $\sqrt 5$ catches lattice points in $\mathbb{Z}[i]$.)

Spicy Bonus

Prove the first link of the chain. It's the same argument that shows every subgroup of $\mathbb{Z}$ is $n\mathbb{Z}$.

🌶️ SPICY BONUS 🌶️

Prove that every Euclidean domain is a principal ideal domain.

Show proof

Proof. Let $R$ be an ED with function $\phi$, and let $I$ be an ideal. If $I = (0)$ it's principal. Otherwise, the set $\{\phi(x) : x \in I, x \neq 0\}$ is a non-empty set of nonnegative integers, so by well-ordering it has a smallest element $\phi(b)$, with $b \in I$, $b \neq 0$.

Clearly $(b) \subseteq I$. Conversely, let $a \in I$. Divide: $a = bq + r$ with $r = 0$ or $\phi(r) < \phi(b)$. But $r = a - bq \in I$, since $a, b \in I$ and $I$ is an ideal. If $r \neq 0$, then $\phi(r) < \phi(b)$ contradicts the minimality of $\phi(b)$. So $r = 0$, $a = bq \in (b)$, and $I = (b)$. $\blacksquare$