Fiveable

🧠Thinking Like a Mathematician Unit 4 Review

QR code for Thinking Like a Mathematician practice questions

4.5 Equivalence relations

4.5 Equivalence relations

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🧠Thinking Like a Mathematician
Unit & Topic Study Guides

Definition of equivalence relations

An equivalence relation is a way of saying when two elements of a set can be treated as "the same" for a particular purpose. You encounter this idea constantly in math: two fractions representing the same number, two shapes with the same angles, two integers with the same remainder. The relation formalizes what "sameness" means in each context.

For a relation RR on a set SS to qualify as an equivalence relation, it must satisfy three properties simultaneously. If even one fails, it's not an equivalence relation.

Properties of equivalence relations

Reflexivity: Every element is related to itself.

aS,  aRa\forall a \in S, \; aRa

Think of it this way: anything should be "the same as" itself under any reasonable notion of sameness.

Symmetry: If aa is related to bb, then bb is related to aa.

a,bS,  aRb    bRa\forall a, b \in S, \; aRb \implies bRa

The relationship goes both directions. If aa has the same birthday as bb, then bb has the same birthday as aa.

Transitivity: If aa is related to bb and bb is related to cc, then aa is related to cc.

a,b,cS,  (aRbbRc)    aRc\forall a, b, c \in S, \; (aRb \land bRc) \implies aRc

Sameness "chains together." If aba \equiv b and bcb \equiv c, then aca \equiv c.

When all three hold, the relation partitions the set into non-overlapping groups of equivalent elements.

Examples of equivalence relations

  • Equality (==) on any set. The most basic equivalence relation.
  • Congruence modulo nn on the integers. Two integers are equivalent if they leave the same remainder when divided by nn. For example, 72(mod5)7 \equiv 2 \pmod{5} because both leave remainder 2.
  • Similarity of geometric shapes. Two triangles are similar if they have the same angles, regardless of size.
  • "Has the same birthday as" on a set of people. This satisfies all three properties: you share a birthday with yourself (reflexive), if you share one with someone they share one with you (symmetric), and the relation chains (transitive).
  • Parallelism among lines in Euclidean geometry. Parallel lines share the same slope (or are both vertical). Note: each line is considered parallel to itself for this to work as an equivalence relation.

Equivalence classes

Once you have an equivalence relation on a set, it naturally groups elements together. Each group is called an equivalence class.

Formation of equivalence classes

For an element aa in set SS, its equivalence class [a][a] is the set of all elements related to aa:

[a]={xSxRa}[a] = \{x \in S \mid xRa\}

Every element in [a][a] is related to every other element in [a][a]. Any member of the class can serve as its representative. For instance, under congruence mod 3, the class [0]={,6,3,0,3,6,}[0] = \{\ldots, -6, -3, 0, 3, 6, \ldots\} could equally be written as [3][3] or [6][-6].

Properties of equivalence classes

  • Disjoint: No element belongs to more than one equivalence class. If [a][a] and [b][b] share even one element, then [a]=[b][a] = [b].
  • Exhaustive: The union of all equivalence classes equals the entire set SS. Every element lands somewhere.
  • Internally connected: All elements within a single class are related to each other.
  • The collection of all equivalence classes forms a partition of SS.

Note: equivalence classes do not necessarily have equal sizes. Under congruence mod 2 on {1,2,3,4,5}\{1, 2, 3, 4, 5\}, the class of even numbers has 2 elements and the class of odd numbers has 3.

Partitions

A partition of a set SS is a collection of non-empty subsets of SS such that every element of SS belongs to exactly one subset. The subsets don't overlap, and together they cover everything.

Relationship to equivalence relations

