Arithmetic you already know
Think about the whole numbers, positive and negative: \(\dots, -2, -1, 0, 1, 2, \dots\) Mathematicians call this set the integers and write it \(\mathbb{Z}\) (from the German Zahlen, "numbers").
With integers you can always add, subtract and multiply, and the answer is still an integer. You can't always divide: \(7 \div 2\) isn't an integer. And the calculations obey rules so familiar that you probably never noticed them:
- Order doesn't matter for adding or multiplying: \(3 + 5 = 5 + 3\) and \(3 \times 5 = 5 \times 3\).
- Brackets don't matter for a chain of additions or multiplications: \((2 \times 3) \times 4 = 2 \times (3 \times 4)\).
- Multiplication spreads over addition: \(3 \times (4 + 5) = 3 \times 4 + 3 \times 5\). This is the rule behind "expanding brackets".
- \(0\) changes nothing when added, and \(1\) changes nothing when multiplied.
- Every number has a negative that cancels it: \(5 + (-5) = 0\).
A ring is any system where you can add, subtract and multiply following these rules. The integers are the model example. The interesting part is how many other systems qualify, and how differently they can behave.
Other worlds, same rules
Arithmetic on a clock
If it's 9 o'clock now, what time will it be in 5 hours? Not 14 o'clock: it's 2 o'clock. On a clock, numbers wrap around. Replace the 12 with a 0, and you get a little world of just twelve numbers, \(0\) to \(11\), where \(9 + 5 = 2\).
Multiplication works too: \(5 \times 5 = 25\), and 25 hours is two full turns plus 1 hour, so on the clock \(5 \times 5 = 1\). This clock world is written \(\mathbb{Z}/12\) and is the subject of Unit 2. It obeys every rule in the list above, yet it has only twelve elements. Strange things happen: \(3 \times 4 = 12 = 0\). Two numbers that aren't zero multiply to give zero.
Even and odd
Forget the actual numbers and keep only whether they're even or odd. You already know how to calculate in this world:
Adding
| + | even | odd |
|---|---|---|
| even | even | odd |
| odd | odd | even |
Multiplying
| × | even | odd |
|---|---|---|
| even | even | even |
| odd | even | odd |
"Even" plays the role of 0 (adding it changes nothing) and "odd" plays the role of 1 (multiplying by it changes nothing). This two-element world is a ring: it's clock arithmetic on a clock with just two positions, \(\mathbb{Z}/2\). It's also how computers work, with 0 and 1.
Polynomials
Expressions like \(3x^2 - x + 5\) can be added and multiplied:
\[ (x + 1)(x - 1) = x^2 - 1, \qquad (2x + 3) + (x^2 - 3) = x^2 + 2x. \]All the usual rules hold. The polynomials with integer coefficients form a ring, written \(\mathbb{Z}[x]\). It contains \(\mathbb{Z}\) as its constant polynomials, but it's much bigger. Unit 4 is all about polynomial rings.
Matrices
Square grids of numbers, like \(2 \times 2\) matrices, can be added entry by entry and multiplied by the row-times-column rule. They obey almost every rule, but with one famous exception: the order of multiplication matters. We'll see an example below.
The number systems
The definition of a ring
Here's the precise version. Don't be put off by the list: every item is a rule you already use without thinking. The point of writing them down is that anything obeying them inherits every consequence we prove from them.
Definition
A ring is a set \(R\) with two operations, addition \(+\) and multiplication \(\cdot\), such that for all \(a, b, c\) in \(R\):
- Addition is associative: \((a + b) + c = a + (b + c)\).
- Addition is commutative: \(a + b = b + a\).
- There is a zero: an element \(0\) with \(a + 0 = a\).
- There are negatives: each \(a\) has an element \(-a\) with \(a + (-a) = 0\).
- Multiplication is associative: \((ab)c = a(bc)\).
- There is a one: an element \(1\) with \(1a = a1 = a\).
- Multiplication distributes over addition: \(a(b + c) = ab + ac\) and \((a + b)c = ac + bc\).
If also \(ab = ba\) for all \(a, b\), the ring is commutative.
Read the list in three chunks:
- Rules 1 to 4: addition behaves just like adding integers. You can add, subtract, and rearrange sums freely. (In the language of group theory, \(R\) is an abelian group under addition.)
- Rules 5 and 6: multiplication can be chained without worrying about brackets, and there's a "do nothing" element. Notice what's missing: no promise that \(ab = ba\), and no promise of division.
- Rule 7: the only link between addition and multiplication. It's the rule that lets you expand brackets, and it does a surprising amount of work.
Subtraction isn't a separate operation: \(a - b\) just means \(a + (-b)\).
A note on conventions
Some books don't require rule 6 (a one), and call the rings that have one "rings with unity". This course follows the more common modern convention: a ring always has a \(1\). Most rings in this course will also be commutative, and we'll say clearly when they aren't.
Examples and non-examples
To check that something is a ring, you need a set, two operations that always give answers inside the set, and all seven rules. One failure is enough to disqualify it.
| Set and operations | Ring? | Why |
|---|---|---|
| Integers \(\mathbb{Z}\) | Yes, commutative | The model example |
| \(\mathbb{Q}\), \(\mathbb{R}\), \(\mathbb{C}\) | Yes, commutative | And you can divide by non-zero elements: fields |
| Clock arithmetic \(\mathbb{Z}/n\) | Yes, commutative | Unit 2 |
| Polynomials \(\mathbb{Z}[x]\), \(\mathbb{R}[x]\) | Yes, commutative | Unit 4 |
| \(2 \times 2\) real matrices | Yes, not commutative | \(AB \ne BA\) in general |
| Functions \(\mathbb{R} \to \mathbb{R}\), added and multiplied point by point | Yes, commutative | \((f+g)(x) = f(x) + g(x)\), \((fg)(x) = f(x)g(x)\) |
| Gaussian integers \(a + bi\), \(a, b \in \mathbb{Z}\) | Yes, commutative | Unit 9 |
| Natural numbers \(\mathbb{N}\) | No | No negatives (rule 4 fails) |
| Even integers | No | No \(1\): nothing even satisfies \(1 \cdot a = a\) for all \(a\) |
| Odd integers | No | \(3 + 5 = 8\) isn't odd: addition leaves the set |
| Vectors in space with the cross product | No | Not associative, and no \(1\) |
| Matrices with determinant 1 | No | \(I + I\) has determinant 4; there's no zero matrix in the set |
Try it. Is the set of all real numbers of the form \(a + b\sqrt{2}\), with \(a, b\) integers, a ring under ordinary addition and multiplication?
Show answer
Yes. The key check is that the operations stay inside the set. Sums: \((a + b\sqrt2) + (c + d\sqrt2) = (a+c) + (b+d)\sqrt2\). Products: \((a + b\sqrt2)(c + d\sqrt2) = (ac + 2bd) + (ad + bc)\sqrt2\), because \(\sqrt2 \cdot \sqrt2 = 2\) is an integer. It contains \(0\) and \(1\), and negatives. The other rules hold automatically, because they hold for all real numbers. This ring is written \(\mathbb{Z}[\sqrt2]\).
Going deeper: a ring made of sets
Take all the subsets of a set, say \(\{1, 2, 3\}\). Define "addition" as the symmetric difference \(A + B\): the elements in exactly one of \(A\) or \(B\). Define "multiplication" as the intersection \(A \cdot B = A \cap B\).
This is a commutative ring! The zero is the empty set (adding it changes nothing), the one is the whole set \(\{1,2,3\}\) (intersecting with it changes nothing), and every set is its own negative, since \(A + A = \varnothing\). Distributivity \(A \cap (B + C) = (A \cap B) + (A \cap C)\) can be checked with a Venn diagram.
Two bizarre facts hold for every element: \(A + A = 0\) and \(A \cdot A = A\). Rings where every element satisfies \(a^2 = a\) are called Boolean rings, after George Boole, and they're the algebra behind logic circuits.
What the rules force
The power of the axioms is that facts proved from them hold in every ring at once: integers, clocks, polynomials, matrices, sets. Here are some facts you've always taken for granted. Now we can see why they're true.
Theorem: basic arithmetic in any ring
For all \(a, b\) in a ring \(R\):
- \(0 \cdot a = 0\) and \(a \cdot 0 = 0\).
- \((-a)\,b = -(ab)\) and \(a\,(-b) = -(ab)\).
- \((-a)(-b) = ab\). In particular, \((-1)(-1) = 1\).
Show proof
1. Since \(0 + 0 = 0\), distributivity gives \(0 \cdot a = (0 + 0)\,a = 0 \cdot a + 0 \cdot a\). Now add \(-(0 \cdot a)\) to both sides: \(0 = 0 \cdot a\). The same argument works on the other side.
2. We want to show \((-a)b\) is the negative of \(ab\), i.e. that they add to zero: \(ab + (-a)b = (a + (-a))\,b = 0 \cdot b = 0\), using distributivity and part 1. Negatives are unique (if \(x + y = 0\) and \(x + z = 0\), then \(y = y + (x + z) = (y + x) + z = z\)), so \((-a)b = -(ab)\).
3. Using part 2 twice: \((-a)(-b) = -(a(-b)) = -(-(ab)) = ab\), since the negative of a negative is the original. ∎
So "minus times minus is plus" isn't a convention that teachers made up. It's forced: any system where addition and multiplication obey the distributive law must have \((-1)(-1) = 1\). If it were \(-1\) instead, expanding brackets would break.
Example: \((a + b)^2\) in a ring
Expanding with distributivity: \((a + b)^2 = (a + b)(a + b) = a^2 + ab + ba + b^2\). The school formula \(a^2 + 2ab + b^2\) needs \(ab = ba\), so it's only true in commutative rings. For matrices it can fail.
Going deeper: the ring where 1 = 0
The axioms don't say that \(0\) and \(1\) are different. What if they're equal? Then for every \(a\): \(a = 1 \cdot a = 0 \cdot a = 0\). So the whole ring is just \(\{0\}\), with \(0 + 0 = 0\) and \(0 \cdot 0 = 0\). This is the zero ring. It satisfies every axiom, but it's so degenerate that most theorems exclude it, and fields are defined to have \(1 \ne 0\).
When order matters
Take two \(2 \times 2\) matrices and multiply them in both orders:
\[ A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, \quad B = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}, \qquad AB = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}, \quad BA = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix}. \]\(AB \ne BA\). Matrices represent actions like rotating, stretching and shearing, and doing two actions in a different order usually gives a different result: putting on socks then shoes isn't the same as shoes then socks. Rings like this are called non-commutative. They're central in physics (quantum mechanics is built on them) and we'll meet another famous one, the quaternions, in Unit 11.
For most of this course we focus on commutative rings, where the theory of factorisation, ideals and fields is richest and most intuitive.
Units and zero divisors
In the integers you can't usually divide. Which elements can you divide by?
Definition
An element \(u\) of a ring is a unit if it has a multiplicative inverse: some \(v\) with \(uv = vu = 1\). Dividing by \(u\) then means multiplying by \(v\).
- In \(\mathbb{Z}\), the only units are \(1\) and \(-1\). You can't divide by 2, because \(2v = 1\) has no integer solution.
- In \(\mathbb{Q}\), \(\mathbb{R}\) and \(\mathbb{C}\), every non-zero element is a unit.
- On the 12-hour clock, \(5\) is a unit, since \(5 \times 5 = 25 = 1\): \(5\) is its own inverse! The units of \(\mathbb{Z}/12\) are \(1, 5, 7, 11\).
- The word "unit" doesn't mean "the number 1": it means "something that behaves like 1 for division purposes". The units of a ring always form a group under multiplication.
Rings can also contain a stranger kind of element:
Definition
A non-zero element \(a\) is a zero divisor if there's a non-zero \(b\) with \(ab = 0\) (or \(ba = 0\)).
In the integers, if \(ab = 0\) then \(a = 0\) or \(b = 0\). That's the fact you use to solve \((x-2)(x-3) = 0\). But on the 12-hour clock, \(3 \times 4 = 0\), and both 3 and 4 are zero divisors. Matrices have them too:
\[ \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}. \]A zero divisor can never be a unit: if \(ab = 0\) with \(b \neq 0\) and \(a\) had an inverse \(v\), then \(b = (va)b = v(ab) = v \cdot 0 = 0\), a contradiction. So units and zero divisors are two opposite kinds of element, and much of ring theory is about telling them apart. In \(\mathbb{Z}/12\) every non-zero element is one or the other, as Unit 2 will show.
Try it. Find all the units of the even/odd ring \(\mathbb{Z}/2\), and of the ring of functions \(\mathbb{R} \to \mathbb{R}\). Does the function ring have zero divisors?
Show answer
In \(\mathbb{Z}/2\), "odd" is the only unit (odd × odd = odd, which is the 1). For functions, \(f\) is a unit exactly when \(f(x) \ne 0\) for every \(x\); then \(1/f\) is its inverse. And yes, there are zero divisors: let \(f(x) = 0\) for \(x \le 0\) and \(f(x) = x\) for \(x > 0\), and let \(g(x) = f(-x)\). Neither is the zero function, but \(f(x)g(x) = 0\) for every \(x\).
Practice set
Mixed questions covering the whole unit. Try each one before opening the answer.
1. On the 12-hour clock, compute \(7 + 8\), \(7 \times 8\) and \(-5\).
Show answer
\(7 + 8 = 15 = 3\). \(7 \times 8 = 56 = 4 \times 12 + 8\), so \(8\). \(-5 = 7\), because \(5 + 7 = 12 = 0\).
2. Use only the ring axioms to prove that \(a \cdot 0 = 0\).
Show answer
\(a \cdot 0 = a\,(0 + 0) = a \cdot 0 + a \cdot 0\) by distributivity. Adding \(-(a \cdot 0)\) to both sides gives \(0 = a \cdot 0\).
3. Using clock arithmetic with 6 hours, consider just \(\{0, 2, 4\}\). Is it a ring? (Look for a "one".)
Show answer
Yes, surprisingly. Sums and products stay in the set: \(2 + 4 = 0\), \(2 \times 2 = 4\), \(4 \times 4 = 16 = 4\), \(2 \times 4 = 8 = 2\). And \(4\) acts as the one: \(4 \times 0 = 0\), \(4 \times 2 = 2\), \(4 \times 4 = 4\). So the "one" of this ring is \(4\), not \(1\). It behaves exactly like the 3-hour clock \(\mathbb{Z}/3\), with \(4\) playing the role of 1 and \(2\) the role of 2.
4. Show that in any ring, \((a - b)(a + b) = a^2 - b^2 + ab - ba\). When does it simplify to \(a^2 - b^2\)?
Show answer
Expand: \((a - b)(a + b) = a^2 + ab - ba - b^2\). It equals \(a^2 - b^2\) exactly when \(ab = ba\), so always in a commutative ring.
5. Is the set of polynomials with integer coefficients and even constant term a ring?
Show answer
No. It's closed under addition, negation and multiplication (the constant term of a product is the product of the constant terms, so even × anything is even). But it doesn't contain \(1\), whose constant term is odd. Sets like this, which absorb multiplication, are called ideals, the star of Unit 6.
6. Which of these are units on the 10-hour clock \(\mathbb{Z}/10\): \(3\), \(4\), \(9\)?
Show answer
\(3\): yes, \(3 \times 7 = 21 = 1\). \(4\): no; every multiple of 4 is even, and on a 10-hour clock even numbers stay even, so \(4v\) can never be 1. In fact \(4 \times 5 = 20 = 0\), so 4 is a zero divisor. \(9\): yes, \(9 \times 9 = 81 = 1\).
Summary and glossary
- A ring is a set where you can add, subtract and multiply, following the familiar rules of integer arithmetic.
- Integers, clock arithmetic, polynomials, matrices, functions and even sets of subsets all form rings.
- Facts proved from the axioms hold in every ring: \(0 \cdot a = 0\) and \((-a)(-b) = ab\) are consequences, not conventions.
- In a commutative ring \(ab = ba\). Matrices show that multiplication need not commute.
- Units can be divided by; zero divisors multiply with something non-zero to give zero. No element is both.
- Ring
- A set with addition and multiplication satisfying the seven axioms.
- Commutative ring
- A ring where \(ab = ba\) for all elements.
- \(\mathbb{Z}\), \(\mathbb{Q}\), \(\mathbb{R}\), \(\mathbb{C}\)
- Integers, rationals (fractions), real numbers, complex numbers.
- \(\mathbb{Z}/n\)
- Clock arithmetic with \(n\) positions.
- Unit
- An element with a multiplicative inverse.
- Zero divisor
- A non-zero element that multiplies with some non-zero element to give 0.
- Field
- A commutative ring with \(1 \ne 0\) in which every non-zero element is a unit.
- Zero ring
- The ring \(\{0\}\), where \(1 = 0\).