Path: blob/main/foundations/02-rings-fields-polynomials/sage/02a-what-is-a-ring.ipynb
483 views
What Is a Ring?
Module 02a | Rings, Fields, and Polynomials
Two operations, one structure. The distributive law is the glue that holds a ring together.
Question: In , we know that and . But compute :
A product of two nonzero numbers is zero! In the integers, this never happens. What kind of algebraic structure allows such bizarre behavior? And why should a cryptographer care?
By the end of this notebook, you will know the answer: rings.
Objectives
By the end of this notebook you will be able to:
State the ring axioms and identify the role of each one
Verify the ring axioms concretely for and
Explain why the distributive law is the crucial axiom that connects the two operations
Distinguish rings from non-rings by finding a failed axiom
Articulate the difference between "a group plus multiplication" and an actual ring
Bridge from Module 01
In Module 01, you studied groups, a set with one operation satisfying four axioms (closure, associativity, identity, inverses). You saw groups like and .
But you always worked with one operation at a time. Addition or multiplication, never both together.
Now we add a second operation and study how the two interact. This is a fundamentally new idea: in a group, there is nothing connecting different operations. In a ring, there is, and that connection is the distributive law.
| Structure | Operations | Key idea |
|---|---|---|
| Group | 1 (e.g., ) | Symmetry, inverses |
| Ring | 2 ( and ) | Two operations linked by distributivity |
The Ring Axioms
A ring is a set equipped with two binary operations satisfying:
Addition axioms, is an abelian group:
Closure under :
Associativity of :
Additive identity: there exists with
Additive inverses: for every , there exists with
Commutativity of :
Multiplication axioms, is a monoid: 6. Closure under : 7. Associativity of : 8. Multiplicative identity: there exists with
The glue, the distributive law: 9. Left distributivity: 10. Right distributivity:
Notice: multiplication does not need to be commutative, and elements do not need multiplicative inverses. These are optional upgrades (commutative rings, fields).
Verifying: Is a Ring
The integers under ordinary addition and multiplication form the most fundamental ring. Let's verify each axiom group.
All axioms check out. SageMath already knows is a ring, ZZ in Rings() returns True.
But notice what is missing: most integers have no multiplicative inverse. There is no integer with . This is fine, rings do not require multiplicative inverses.
Verifying: Is a Ring
From Module 01, you know is a group. But also has multiplication. Is it a ring?
Checkpoint: Before running the next cell, predict: what is in ? And does equal when we work mod 12?
Let's do a brute-force check of the distributive law for every triple in :
1,728 triples, zero violations. is indeed a ring.
The Distributive Law: Why It Matters
Out of the 10 axioms, the distributive law is the only one that connects addition and multiplication. Without it, and would just be two unrelated operations living on the same set, like having a bicycle and a piano in the same room. The distributive law is what makes them talk to each other.
Here is a concrete demonstration of its power:
Checkpoint: Using the same style of argument, can you prove that in any ring? The key step uses distributivity: .
The Big Misconception
Common mistake: "A ring is just a group with multiplication added on top." No! If you take an abelian group and slap a multiplication operation onto the same set, you do not automatically get a ring. You need the distributive law: . This is a nontrivial requirement that constrains how can behave relative to .
Think of it this way: there are many possible multiplication operations on , but only those satisfying distributivity (with respect to addition mod 12) produce a ring. The distributive law is what makes the two operations into a system.
To drive this home, let's construct a fake multiplication on that does NOT satisfy the distributive law, proving that distributivity is a real constraint:
A Non-Example: The Natural Numbers
The natural numbers have addition and multiplication, and the distributive law holds. Are they a ring?
Checkpoint: Which ring axiom fails for ? Predict before reading on.
This is instructive: satisfies 9 out of 10 axioms. But one failure is enough, all axioms must hold.
The fix is to "complete" by adding additive inverses: . The integers are the smallest ring containing the natural numbers.
Quick Comparison: Group vs Ring
Let's use SageMath to inspect the structural difference between a group and a ring.
The Anatomy of a Ring, Summarized
Here is the complete picture:
The abelian group gives you addition (with inverses). The monoid gives you multiplication (without requiring inverses). The distributive law is the bridge between them.
Common mistake: "If I know is a group and is a monoid, then must be a ring." Wrong! You also need the distributive law to hold. As we saw with the fake multiplication example, you can have a perfectly good group and a perfectly good monoid on the same set, and still fail to have a ring.
Exercises
Exercise 1 (Worked)
Verify all 10 ring axioms for . For each axiom, show a concrete example.
Exercise 2 (Guided)
Verify the distributive law for by exhaustive computation. Count how many of the triples satisfy .
Exercise 3 (Independent)
Consider the set of integer matrices . SageMath represents this as MatrixSpace(ZZ, 2).
Pick three matrices and verify left distributivity: .
Is multiplication commutative? Find matrices where .
Does SageMath confirm this is a ring?
This is an example of a non-commutative ring, multiplication does not commute, but all ring axioms still hold.
Summary
| Concept | Key idea |
|---|---|
| Ring | A set with two operations ( and ) satisfying ten axioms |
| Abelian group + monoid | must be an abelian group, and must be a monoid (associative with identity) |
| Distributive law | The crucial axiom is the only one involving both operations, making them a coherent system |
| and | Both are rings under ordinary (or modular) addition and multiplication |
| is not a ring | The natural numbers fail the additive inverses axiom, one failure is enough |
| Optional upgrades | Rings do not require multiplicative inverses or commutativity of |
Crypto foreshadowing: AES (the Advanced Encryption Standard) performs all of its operations inside the ring , a quotient of a polynomial ring. In Module 02f, you will build this ring yourself. The distributive law is what makes AES's MixColumns operation work correctly.
Next: Integers Mod n as a Ring, zero divisors, units, and the strange things that happen in that cannot happen in .