# Discrete Mathematics: An Active Approach to Mathematical Reasoning

## Section8.3Equivalence Relations

In Section 8.2 we studied three properties of a relation, the reflexive, symmetric, and transitive properties. These three properties are important for generalizing the idea of equality in mathematics. We may want to relate objects based on certain criteria; objects that share that criteria are “equivalent.” For example, you may recall from geometry, the idea of congruent triangles. Two triangles are congruent if they have the same angles. In geometry, we may not care at all about the lengths of the sides, just the angles. In this case, we relate triangles with the same angles and treat them as the same triangle.

### Definition8.3.1.

A relation that is reflexive, symmetric and transitive is an equivalence relation.
In Example 8.2.8 we proved that the relation given by $$(m, n)\in R \Leftrightarrow 3\mid (m-n)$$ is an equivalence relation since we proved it is reflexive, symmetric, and transitive.
In fact, the proof can easily be adapted to show $$(m, n)\in R \Leftrightarrow d\mid (m-n)$$ is an equivalence relation for $$d\neq 0, d\in \mathbb{Z}\text{.}$$ The details are left as an exercise, Exercise 8.3.9
This relation is an important enough that it has its own definition.

### Definition8.3.2.

Let $$m, n, d\in \mathbb{Z}, d>0\text{.}$$ Then $$m$$ and $$n$$ are congruent modulo $$d$$ if $$d\mid (m-n)\text{.}$$
We often just say $$m$$ is congruent to $$n$$ mod $$d\text{,}$$ and denote it
\begin{equation*} m\equiv n \mod d. \end{equation*}

### Example8.3.3.Congruence mod 3.

True or false: $$7\equiv 1 \mod 3\text{.}$$
Since $$3\mid (7-1)\text{,}$$ true.
True or false: $$7\equiv -2 \mod 3\text{.}$$
Since $$3\mid (7+2)\text{,}$$ true.
True or false: $$7\equiv -7 \mod 3\text{.}$$
Since $$3\nmid (7+7)\text{,}$$ false.
True or false: $$7\equiv 2 \mod 3\text{.}$$
Since $$3\nmid (7-2)\text{,}$$ false.
Let $$R$$ be an equivalence relation on $$A\text{.}$$ Let $$a\in A\text{.}$$ The set
\begin{equation*} [a]=\{b\in A : b R a\} \end{equation*}
is the equivalence class of $$a\text{.}$$
Given a specific $$a\in A\text{,}$$ we find the equivalence class of $$a$$ by finding all the elements that are related to $$a\text{.}$$ Keep in mind the equivalence class is a set, denoted $$[a]\text{.}$$

### Example8.3.4.Equivalence Classes.

Consider the equivalence relation $$m\equiv n \mod 3\text{,}$$ on $$\mathbb{Z}\text{.}$$
Find $$[0]\text{,}$$ the set of elements in $$\mathbb{Z}$$ equivalent to 0.
$$[0]=\{0, 3, -3, 6, -6, \ldots\}=\{3k : k\in \mathbb{Z}\}$$
Find $$[1]\text{,}$$ the set of elements in $$\mathbb{Z}$$ equivalent to 1.
$$[1]=\{1, 4, -2, -5, 7, 10, \ldots\}=\{3k+1: k\in \mathbb{Z}\}$$
Find $$[2]\text{,}$$ the set of elements in $$\mathbb{Z}$$ equivalent to 2.
$$[2]=\{2, 5, -1, -4, -7, \ldots\}=\{3k+2: k\in \mathbb{Z}\}$$
Find $$[3]\text{,}$$ the set of elements in $$\mathbb{Z}$$ equivalent to 3.
$$[3]=\{0, 3, -3, 6, -6, \ldots\}=\{3k : k\in \mathbb{Z}\}$$
Find $$[-1]\text{,}$$ the set of elements in $$\mathbb{Z}$$ equivalent to -1.
$$[-1]=\{2, 5, -1, -4, -7, \ldots\}=\{3k+2: k\in \mathbb{Z}\}$$
We can notice a few things from this last example. We can see that some of our equivalence classes are the same. In particular, $$[0]=[3]$$ and $$[2]=[-1]\text{.}$$ In fact, there are only three distinct equivalence classes, $$[0], [1], [2]\text{,}$$ any other equivalence class will equal one of these.
A few other things to notice, distinct equivalence classes are disjoint--they have no elements in common. Also, $$[a]$$ contains $$a\text{.}$$ We may also recognize that the equivalence classes $$[0], [1], [2]$$ partition the integers.

### Example8.3.5.More Equivalence Classes.

