DISCRETE MATH • RELATIONS AND DISCRETE STRUCTURES

Equivalence relations and partitions

How reflexivity, symmetry, and transitivity carve a set into non-overlapping classes that perfectly reassemble the whole.

Historical Context & Motivation

The idea that mathematical objects can be grouped by shared properties is far older than the formal language of set theory. Ancient Greek mathematicians implicitly partitioned integers into even and odd, while Gauss's 1801 Disquisitiones Arithmeticae built the entire theory of modular arithmetic on the notion that two integers are 'alike' when they leave the same remainder upon division. Yet the abstract framework that unifies all such constructions—equivalence relations and their corresponding partitions—crystallized only in the late nineteenth and early twentieth centuries as set theory matured.

1801
Gauss's Congruence Classes
Carl Friedrich Gauss publishes Disquisitiones Arithmeticae, formalizing congruence modulo n and demonstrating that integers sharing a remainder form well-defined classes—an early prototype of equivalence classes.
1872
Dedekind's Ideal Theory
Richard Dedekind introduces ideals in algebraic number theory, implicitly using quotient structures that rely on partitioning a ring into cosets—anticipating the formal equivalence-relation framework.
1895
Cantor's Set Theory Foundations
Georg Cantor's set-theoretic framework provides the language of sets, subsets, and relations needed to state the three defining axioms of equivalence relations precisely.
1927
Formal Axiomatization
The properties of reflexivity, symmetry, and transitivity are codified as the standard axioms for equivalence relations in emerging algebra textbooks, notably by B.L. van der Waerden and Emmy Noether's school.
1940s
The Fundamental Theorem
The bijective correspondence between equivalence relations on a set and partitions of that set becomes a standard theorem in abstract algebra and topology, unifying disparate classification schemes across mathematics.

The central question that equivalence relations address is deceptively simple: given a set of objects, how can we rigorously define what it means for two objects to be 'the same in some respect,' and how does such a definition automatically slice the set into non-overlapping groups? Understanding this correspondence is essential not only for algebra and number theory but also for computer science (e.g., type checking and union-find data structures), logic, and combinatorics.

Core Principles & Definitions

An equivalence relation on a set S is a binary relation ∼ ⊆ S × S that satisfies three axioms, each of which mirrors a basic intuition about what 'sameness' should mean. Together, these axioms guarantee that ∼ behaves like equality in the relevant respect, even though the objects being related may differ in other ways. Meanwhile, a partition of S is a collection of non-empty, pairwise disjoint subsets whose union equals S. The deep insight is that these two notions—an algebraic property of a relation and a set-theoretic decomposition—are two perspectives on exactly the same structure.

1

Reflexivity

For every element a ∈ S, we require a ∼ a. Every element is related to itself—no object can fail to belong to its own class.
2

Symmetry

If a ∼ b, then b ∼ a. The relation is bidirectional: 'sameness' is a mutual relationship, not a one-way comparison.
3

Transitivity

If a ∼ b and b ∼ c, then a ∼ c. Chains of relatedness collapse: if a is like b and b is like c, then a is like c directly.
4

Equivalence Class [a]

The equivalence class of a is the set [a] = {x ∈ S : x ∼ a}. It collects every element that is related to a under ∼.
5

Partition

A partition of S is a family {A_i} of non-empty subsets satisfying: (i) ∪ A_i = S, and (ii) A_i ∩ A_j = ∅ for i ≠ j. Every element belongs to exactly one block.
KEY TAKEAWAY
Think of an equivalence relation as a sorting rule at a mail distribution center. Every package (element) must go into exactly one bin (equivalence class). Reflexivity ensures no package is left on the floor; symmetry means if package A belongs in the same bin as package B, then B belongs with A; transitivity guarantees the sorting is consistent—if A matches B and B matches C, all three share a bin. The resulting arrangement of bins, with every package accounted for and no package in two bins at once, is precisely a partition.

Visual Explanation

The following diagram illustrates the correspondence between an equivalence relation on a six-element set S = {1, 2, 3, 4, 5, 6} and the partition it induces. On the left, the relation is depicted as a directed graph (with bidirectional arrows representing symmetry and self-loops representing reflexivity). On the right, the same set is shown decomposed into three equivalence classes, visually confirming that the classes are disjoint and exhaustive.

