Target Audience: Anyone who has met groups and wants to know what happens when a second operation arrives — and why division works in some number systems and not others.
Prerequisites: Groups for groups, normal subgroups and quotients; Number Theory for Bézout, congruences and the Chinese Remainder Theorem; and Algebra, Polynomials and Complex Numbers for polynomial division and roots.
A group has one operation. The integers, the residues mod \(n\), the polynomials and the matrices all have two, and the interesting questions — can you cancel, can you divide, does factorisation come out unique — are about how the two interact. A ring is the structure that asks them.
As with groups, most of this page is not new. The number theory material showed that cancellation mod \(n\) can fail, that every non-zero residue mod a prime is invertible, and that the Chinese Remainder Theorem splits arithmetic mod \(mn\) into two pieces. The polynomials material stated the division algorithm and the root bound. Euclid’s Lemma already calls its property the definition of a prime element. Sections 1 to 5 name what those results were about; Sections 6 to 8 build new rings from old ones; Section 9 asks when factorisation is unique; and Section 10 goes back over the list.
The explorer in Section 4 does not take the classification on trust: it sorts every element of a ring into units and zero divisors twice, once by searching the multiplication table and once by Bézout’s identity, and reports whether the two agree.
A ring is a set \(R\) with two operations, \(+\) and \(\cdot\), such that:
The ring is commutative if \(ab = ba\) for all \(a, b\). From Section 3 on, every ring on this page is commutative.
Multiplicative inverses. The additive half is a group, so subtraction always works; the multiplicative half is not required to be one, so division may not. Almost everything on this page is about which elements you can divide by, and what goes wrong with the rest.
\(0 \cdot a = 0\). Distributivity gives \(0 \cdot a = (0 + 0) \cdot a = 0 \cdot a + 0 \cdot a\), and subtracting \(0 \cdot a\) from both sides leaves \(0 = 0 \cdot a\).
\((-a)b = -(ab)\). \(ab + (-a)b = (a + (-a))b = 0 \cdot b = 0\), so \((-a)b\) is the additive inverse of \(ab\).
\((-a)(-b) = ab\). The previous rule gives \((-a)(-b) = -(a(-b))\). Its mirror image \(a(-b) = -(ab)\), proved the same way from the other distributive law, turns that into \(-(-(ab)) = ab\). A negative times a negative is positive because distributivity leaves no alternative — it is a theorem, not a convention.
If \(1 = 0\) then every \(a = 1 \cdot a = 0 \cdot a = 0\), and the ring has one element. That is the zero ring, and the definitions in Section 4 exclude it explicitly by requiring \(1 \neq 0\).
An element with a multiplicative inverse is a unit, and the units of \(R\) form a group \(R^{\times}\) under multiplication: \(1\) is a unit, and \((ab)^{-1} = b^{-1}a^{-1}\). This is where the groups page got \((\mathbb{Z}/n\mathbb{Z})^{\times}\) from. The units of \(\mathbb{Z}\) are just \(\pm 1\); the units of the matrix ring are the invertible matrices.
The natural numbers have no additive inverses. The even integers have no \(1\): no even \(e\) has \(e \cdot 2 = 2\). Both fail an axiom, and both fail it for a reason that matters later — subtraction and a multiplicative identity are used constantly.
\(a\) is a unit if \(ab = 1\) for some \(b\). A non-zero \(a\) is a zero divisor if \(ab = 0\) for some non-zero \(b\).
In \(\mathbb{Z}/6\mathbb{Z}\), the units are \(1\) and \(5\), and the zero divisors are \(2\), \(3\) and \(4\): \(2 \cdot 3 = 0\) and \(4 \cdot 3 = 0\).
A non-zero residue \(a\) is a unit exactly when \(\gcd(a, n) = 1\) — that is Bézout. And when \(g = \gcd(a, n) \gt 1\), it is a zero divisor: \(a \cdot \frac{n}{g} = \frac{a}{g} \cdot n \equiv 0\), while \(\frac{n}{g}\) is a non-zero residue. So every non-zero element of \(\mathbb{Z}/n\mathbb{Z}\) is one or the other.
In a finite commutative ring, every non-zero element is a unit or a zero divisor, and never both.
Never both. If \(ab = 1\) and \(ac = 0\), then \(c = (ba)c = b(ac) = 0\).
At least one. Consider \(x \mapsto ax\). If it is injective, it is a bijection of a finite set, so some \(x\) has \(ax = 1\) and \(a\) is a unit. If not, \(ax = ay\) with \(x \neq y\), so \(a(x - y) = 0\) with \(x - y \neq 0\), and \(a\) is a zero divisor. “Injective plus finite is bijective” is the step Fermat’s Little Theorem uses in its shuffle proof.
In \(\mathbb{Z}\), \(2\) is neither: nothing times \(2\) is \(1\), and nothing non-zero times \(2\) is \(0\). The map \(x \mapsto 2x\) is injective but misses every odd number, which is only possible because \(\mathbb{Z}\) is infinite.
\(ca = cb\) says \(c(a - b) = 0\). So cancelling \(c\) is safe for every \(a\) and \(b\) exactly when \(c\) is non-zero and not a zero divisor.
The number theory page’s warning — \(2 \cdot 3 \equiv 2 \cdot 8 \pmod{10}\) but \(3 \not\equiv 8\) — is this in action: the difference is \(2 \cdot 5 \equiv 0\), because \(2\) is a zero divisor mod \(10\). Its rule “cancel only when \(\gcd(c, n) = 1\)” is the gcd test above.
An integral domain is a commutative ring with \(1 \neq 0\) and no zero divisors: \(ab = 0\) forces \(a = 0\) or \(b = 0\).
A field is a commutative ring with \(1 \neq 0\) in which every non-zero element is a unit.
Every field is an integral domain, because a unit is never a zero divisor (Section 3).
Every finite integral domain is a field, because by the theorem of Section 3 a non-zero element that is not a zero divisor must be a unit. For finite rings, the two notions coincide.
If \(n = ab\) with \(1 \lt a, b \lt n\), then \(a \cdot b = 0\) with both factors non-zero, so there are zero divisors.
If \(n = p\) is prime, Euclid’s Lemma — \(p \mid ab\) forces \(p \mid a\) or \(p \mid b\) — says precisely that \(\mathbb{Z}/p\mathbb{Z}\) has no zero divisors. It is a finite integral domain, and therefore a field. That page’s interactive table of products is a search for zero divisors.
Choose a ring. The explorer first checks the ring axioms by exhaustion — associativity and both distributive laws on every triple. Then it classifies every element twice: once by searching the multiplication table for an inverse or a zero product, and once structurally, by the extended Euclidean algorithm — on integers for \(\mathbb{Z}/n\), on polynomials for the rings of Section 8. Finally it compares the field verdict with a third, independent test.
Compare \(\mathbb{Z}/4\) with \(\mathbb{F}_2[x]/(x^2 + x + 1)\): both have four elements, but in the first \(2 \cdot 2 = 0\), and the second is a field.
The polynomials page states its theorems for coefficients in \(\mathbb{R}\) or \(\mathbb{C}\). Each one uses a property of the coefficients, and changing the coefficient ring shows which.
Over \(\mathbb{Z}/8\mathbb{Z}\), the quadratic \(t^2 - 1\) has four roots: \(1, 3, 5, 7\). Over \(\mathbb{Z}/15\mathbb{Z}\) it has four as well: \(1, 4, 11, 14\).
The proof of the root bound takes a root \(c\), writes \(f = (x - c)\,q\), and argues that any other root \(d\) is a root of \(q\). That step reads \((d - c)\,q(d) = 0\) and concludes \(q(d) = 0\) — which needs \(d - c\) not to be a zero divisor. Mod \(8\) it fails: at \(t = 3\), \((3 - 1)(3 + 1) = 2 \cdot 4 \equiv 0\) with neither factor zero.
In particular over any field, and over \(\mathbb{Z}/p\mathbb{Z}\). Lemma 2 on the Primitive Roots page proves it mod \(p\) by exactly this argument, invoking Euclid’s Lemma at the step where \(d - c\) is cancelled.
Dividing by \(g\) means cancelling its leading coefficient. In \(\mathbb{Z}[x]\), \(x^2\) cannot be divided by \(2x\) with a remainder of degree below \(1\): the \(x^2\) coefficient of \(x^2 - 2x \cdot q(x)\) is \(1\) minus an even number, never \(0\).
Over a field every non-zero leading coefficient is a unit, so the division algorithm always works. Over any ring it works when the divisor is monic.
\(\deg(pq) = \deg p + \deg q\) needs the product of the leading coefficients to be non-zero. Over \(\mathbb{Z}/4\mathbb{Z}\) it is not:
A polynomial of degree \(1\) has an inverse. Over an integral domain that cannot happen: \(pq = 1\) forces \(\deg p + \deg q = 0\), so the units of \(R[x]\) are just the units of \(R\).
An ideal of a commutative ring \(R\) is an additive subgroup \(I\) that absorbs multiplication: \(a \in I\) and \(r \in R\) give \(ra \in I\).
The multiples of \(n\) form the ideal \(n\mathbb{Z}\). In general the multiples of one element \(a\) form the ideal \((a) = \{ra : r \in R\}\), the ideal generated by \(a\).
The cosets \(a + I\) form a ring \(R/I\) under
Absorption is exactly what makes the product well defined. If \(a_2 = a + i\) and \(b_2 = b + j\) with \(i, j \in I\), then \(a_2 b_2 = ab + aj + ib + ij\), and the last three terms lie in \(I\) — so the answer does not depend on the representatives.
A normal subgroup is what a quotient group needs; an ideal is what a quotient ring needs. The groups page built \(\mathbb{Z}/n\mathbb{Z}\) as a quotient group under addition. That the multiplication descends as well is the statement that \(n\mathbb{Z}\) is an ideal — which is the number theory page’s fact that congruence respects products.
Let \(I \neq \{0\}\), and let \(n\) be its least positive element. For \(a \in I\), divide: \(a = qn + r\) with \(0 \leq r \lt n\). Then \(r = a - qn\) lies in \(I\), so \(r = 0\) by the minimality of \(n\), and \(a\) is a multiple of \(n\). An integral domain in which every ideal is generated by one element is a principal ideal domain.
Replace size by degree and the proof works in \(F[x]\) for any field \(F\). The Minimal Polynomial page proves that \(m_A\) divides every polynomial with \(p(A) = 0\) by dividing and showing the remainder is zero — which says the polynomials annihilating \(A\) form an ideal, generated by its monic element of least degree.
And a field has only two ideals, \(\{0\}\) and itself: an ideal containing a unit \(u\) contains \(u^{-1}u = 1\), hence everything.
A map \(\varphi : R \to S\) with \(\varphi(a + b) = \varphi(a) + \varphi(b)\), \(\varphi(ab) = \varphi(a)\varphi(b)\) and \(\varphi(1) = 1\). Its kernel is an ideal, and the First Isomorphism Theorem holds in the same form as for groups: \(R / \ker\varphi \cong \operatorname{im}\varphi\).
Evaluation at \(c\), sending \(f \mapsto f(c)\), is a ring homomorphism \(F[x] \to F\). Its kernel is the polynomials with \(f(c) = 0\), and the Factor Theorem says those are exactly the multiples of \(x - c\). So the kernel is the ideal \((x - c)\), evaluation is onto, and \(F[x]/(x - c) \cong F\).
If \(\gcd(m, n) = 1\), then
where the ring on the right adds and multiplies pairs componentwise. The map respects both operations because reduction does. Its kernel is the multiples of both \(m\) and \(n\), which for coprime \(m, n\) are the multiples of \(mn\), so it is injective; both sides have \(mn\) elements, so it is a bijection. That bijection is the existence and uniqueness that the number theory page states.
An isomorphism matches units with units, and a pair is a unit exactly when both entries are. So \(\varphi(mn) = \varphi(m)\varphi(n)\) — the multiplicativity of the totient, whose proof restricts the CRT bijection to units.
It also explains the four roots of \(t^2 = 1\) mod \(15\). Since \(\mathbb{Z}/15 \cong \mathbb{Z}/3 \times \mathbb{Z}/5\), and each factor is a field with the two roots \(\pm 1\), there are \(2 \times 2 = 4\).
\(\mathbb{Z}/4\mathbb{Z}\) is not isomorphic to \(\mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}\). In the product every element satisfies \(a + a = 0\), but in \(\mathbb{Z}/4\), \(1 + 1 = 2 \neq 0\). Testing all \(24\) bijections between the two confirms that none respects both operations.
If \(F\) is a field and \(f \in F[x]\) is irreducible — not a product of two polynomials of lower degree — then \(F[x]/(f)\) is a field.
Proof. Every element is represented by a polynomial \(a\) of degree below \(\deg f\). If \(a \neq 0\), then \(\gcd(a, f) = 1\), since \(f\) is irreducible and does not divide \(a\). Polynomial Bézout gives \(sa + tf = 1\), so \(sa = 1\) in the quotient. It is the argument that made \(\mathbb{Z}/p\mathbb{Z}\) a field, with an irreducible polynomial in place of a prime; the Primary Decomposition page uses the same polynomial Bézout identity.
If \(f = gh\) with both of lower degree, then \(g\) and \(h\) are non-zero in \(F[x]/(f)\), but \(gh = f = 0\).
\(x^2 + 1\) has no real root, so it is irreducible over \(\mathbb{R}\), and \(\mathbb{R}[x]/(x^2 + 1)\) is a field. Its elements are \(a + bx\), with \(x^2 = -1\), and
That is complex multiplication, with \(x\) playing \(i\). The polynomials page defines \(\mathbb{C}\) as \(\mathbb{R}^2\) with a particular multiplication; this construction explains where that multiplication comes from. It is exactly “expand the brackets and replace \(i^2\) by \(-1\)”, because in the quotient \(x^2\) really is \(-1\).
Over \(\mathbb{F}_2 = \mathbb{Z}/2\mathbb{Z}\), \(x^2 + x + 1\) has no root — it is \(1\) at both \(0\) and \(1\) — and a quadratic with no root cannot factor into linear pieces, so it is irreducible. The quotient \(\mathbb{F}_2[x]/(x^2 + x + 1)\) has the four elements \(0, 1, x, x + 1\), with
Every non-zero element is a unit, so it is a field. It is not \(\mathbb{Z}/4\mathbb{Z}\), which has \(2 \cdot 2 = 0\). The explorer’s last three presets are this ring, \(\mathbb{F}_2[x]/(x^2 + 1)\), which is not a field because \(x^2 + 1 = (x + 1)^2\) over \(\mathbb{F}_2\), and \(\mathbb{F}_3[x]/(x^2 + 1)\), a field with nine elements because the squares mod \(3\) are only \(0\) and \(1\).
The characteristic of a ring is the least \(k \geq 1\) with \(1 + 1 + \cdots + 1 = 0\) (\(k\) terms), or \(0\) if there is none. In an integral domain it is \(0\) or a prime: if \(k = ab\) with \(1 \lt a, b \lt k\), the sums of \(a\) ones and of \(b\) ones would be non-zero with product zero.
In characteristic \(p\), \((a + b)^p = a^p + b^p\): the map \(a \mapsto a^p\), called the Frobenius map, is a ring homomorphism. That is the freshman’s dream, proved there from \(p \mid \binom{p}{k}\). On \(\mathbb{Z}/p\mathbb{Z}\) it is the identity, which is Fermat’s \(a^p \equiv a\). On the four-element field it is not: it swaps \(x\) and \(x + 1\). And since \(\mathbb{Z}/4\) has characteristic \(4\) while the four-element field has characteristic \(2\), no isomorphism between them is possible.
\(\mathbb{Z}\) and \(F[x]\) share one feature: division with remainder, by size in one and by degree in the other. From it, the number theory chain runs word for word — the Euclidean algorithm, then Bézout, then Euclid’s Lemma, then unique factorisation. An integral domain with such a division is a Euclidean domain.
In an integral domain, a non-zero non-unit \(p\) is irreducible if \(p = ab\) forces \(a\) or \(b\) to be a unit, and prime if \(p \mid ab\) forces \(p \mid a\) or \(p \mid b\).
Every prime is irreducible. In a Euclidean domain every irreducible is prime too — that is Euclid’s Lemma — and it is what makes factorisation unique. The Euclid’s Lemma page makes the same point: in modern algebra its property is the definition of a prime, and “no divisors” is demoted to irreducible.
The number theory page notes that among numbers \(a + b\sqrt{-5}\), \(6\) factors two ways:
The norm \(N(a + b\sqrt{-5}) = a^2 + 5b^2\) is multiplicative, and \(N(2) = 4\), \(N(3) = 9\), \(N(1 \pm \sqrt{-5}) = 6\). No element has norm \(2\) or \(3\), since \(a^2 + 5b^2\) never equals either. So \(2\) is irreducible: a factorisation into non-units would need two factors of norm \(2\). The only units are \(\pm 1\), the elements of norm \(1\), so the two factorisations really are different.
But \(2\) is not prime: it divides \((1 + \sqrt{-5})(1 - \sqrt{-5}) = 6\) and divides neither factor, since \(\frac{1 \pm \sqrt{-5}}{2}\) is not in the ring. An irreducible that is not prime is exactly how uniqueness breaks — and it shows \(\mathbb{Z}[\sqrt{-5}]\) has no division algorithm of the Euclidean kind.
Go back over the site with the new vocabulary, and results proved separately turn out to be the same few facts:
| Result on the site | As ring theory |
|---|---|
| Cancel \(c\) mod \(n\) only when \(\gcd(c, n) = 1\) | \(c\) must not be a zero divisor |
| Every non-zero residue mod \(p\) is invertible | \(\mathbb{Z}/p\mathbb{Z}\) has no zero divisors, by Euclid’s Lemma, so it is a finite integral domain, hence a field |
| At most \(n\) roots mod \(p\), in Primitive Roots | The root bound over any integral domain |
| The Factor Theorem | The kernel of evaluation at \(c\) is the ideal \((x - c)\) |
| The Chinese Remainder Theorem and the multiplicativity of \(\varphi\) | \(\mathbb{Z}/mn \cong \mathbb{Z}/m \times \mathbb{Z}/n\), and its units |
| The freshman’s dream mod \(p\) | Frobenius is a ring homomorphism in characteristic \(p\) |
| \(\mathbb{C}\) as \(\mathbb{R}^2\) with a special multiplication | \(\mathbb{R}[x]/(x^2 + 1)\) |
| Euclid’s Lemma and unique factorisation | \(\mathbb{Z}\) is a Euclidean domain, and so is \(F[x]\) |
\(\mathbb{Z}/p\mathbb{Z}\) is a field and \(F[x]/(f)\) is a field for the same reason: in a Euclidean domain, an element coprime to the modulus has a Bézout inverse, and a prime or an irreducible polynomial is coprime to everything it does not divide. The number theory and the polynomial algebra were one piece of mathematics, done twice.
The second Tier 5 unit, continuing abstract algebra from Groups. As there, most of what this page says, the number theory and polynomial units had already proved in concrete form.
| Concept | Statement | Already on this site as |
|---|---|---|
| Ring | abelian group under \(+\), associative distributive \(\cdot\) with \(1\) | \(\mathbb{Z}\), \(\mathbb{Z}/n\mathbb{Z}\), polynomials, matrices |
| Unit | \(ab = 1\) for some \(b\) | invertible residue; \(\gcd(a, n) = 1\) |
| Zero divisor | \(a \neq 0\), \(ab = 0\) for some \(b \neq 0\) | why cancellation mod \(n\) fails |
| Integral domain | no zero divisors, \(1 \neq 0\) | \(\mathbb{Z}\); Euclid’s Lemma for \(\mathbb{Z}/p\mathbb{Z}\) |
| Field | every non-zero element a unit | \(\mathbb{Q}\), \(\mathbb{R}\), \(\mathbb{C}\), \(\mathbb{Z}/p\mathbb{Z}\) |
| Ideal | additive subgroup with \(ra \in I\) | \(n\mathbb{Z}\); annihilating polynomials |
| Quotient ring | \(R/I\), cosets \(a + I\) | \(\mathbb{Z}/n\mathbb{Z}\) |
| Chinese Remainder Theorem | \(\mathbb{Z}/mn \cong \mathbb{Z}/m \times \mathbb{Z}/n\), \(\gcd(m, n) = 1\) | \(\varphi(mn) = \varphi(m)\varphi(n)\) |
| Field from a polynomial | \(F[x]/(f)\), \(f\) irreducible | \(\mathbb{C} \cong \mathbb{R}[x]/(x^2 + 1)\) |
| Characteristic \(p\) | \((a + b)^p = a^p + b^p\) | the freshman’s dream |
| Prime element | \(p \mid ab \Rightarrow p \mid a\) or \(p \mid b\) | Euclid’s Lemma |