Consider the equivalence relation $$A R B \Leftrightarrow |A|=|B|\text{,}$$ on $$\mathcal{P}(\{1, 2, 3\})\text{.}$$
This is the relation where two subsets of $$\{1, 2, 3\}$$ are related if they have the same number of elements. You can check that this is an equivalence relation.
Find $$[\emptyset]\text{,}$$ the set of elements in $$\mathcal{P}(\{1, 2, 3\})$$ equivalent to $$\emptyset\text{.}$$
$$[\emptyset]=\{\emptyset\}\text{,}$$ since this is the only subset with 0 elements.
Find $$[\{1\}]\text{.}$$
$$[\{1\}]=\{\{1\}, \{2\}, \{3\}\}\text{,}$$ since these all have 1 element.
Find $$[\{1, 2\}]\text{.}$$
$$[\{1, 2\}]=\{\{1, 2\}, \{2, 3\}, \{1, 3\}\}$$
Find $$[\{1, 2, 3\}]\text{.}$$
$$[\{1, 2, 3\}]=\{\{1, 2, 3\}\}$$
Once again, the distinct equivalence classes are disjoint--they have no elements in common. Furthermore, the equivalence classes $$[\emptyset], [\{1\}], [\{1, 2\}], [\{1, 2, 3\}]$$ partition the power set by size of the subset.

### Activity8.3.1.

Define the relation on $$\mathbb{Z}$$ by $$xRy \iff |x|=|y|\text{.}$$

#### (a)

Prove $$R$$ is an equivalence relation.

#### (b)

Find $$[0]$$ and $$[-5]\text{.}$$

### Activity8.3.2.

Recall that $$n \equiv m \mod 5\iff 5\mid (m-n)\text{.}$$

#### (a)

Prove the relation $$nRm \iff n \equiv m \mod 5$$ is an equivalence relation on $$\mathbb{Z}\text{.}$$

#### (b)

Find $$[0]$$ and $$[2]\text{.}$$

### Activity8.3.3.

Let $$S=\{1, 2, 3, 4, 5, 6\}\text{.}$$ Let $$A_1=\{1, 2, 3\}, A_2=\{4\}, A_3=\{5, 6\}\text{.}$$

#### (a)

Check the conditions in Definition 6.1.17 to show $$\{A_i\}$$ is a partition of $$S\text{.}$$

#### (b)

Define the relation on $$S\text{,}$$ $$xRy \iff$$ $$x$$ and $$y$$ are in the same subset of the partition. Draw the directed graph for $$R\text{.}$$

#### (c)

Show $$R$$ is reflexive, symmetric and transitive.

#### (d)

Find $$[1]\text{,}$$ the equivalence class of 1.

#### (e)

Do you think this particular partition matters? Could we define this relation on any partition of any set and still have it be reflexive, symmetric and transitive?
There is an important connection between equivalence classes and partitions, as we see in the next two theorems.
Conversely, as we saw in Activity 8.3.3, if we have a partition $$\{A_1, A_2, \ldots, A_n\ldots\}$$ of $$A$$ and define the relation $$(a, b)\in R \Leftrightarrow a$$ and $$b$$ are in the same subset $$A_i\text{,}$$ then $$R$$ is an equivalence relation. We call this the equivalence relation induced by the partition.
We leave the details of the proof of Theorem 8.3.7 as an exercise.
The proof of Theorem 8.3.6 follows directly from the next two Lemmas.

### Proof.

Since we want to show the sets are equal, we will show $$[a], [b]$$ are subsets of each other.
Show $$[a]\subseteq [b]\text{.}$$ Let $$x\in [a]\text{.}$$ Then by defintion of equivalence class, $$x R a\text{.}$$ We assumed $$a R b\text{.}$$ By the transitive property, $$x R b\text{.}$$ Thus, $$x\in [b]\text{.}$$
Show $$[b]\subseteq [a]\text{.}$$ Let $$x\in [b]\text{.}$$ Then by definition of equivalence class, $$x R b\text{.}$$ We assumed $$a R b\text{.}$$ By the symmetric property, $$b R a\text{.}$$ By the transitive property, $$x R a\text{.}$$ Thus, $$x\in [a]\text{.}$$
Lemma 8.3.8 really says that if two elements are related in an equivalence relation, they must have the same equivalence class. You can check this with the above examples. Note, we needed the symmetric and transitive properties to prove this lemma.

### Proof.

