Skip to content
Part IA Michaelmas, Lent Term

Abstract Algebra: Monoids, Groups, Semirings, and Fields

The Hierarchy of Algebraic Structures

Abstract algebra studies mathematical structures by specifying the operations and properties they must satisfy. Each structure adds more requirements, making it more powerful but more restrictive.

Hierarchy of algebraic structures


Monoids

Definition

A monoid is a triple (S,,e)(S, \bullet, e) where:

  • SS is a set
  • :S×SS\bullet : S \times S \to S is a binary operation (closed)
  • eSe \in S is the identity element

satisfying:

  1. Associativity: (xy)z=x(yz)(x \bullet y) \bullet z = x \bullet (y \bullet z) for all x,y,zSx, y, z \in S
  2. Identity: ex=x=xee \bullet x = x = x \bullet e for all xSx \in S

Examples

MonoidOperationIdentity
(N,+,0)(\mathbb{N}, +, 0)Addition00
(N,×,1)(\mathbb{N}, \times, 1)Multiplication11
(Σ,,ε)(\Sigma^*, \cdot, \varepsilon)String concatenationε\varepsilon
(Rel(A,A),,idA)(\text{Rel}(A, A), \circ, \text{id}_A)Relational compositionidA\text{id}_A
(P(A),,)(\mathcal{P}(A), \cup, \emptyset)Union\emptyset
(P(A),,A)(\mathcal{P}(A), \cap, A)IntersectionAA

Commutative Monoid

A monoid is commutative (or abelian) if xy=yxx \bullet y = y \bullet x for all x,ySx, y \in S.

Examples: (N,+,0)(\mathbb{N}, +, 0), (P(A),,)(\mathcal{P}(A), \cup, \emptyset).

Non-example: (Σ,,ε)(\Sigma^*, \cdot, \varepsilon) is NOT commutative (abbaab \neq ba in general).

Examinable: Endo-Relations Form a Monoid

Theorem: For any set AA, the endo-relations (Rel(A,A),,idA)(\text{Rel}(A, A), \circ, \text{id}_A) form a monoid.

Proof:

  • Closure: Composition of relations R:AAR : A \nrightarrow A and S:AAS : A \nrightarrow A yields SR:AAS \circ R : A \nrightarrow A.
  • Associativity: Already proved: (TS)R=T(SR)(T \circ S) \circ R = T \circ (S \circ R).
  • Identity: idAR=R=RidA\text{id}_A \circ R = R = R \circ \text{id}_A.

Groups

Definition

A group is a monoid (G,,e)(G, \bullet, e) where every element has an inverse.

For each xGx \in G, there exists x1Gx^{-1} \in G such that:

xx1=e=x1xx \bullet x^{-1} = e = x^{-1} \bullet x

Examples

GroupOperationIdentityInverse
(Z,+,0)(\mathbb{Z}, +, 0)Addition00x-x
(Q{0},×,1)(\mathbb{Q} \setminus \{0\}, \times, 1)Multiplication111/x1/x
(Zn,+,0)(\mathbb{Z}_n, +, 0) mod nnAddition mod nn00nxn - x
Symmetric group SnS_nPermutation compositionIdentity permutationInverse permutation

Abelian Group

A group is abelian if the operation is commutative.

Key Property

In a group, equations are always solvable: for any a,bGa, b \in G, there exists a unique xx with ax=ba \bullet x = b (namely x=a1bx = a^{-1} \bullet b).

Non-examples

  • (N,+,0)(\mathbb{N}, +, 0) is NOT a group (no additive inverses)
  • (Z,×,1)(\mathbb{Z}, \times, 1) is NOT a group (most elements lack multiplicative inverses)

Semirings

Definition

A semiring is a structure (S,0,,1,)(S, 0, \oplus, 1, \otimes) where:

  1. (S,0,)(S, 0, \oplus) is a commutative monoid (addition)
  2. (S,1,)(S, 1, \otimes) is a monoid (multiplication)
  3. Distributivity: x(yz)=(xy)(xz)x \otimes (y \oplus z) = (x \otimes y) \oplus (x \otimes z) and (xy)z=(xz)(yz)(x \oplus y) \otimes z = (x \otimes z) \oplus (y \otimes z)
  4. Annihilation: 0x=0=x00 \otimes x = 0 = x \otimes 0

