Equivalence Relations
What each axiom contributes
The three conditions are not a checklist invented to make proofs longer; each one removes a specific defect. Reflexivity guarantees every element belongs to its own class, so no class comes out empty. Without it, an element that relates to nothing would vanish from the partition and the union of the classes would no longer be the whole set.
Symmetry makes membership mutual: if sits in the class of , then must sit in the class of . This is what lets you speak of a class at all rather than a one-way reachability. Transitivity is the condition that stops classes from half-overlapping. It forces the classes either to coincide completely or to stay disjoint, because a chain of three links either closes into one block or never opens.
Why the three axioms produce a partition
Suppose is an equivalence relation on , pick two elements and , and ask what happens if their classes share a single element . Then and , so by symmetry , and by transitivity . That gives and, by symmetry again, . In other words the two classes contain each other, so they are the same set. Partial overlap is impossible.
Exhaustion is easier: reflexivity puts in for every , so every element lands somewhere. Together, "every element lands somewhere" and "any two classes are equal or disjoint" are exactly the two requirements for a partition, which is why the two ideas â equivalence relations and partitions â are interchangeable descriptions of the same structure.
Counting classes and counting pairs
A partition of a finite set immediately gives you the size of the relation. If the classes have sizes , through , then a pair belongs to precisely when both entries lie in the same class, so each class of size contributes ordered pairs.
For the congruence mod 4 relation on the four classes each hold 3 elements, giving pairs out of a possible 144. For divisibility by 3 on the integers to , the three classes , , give pairs out of 36. The formula also works backwards: if you know the relation contains 100 pairs and splits into four equal classes, then forces and a set of size 20.
A proof template for exam answers
A complete proof of an equivalence relation runs in three labelled steps, each using arbitrary elements rather than chosen numbers. Begin with "Let be any element of " and show using the definition. Then write "Let " and show . Finally take and , apply the definition twice to obtain a relation between and , and conclude .
The common failure is substituting a number such as for a generic element; that proves only one instance. A second failure is using symmetry before you have established it, since the steps must be justified in the order reflexivity, symmetry, transitivity. When the definition involves divisibility, translate the condition into an equation such as before combining two hypotheses, because algebra on integers is where the transitivity argument actually happens.
Candidate relations that fail an axiom
Isolating the failing axiom builds the right intuition. The relation written as for less than on the integers fails reflexivity immediately, since no integer is strictly less than itself, and it fails symmetry too, so only transitivity survives. The relation at most 1 on the set is reflexive and symmetric but breaks transitivity: is related to , and is related to , yet and differ by 2 and are not related.
Sharing a common factor greater than 1 shows how one element can spoil reflexivity: on any set containing the number 1, the value means the relation is not reflexive at that element. It also fails transitivity in general, because 4 shares a factor with 6 and 6 shares a factor with 9, while 4 and 9 share none. Working through these three cases tells you which axiom to test first when a problem asks whether a proposed relation qualifies.
Checking axioms and extracting classes in Python
The three axioms translate directly into three Boolean expressions over a set of pairs, and returning them as a tuple makes the failing condition visible at a glance.
def axioms(pairs, universe):
refl = all((a, a) in pairs for a in universe)
sym = all((b, a) in pairs for (a, b) in pairs)
trans = all((a, c) in pairs
for (a, b) in pairs
for (b2, c) in pairs if b == b2)
return refl, sym, trans
Z6 = set(range(6))
mod3 = {(a, b) for a in Z6 for b in Z6 if (a - b) % 3 == 0}
near = {(a, b) for a in Z6 for b in Z6 if abs(a - b) <= 1}
print("mod 3:", axioms(mod3, Z6)) # mod 3: (True, True, True)
print("within 1:", axioms(near, Z6)) # within 1: (True, True, False)
Once the axioms hold, extracting the classes is a grouping pass: walk the elements in order, pull out every member that relates to the current one, and remove them from the pool so each class is produced exactly once.
def blocks(rule, items):
remaining, out = set(items), []
while remaining:
a = min(remaining)
block = frozenset(b for b in remaining if rule(a, b))
out.append(sorted(block))
remaining -= block
return out
mod4 = blocks(lambda a, b: (a - b) % 4 == 0, range(1, 13))
for block in mod4:
print(block)
# [1, 5, 9]
# [2, 6, 10]
# [3, 7, 11]
# [4, 8, 12]
print("classes:", len(mod4), "sizes:", [len(b) for b in mod4])
print("pairs:", sum(len(b) ** 2 for b in mod4)) # pairs: 36
Equivalence relations you have already met
Congruence modulo is the textbook example, but three others appear constantly. Parallelism of lines in a plane, counting a line as parallel to itself, splits all lines into direction classes: every line belongs to exactly one direction. Two fractions are related when cross-multiplication gives equal products, which merges , and into a single class â the rational numbers are built precisely by quotienting in this way.
Row equivalence under elementary row operations is the fourth, and it is what makes the rank of a matrix well defined: any two row-echelon forms of the same matrix share the same non-zero row count because they sit in the same class. The reverse construction also works. Given any partition of a set â students grouped by section, integers grouped by remainder, strings grouped by first letter â declaring two elements related exactly when they land in the same block produces an equivalence relation, with no further verification needed.
Key Takeaways
- Reflexivity keeps classes non-empty, symmetry makes membership mutual, and transitivity is what forces two classes to be either identical or completely disjoint.
- An equivalence relation and a partition carry the same information, because every relation partitions its set and every partition defines a relation of same-block membership.
- If class sizes are n1 through nk, the relation contains the sum of ni squared ordered pairs, which turns a counting question into simple arithmetic.
- A valid proof uses arbitrary elements in the order reflexivity, symmetry, transitivity, and substituting a concrete number proves only a single instance.
Common Mistakes
Proving transitivity with specific numbers such as checking only whether 0 relates to 2
Fix: Start from arbitrary a R b and b R c, translate the definition into an equation, and derive a R c so the argument covers every pair.
Using symmetry inside the transitivity step before symmetry has been proved
Fix: Keep the order fixed: settle reflexivity first, then symmetry, and only then quote either of them in the third step.
Stopping once three classes have been listed without confirming they cover the whole set
Fix: Check that the class sizes add up to the size of the original set, since a missing element means the relation is not an equivalence.