Left: the equivalence relation on S = {1, 2, 3, 4, 5, 6} shown as a graph with self-loops (reflexivity) and bidirectional edges (symmetry). Cyan edges connect 1 and 4; violet edges connect 2, 5, and 6 (note the transitive closure); 3 stands alone. Right: the three equivalence classes [1] = {1, 4}, [2] = {2, 5, 6}, and [3] = {3} form a partition—disjoint, non-empty, and collectively exhausting S.

Observe several critical features in the diagram. First, every node has a self-loop, confirming reflexivity. Second, every edge is bidirectional, reflecting symmetry. Third, within the violet cluster, the edges among 2, 5, and 6 form a complete subgraph (a clique), which is exactly the graphical signature of transitivity. In fact, the connected components of the relation graph (ignoring self-loops) correspond precisely to the blocks of the partition on the right. This is no coincidence; it is a consequence of the fundamental theorem that we will state formally in Section 4.

Mathematical Framework

We now state the three axioms formally and develop the key theorem that equivalence relations and partitions are two sides of the same coin. Let S be a non-empty set and let ∼ be a binary relation on S, i.e., a subset of S × S.

REFLEXIVITY
∀ a ∈ S : a ∼ a
Every element is related to itself. In the relation matrix, this means the main diagonal consists entirely of 1s.
SYMMETRY
∀ a, b ∈ S : a ∼ b ⟹ b ∼ a
The relation is its own inverse. In the relation matrix, M is symmetric: M[i][j] = M[j][i].
TRANSITIVITY
∀ a, b, c ∈ S : (a ∼ b ∧ b ∼ c) ⟹ a ∼ c
Relatedness propagates through chains. Combined with symmetry, this guarantees that equivalence classes are internally 'fully connected.'

The Fundamental Theorem

The Fundamental Theorem of Equivalence Relations establishes a bijection between equivalence relations on S and partitions of S. Specifically, if ∼ is an equivalence relation on S, then the set of equivalence classes S/∼ = {[a] : a ∈ S} is a partition of S. Conversely, if 𝒫 = {Ai} is a partition of S, then the relation defined by a ∼ b if and only if a and b belong to the same block Ai is an equivalence relation on S. Moreover, these two constructions are inverses of each other.

EQUIVALENCE CLASS
[a] = { x ∈ S : x ∼ a }
The class [a] is the block of the partition containing a. A critical lemma: [a] = [b] if and only if a ∼ b, and [a] ∩ [b] = ∅ otherwise.
📐 Proof Sketch: Classes Are Disjoint or Identical
Suppose [a] ∩ [b] ≠ ∅, and let c ∈ [a] ∩ [b]. Then c ∼ a and c ∼ b. By symmetry, a ∼ c, and by transitivity, a ∼ b. Now take any x ∈ [a]; we have x ∼ a and a ∼ b, so x ∼ b by transitivity, giving x ∈ [b]. By symmetric argument, [b] ⊆ [a]. Hence [a] = [b]. This shows any two classes are either identical or disjoint—exactly the partition property.

Detailed Breakdown: Congruence Modulo n

The most classical example of an equivalence relation is congruence modulo n, defined on the integers ℤ. For a fixed positive integer n, we say a ≡ b (mod n) if and only if n divides (a − b). This relation satisfies all three axioms: reflexivity (n | 0), symmetry (if n | (a − b) then n | (b − a)), and transitivity (if n | (a − b) and n | (b − c), then n | (a − c) by adding). The equivalence classes are the residue classes [0], [1], …, [n − 1], and they form the partition of ℤ into n infinite subsets. Below, we visualize the partition of integers under congruence modulo 3.

The number line is color-coded by residue class: cyan for [0], violet for [1], and amber for [2]. Below the line, each class is displayed as an infinite set. Together the three classes partition ℤ—every integer appears in exactly one class.

