8.4 Equivalence Relations

We can bring these properties together to define a particular type of relation.

Definition 8.30 (Equivalence Relation).

Let XX be a set. Let \sim be a relation on XX. If \sim is reflexive, symmetric and transitive, then we call \sim an equivalence relation.

Equivalence relations are important as they give us a notion of ’equivalence’ or ’sameness’ between mathematical objects.

We’ve already seen in Example 8.23 that == on \mathbb{R} is an equivalence relation. Let us look at some other examples.

Theorem 8.31.

Let mm\in\mathbb{N}. Congruence modulo mm on the set \mathbb{Z} is an equivalence relation.

Proof.

To show that congruence modulo mm is an equivalence relation, we need to show it is reflexive, symmetric and transitive.

First we show that a=bmodma=b\mod m is reflexive. Take any integer xx\in\mathbb{Z}, and observe that m|0m|0, so m|(xx)m|(x-x) for any mm. By definition of congruence modulo mm, we have x=xmodmx=x\mod m. This shows x=xmodmx=x\mod m for every xx\in\mathbb{Z}, so a=bmodma=b\mod m is reflexive.

Next, we will show that a=bmodma=b\mod m is symmetric. For this, we must show that for all x,yx,y\in\mathbb{Z}, the condition x=ymodmx=y\mod m implies that y=xmodmy=x\mod m. We use a direct proof. Suppose x=ymodmx=y\mod m. Thus m|(xy)m|(x-y) by definition of congruence modulo mm. Then xy=max-y=ma for some aa\in\mathbb{Z} by definition of divisibility. Multiplying both sides by 1-1 gives yx=m(a)y-x=m(-a). Therefore m|(yx)m|(y-x), and this means y=xmodmy=x\mod m. We’ve shown that x=ymodmx=y\mod m implies that y=xmodmy=x\mod m, and this means a=bmodma=b\mod m is symmetric.

Finally we will show that a=bmodma=b\mod m is transitive. For this we must show that if x=ymodmx=y\mod m and y=zmodmy=z\mod m, then x=zmodmx=z\mod m. Again, we use direct proof. Suppose x=ymodmx=y\mod m and y=zmodmy=z\mod m. This means m|(xy)m|(x-y) and m|(yz)m|(y-z). Therefore there are integers aa and bb for which xy=max-y=ma and yz=mby-z=mb. Therefore, we obtain (xy)+(yz)=xz=ma+mb(x-y)+(y-z)=x-z=ma+mb. Consequently, xz=m(a+b)x-z=m(a+b) with a+ba+b\in\mathbb{Z}, and so m|(xz)m|(x-z). Hence x=zmodmx=z\mod m. This completes the proof that congruence modulo mm is transitive.

We have shown that congruence modulo mm is reflexive, symmetric and transitive, and hence an equivalence relation.

We can also look at equivalence relations between functions:

Theorem 8.32.

Let XX be the set of all sets and \sim be a relation on XX such that ABA\sim B if there exists a bijective function f:ABf:A\to B where A,BXA,B\in X. Then \sim is an equivalence relation.

Proof.

Recall that a bijective function is both surjective and injective.

  • To show \sim is reflexive, consider the identity function idA:AAid_{A}:A\to A where idA(a)=aid_{A}(a)=a for all aAa\in A. This is a bijective function. Indeed, idA(a)=idA(b)id_{A}(a)=id_{A}(b) implies a=ba=b for all a,bAa,b\in A immediately from the definition of idAid_{A} so this function is injective. It is also surjective since y=idA(y)y=id_{A}(y) for all yAy\in A.

  • For \sim to be symmetric, recall that bijective functions are invertible. Therefore, if ABA\sim B, then there exists a bijection f:ABf:A\to B. As this is a bijection, there exists f1:BAf^{-1}:B\to A which is also a bijection meaning BAB\sim A so \sim is symmetric.

  • For transitivity, recall that the composition of bijective functions is a bijection by Proposition 6.47 so if ABA\sim B and BCB\sim C, then there exist bijections f:ABf:A\to B and g:BCg:B\to C. Consider gf:ACg\circ f:A\to C. As both ff and gg are bijections, then gfg\circ f is also a bijection so ACA\sim C.

We have shown that \sim is reflexive, symmetric and transitive meaning it is an equivalence relation.

8.4.1 Cyclic Relations

