洪水包围的房屋与小船,水中映出建筑和天空
马尔利港的洪水 · Alfred Sisley / National Gallery of Art

An equivalence relation formalizes a choice to treat objects as the same for a particular purpose. Integers can have the same remainder, strings can have the same length, and records can have the same classification. The objects need not be equal. What matters is that the chosen test divides the whole underlying set into consistent, nonoverlapping classes.

This note uses the relation properties from Note 1.1. Its main connection is a two-way correspondence: equivalence relations determine partitions, and partitions determine equivalence relations.

1. Equivalence Relations and Proof Methods

A relation RR on a set AA is an equivalence relation if it is reflexive, symmetric, and transitive. When these conditions hold, write a∼ba\sim b for (a,b)∈R(a,b)\in R.

RequirementWhat must be proved
ReflexiveEvery a∈Aa\in A satisfies a∼aa\sim a
SymmetricFor arbitrary a,b∈Aa,b\in A, a∼ba\sim b implies b∼ab\sim a
TransitiveFor arbitrary a,b,c∈Aa,b,c\in A, a∼ba\sim b and b∼cb\sim c imply a∼ca\sim c

Checking several pairs is not a proof on an infinite set. Begin with arbitrary elements and use the defining condition. To disprove equivalence, one explicit failure of any required property is enough.

Example: Congruence modulo an integer. Fix an integer m≥2m\ge2. On Z\mathbb Z, define a∼ba\sim b when m∣(a−b)m\mid(a-b). Prove that this is an equivalence relation.

Show proof
  • Reflexivity: a−a=0=m⋅0a-a=0=m\cdot0, so m∣(a−a)m\mid(a-a).
  • Symmetry: If a−b=kma-b=km for an integer kk, then b−a=(−k)mb-a=(-k)m.
  • Transitivity: If a−b=kma-b=km and b−c=ℓmb-c=\ell m, then a−c=(k+ℓ)ma-c=(k+\ell)m.

Each required property holds for arbitrary integers, so congruence modulo mm is an equivalence relation. Negative integers are included; divisibility of the difference is the defining test.

Equality of a Feature

A useful general construction starts with any function f:A→Bf:A\to B:

a∼b⟺f(a)=f(b).a\sim b\quad\Longleftrightarrow\quad f(a)=f(b).

Equality of outputs is reflexive, symmetric, and transitive, so this always defines an equivalence relation. Its classes are the nonempty fibers f−1({y})f^{-1}(\{y\}). Surjectivity is not needed: values outside the image produce empty fibers, which are not classes.

For instance, if f(s)f(s) is the length of a finite string, the classes collect strings of the same length. The empty string forms the only member of the length-zero class. A feature groups objects by a specified rule; it does not assert that the objects themselves are identical.

Counterexample: Being close is insufficient. On R\mathbb R, define xRyxRy when ∣x−y∣<1|x-y|<1. Determine whether this is an equivalence relation.

Show the property checks

It is reflexive because ∣x−x∣=0<1|x-x|=0<1, and symmetric because ∣x−y∣=∣y−x∣|x-y|=|y-x|. It is not transitive: 0R(3/4)0R(3/4) and (3/4)R(3/2)(3/4)R(3/2), but 00 is not related to 3/23/2. Thus it is not an equivalence relation. Overlapping neighborhoods cannot be treated as equivalence classes without changing the relation.

2. Equivalence Classes and Quotient Sets

For an equivalence relation RR on AA, the equivalence class of a∈Aa\in A is

[a]R={x∈A:xRa}.[a]_R=\{x\in A:xRa\}.

The subscript can be omitted when the relation is clear. Symmetry allows the equivalent definition {x∈A:aRx}\{x\in A:aRx\}. The element aa is a representative of its class; different representatives may name the same class.

For any a,b∈Aa,b\in A, the following statements are equivalent:

aRb⟺[a]R=[b]R⟺[a]R∩[b]R≠∅.aRb\quad\Longleftrightarrow\quad[a]_R=[b]_R \quad\Longleftrightarrow\quad[a]_R\cap[b]_R\ne\varnothing.

To prove the first implication, suppose aRbaRb. If xRaxRa, transitivity gives xRbxRb, so [a]R⊆[b]R[a]_R\subseteq[b]_R. Symmetry gives bRabRa, yielding the reverse inclusion. If the classes are equal, their intersection contains aa by reflexivity. Finally, if xx belongs to both classes, then xRaxRa and xRbxRb; symmetry gives aRxaRx, and transitivity gives aRbaRb.

Consequently, two classes are either exactly equal or disjoint. They cannot partly overlap. Also a∈[a]Ra\in[a]_R for every a∈Aa\in A, so no class is empty and their union covers AA.

The quotient set is the set of distinct equivalence classes:

A/R={[a]R:a∈A}.A/R=\{[a]_R:a\in A\}.

Its elements are subsets of AA, not individual elements of AA. Repeated names for the same class are listed only once. The map a↦[a]Ra\mapsto[a]_R sends every original element to the class containing it.