This example generalizes broadly. Any time you encounter a mathematical construction that groups objects by a shared feature—triangles by similarity, matrices by rank, integers by divisibility pattern—you are almost certainly looking at an equivalence relation in disguise. The partition perspective is equally useful: it tells you that the number of distinct 'types' under a given classification equals the number of equivalence classes, a quantity often denoted |S/∼| and called the index of the equivalence relation.

Common examples of equivalence relations and the partitions they induce.
Example RelationSet SEquivalence Classes
a ≡ b (mod 4)[0], [1], [2], [3] (index = 4)
Same absolute value: |a| = |b|{0}, {−1, 1}, {−2, 2}, … (index = ∞)
Same cardinality: |A| = |B|𝒫(S) (power set)Subsets grouped by size
Similarity of trianglesSet of all trianglesEach class = all triangles with given angle triple

Worked Example

Let S = {a, b, c, d, e} and define the relation R = {(a,a), (b,b), (c,c), (d,d), (e,e), (a,b), (b,a), (d,e), (e,d)}. Determine whether R is an equivalence relation, and if so, find the equivalence classes and the corresponding partition.

Classifying a Relation on a Five-Element Set
1
Step 1 — Check ReflexivityWe need (x, x) ∈ R for every x ∈ S. Inspecting R: (a,a) ✓, (b,b) ✓, (c,c) ✓, (d,d) ✓, (e,e) ✓. All five diagonal pairs are present.
Reflexivity: satisfied ✓
2
Step 2 — Check SymmetryFor every (x, y) ∈ R with x ≠ y, we need (y, x) ∈ R. The non-diagonal pairs are (a,b) and (b,a), and (d,e) and (e,d). Each pair has its reverse present in R.
Symmetry: satisfied ✓
3
Step 3 — Check TransitivityWe examine all chains (x, y) and (y, z) in R. The relevant non-trivial chains are: (a,b) and (b,a) → need (a,a) ✓ (present). (b,a) and (a,b) → need (b,b) ✓. (d,e) and (e,d) → need (d,d) ✓. (e,d) and (d,e) → need (e,e) ✓. No other non-trivial chains exist because the clusters {a,b} and {d,e} are disjoint and c relates only to itself.
Transitivity: satisfied ✓
4
Step 4 — Identify Equivalence ClassesSince R is an equivalence relation, we compute the classes: [a] = {x ∈ S : (x, a) ∈ R} = {a, b}. [b] = {a, b} (same class). [c] = {c}. [d] = {d, e}. [e] = {d, e}.
Equivalence classes: {a, b}, {c}, {d, e}
5
Step 5 — State the PartitionThe partition is 𝒫 = { {a, b}, {c}, {d, e} }. Verification: the blocks are non-empty, pairwise disjoint, and their union {a,b} ∪ {c} ∪ {d,e} = {a,b,c,d,e} = S.
Partition: 𝒫 = { {a, b}, {c}, {d, e} }

Equivalence vs. Other Relations

Equivalence relations occupy a specific niche among binary relations. Students often confuse them with partial orders or with relations that satisfy only two of the three axioms. The following table contrasts equivalence relations with several common relation types to clarify where they differ and what structural consequences follow.

Comparison of equivalence relations with partial orders and preorders.
PropertyEquivalence RelationPartial OrderPreorder
Reflexive✓ Required✓ Required✓ Required
Symmetric✓ Required✗ Not in general✗ Not in general
Antisymmetric✗ (only for singletons)✓ Required✗ Not in general
Transitive✓ Required✓ Required✓ Required
Structural resultPartition of the setHasse diagram / latticeDirected acyclic structure (modulo equivalence)

A crucial distinction is that partial orders use antisymmetry (if a ≤ b and b ≤ a then a = b) in place of symmetry. This makes partial orders suitable for hierarchical structures such as divisibility on the natural numbers or subset inclusion on a power set, whereas equivalence relations model flat, non-hierarchical groupings. Meanwhile, a preorder is reflexive and transitive but neither symmetric nor antisymmetric in general. Interestingly, every preorder naturally induces an equivalence relation—define a ∼ b when both a ≤ b and b ≤ a—and the quotient set under this equivalence becomes a partial order.