There's a perfect correspondence between equivalence relations and partitions:

  • Every equivalence relation on SS produces a unique partition (its equivalence classes).
  • Every partition of SS defines a unique equivalence relation (declare two elements related if and only if they're in the same subset).

This two-way connection means you can always move between the two perspectives. Sometimes it's easier to define the partition directly, and other times it's easier to define the relation and let the classes fall out.

Properties of partitions

  • Each element of SS belongs to exactly one subset (block) of the partition.
  • The union of all blocks equals SS.
  • Any two distinct blocks have empty intersection: if ABA \neq B, then AB=A \cap B = \emptyset.
  • The number of blocks equals the number of equivalence classes.
  • A refinement of a partition splits some blocks into smaller pieces, corresponding to a "finer" (more discriminating) equivalence relation.
Properties of equivalence relations, Symmetric relation - Wikipedia

Quotient sets

The quotient set collects all the equivalence classes into a single set. It's the result of "collapsing" each equivalence class down to a single point.

Construction of quotient sets

The quotient set of SS by the equivalence relation RR is written:

S/R={[a]aS}S/R = \{[a] \mid a \in S\}

Each element of S/RS/R is an entire equivalence class, not an individual element of SS. For example, Z/3\mathbb{Z}/\equiv_3 (the integers mod 3) has exactly three elements: [0],[1],[2][0], [1], [2].

To construct a quotient set:

  1. Identify the equivalence relation RR on SS.
  2. Determine the equivalence classes by grouping related elements.
  3. Collect these classes into a set. That set is S/RS/R.

Applications of quotient sets

  • Modular arithmetic: Z/nZ\mathbb{Z}/n\mathbb{Z} treats integers as equivalent if they differ by a multiple of nn, giving you a finite number system to work with.
  • Constructing new structures: In algebra, factor groups (quotient groups) are built this way.
  • State reduction: In computer science, minimizing a finite automaton involves collapsing equivalent states into a quotient structure.
  • Rational numbers: Q\mathbb{Q} can be constructed as a quotient set of pairs of integers, where abcd\frac{a}{b} \sim \frac{c}{d} whenever ad=bcad = bc.

Equivalence relation proofs

Proving that a relation is (or isn't) an equivalence relation is a standard exercise that builds proof-writing skills. The structure is always the same: check all three properties.

Proving reflexivity, symmetry, transitivity

To prove a relation RR on a set SS is an equivalence relation, you need three separate arguments:

  1. Reflexivity: Pick an arbitrary aSa \in S. Show that aRaaRa holds using the definition of RR.
  2. Symmetry: Assume aRbaRb for arbitrary a,bSa, b \in S. Show that bRabRa follows.
  3. Transitivity: Assume aRbaRb and bRcbRc for arbitrary a,b,cSa, b, c \in S. Show that aRcaRc follows.

Worked example: Prove that congruence mod 3 is an equivalence relation on Z\mathbb{Z}.

Define aRbaRb to mean 3(ab)3 \mid (a - b).

  • Reflexivity: aa=0=30a - a = 0 = 3 \cdot 0, so 3(aa)3 \mid (a - a). Thus aRaaRa.
  • Symmetry: If 3(ab)3 \mid (a - b), then ab=3ka - b = 3k for some integer kk. So ba=3(k)b - a = 3(-k), meaning 3(ba)3 \mid (b - a). Thus bRabRa.
  • Transitivity: If 3(ab)3 \mid (a - b) and 3(bc)3 \mid (b - c), then ab=3ka - b = 3k and bc=3mb - c = 3m. Adding: ac=3(k+m)a - c = 3(k + m), so 3(ac)3 \mid (a - c). Thus aRcaRc.

Disproving equivalence relations

To show a relation is not an equivalence relation, you only need one counterexample violating one property:

  • Reflexivity fails: Find an element aa where aRaaRa doesn't hold.
  • Symmetry fails: Find a,ba, b where aRbaRb but not bRabRa.
  • Transitivity fails: Find a,b,ca, b, c where aRbaRb and bRcbRc but not aRcaRc.

For example, "is a friend of" on a set of people might fail transitivity: Alice is friends with Bob, Bob is friends with Carol, but Alice and Carol might not be friends.

Equivalence relations in mathematics

Number theory applications

  • Congruence modulo nn partitions Z\mathbb{Z} into nn equivalence classes based on remainders. This is the foundation of modular arithmetic and appears throughout number theory and cryptography.
  • Rational number equivalence treats fractions as equivalent when they reduce to the same value: 122436\frac{1}{2} \sim \frac{2}{4} \sim \frac{3}{6}.
  • Equivalence of quadratic residues modulo a prime groups integers by whether they're perfect squares in that modular system.
Properties of equivalence relations, discrete mathematics - Binary relation, reflexive, symmetric and transitive - Mathematics Stack ...

Geometry applications

  • Congruence of figures: same size and shape (related by rigid motions).
  • Similarity of figures: same shape, possibly different sizes (related by rigid motions plus scaling).
  • Parallelism of lines groups lines by direction.
  • Equivalence under transformations: Points that map to each other under a group of symmetries (rotations, reflections) form equivalence classes called orbits.

Equivalence relations in computer science

Hashing and equivalence

Hash functions map elements into buckets, and elements landing in the same bucket form a kind of equivalence class. Collision resolution handles the case where distinct elements end up in the same class. Locality-sensitive hashing intentionally groups similar items together, using a notion of approximate equivalence.

State equivalence in automata

When minimizing a finite automaton, you identify states that produce identical output behavior for all possible inputs. These equivalent states get merged, producing the smallest automaton that recognizes the same language. Hopcroft's algorithm does this efficiently by iteratively refining equivalence classes of states.

Bisimulation in process calculi extends this idea: two processes are bisimilar (behaviorally equivalent) if they can simulate each other step by step.

Equivalence vs other relations

Equivalence vs partial order

PropertyEquivalence RelationPartial Order
ReflexiveYesYes
SymmetricYesNo (antisymmetric instead)
TransitiveYesYes
Effect on setPartitions into classesOrganizes into a hierarchy
VisualizationGroups/clustersHasse diagrams

The key distinction: equivalence relations group elements as "the same," while partial orders rank elements as "less than or equal to." A partial order's antisymmetry means if aRbaRb and bRabRa, then a=ba = b, which is the opposite of what symmetry does.

Equivalence vs congruence

A congruence relation is an equivalence relation that also respects algebraic operations. For example, congruence mod nn isn't just an equivalence relation on Z\mathbb{Z}; it's compatible with addition and multiplication:

  • If ab(modn)a \equiv b \pmod{n} and cd(modn)c \equiv d \pmod{n}, then a+cb+d(modn)a + c \equiv b + d \pmod{n}.

This compatibility is what allows you to do arithmetic in the quotient set Z/nZ\mathbb{Z}/n\mathbb{Z}. A general equivalence relation doesn't guarantee this, so you can't always define operations on the quotient set.

Computational aspects

Algorithms for equivalence checking

The Union-Find (disjoint set) data structure is the go-to tool for managing equivalence classes computationally. It supports two operations:

  1. Find: Determine which equivalence class an element belongs to.
  2. Union: Merge two equivalence classes when you learn two elements are related.

With path compression and union by rank optimizations, both operations run in nearly constant amortized time (O(α(n))O(\alpha(n)), where α\alpha is the inverse Ackermann function, which grows incredibly slowly).

Other relevant algorithms include Hopcroft's algorithm for DFA minimization and graph-based approaches for finding equivalence classes in networks.

Complexity considerations

  • Union-Find with optimizations gives near-constant time per operation, making it practical for very large sets.
  • Equivalence checking can often be reduced to graph reachability: two elements are equivalent if and only if there's a path between them.
  • There are space-time tradeoffs between storing all equivalence classes explicitly versus computing membership on the fly.
  • Some equivalence problems are computationally hard. Graph isomorphism (determining whether two graphs are "the same" up to relabeling) is a famous example whose exact complexity class remains an open question.