For a finite illustration, take A={0,1,2,3,4,5,6,7,8}A=\{0,1,2,3,4,5,6,7,8\} with equivalence defined by equal remainders modulo 3. The projection sends each number to its whole equivalence class:

Nine integers map to three equivalence classes, with three representatives pointing to each class

Figure 1. Three different representatives in each group point to the same element of the quotient set. The quotient has three elements, each of which is a set of original elements.

For example, 00, 33, and 66 are different elements of AA, but [0]=[3]=[6]={0,3,6}[0]=[3]=[6]=\{0,3,6\}. Counting representatives and counting distinct classes answer different questions.

Example: Classes with negative representatives. For congruence modulo 3 on Z\mathbb Z, find [−1][-1], [2][2], and the quotient set. Explain why there are three classes rather than infinitely many.

Show classes and representatives

For any integer rr,

[r]={r+3k:k∈Z}.[r]=\{r+3k:k\in\mathbb Z\}.

Since −1−2=−3-1-2=-3 is divisible by 3, [−1]=[2][-1]=[2]. This class is {…,−4,−1,2,5,8,…}\{\ldots,-4,-1,2,5,8,\ldots\}. Every integer has exactly one remainder in {0,1,2}\{0,1,2\}, so

Z/R={[0],[1],[2]}.\mathbb Z/R=\{[0],[1],[2]\}.

The infinitely many integers provide infinitely many representatives, but only three distinct classes. No arithmetic on these classes has yet been defined; a quotient set by itself is simply a set of classes.

3. Partitions and the Two-Way Correspondence

A partition P\mathcal P of AA is a collection of subsets, called blocks, such that:

  1. Every block is nonempty.
  2. Distinct blocks are disjoint.
  3. The union of all blocks is AA.

Original textbook diagram of a set divided into nine regions labeled A1 through A9

Figure 2. Each region Ai denotes a nonempty block. The blocks are pairwise disjoint and their union is the whole set.

Equivalently, every element of AA belongs to exactly one block. A collection with overlapping blocks or an omitted element fails to be a partition. With the usual convention, the empty collection is the partition of the empty set.

The class theorem above proves that A/RA/R is a partition whenever RR is an equivalence relation. Conversely, given a partition P\mathcal P, define

RP=⋃B∈P(B×B).R_{\mathcal P}=\bigcup_{B\in\mathcal P}(B\times B).

In words, two elements are related exactly when they belong to the same block. Reflexivity follows because each element belongs to a block. Symmetry follows because block membership has no direction. For transitivity, if a,ba,b share a block and b,cb,c share a block, those blocks intersect at bb. Disjointness forces them to be the same block, so a,ca,c share it as well.

The classes of RPR_{\mathcal P} are exactly the original blocks. Starting with an equivalence relation, forming its classes, then reconstructing same-block pairs likewise recovers the original relation. Thus this is a one-to-one correspondence, not just a method that produces some relation.

Example: A finite restriction of modular congruence. Let A={0,1,2,3,4,5,6,7,8}A=\{0,1,2,3,4,5,6,7,8\} and define aRbaRb when 3∣(a−b)3\mid(a-b). Find the partition and the number of ordered pairs in RR.

Show the partition and pair count

The partition is

P={{0,3,6},{1,4,7},{2,5,8}}.\mathcal P=\{\{0,3,6\},\{1,4,7\},\{2,5,8\}\}.

Each block contributes its full Cartesian square, including loops and both directions between distinct elements. Each has three elements and contributes 32=93^2=9 pairs. The blocks do not overlap, so ∣R∣=9+9+9=27|R|=9+9+9=27.

These finite classes differ from the classes on Z\mathbb Z: for example, here [0]={0,3,6}[0]=\{0,3,6\}, whereas on Z\mathbb Z it includes every multiple of 3. Always identify the underlying set before listing a class.

4. Reconstructing Relations and Matrices

For a finite partition with block sizes n1,…,nkn_1,\ldots,n_k,

∣A∣=∑i=1kni,∣R∣=∑i=1kni2.|A|=\sum_{i=1}^k n_i,\qquad |R|=\sum_{i=1}^k n_i^2.

The second formula counts ordered pairs, including diagonal pairs. It does not count unordered pairs and does not count equivalence classes; the latter number is kk.

If rows and columns are ordered block by block, the zero-one matrix has square all-one blocks along its diagonal and zeros elsewhere. Inside a class every pair is present; between different classes every pair is absent. In the digraph, each class has every loop and both directed edges between any two distinct vertices, with no edges between classes.

Example: From a partition to a relation. On A={1,2,3,4,5}A=\{1,2,3,4,5\} take P={{1,3},{2,4},{5}}\mathcal P=\{\{1,3\},\{2,4\},\{5\}\}. List all pairs, give the matrix in the order 1,3,2,4,51,3,2,4,5, and identify [3][3] and A/RA/R.

Show reconstruction

Taking the Cartesian square of each block gives

