← mapSet Theory

Relations & Equivalence

⚗ Dr. Möbius, from the lab

"3<73 < 7." "4=44 = 4." "22 divides 66." These all feel like different kinds of statements, but they're the same damn species of object — a relation, which is nothing but a set of ordered pairs wearing a verb costume. And buried inside the best-behaved relations is one of the most powerful ideas in mathematics: the machine that lets you build new numbers by declaring things equal. That's how fractions get born. That's how number systems get forged. Pay attention — this one matters.

THE BIG IDEA

A relation on A is a subset of A×A, and an equivalence relation (reflexive, symmetric, transitive) carves A into a partition of equivalence classes.

A relation is just a set of pairs

We built ordered pairs and the product A×AA \times A in the last node. Now cash it in. A relation on AA is simply a subset RA×AR \subseteq A \times A. The pairs in RR are the ones that are "related"; the pairs not in RR aren't. We write aRba \mathbin{R} b (read "aa is related to bb") as shorthand for (a,b)R(a, b) \in R.

That's the entire definition, and it's deflating in the best way — I love watching students realize it. The relation "<<" on R\mathbb{R} is the set {(a,b)a<b}\{(a, b) \mid a < b\}. The relation "==" is the set {(a,a)aA}\{(a, a) \mid a \in A\} — the diagonal. "Divides" on Z\mathbb{Z} is {(a,b)a divides b}\{(a, b) \mid a \text{ divides } b\}. Every comparison you've ever made is secretly a subset of a Cartesian product you built two lessons ago. Relations aren't a new kind of thing; they're sets of ordered pairs with attitude.

Three properties to check

Relations come in flavors, and we classify them by three properties. Let RR be a relation on AA.

  • Reflexive: every element relates to itself. aA, aRa\forall a \in A,\ a \mathbin{R} a.
  • Symmetric: the relation doesn't care about direction. a,b, aRb    bRa\forall a, b,\ a \mathbin{R} b \implies b \mathbin{R} a.
  • Transitive: relating chains through. a,b,c, (aRbbRc)    aRc\forall a, b, c,\ (a \mathbin{R} b \land b \mathbin{R} c) \implies a \mathbin{R} c.

Now drag the usual suspects through the checklist — this is how you build intuition, by interrogating each relation like a detective who won't be fooled by surface appearances:

relationreflexive?symmetric?transitive?
<< on R\mathbb{R}no (a<aa < a fails)no (3<73<7 but not 7<37<3)yes
\le on R\mathbb{R}yesnoyes
== on any AAyesyesyes
"same parity" on Z\mathbb{Z}yesyesyes
"divides" on Z+\mathbb{Z}^{+}yesno (262 \mid 6, not 626 \mid 2)yes

Read that table like a detective who has seen this kind of thing before. << flunks reflexivity and symmetry — utterly disqualified. \le recovers reflexivity but still isn't symmetric. The two relations that pass all three== and "same parity" — are special. They have a name, and they run the rest of this lesson.

Equivalence relations: all three at once

A relation that is reflexive, symmetric, and transitive is called an equivalence relation. It's the mathematical formalization of "these things are the same in the way that matters," which is one of the most productive ideas in all of mathematics. Equality is the strictest one (same in every way), but the useful ones are looser: "same parity," "same remainder," "congruent triangles," "anagrams of each other." Different costumes, same equivalence class. You've seen this move before — it's the same spirit as "the squiggle is not the thing."

Given an equivalence relation \sim on AA, each element aa drags along its equivalence class — the set of everything related to it:

[a]={xAxa}.[a] = \{\, x \in A \mid x \sim a \,\}.

The class [a][a] is the bag of all elements that are "the same as aa" according to \sim. By reflexivity a[a]a \in [a], so nobody's class is empty.

The headline example: congruence mod n

Fix a positive integer nn. Say ab(modn)a \equiv b \pmod{n} ("aa is congruent to bb mod nn") when nn divides aba - b — equivalently, aa and bb leave the same remainder when divided by nn. Let me prove this is an equivalence relation, because I refuse to claim something is true and then just wink at you. The proof is three lines. Watch.

  • Reflexive: n(aa)=0n \mid (a - a) = 0? Yes, n0n \mid 0 always. ✓
  • Symmetric: if n(ab)n \mid (a - b), then ab=nka - b = nk for some integer kk, so ba=n(k)b - a = n(-k), so n(ba)n \mid (b - a). ✓
  • Transitive: if n(ab)n \mid (a-b) and n(bc)n \mid (b-c), then ab=nka - b = nk and bc=nmb - c = nm; adding, ac=n(k+m)a - c = n(k + m), so n(ac)n \mid (a-c). ✓