Definition 8.33.

Let \sim be a relation on a set XX. We call \sim cyclic if, for every a,b,cXa,b,c\in X such that aba\sim b and bcb\sim c, we have cac\sim a.

Notice that this differs from the definition of a transitive relation since the conclusion is cac\sim a instead of aca\sim c.

If we know our relation is cyclic, we only need to check that it is also reflexive to confirm that it is an equivalence relation.

Proposition 8.34.

Let \sim be a relation over a set XX.

\sim is an equivalence relation if and only if \sim is reflexive and cyclic.

Proof.

Let \sim be a relation over a set XX.

We first assume that \sim is an equivalence relation and aim to show that it is reflexive and cyclic.

Since \sim is an equivalence relation, we know that \sim is reflexive, symmetric, and transitive. Consequently, \sim is reflexive, so we just need to show that \sim is cyclic.

To prove that \sim is cyclic, let a,b,cXa,b,c\in X where aba\sim b and bcb\sim c. We need to show that cac\sim a. As aba\sim b and bcb\sim c and since \sim is transitive, aca\sim c. Then, since \sim is symmetric, we see that cac\sim a, which is what we needed to prove.

Hence, if \sim is an equivalence relation, it is reflexive and cyclic.

On the other hand, assuming \sim is reflexive and cyclic, we can prove that \sim is an equivalence relation. We need to show that \sim is reflexive, symmetric, and transitive. Since we already know by assumption that \sim is reflexive, we just need to show that \sim is symmetric and transitive.

First, we prove that \sim is symmetric. To do so, consider any arbitrary a,bXa,b\in X where aba\sim b holds. Since \sim is reflexive, we know that aaa\sim a. Therefore, by cyclicity, since aaa\sim a and aba\sim b, we learn that bab\sim a meaning \sim is symmetric.

Finally, we prove that \sim is transitive. Let a,ba,b, and cc be any elements of XX where aba\sim b and bcb\sim c. We need to prove that aca\sim c. Since \sim is cyclic, from aba\sim b and bcb\sim c we see that cac\sim a. We’ve already proven \sim is symmetric so we also have aca\sim c and so \sim is transitive.

Overall, we have shown that \sim is cyclic and reflexive if and only if it is an equivalence relation.

8.4.2 Equivalence Classes

As we’ve already seen, it can be very helpful in a proof to reduce the number of cases that need considering. Equivalence relations are often a very useful way to do this as they can tell us which objects are “the same". Instead of working with each individual object, we can therefore work with sets consisting of the ’same’ object.

Definition 8.35.

Let \sim be an equivalence relation on a set XX, and let xXx\in X. The equivalence class of xx is

[x]={yX:xy}.[x]=\{y\in X:x\sim y\}.

The set of equivalence classes is the set X/={[x]:xX}X/{\sim}=\left\{[x]:x\in X\right\}.

Example 8.36.

We are already very familiar with equivalence classes in relation to rational numbers. Consider the set

F={(p,q):p,q,q0}.F=\left\{(p,q):p,q\in\mathbb{Z},q\neq 0\right\}.

Let \sim be the equivalence relation on FF such that (a,b)(c,d)(a,b)\sim(c,d) if ad=bcad=bc. Since ad=bcab=cdad=bc\iff\frac{a}{b}=\frac{c}{d} as b,d0b,d\neq 0, the equivalence class [(a,b)][(a,b)] is the set of all pairs (c,d)(c,d) whose corresponding fraction cd\frac{c}{d} is equal to ab\frac{a}{b}. So, for example,

[(1,2)]={(2,4),(3,6),(4,8),},\left[(1,2)\right]=\left\{(2,4),(3,6),(4,8),\cdots\right\},

since

12=24=36=48=\frac{1}{2}=\frac{2}{4}=\frac{3}{6}=\frac{4}{8}=\cdots

In particular, this means we can view \mathbb{Q} as the set of all equivalence classes of FF, since no fraction is repeated in this set.

We do have to take care with notation here as [x][x] does not tell us which equivalence relation we are defining equivalence classes with respect to. So we must always make sure that the context in which we are using this notation is clear.

Exercise 8.37.

Prove that \sim in Example 8.36 is an equivalence relation.

Solution (please try for yourself before looking)
Proof.

