The astronomical dial of the Prague astronomical clock, a gilded 24-hour ring around an inner dial with hands, mounted on the stone tower of the Old Town Hall
Unit 07 · All masterclasses · 75 min

Rings and Fields

Clock arithmetic made precise, and the two structures with two operations
Image: Andrew Shiva (Godot13), via Wikimedia Commons, CC BY-SA 4.0

Congruence modulo n and the ring of residue classes, the ring axioms with their first examples and consequences, zero divisors and invertible elements, the extended Euclidean algorithm, fields and the theorem that the integers modulo n form a field exactly when n is prime, the field of numbers a + b times the square root of 2, Fermat's little theorem from a group argument, and check digits. The closing section looks at recurrences that divide at every step and still produce integers.

Preview: the beginning of the unit

A clock that shows 9 o’clock will show 2 o’clock five hours later, and nobody minds that \(9 + 5\) is 14. The clock has thrown away a multiple of 12, and an arithmetic that throws away every multiple of a fixed number turns out to be a complete system of numbers in its own right, with an addition and a multiplication that obey almost every law of Unit 1. This unit makes that system precise, asks which of the familiar laws survive in it, and uses the answer to define the two structures with two operations on which the rest of algebra is built, which are the ring and the field. On the way it explains why \(2 \cdot 3 = 0\) can happen modulo 6 and never modulo 7, and why Fermat’s little theorem is a statement about a group.

1 Congruence and residue classes

Fix a positive integer \(n\), called the modulus. Two integers \(a\) and \(b\) are congruent modulo \(n\), written \[ a \equiv b \pmod n , \] when \(n\) divides the difference \(a - b\), that is, when \(a - b = kn\) for some integer \(k\). For example, \(14 \equiv 2 \pmod{12}\) because \(14 - 2 = 12\), and \(20 \equiv 8 \pmod{12}\) because \(20 - 8 = 12\); both are the clock calculations of Figure 1. Negative numbers are included, so \(-1 \equiv 11 \pmod{12}\), since \(-1 - 11 = -12\). Carl Friedrich Gauss (1777-1855) introduced the symbol \(\equiv\) in the opening articles of his book Disquisitiones Arithmeticae (1801) and chose it for its resemblance to the equals sign, because congruence behaves like a weaker kind of equality. An equivalent description is that \(a\) and \(b\) leave the same remainder on division by \(n\). To see this, write \(a = qn + r\) and \(b = q'n + r'\) with remainders \(r\) and \(r'\) between \(0\) and \(n - 1\). Then \(a - b = (q - q')n + (r - r')\) is a multiple of \(n\) exactly when \(r - r'\) is a multiple of \(n\), and since both remainders lie between \(0\) and \(n - 1\), their difference lies strictly between \(-n\) and \(n\), so it is a multiple of \(n\) only when it is \(0\).

Arithmetic modulo 12 on a clock face, with \(0\) at the top in place of 12. On the left, five steps on from 9 land on 2, which is the remainder of \(…
Figure 1. Arithmetic modulo 12 on a clock face, with \(0\) at the top in place of 12. On the left, five steps on from 9 land on 2, which is the remainder of \(14\) on division by 12. On the right, four jumps of five steps starting at 0 pass through 5, 10, and 15, which is 3 on the dial, and land on 8, the remainder of \(20\).

Congruence modulo \(n\) is an equivalence relation in the sense of Unit 1. It is reflexive because \(a - a = 0\) is a multiple of \(n\), symmetric because \(b - a = -(a - b)\) is a multiple of \(n\) whenever \(a - b\) is, and transitive because \(a - c = (a - b) + (b - c)\) is a sum of two multiples of \(n\). Its equivalence classes are called residue classes, and the class of \(a\) is written \([a]\): \[ [a] = \{\, b \in \mathbb{Z} : b \equiv a \pmod n \,\} = \{ \ldots,\ a - 2n,\ a - n,\ a,\ a + n,\ a + 2n,\ \ldots \} . \] There are exactly \(n\) classes, \([0], [1], \ldots, [n - 1]\), one for each possible remainder, and every integer lies in exactly one of them. The set of these \(n\) classes is written \(\mathbb{Z}/n\mathbb{Z}\) and read “\(\mathbb{Z}\) modulo \(n\)”: \(n\mathbb{Z}\) is the set of all multiples of \(n\), which is the class \([0]\), and \(\mathbb{Z}/n\mathbb{Z}\) is the integers with every multiple of \(n\) treated as zero. Many books write \(\mathbb{Z}_n\) for the same set; this program keeps \(\mathbb{Z}/n\mathbb{Z}\), because the same slash notation returns later in algebra for other constructions of the same kind, and \(\mathbb{Z}_p\) has a different meaning in number theory.

The full unit is part of the program

Want to see a complete unit first? Unit 3, Complex Numbers, is free to read.