Path: blob/main/foundations/01-modular-arithmetic-groups/sage/01c-groups-first-look.ipynb
483 views
Groups: A First Look
Module 01c | Modular Arithmetic and Groups
Two completely different operations, one shared structure. Welcome to abstract algebra.
Question: under addition has 7 elements and every equation has a solution. under multiplication has 6 elements and every equation has a solution. These are completely different operations, but they share the same deep structure. What IS that structure?
Objectives
By the end of this notebook you will be able to:
State the four group axioms (closure, associativity, identity, inverses)
Verify group axioms for and
Distinguish groups from non-groups using a concrete failed axiom
Explain why prime moduli give the largest multiplicative groups
From Arithmetic to Algebra
In 01b we discovered that has two interesting subsets:
All elements under addition
Units under multiplication
Both let you combine elements and undo the operation. Let's extract the common pattern, this is where abstract algebra begins.
Spotting the Pattern
Let's check the same four properties for two very different systems: and .
Two different operations, same four properties:
| Property | ||
|---|---|---|
| Closure | ||
| Identity | ||
| Inverses | ||
| Associativity |
A set + an operation + these four properties = a group.
The Four Axioms, Concretely
A group is a set with a binary operation satisfying:
Closure: for all
Associativity:
Identity: There exists with for all
Inverses: For every , there exists with
Checkpoint: In , what is the identity element? What is the inverse of 3? Predict before running:
A Non-Example: When Axioms Fail
Is , all of under multiplication, a group?
Not a group! Elements 2, 3, and 4 have no multiplicative inverses. The inverse axiom fails.
But if we restrict to just the units , we get , and this IS a group (albeit a tiny one with just 2 elements).
Additive vs. Multiplicative Groups
Here's the key insight:
Key facts:
is ALWAYS a group, for any . It has elements.
is a group of the units.
When is prime, has the maximum elements.
Prime moduli give us the biggest, cleanest multiplicative groups. This is why cryptography loves primes.
Common mistake: "A group is just a set of numbers." No! A group is a set together with an operation. The same set forms a group under multiplication mod 7, but NOT under multiplication mod 12 (because knocks you out of the set). Always specify both the set and the operation.
Exercises
Exercise 1 (Worked)
Verify all 4 axioms for .
Exercise 2 (Guided)
Check whether under multiplication mod 7 is a group. Verify each axiom.
Exercise 3 (Independent)
Investigate the set under addition mod 12.
Is this a group? If yes, verify each axiom. If no, identify which axiom fails.
Hint: What is this set really? Try computing in .
Summary
| Concept | Key idea |
|---|---|
| Group | A set + an operation satisfying closure, associativity, identity, and inverses |
| Always a group, for any | |
| A group of the units (elements coprime to ) | |
| Prime moduli | When is prime, has the maximum elements |
| Non-examples | Checking where axioms fail (like missing inverses) sharpens your understanding |
The group axioms capture the shared structure behind addition and multiplication. Once you see this pattern, you'll recognize it everywhere in cryptography.
Crypto teaser: Diffie-Hellman key exchange works inside . The security depends on this group being large enough that brute force is impossible. In the next notebook, we'll discover that some elements of this group are more powerful than others.
Next: Cyclic Groups and Generators, some elements can regenerate the entire group by themselves.