4.7.2: Equivalence relations

We’ll approach another important kind of binary relation indirectly, through what might at first appear to be an unrelated idea. Let be a set. A partition of is defined to be a collection of non-empty subsets of such that each pair of distinct subsets in the collection is disjoint and the union of all the subsets in the collection is A. A partition of is just a division of all the elements of into non-overlapping subsets. For example, the sets {1,2,6}, {3,7}, {4,5,8,10}, and {9} form a partition of the set {1,2,...,10}. Each element of {1, 2, . . . , 10} occurs in exactly one of the sets that make up the partition. As another example, we can partition the set of all people into two sets, the set of males and the set of females. Biologists try to partition the set of all organisms into different species. Librarians try to partition books into various categories such as fiction, biography, and poetry. In the real world, classifying things into categories is an essential activity, although the boundaries between categories are not always well-defined. The abstract mathematical notion of a partition of a set models the real-world notion of classification. In the mathematical world, though, the categories are sets and the boundary between two categories is sharp.
In the real world, items are classified in the same category because they are related in some way. This leads us from partitions back to relations. Suppose that we have a partition of a set A. We can define a relation R on by declaring that for any and in Aif and only if and are members of the same subset in the partition. That is, two elements of are related if they are in the same category. It is clear that the relation defined in this way is reflexive, symmetric, and transitive.

An equivalence relation is defined to be a binary relation that is reflexive, symmetric, and transitive. Any relation defined, as above, from a partition is an equivalence relation. Conversely, we can show that any equivalence relation defines a partition. Suppose that R is an equivalence relation on a set A. Let ∈ A. We define the equivalence class of under the equivalence relation R to be the subset [a]R defined as [a]R = {∈ a}. That is, the equivalence class of is the set of all elements of that are related to a. In most cases, we’ll assume that the relation in question is understood, and we’ll write [a]instead of [a]R. Note that each equivalence class is a subset of A. The following theorem shows that the collection of equivalence classes form a partition of A.

Theorem 4.12.

Let be a set and let R be an equivalence relation on A. Then the collection of all equivalence classes under R is a partition of A.

Proof. To show that a collection of subsets of is a partition, we must show that each subset is non-empty, that the intersection of two distinct subsets is empty, and that the union of all the subsets is A.

If [a] is one of the equivalence classes, it is certainly non-empty, since ∈ [a]. (This follows from the fact that R is reflexive, and hence a.) To show that is the union of all the equivalence classes, we just have to show that each element of is a member of one of the equivalence classes. Again, the fact that ∈ [a] for each ∈ shows that this is true.

Finally, we have to show that the intersection of two distinct equivalence classes is empty. Suppose that and are elements of and consider the equivalence classes [a]and [b]. We have to show that if [a]$$\neq$$ [b], then [a] ∩ [b] = ∅. Equivalently, we can show the converse: If [a] ∩ [b]$$\neq$$ ∅ then [a] = [b]. So, assume that [a] ∩ [b]$$\neq$$ ∅. Saying that a set is not empty just means that the set contains some element, so there must be an x ∈ such that ∈ [a]∩[b]. Since ∈ [a], xRa. Since R is symmetric, we also have a x. Since ∈ [b], b. Since R is transitive and since (x) ∧ (b), it follows that aRb.

Our object is to deduce that [a] = [b]. Since [a] and [b] are sets, they are equal if and only if [a] ⊆ [b] and [b] ⊆ [a]. To show that [a] ⊆ [b], let be an arbitrary element of[a]. We must show that ∈ [b]. Since ∈ [a], we have that a. And we have already shown that b. From these two facts and the transitivity of R, it follows that b. By definition, this means that ∈ [b]. We have shown that any member of [a] is a member of [b] and therefore that [a] ⊆ [b]. The fact that [b] ⊆ [a] can be shown in the same way. We deduce that [a] = [b], which proves the theorem.

The point of this theorem is that if we can find a binary relation that satisfies certain properties, namely the properties of an equivalence relation, then we can classify things into categories, where the categories are the equivalence classes.

For example, suppose that is a possibly infinite set. Define a binary relation ∼ onP(U) as follows: For and in P(U), ∼ if and only if there is a bijective function from the set to the set Y. In other words, ∼ means that and have the same cardinality. Then ∼ is an equivalence relation on P(U). (The symbol ∼ is often used to denote equivalence relations. It is usually read ‘is equivalent to’.) If ∈ P(U), then the equivalence class [X]∼ consists of all the subsets of that have the same cardinality as X. We have classified all the subsets of according to their cardinality—even though we have never said what an infinite cardinality is. (We have only said what it means to have the same cardinality.)

You might know the popular puzzle called Rubik’s Cube 9, a cube made of smaller cubes with coloured sides that could be manipulated by twisting layers of little cubes. The object was to manipulate the cube so that the colours of the little cubes formed a certain configuration. Define two configurations of the cube to be equivalent if it’s possible to manipulate one configuration into the other by a sequence of twists. This is, in fact, an equivalence relation on the set of possible configurations. (Symmetry follows from the fact that each move is reversible.) It has been shown that this equivalence relation has exactly twelve equivalence classes. The interesting fact is that it has more than one equivalence class: If the configuration that the cube is in and the configuration that you want to achieve are not in the same equivalence class, then you are doomed to failure.

Fortunately if you buy the cube in the configuration you want it to be in (i.e., with 6 faces all having just one colour), you can still be successful. Since all configurations you can get to using legal moves are in the same class, you can only move to another class of configurations with an illegal move. So it is only by taking the cube apart and incorrectly putting it back together that you can really change this puzzle from difficult to impossible.