Assume $$[a]\cap[b]\neq \emptyset\text{.}$$ We want to show $$[a]=[b]\text{.}$$ Since $$[a]\cap[b]\neq \emptyset\text{,}$$ there exists $$x\in [a]\cap[b]\text{.}$$ This means $$x R a$$ and $$x R b\text{.}$$ By the symmetric property, $$a R x\text{.}$$ By the transitive property, since $$a R x$$ and $$x R b\text{,}$$ we have $$a R b\text{.}$$ By Lemma 8.3.8, $$[a]=[b]\text{.}$$
Lemma 8.3.9 really says that any two equivalence classes are either disjoint or exactly the same.
Theorem 8.3.6 follows since, by the reflexive property, $$x R x, \forall x\in A$$ means every element is in an equivalence class. Thus, the union of the equivalence classes is all of $$A\text{.}$$ By Lemma 8.3.9 distinct equivalence classes are disjoint. Thus, we have a partition of $$A\text{.}$$

#### 1.

Determine if the relation is an equivalence relation. If it is, give the number of distinct equivalence classes. $$R$$ is the relation on $$A=\{1, 2, 3\}$$ given by
\begin{equation*} a R b \Leftrightarrow a\leq b. \end{equation*}
• Not an equivalence relation.
• Correct.
• Equivalence relation with 1 equivalence class.
• $$R$$ is not symmetric.
• Equivalence relation with 2 equivalence classes.
• $$R$$ is not symmetric.
• Equivalence relation with 3 equivalence classes.
• $$R$$ is not symmetric.

#### 2.

Determine if the relation is an equivalence relation. If it is, give the number of distinct equivalence classes. $$R$$ is the relation on $$C=\{0, 1\}$$ given by
\begin{equation*} a R b \Leftrightarrow a+b \text{ is even}. \end{equation*}
• Not an equivalence relation.
• Check that $$R$$ is reflexive, symmetric, and transitive.
• Equivalence relation with 1 equivalence class.
• Is $$0 R 1\text{?}$$
• Equivalence relation with 2 equivalence classes.
• Correct. The equivalence classes are $$[0]=\{0\}, [1]=\{1\}\text{.}$$

#### 3.

Determine if the relation is an equivalence relation. If it is, give the number of distinct equivalence classes. $$R$$ is the relation on $$B=\{2, 4, 6, 8\}$$ given by
\begin{equation*} a R b \Leftrightarrow a+b \text{ is even}. \end{equation*}
• Not an equivalence relation.
• Check that $$R$$ is reflexive, symmetric, and transitive.
• Equivalence relation with 1 equivalence class.
• Correct. The equivalence class is $$[2]=\{2, 4, 6, 8\}\text{.}$$
• Equivalence relation with 2 equivalence classes.
• Check that the sum of any two elements in $$B$$ is even. Thus, all elements are related to each other.

#### 4.

Determine if the relation is an equivalence relation. If it is, give the number of distinct equivalence classes. $$R$$ is the relation on $$A=\{1, 2, 3\}$$ given by
\begin{equation*} a R b \Leftrightarrow a+b \text{ is even}. \end{equation*}
• Not an equivalence relation.
• Check that $$R$$ is reflexive, symmetric, and transitive.
• Equivalence relation with 1 equivalence class.
• Note, $$2+3$$ is odd, so 2 is not related to 3.
• Equivalence relation with 2 equivalence classes.
• Correct. The equivalence classes are $$[1]=\{1, 3\}, [2]=\{2\}\text{.}$$
• Equivalence relation with 3 equivalence classes.
• Note, $$1+3$$ is even, so 1 is related to 3.

#### 5.

Determine if the relation is an equivalence relation. If it is, give the number of distinct equivalence classes. $$R$$ is the relation on $$B=\{2, 4, 6, 8\}$$ given by
\begin{equation*} a R b \Leftrightarrow a\mid b. \end{equation*}
• Not an equivalence relation.
• Correct.
• Equivalence relation with 1 equivalence class.
• $$R$$ is not symmetric.
• Equivalence relation with 2 equivalence classes.
• $$R$$ is not symmetric.
• Equivalence relation with 4 equivalence classes.
• $$R$$ is not symmetric.

#### 6.

Determine if the relation is an equivalence relation. If it is, give the number of distinct equivalence classes. $$R$$ is the relation on $$\mathbb{Z}$$ given by
\begin{equation*} a R b \Leftrightarrow a+b=0. \end{equation*}
• Not an equivalence relation.
• Correct.
• Equivalence relation with 1 equivalence class.
• $$R$$ is not transitive.
• Equivalence relation with 2 equivalence classes.
• $$R$$ is not transitive.
• Equivalence relation with infinitely many equivalence classes.
• $$R$$ is not transitive.

