129. Equivalence relations
If an object $a$ is like an object $b$ in some specified way, then $b$ is like $a$ in that respect. And surely $a$ is like itself — in every respect! Thus if you want to give an abstract definition of a type of relation intended to capture the idea of being alike in some respect, two of the properties you could require are reflexivity and symmetry. Relations with those two properties are studied in the literature (the nearness relation $\mathcal{N}$ in Section 55.1.4 is such a relation), but here we are going to require the additional property of transitivity, which roughly speaking forces the objects to fall into discrete types, making a partition of the set of objects being studied.
129.1 Definition: equivalence relation
An equivalence relation on a set $S$ is a reflexive, symmetric, transitive relation on $S$.
129.1.1 Remark This is an abstract definition — you don’t have to have some property or mode of similarity in mind to define an equivalence relation.
129.1.2 Example Let $A=\{1,2,3,4,5,6\}$. Here is an equivalence relation $\alpha$ on the set $A$:
$$\alpha=\{\langle n,n\rangle\mid n\in A\}\cup\{\langle 2,5\rangle,\langle 5,2\rangle,\langle 3,4\rangle,\langle 4,3\rangle,\langle 3,6\rangle,\langle 6,3\rangle,\langle 4,6\rangle,\langle 6,4\rangle\} \tag{129.1}$$
129.1.3 Example The relation “equals” on any set is an equivalence relation.
129.1.4 Example The relation “has the same parity as” on the set $\mathrm{N}$ of natural numbers is an equivalence relation. Two numbers have the same parity if they are both even or both odd.
129.1.5 Example The relation of being in the same suit on a deck of cards is an equivalence relation.
129.1.6 Example Both the congruence relation and the similarity relation on the set of triangles are equivalence relations.
129.1.7 Example The relation called equivalence on the set of propositions or the set of predicates is an equivalence relation. (This example requires that the set of propositions or predicates be precisely defined, which is done in formal treatments of logic but which has not been done in this text.)
129.2 Exercise set
In questions 129.2.1 through 129.2.9, let $E$ be the relation defined in the question on $\mathrm{Z}$. Is $E$ an equivalence relation? Explain your answer.
129.2.1 $mEn\Leftrightarrow m\leq n$ (Answer on page 250.)
129.2.2 $mEn\Leftrightarrow m^2=n$ (Answer on page 250.)
129.2.3 $mEn\Leftrightarrow m=n+1\vee n=m+1$ (Answer on page 250.)
129.2.4 $mEn\Leftrightarrow 2\mid m-n\vee 3\mid m-n$ (Answer on page 250.)
129.2.5 $mEn\Leftrightarrow m^2=n^2$
129.2.6 $mEn\Leftrightarrow m\mid n\wedge n\mid m$
129.2.7 $mEn\Leftrightarrow |m-n|<6$.
129.2.8 $mEn\Leftrightarrow 12\mid(m-n+1)$.
129.2.9 $mEn\Leftrightarrow(6\mid(m-n)\text{ and }8\mid(m-n))$.
129.3 Exercise set
In questions 129.3.1 through 129.3.6, let $E$ be the relation defined in the question on $\mathrm{R}$. Is $E$ an equivalence relation?
129.3.1 $rEs\Leftrightarrow r/s=1$ (Answer on page 250.)
129.3.2 $rEs\Leftrightarrow\mathrm{floor}(r)=\mathrm{floor}(s)$. (Answer on page 250.)
129.3.3 $rEs\Leftrightarrow[r=s\vee(0\leq r\leq 1\wedge 0\leq s\leq 1)]$ (Answer on page 250.)
129.3.4 $rEs\Leftrightarrow r+s=1$.
129.3.5 $rEs\Leftrightarrow r-s\in\mathrm{N}$.
129.3.6 $rEs\Leftrightarrow r-s\in\mathrm{Z}$
129.3.7 Exercise If $E$ and $F$ are equivalence relations on a set $S$, are $E\cap F$ and $E\cup F$ always equivalence relations?
Pages 200–201 of the book (PDF).