All three hold, so congruence mod nn is an equivalence relation. Take n=3n = 3. The classes are:

[0]={,3,0,3,6,},[1]={,2,1,4,7,},[2]={,1,2,5,8,}.[0] = \{\dots, -3, 0, 3, 6, \dots\}, \quad [1] = \{\dots, -2, 1, 4, 7, \dots\}, \quad [2] = \{\dots, -1, 2, 5, 8, \dots\}.

Three classes, sorted by remainder 0,1,20, 1, 2. Every integer lands in exactly one. These classes have a name you'll meet in algebra: Z/3Z\mathbb{Z}/3\mathbb{Z}, the integers mod 33.

The fundamental theorem: equivalence relations ARE partitions

Now the punchline, and it's a genuine theorem. Recall partitions from the set-operations lesson: a partition of AA chops it into pairwise-disjoint, non-empty blocks that cover all of AA. Here's the deep fact:

An equivalence relation on AA is the exact same data as a partition of AA.

Two outfits, one body. Given an equivalence relation, its equivalence classes form a partition — and here's why, in two strokes. (1) They cover AA: every aa sits in its own class [a][a] (reflexivity). (2) They don't overlap: if two classes share even one element, they're identical. Suppose x[a][b]x \in [a] \cap [b]. Then xax \sim a and xbx \sim b; by symmetry axa \sim x, and by transitivity aba \sim b, which forces [a]=[b][a] = [b] (everything related to aa is related to bb and vice versa). So distinct classes are disjoint. Cover plus disjoint equals partition. Conversely, any partition defines an equivalence relation: declare aba \sim b iff they're in the same block. Same data, two outfits.

For mod 33: the three classes [0],[1],[2][0], [1], [2] are disjoint and cover Z\mathbb{Z} — a partition into three blocks. The theorem in the flesh.

The payoff: how mathematicians forge new objects

Here's the teaser that makes this lesson matter far beyond bookkeeping. The phrase "equal up to something" is how mathematicians build new objects — and this is the move that forges number systems. You declare an equivalence relation, then treat each class as a single new thing. It's one of the most audacious tricks in mathematics, and once you see it you'll never unsee it.

The cleanest case: fractions ARE equivalence classes. The fractions 12,24,36,\tfrac{1}{2}, \tfrac{2}{4}, \tfrac{3}{6}, \dots are different pairs of integers (1,2),(2,4),(3,6)(1,2), (2,4), (3,6), but they name the same rational number. Define (a,b)(c,d)(a,b) \sim (c,d) when ad=bcad = bc — that's an equivalence relation on pairs — and a rational number is literally an equivalence class of such pairs. Remember when we "invented fractions" to fix N\mathbb{N}'s division defect? This is the forge that does it: glue together all the pairs that should be equal, and call each glued bundle a number. Equivalence relations are the forge. You'll see this exact move every time a new number system or quotient object gets built — file it away, because it pays off forever, and mathematicians who don't know it look like they're doing magic when they're just doing this.

🔬 SPECIMENS (worked examples)

Worked example 1 — interrogating a relation (all three properties, no shortcuts)

On A={1,2,3}A = \{1, 2, 3\}, let R={(1,1),(2,2),(3,3),(1,2),(2,1)}R = \{(1,1), (2,2), (3,3), (1,2), (2,1)\}. Is RR reflexive? Symmetric? Transitive?

Check each property against the definition.

Reflexive? Need (a,a)R(a,a) \in R for every aAa \in A. We have (1,1),(2,2),(3,3)(1,1), (2,2), (3,3) — all three present. Yes.

Symmetric? Need: whenever (a,b)R(a,b) \in R, also (b,a)R(b,a) \in R. The only "off-diagonal" pair is (1,2)(1,2), and its reverse (2,1)(2,1) is in RR. The diagonal pairs are their own reverses. Yes.

Transitive? Need: (a,b),(b,c)R    (a,c)R(a,b), (b,c) \in R \implies (a,c) \in R. The risky chains involve 11 and 22: (1,2)(1,2) and (2,1)(2,1) give (1,1)(1,1) — present. (2,1)(2,1) and (1,2)(1,2) give (2,2)(2,2) — present. All chains close. Yes.

All three hold, so RR is an equivalence relation. Its classes: [1]={1,2}=[2][1] = \{1, 2\} = [2] and [3]={3}[3] = \{3\}. Partition of AA: {{1,2},{3}}\{\{1,2\}, \{3\}\}. Two blocks, disjoint, covering everything.

Worked example 2 — congruence mod 4 and its classes