We first show that \sim is reflexive i.e. xxx\sim x for every xFx\in F. So suppose xFx\in F. Then there exist a,ba,b\in\mathbb{Z} with b0b\neq 0 such that x=(a,b)x=(a,b). Then ab=abab=ab since a,ba,b\in\mathbb{Z}. So xxx\sim x and thus, \sim is reflexive.

Next we show that \sim is symmetric. So we need to prove that xyyxx\sim y\implies y\sim x for every x,yFx,y\in F. So suppose x,yFx,y\in F such that xyx\sim y. Then there exist a,b,c,da,b,c,d\in\mathbb{Z} where b,d0b,d\neq 0 such that x=(a,b)x=(a,b) and y=(c,d)y=(c,d). Since xyx\sim y, we have (a,b)(c,d)(a,b)\sim(c,d) and thus ad=bcad=bc. This means that cb=dacb=da. Therefore (c,d)(a,b)(c,d)\sim(a,b) and thus yxy\sim x, which proves that \sim is symmetric.

Finally, to show that \sim is transitive, we need to prove that xyx\sim y and yzy\sim z implies that xzx\sim z for all x,y,zFx,y,z\in F. So suppose that x,y,zFx,y,z\in F such that xyx\sim y and yzy\sim z. Then there exist a,b,c,d,e,fa,b,c,d,e,f\in\mathbb{Z} where b,d,f0b,d,f\neq 0 such that x=(a,b)x=(a,b), y=(c,d)y=(c,d) and z=(e,f)z=(e,f). Since xyx\sim y and yzy\sim z, we have (a,b)(c,d)(a,b)\sim(c,d) and (c,d)(e,f)(c,d)\sim(e,f). This means that ad=bcad=bc and cf=decf=de. Thus, c=defc=\frac{de}{f}, since f0f\neq 0. Hence,

ad=b(def)adf=bdeaf=be,{ad=b\left(\frac{de}{f}\right)\iff adf=bde\iff af=be,}

since d0d\neq 0. Thus, (a,b)(e,f)(a,b)\sim(e,f) which means that xzx\sim z. Hence, \sim is transitive.

Having shown that \sim is reflexive, symmetric and transitive, we’ve therefore shown \sim is an equivalence relation on FF.

Example 8.38.

We saw in Theorem 8.31 that congruence modulo mm is an equivalence relation. The equivalence classes for this relation are:

[0]\displaystyle[0] ={n:n=0modm}={0,m,2m,}\displaystyle=\{n\in\mathbb{Z}:n=0\mod m\}=\{0,m,2m,\cdots\}
[1]\displaystyle[1] ={n:n=1modm}={1,m+1,2m+1,}\displaystyle=\{n\in\mathbb{Z}:n=1\mod m\}=\{1,m+1,2m+1,\cdots\}
\displaystyle\vdots \displaystyle\hskip 56.9055pt\vdots
[m1]\displaystyle[m-1] ={n:n=m1modm}={m1,2m1,3m1,}.\displaystyle=\{n\in\mathbb{Z}:n=m-1\mod m\}=\{m-1,2m-1,3m-1,\cdots\}.

For congruence modulo mm, we can prove that there are finitely many equivalence classes. This is not always the case.

Theorem 8.39.

Let mm\in\mathbb{N}. Congruence modulo mm on the set \mathbb{Z} has exactly mm equivalence classes.

Proof.

We saw in Corollary 8.5 that every integer kk is congruent to exactly one of 0,1,,m1modm0,1,\cdots,m-1\mod m. Setting r{0,1,,m1}r\in\{0,1,\cdots,m-1\} such that k=rmodmk=r\mod m, then [k]={n:n=kmodm}={n:n=rmodm}=[r].[k]=\{n\in\mathbb{Z}:n=k\mod m\}=\{n\in\mathbb{Z}:n=r\mod m\}=[r]. This means that we have at most mm equivalence classes.

Moreover, for r1,r2{0,1,,m1}r_{1},r_{2}\in\{0,1,\cdots,m-1\}, Theorem 8.4 says that r1r2modmr_{1}\equiv r_{2}\mod m if and only if r1=r2r_{1}=r_{2} which means that there are at least mm equivalence classes.

Taken together, there are exactly mm equivalence classes congruence modulo mm on \mathbb{Z}.

We also have examples where there are an infinite number of equivalence classes. This was true for our relation defined on the set FF in Example 8.36. Here’s another example.