KEY TAKEAWAY
If you think of relations as lenses through which you view a set, an equivalence relation is a 'grouping lens' that clusters elements into peer groups of equals. A partial order is a 'ranking lens' that arranges elements into a hierarchy. The choice of lens depends on whether your goal is classification (use equivalence relations) or comparison (use partial orders). Many powerful results in algebra, such as the First Isomorphism Theorem, arise from combining both perspectives.

Connections to Advanced Theory

Equivalence relations and partitions serve as the launching point for several deep ideas in abstract algebra, topology, and theoretical computer science. The quotient set S/∼ is not merely a collection of subsets; when S carries algebraic structure (group, ring, vector space), the quotient often inherits that structure, yielding quotient groups, quotient rings, and quotient spaces. This construction is formalized through the notion of a congruence relation—an equivalence relation that is also compatible with the algebraic operations.

How the concepts in this lesson generalize to advanced settings.
Concept in This LessonAdvanced GeneralizationWhere It Appears
Equivalence class [a]Coset aH in group theoryQuotient groups G/H, Lagrange's theorem
Partition of a setQuotient topology on X/∼Identification spaces, CW complexes
Index |S/∼|Index of a subgroup [G : H]Lagrange's theorem, orbit-counting
Congruence mod nKernel of a ring homomorphismFirst Isomorphism Theorem for rings
Union-find (disjoint sets)Partition refinement algorithmsKruskal's MST, automata minimization

In computer science, the union-find (disjoint-set) data structure maintains a partition of a finite set under two operations: find(x) returns the representative of the equivalence class containing x, and union(x, y) merges the classes of x and y. With path compression and union by rank, this structure supports nearly-constant-time operations, making it indispensable in algorithms for minimum spanning trees (Kruskal's algorithm), connected components in graphs, and DFA minimization. Mastering the equivalence-relation/partition duality gives you the conceptual foundation for all of these applications.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain why the relation 'a divides b' (written a | b) on the set of positive integers ℤ⁺ is not an equivalence relation. Which of the three axioms does it violate? Provide a specific counterexample for each violated axiom.
PROBLEM 2BASIC CALCULATION
Let S = {1, 2, 3, 4, 5, 6, 7, 8} and define the relation a ∼ b if and only if a ≡ b (mod 3). List all equivalence classes and state the partition. How many classes are there?
PROBLEM 3INTERMEDIATE
On ℤ × ℤ (ordered pairs of integers), define (a, b) ∼ (c, d) if and only if a + d = b + c. Prove that ∼ is an equivalence relation and describe what each equivalence class looks like geometrically.
PROBLEM 4APPLIED
A compiler uses a union-find data structure to track type equivalence. Initially, five type variables {T₁, T₂, T₃, T₄, T₅} are each in their own singleton class. The type-checker then processes the constraints T₁ = T₃, T₂ = T₅, and T₃ = T₅ (here = denotes type equality). After processing all three constraints, how many equivalence classes remain? List the classes. Explain why transitivity is essential for the compiler's correctness.
PROBLEM 5CRITICAL THINKING
Prove that the number of equivalence relations on a finite set with n elements equals the Bell number B(n). Specifically, establish the bijection and compute B(4) by enumerating all partitions of {1, 2, 3, 4}.

Lesson Summary

An equivalence relation on a set S is a binary relation satisfying three axioms: reflexivity (every element relates to itself), symmetry (if a ∼ b then b ∼ a), and transitivity (if a ∼ b and b ∼ c then a ∼ c). Each equivalence relation gives rise to equivalence classes [a] = {x ∈ S : x ∼ a}, and the collection of all classes forms a partition of S—a family of non-empty, pairwise disjoint subsets whose union is S.

The Fundamental Theorem establishes a bijection between equivalence relations on S and partitions of S, meaning every partition defines exactly one equivalence relation and vice versa. The canonical example is congruence modulo n, which partitions ℤ into n residue classes. This framework extends to quotient structures in algebra (quotient groups, quotient rings), identification spaces in topology, and the union-find data structure in computer science, making it one of the most versatile constructions in all of mathematics.

Varsity Tutors • Discrete Math • Equivalence relations and partitions