R={(1,1),(1,3),(3,1),(3,3),(2,2),(2,4),(4,2),(4,4),(5,5)}.\begin{aligned} R=\{&(1,1),(1,3),(3,1),(3,3),\\ &(2,2),(2,4),(4,2),(4,4),(5,5)\}. \end{aligned}

In the requested ordering,

MR=[1100011000001100011000001].M_R=\begin{bmatrix} 1&1&0&0&0\\1&1&0&0&0\\0&0&1&1&0\\0&0&1&1&0\\0&0&0&0&1 \end{bmatrix}.

There are 22+22+12=92^2+2^2+1^2=9 pairs, agreeing with the list and matrix. The class [3]={1,3}[3]=\{1,3\} equals [1][1], and A/R=PA/R=\mathcal P has three elements. A different row ordering would rearrange the matrix without changing the relation.

5. Review and Self-Check

  1. On A={a,b,c}A=\{a,b,c\}, does {{a,b},{b,c}}\{\{a,b\},\{b,c\}\} define a partition? If its two block squares are simply united, which equivalence property fails? Give a witness.
  2. Let RR be congruence modulo 4 on Z\mathbb Z. Find [−2][-2], decide whether [6]=[−2][6]=[-2], and list the distinct classes.
  3. An equivalence relation on a six-element set has class sizes 1, 2, and 3. How many classes and ordered pairs does it have? Can two of its classes share exactly one element?
Show self-check answers
  1. The proposed blocks overlap at bb, so they are not a partition. The union of their squares contains (a,b)(a,b) and (b,c)(b,c) but not (a,c)(a,c); it is not transitive. Merging all three elements into one block would produce a different relation.
  2. [−2]={−2+4k:k∈Z}=[2]=[6][-2]=\{-2+4k:k\in\mathbb Z\}=[2]=[6]. The distinct classes are [0],[1],[2],[3][0],[1],[2],[3].
  3. There are three classes and 12+22+32=141^2+2^2+3^2=14 ordered pairs. Distinct classes are disjoint, so they cannot share one element.

Equivalence relations organize objects into classes. Note 1.8 develops a different use of relations: comparing objects without requiring every two objects to be comparable.

6. Compatible Relations and Operations

Compatible Relations and Complete Covers

A compatible relation is reflexive and symmetric. For example, on A={1,2,3,4}A=\{1,2,3,4\} define xRyxRy by ∣x−y∣≤1|x-y|\le1. Here 1R21R2 and 2R32R3, while 11 and 33 fail the test, so transitivity fails.

A nonempty subset C⊆AC\subseteq A is a compatible class when every pair in CC belongs to RR. To find such sets in a finite example, omit the loops and draw one undirected edge for each related pair of distinct elements. A compatible class is a clique: every two distinct vertices in it are joined. It is maximal if no additional vertex can be included while preserving the pairwise condition. In the example the simplified graph has edges {1,2}\{1,2\}, {2,3}\{2,3\}, and {3,4}\{3,4\}. Each edge gives a maximal class, and every singleton can grow into an edge. The resulting complete cover is {{1,2},{2,3},{3,4}}\{\{1,2\},\{2,3\},\{3,4\}\}. It covers AA and some classes overlap. For any finite compatible relation, a singleton can be enlarged to a maximal class, so the maximal classes cover the set.

Intersections and Unions of Equivalence Relations

If R1R_1 and R2R_2 are equivalence relations on AA, then R1∩R2R_1\cap R_2 is an equivalence relation. Every diagonal pair is in both, and reversals and transitive consequences of pairs in both belong to both. Its class of aa is [a]R1∩[a]R2[a]_{R_1}\cap[a]_{R_2}.

The union R1∪R2R_1\cup R_2 is compatible because each diagonal pair is present and every pair can be reversed within the relation that supplied it. A two-step chain can use one pair from each relation and have no matching endpoint pair in either. For example, let the partitions be {{1,2},{3}}\{\{1,2\},\{3\}\} and {{1},{2,3}}\{\{1\},\{2,3\}\}. Their union contains (1,2)(1,2) and (2,3)(2,3) and omits (1,3)(1,3). Its transitive closure adds both (1,3)(1,3) and (3,1)(3,1), giving the universal equivalence relation on the three elements.

Glossary and Sources

TermMain idea
Equivalence relationReflexive, symmetric, and transitive relation
Equivalence classAll elements equivalent to a given representative
Quotient setSet of distinct equivalence classes
PartitionNonempty, disjoint blocks covering the underlying set
RepresentativeAn element used to name its class
  • Kenneth H. Rosen, Discrete Mathematics and Its Applications, 8th edition, Section 9.5, printed pages 638–646.
  • Figure 1 is a constructed illustration of the quotient map. Figure 2 is cropped from Rosen, Section 9.5, Figure 1 (printed page 644). The finite examples, matrix, and self-checks are constructed from the stated definitions. Equality of a feature is a general formulation of the equal-length and congruence constructions.

Updated:

RelationsEquivalencePartitions