Example 8.40.

Consider the set ×\mathbb{R}\times\mathbb{R} with the relation (a,b)(c,d)(a,b)\sim(c,d) if and only if a2+b2=c2+d2a^{2}+b^{2}=c^{2}+d^{2}.

Let us consider the equivalence class of (a,b)(a,b). Let A=a2+b2A=a^{2}+b^{2}. Then a general point (x,y)2(x,y)\in\mathbb{R}^{2} is related to (a,b)(a,b) if x2+y2=Ax^{2}+y^{2}=A. This is the equation of a circle centred at the origin with radius A\sqrt{A} so the equivalence classes consist of concentric circles. Note that the equivalence class [(0,0)][(0,0)] is a circle of radius 0 and consists of a single point (0.0)(0.0).

Examples of these equivalence classes are shown in Figure 8.9.

10-105-555101010-105-5551010
Figure 8.9: Diagram showing the equivalence classes [(0,0)][(0,0)] in black, [(2,0)][(2,0)] in red, [(3,4)][(3,4)] in blue and [(0,8)][(0,8)] in orange under the equivalence relation defined in Example 8.40.
Exercise 8.41.

Prove that the relation given in Example 8.40 is an equivalence relation.

Solution (please try for yourself before looking)
Proof.

Consider the set ×\mathbb{R}\times\mathbb{R} with the relation (a,b)(c,d)(a,b)\sim(c,d) if and only if a2+b2=c2+d2a^{2}+b^{2}=c^{2}+d^{2}. We need to show reflexivity, symmetry and transitivity.

  • To show \sim is reflexive, we note that a2+b2=a2+b2a^{2}+b^{2}=a^{2}+b^{2} so (a,b)(a,b)(a,b)\sim(a,b).

  • For \sim to be symmetric, we assume (a,b)(c,d)(a,b)\sim(c,d) so a2+b2=c2+d2.a^{2}+b^{2}=c^{2}+d^{2}. This is equivalent to c2+d2=a2+b2c^{2}+d^{2}=a^{2}+b^{2} so (c,d)(a,b)(c,d)\sim(a,b) and \sim is symmetric.

  • For transitivity, if (a,b)(c,d)(a,b)\sim(c,d) and (c,d)(e,f)(c,d)\sim(e,f), then a2+b2=c2+d2a^{2}+b^{2}=c^{2}+d^{2} and c2+d2=e2+f2c^{2}+d^{2}=e^{2}+f^{2} but this means a2+b2=e2+f2a^{2}+b^{2}=e^{2}+f^{2} and (a,b)(e,f)(a,b)\sim(e,f) which gives transitivity.

We have shown that \sim is reflexive, symmetric and transitive meaning it is an equivalence relation.

8.4.3 Equivalence Classes and Partitions

We now consider some properties of equivalence classes.

Theorem 8.42.

Let XX be a non-empty set and let \sim be an equivalence relation on the set XX. Then, for all x,yXx,y\in X:

  1. a)

    x[x]x\in[x].

  2. b)

    xyx\sim y if and only if [x]=[y][x]=[y].

  3. c)

    Either [x]=[y][x]=[y] or [x][y]=∅︀[x]\cap[y]=\emptyset.

Proof.
  1. a)

    Let xXx\in X. As \sim is an equivalence relation on XX, then by reflexivity, we necessarily have that xxx\sim x. Therefore x[x]x\in[x] by Definition 8.35.

  2. b)

    We first show that if xyx\sim y, then [x]=[y][x]=[y]. We are therefore showing that two sets are equal so we need to show that [x][y][x]\subseteq[y] and vice versa.

    Let a[x]a\in[x]. Then xax\sim a by Definition 8.35. By assumption xyx\sim y and, by the transitivity and symmetry of \sim, we therefore have yay\sim a so a[y]a\in[y]. Therefore [x][y][x]\subseteq[y].

    Similarly, if b[y]b\in[y], then yby\sim b and, by transitivity with xyx\sim y, xbx\sim b so b[x]b\in[x] and [y][x][y]\subseteq[x].

    We have then shown that if xyx\sim y, then [x]=[y][x]=[y]. On the other hand, we assume [x]=[y][x]=[y] and show that xyx\sim y.

    By a), we have that x[x]x\in[x] so, as [x]=[y][x]=[y], we have that x[y]x\in[y]. By definition, this means yxy\sim x so by the symmetry of \sim xyx\sim y.

    This completes the proof for b).

  3. c)

    Consider the set [x][y][x]\cap[y].

    Case 1: [x][y][x]\cap[y] is non-empty.

    This means there is an element a[x]a\in[x] and a[y]a\in[y]. As a[x]a\in[x], then xax\sim a so, by b), [x]=[a][x]=[a]. Similarly, [y]=[a][y]=[a]. Hence, [x]=[y][x]=[y].

    Case 2: [x][y][x]\cap[y] is empty.

    As the intersection must be either empty or non-empty, we have covered all possible cases and hence, we must have either [x]=[y][x]=[y] or [x][y]=∅︀[x]\cap[y]=\emptyset.