#### 7.

Determine if the relation is an equivalence relation. If it is, find the equivalence classes. $$R$$ is the relation on $$\mathbb{Z}$$ given by
\begin{equation*} a R b \Leftrightarrow a\equiv b \mod 4. \end{equation*}
• Not an equivalence relation.
• Check that $$R$$ is reflexive, symmetric, and transitive.
• Equivalence relation with 1 equivalence class.
• Note, 2 is not equivalent to 1 mod 4. So there is more than one equivalence class.
• Equivalence relation with 4 equivalence classes.
• Correct. The equivalence classes are $$[0]=\{4k : k\in \mathbb{Z}\}\text{,}$$ $$[1]=\{4k+1: k\in \mathbb{Z}\}\text{,}$$ $$[2]=\{4k+2 : k\in \mathbb{Z}\}\text{,}$$ $$[3]=\{4k+3 : k\in \mathbb{Z}\}\text{.}$$
• Equivalence relation with infinitely many equivalence classes.
• Although each equivalence class has infinitely many elements, there are only as many equivalence classes as possible remainders when dividing by 4.

### ExercisesExercises

#### 1.

Let $$A=\{0, 1, 2, 3, 4\}\text{.}$$ Let
\begin{equation*} R=\{(0, 0), (0, 4), (1, 1), (1, 3), (2, 2), (3, 1), (3, 3), (4, 0), (4, 4)\}. \end{equation*}
Find the equivalence classes of $$R\text{.}$$

#### 2.

Let $$A=\{0, 1, 2, 3, 4, \ldots, 20\}\text{.}$$ Let $$R$$ be the relation on $$A$$ given by
\begin{equation*} x\ R\ y\iff 4\mid (x-y). \end{equation*}
Find the equivalence classes of $$R\text{.}$$

#### 3.

Let $$A=\{-4, -3, -2, -1, 0, 1, 2, 3, 4, 5\}\text{.}$$ Let $$R$$ be the relation on $$A$$ given by
\begin{equation*} x\ R\ y\iff 3\mid (x-y). \end{equation*}
Find the equivalence classes of $$R\text{.}$$

#### 4.

Let $$X=\{a, b, c\}$$ and $$A={\cal P}(X)\text{.}$$ Let $$R$$ be the relation on $$A$$ given by
\begin{equation*} U\ R\ V\iff N(U)=N(V) \end{equation*}
where $$N(U)$$ is the number of elements in $$U\text{.}$$ Find the equivalence classes of $$R\text{.}$$

#### 5.

Determine if the following are true or false.
1. $$17 \equiv 2 \mod 5\text{.}$$
2. $$4 \equiv -5 \mod 7\text{.}$$
3. $$-2 \equiv -8 \mod 3\text{.}$$
4. $$-6 \equiv 22 \mod 2\text{.}$$

#### 6.

Let $$R$$ be the relation “congruence modulo 3.” Which of the following equivalence classes are equal?
\begin{equation*} [7], [-4], [-6], [17], [4], [27], [19] \end{equation*}

#### 7.

Let $$R$$ be the relation “congruence modulo 7.” Which of the following equivalence classes are equal?
\begin{equation*} [35], [3], [-7], [12], [0], [-2], [17] \end{equation*}

#### 8.

Prove $$a \equiv b\ \text{mod}\ 4$$ is an equivalence relation on $$\mathbb{Z}\text{.}$$ Then describe the distinct equivalence classes for this relation.
Hint.
Use that $$aRb \iff a \equiv b\ \text{mod}\ 4\iff 4\mid (a-b)\text{.}$$

#### 9.

Prove $$a \equiv b\ \text{mod}\ n$$ is an equivalence relation on $$\mathbb{Z}\text{.}$$ Then describe the distinct equivalence classes for this relation.
Hint.
Use that $$aRb \iff a \equiv b\ \text{mod}\ n\iff n\mid (a-b)\text{.}$$

#### 10.

Define $$A$$ to be the “absolute value” relation on $$\mathbb{R}$$ by
\begin{equation*} x\ A\ y \iff |x|=|y|. \end{equation*}
1. Prove $$A$$ is an equivalence relation on $$\mathbb{R}\text{.}$$
2. Describe the distinct equivalence classes for this relation.

#### 11.

Let $$R$$ be an equivalence relation on a set $$A\text{.}$$ Prove for all $$a\text{,}$$ $$b\text{,}$$ and $$c$$ in $$A\text{,}$$ if $$b\ R\ c$$ and $$c\in [a]\text{,}$$ then $$b\in [a]\text{.}$$