Working mod 44, which equivalence class contains 1717, and what is the full list of classes? Verify 171(mod4)17 \equiv 1 \pmod 4.

Mod 44 sorts integers by their remainder on division by 44, so there are exactly four classes — one per remainder 0,1,2,30, 1, 2, 3:

[0]={,4,0,4,8,},[1]={,3,1,5,9,},[0] = \{\dots, -4, 0, 4, 8, \dots\}, \quad [1] = \{\dots, -3, 1, 5, 9, \dots\}, [2]={,2,2,6,10,},[3]={,1,3,7,11,}.[2] = \{\dots, -2, 2, 6, 10, \dots\}, \quad [3] = \{\dots, -1, 3, 7, 11, \dots\}.

Where does 1717 go? Divide: 17=44+117 = 4 \cdot 4 + 1, remainder 11. So 17[1]17 \in [1].

Verify 171(mod4)17 \equiv 1 \pmod 4: the definition says 4(171)=164 \mid (17 - 1) = 16. Since 16=4416 = 4 \cdot 4, yes 4164 \mid 16. ✓ So 1717 and 11 are congruent mod 44 — same class.

These four classes are disjoint and cover Z\mathbb{Z}: a partition into four blocks, the set Z/4Z\mathbb{Z}/4\mathbb{Z}.

Worked example 3 — the trap: two-out-of-three is zero-out-of-one

On R\mathbb{R}, define aRba \mathbin{R} b iff ab1|a - b| \le 1 ("within distance 11"). Show RR is reflexive and symmetric but not transitive — so it is NOT an equivalence relation.

This relation looks like "sameness" but it has a fatal flaw. Check the three properties.

Reflexive? aa=01|a - a| = 0 \le 1 for all aa. Yes.

Symmetric? ab=ba|a - b| = |b - a|, so ab1    ba1|a-b| \le 1 \iff |b - a| \le 1. Yes.

Transitive? We need a counterexample to break it. Take a=0a = 0, b=1b = 1, c=2c = 2:

  • 01=11|0 - 1| = 1 \le 1, so 0R10 \mathbin{R} 1. ✓
  • 12=11|1 - 2| = 1 \le 1, so 1R21 \mathbin{R} 2. ✓
  • 02=2≰1|0 - 2| = 2 \not\le 1, so 0R20 \mathbin{R} 2 is false.

Transitivity fails: 0R10 \mathbin{R} 1 and 1R21 \mathbin{R} 2 but not 0R20 \mathbin{R} 2. Not transitive.

So "within distance 11" is reflexive and symmetric but not transitive — not an equivalence relation. This is the classic trap: closeness chains can drift arbitrarily far. Two-out-of-three is not good enough; an equivalence relation needs all three, no exceptions.

☠ KNOWN HAZARDS

  • Calling << or \le an equivalence relation. << fails reflexivity and symmetry; \le fails symmetry. Neither is an equivalence relation — check all three properties, don't eyeball it. Eyeballing is how you fail every proof in this stratum.

  • Confusing symmetric with reflexive. Symmetric is about direction (aRbbRaa\mathbin{R}b \Rightarrow b\mathbin{R}a); reflexive is about self-relation (aRaa\mathbin{R}a). A relation can have one without the other. They are different requirements.

  • Thinking equivalence classes can overlap. Two classes are either identical or disjoint — share one element and they're the same class. That's why they form a partition. If you think classes can overlap "a little," the proof I wrote above already killed that idea.

  • Forgetting transitivity needs a middle. aRba\mathbin{R}b and bRcb\mathbin{R}c give aRca\mathbin{R}c — but only through the shared bb. "aa related to bb, cc related to dd" tells you nothing about aa and cc. The chain must actually chain.

TL;DR

  • A relation on AA is a subset RA×AR \subseteq A \times A; aRba \mathbin{R} b means (a,b)R(a,b) \in R. Every comparison (<<, ==, divides) is one.

  • Three properties: reflexive (aRaa \mathbin{R} a), symmetric (aRbbRaa\mathbin{R}b \Rightarrow b\mathbin{R}a), transitive (aRbbRcaRca\mathbin{R}b \land b\mathbin{R}c \Rightarrow a\mathbin{R}c).

  • An equivalence relation has all three. Its classes [a]={xxa}[a] = \{x \mid x \sim a\} group "the same in the way that matters."

  • Congruence mod nn (nabn \mid a-b) is an equivalence relation; mod 33 gives the three remainder classes [0],[1],[2][0],[1],[2].

  • Fundamental theorem: equivalence relations and partitions are the same data. The forge for new objects — fractions ARE equivalence classes of integer pairs.

unlocks