Exercise 8.43.

In b), why did we have to use both transitivity and symmetry when showing [x][y][x]\subseteq[y] but only needed transitivity when showing [y][x][y]\subseteq[x]?

Solution (please try for yourself before looking)

Transitivity is sufficient for showing [y][x][y]\subseteq[x] because we already know that xyx\sim y and yby\sim b (no swapping of order is necessary), which immediately gives us xbx\sim b.

This theorem means we can sort the elements of a set XX into distinct equivalence classes. Note that all the equivalence classes we found in the previous section are disjoint.

The map p:XX/p:X\to X/\sim which maps elements to their equivalence classes is often called the canonical projection and will continue to appear in your later studies33 3 In particular, your algebra courses. If you are interested, you may want to read about quotient spaces.. By Theorem 8.42, p(x)p(x) is a surjective map which can be used to decompose any function into the composition of a surjective and injective function.

Proposition 8.44.

Let f:ABf:A\to B be a function and consider the equivalence relation \sim on AA where aba\sim b if and only if f(a)=f(b)f(a)=f(b) for a,bAa,b\in A.

Define the function i:A/Bi:A/\sim\to B where i([a])=f(a)i([a])=f(a). Then ii is injective and f=ipf=i\circ p where p:AA/p:A\to A/\sim is the canonical projection.

Proof.

We first show that the function i:A/Bi:A/\sim\to B where i([a])=f(a)i([a])=f(a) is injective.

Assume [a],[b]A/[a],[b]\in A/\sim such that i([a])=i([b])i([a])=i([b]). To prove injectivity, we want to show [a]=[b][a]=[b].

By definition of ii, if i([a])=i([b])i([a])=i([b]), then f(a)=f(b)f(a)=f(b) so, by definition of the equivalence relation \sim, we necessarily have aba\sim b. However, by Theorem 8.42, this means [a]=[b][a]=[b]. Hence, we have shown ii is an injective function.

Finally, we consider ip:ABi\circ p:A\to B. Then, for aAa\in A, (ip)(a)=i([a])=f(a)(i\circ p)(a)=i([a])=f(a) so ip=fi\circ p=f and any function can be decomposed into the composition of a surjective and injective function.

Theorem 8.42 is not the first time we’ve seen a set being discomposed into disjoint subsets. Recall from Block 2, Definition 4.9:

Definition 8.45.

Let 𝒫\mathcal{P} be a (possibly infinite) set of subsets A1,A2,A_{1},A_{2},\cdots of the set AA such that

  1. 1.

    A=k=1AkA=\bigcup_{k=1}^{\infty}A_{k} and

  2. 2.

    AiAj=∅︀A_{i}\cap A_{j}=\emptyset for every iji\neq j.

Then we call the collection 𝒫\mathcal{P} a partition of the set AA.

Theorem 8.46.

Let XX be a non-empty set. If \sim is an equivalence relation on XX, then X/X/\sim, the set of equivalence classes, is a partition of XX.

Proof.

Let \sim be an equivalence relation on the set XX with equivalence classes [x1],[x2],[x_{1}],[x_{2}],\cdots. We need to show that i[xi]=X\cup_{i}[x_{i}]=X and the equivalence classes are pairwise disjoint.

We first show that i[xi]X\cup_{i}[x_{i}]\subseteq X. Let xi[xi]x\in\cup_{i}[x_{i}]. Then xx is an element of at least one equivalence class. By Definition 8.35, this means xXx\in X so i[xi]X\cup_{i}[x_{i}]\subseteq X.