Suppose that R is a binary relation on a set A. Even though R might not be transitive, it is always possible to construct a transitive relation from R in a natural way. If we think of as meaning that is related by R to ‘in one step’, then we consider the relationship that holds between two elements and when is related by R to ‘in one or more steps’. This relationship defines a binary relation on that is called the transitive closure of R. The transitive closure of R is denoted R∗. Formally, R∗ is defined as follows: For $$a$$ and $$b$$ in $$A, a \mathcal{R}^{*} b$$ if there is a sequence $$x_{0}, x_{1}, \ldots x_{n}$$ of elements of $$A$$， where $$n>0$$ and $$x_{0}=a$$ and $$x_{n}=b,$$ such that $$x_{0} \mathcal{R} x_{1}, x_{1} \mathcal{R} x_{2}, \ldots,$$ and $$x_{n-1} \mathcal{R} x_{n}$$.

You will revist the notion of transitive closures in the course Automata, Languages, and Computability.

For example, if aRccRd, and dRb, then we would have that aR∗ b. Of course, we would also have that R∗ c, and R∗ d.

For a practical example, suppose that is the set of all cities and let A be the binary relation on such that for and in Cif there is a regularly scheduled airline flight from to y. Then the transitive closure A has a natural interpretation: A∗ if it’s possible to get from to by a sequence of one or more regularly-scheduled airline flights. You’ll find a few more examples of transitive closures in the exercises.

Exercises

1. For a finite set, it is possible to define a binary relation on the set by listing the elements of the relation, considered as a set of ordered pairs. Let be the set {abcd}, where abc, andd are distinct. Consider each of the following binary relations on A. Is the relation reflexive? Symmetric? Antisymmetric? Transitive? Is it a partial order? An equivalence relation?

a) R = {(ab), (ac), (ad)}.
b) S = {(a,a), (b,b), (c,c), (d,d), (a,b), (b,a)}.

c) T = {(bb), (cc), (dd)}.
d) C = {(ab), (bc), (ac), (dd)}.e) D = {(ab), (ba), (cd), (dc)}.

2. Let be the set {1, 2, 3, 4, 5, 6}. Consider the partition of into the subsets {1, 4, 5}, {3}, and{2, 6}. Write out the associated equivalence relation on as a set of ordered pairs.

3. Consider each of the following relations on the set of people. Is the relation reflexive? Sym- metric? Transitive? Is it an equivalence relation?

a) is related to if and have the same biological parents.
b) is related to if and have at least one biological parent in common.

c) is related to if and were born in the same year.d) is related to if is taller than y.
e) is related to if and have both visited Indonesia.

4. It is possible for a relation to be both symmetric and antisymmetric. For example, the equality relation, =, is a relation on any set which is both symmetric and antisymmetric. Suppose thatA is a set and R is a relation on that is both symmetric and antisymmetric. Show that R is a

subset of = (when both relations are considered as sets of ordered pairs). That is, show that

for any and in A, (b) → (b).

5. Let ∼ be the relation on R, the set of real numbers, such that for and in R, ∼ if and only if $$x-y \in \mathbb{Z} .$$ For example, $$\sqrt{2}-1 \sim \sqrt{2}+17$$ because the difference, $$(\sqrt{2}-1)-$$ $$(\sqrt{2}+17),$$ is $$-18,$$ which is an integer. Show that $$\sim$$ is an equivalence relation. Show that each equivalence class [x]∼ contains exactly one number which satisfies 0 ≤ < 1. (Thus, the set of equivalence classes under ∼ is in one-to-one correspondence with the half-open interval[0, 1).

6. Let and be any sets, and suppose → B. Define a relation ∼ on such that for any xand in A∼ if and only if f(x) = f(y). Show that ∼ is an equivalence relation on A.

7. Let $$\mathbb{Z}^{+}$$ be the set of positive integers $$\{1,2,3, \ldots\} .$$ Define a binary relation $$\mathcal{D}$$ on $$\mathbb{Z}^{+}$$ such that for $$n$$ and $$m$$ in $$\mathbb{Z}^{+}, n \supset m$$ if $$n$$ divides evenly into $$m,$$ with no remainder. Equivalently, $$n \supset m$$ if $$n$$ is a factor of $$m,$$ that is, if there is a $$k$$ in $$\mathbb{Z}^{+}$$ such that $$m=n k .$$ Show that $$\mathcal{D}$$ is a partial order.

8. Consider the set N × N, which consists of all ordered pairs of natural numbers. Since N × Nis a set, it is possible to have binary relations on N × N. Such a relation would be a subset of (N×N)×(N×N). Define a binary relation ⪯ on N×N such that for (m,n) and (k,l)inN×N,(m,n) ⪯ (k,l)ifandonlyifeitherm kor((k)∧(≤ l)). Whichofthe following are true?

1. (2,7) ⪯ (5,1)

2. (8,5) ⪯ (8,0)

3. (0,1) ⪯ (0,2)

4. (17,17) ⪯ (17,17)  Show that ⪯ is a total order on N × N.

9. Let ∼ be the relation defined on N × N such that (nm) ∼ (k, l) if and only if + l = k. Show that ∼ is an equivalence relation.

10. Let be the set of people and let Cbethe‘child of relation. That is xCy means that is a child of y. What is the meaning of the transitive closure C∗? Explain your answer.

11. Let R be the binary relation on N such that if and only if + 1. Identify the transitive closure R∗. (It is a well-known relation.) Explain your answer.

12. Suppose that R is a reflexive, symmetric binary relation on a set A. Show that the transitive closure R∗ is an equivalence relation.