Examples

SemiringAddition \oplusMultiply \otimesZeroOne
(N,+,×)(\mathbb{N}, +, \times)++×\times0011
Boolean semiring B\mathbb{B}\lor (OR)\land (AND)0011
Min-plus (tropical)min\min++\infty00
Max-plusmax\max++-\infty00

The Boolean Semiring

B=({0,1},0,,1,)\mathbb{B} = (\{0, 1\}, 0, \lor, 1, \land)

This is the foundation for:

  • Relational composition via matrix multiplication
  • Reachability in graphs

The Min-Plus Semiring (Tropical)

(R{},,min,0,+)(\mathbb{R} \cup \{\infty\}, \infty, \min, 0, +)

Applications:

  • Shortest path algorithms
  • Dynamic programming optimisation

Boolean vs Min-Plus semiring comparison


Rings

Definition

A ring is a semiring where (S,0,)(S, 0, \oplus) is an abelian group.

Every element has an additive inverse.

Examples

  • (Z,+,×)(\mathbb{Z}, +, \times): integers (additive inverse is negation)
  • (Zn,+,×)(\mathbb{Z}_n, +, \times): integers mod nn
  • Polynomials over Z\mathbb{Z}

Non-example

(N,+,×)(\mathbb{N}, +, \times) is NOT a ring (no additive inverses).


Fields

Definition

A field is a commutative ring where every non-zero element has a multiplicative inverse.

(F,0,+,1,×)(F, 0, +, 1, \times) satisfies:

  1. (F,0,+)(F, 0, +) is an abelian group
  2. (F{0},1,×)(F \setminus \{0\}, 1, \times) is an abelian group
  3. Distributivity holds

Examples

  • Q\mathbb{Q}: rational numbers
  • R\mathbb{R}: real numbers
  • C\mathbb{C}: complex numbers
  • Zp\mathbb{Z}_p: integers mod pp, where pp is prime

Key Theorem

Theorem: Zp\mathbb{Z}_p (integers mod pp) is a field if and only if pp is prime.

Proof:

  • If pp is prime and a≢0(modp)a \not\equiv 0 \pmod{p}, then gcd(a,p)=1\gcd(a, p) = 1.
  • By Bézout’s identity, x,y\exists x, y with ax+py=1ax + py = 1.
  • Thus ax1(modp)ax \equiv 1 \pmod{p}, so aa has a multiplicative inverse.
  • If pp is composite, say p=abp = ab with 1<a,b<p1 < a, b < p, then a,ba, b are zero divisors and cannot have inverses.

Why This Matters for Cryptography

Zp\mathbb{Z}_p being a field is essential for:

  • Diffie-Hellman key exchange: relies on exponentiation in Zp\mathbb{Z}_p^*
  • RSA: requires computing inverses mod φ(n)\varphi(n)

Summary Table

StructureAdditionMultiplicationKey Property
MonoidAssociative + IdentityMinimal structure
GroupInverses existEquations solvable
SemiringCommutative monoidMonoidMatrix multiplication works
RingAbelian groupMonoidCan subtract
FieldAbelian groupAbelian group (except 0)Can divide

Tripos Questions

2016 P2 Q6: Prove that the set of all strings over alphabet {a,b}\{a, b\} under concatenation forms a monoid. Is it a group?

2020 P2 Q9: Show that Zp\mathbb{Z}_p is a field when pp is prime. Explain why ap11(modp)a^{p-1} \equiv 1 \pmod{p} for a≢0(modp)a \not\equiv 0 \pmod{p}.


Summary

  • Monoid: set + operation + identity + associativity
  • Group: monoid + inverses
  • Semiring: two operations, distributivity, additive identity annihilates
  • Ring: semiring + additive inverses
  • Field: ring + multiplicative inverses (except zero)
  • Zp\mathbb{Z}_p is a field iff pp is prime (foundational for cryptography)