Alternatively, let yXy\in X. By Theorem 8.42 part a), y[y]y\in[y]. As [y][y] is an equivalence class of XX, there exists some [xi][x_{i}] such that [xi]=[y][x_{i}]=[y]. Therefore, yi[xi]y\in\cup_{i}[x_{i}] and, overall, we have i[xi]=X\cup_{i}[x_{i}]=X.

Finally, let [xi][x_{i}] and [xj][x_{j}] be two equivalence classes. Then, by Theorem 8.42 part c), either [xi]=[xj][x_{i}]=[x_{j}] or [xi][xj]=∅︀[x_{i}]\cap[x_{j}]=\emptyset so the equivalence classes are pairwise disjoint.

Example 8.47.

Consider congruence modulo 2. The equivalence classes here are

[0]\displaystyle[0] ={n:n=0mod2}={0,2,4,}\displaystyle=\{n\in\mathbb{Z}:n=0\mod 2\}=\{0,2,4,\cdots\}
[1]\displaystyle[1] ={n:n=1mod2}={1,3,5,}.\displaystyle=\{n\in\mathbb{Z}:n=1\mod 2\}=\{1,3,5,\cdots\}.

Alternatively, we can say congruences modulo 2 partitions the integers into odd and even numbers.

Sometimes, it’s more useful to start with a partition on a set XX and it turns out, we can define a relation on the set XX from a partition.

Definition 8.48.

Let 𝒫\mathcal{P} be a partition on the non-empty set XX with sets A1,A2,A_{1},A_{2},\cdots. Let \sim be a relation on XX with xyx\sim y if there exists some Ai𝒫A_{i}\in\mathcal{P} such that xAix\in A_{i} and yAiy\in A_{i}. We call this the relation induced by the partition 𝒫\mathcal{P}.

Example 8.49.

Consider the set {1,2,3,4,5,6}\{1,2,3,4,5,6\} with the partition {{1,4},{3},{2,5,6}}\{\{1,4\},\{3\},\{2,5,6\}\}, then the corresponding equivalence relation is given by the graph in Figure 8.10.

143256
Figure 8.10: The relation induced by the partition given in Example 8.49.

Looking at the properties of this induced relation, we get the following fundamental theorem.

Theorem 8.50.

Let XX be a non-empty set with a partition 𝒫\mathcal{P}. The relation \sim induced by the partition 𝒫\mathcal{P} is an equivalence relation.

Proof.

We have to show that the relation \sim induced by a partition 𝒫\mathcal{P} on a non-empty set XX is reflexive, symmetric and transitive.

  1. Reflexivity: Let xXx\in X. Then, as 𝒫\mathcal{P} is a partition of XX, there exists some (unique) subset Xi𝒫X_{i}\in\mathcal{P} such that xXix\in X_{i}. Therefore xyx\sim y for all yXiy\in X_{i} by Definition 8.48 but xXix\in X_{i} so xxx\sim x as required.

  2. Symmetry: Suppose x,yXx,y\in X such that xyx\sim y. This means there is a set Xi𝒫X_{i}\in\mathcal{P} such that xXix\in X_{i} and yXiy\in X_{i}. However, if both yXiy\in X_{i} and xXix\in X_{i}, then yxy\sim x by Definition 8.48.

  3. Transitivity: Let x,y,zXx,y,z\in X such that xyx\sim y and yzy\sim z. Therefore there are some sets Xi,Xj𝒫X_{i},X_{j}\in\mathcal{P} such that x,yXix,y\in X_{i} and y,zXjy,z\in X_{j}.

    By definition of a partition, XiXjX_{i}\cap X_{j} is empty if iji\neq j. However, yXiy\in X_{i} and yXjy\in X_{j} by assumption so we must have Xi=XjX_{i}=X_{j}. But this means xXix\in X_{i} and zXiz\in X_{i} so xzx\sim z and \sim is transitive.

Therefore \sim induced by 𝒫\mathcal{P} is an equivalence relation.

Together, we’ve therefore seen that partitions define equivalence relations and equivalence relations define partitions: there is a bijective correspondence between them. They are therefore really just two different ways of looking at the same thing!

We can now also address the question posed at the beginning of this section: what is equality?

Definition 8.51 (Equality).

Given a non-empty set XX, equality on XX is the equivalence relation on XX whose equivalence classes all contain a single element.