Lecture 19: equivalence classes

Equivalence classes

Definitions

Definition: If \(R\) is an equivalence relation on \(A\) and \(x \in A\), then the equivalence class of \(x\), denoted \([x]_R\), is the set of all elements of \(A\) that are related to \(x\), i.e. \([x]_R = \{y \in A \mid x R y\}\). If \(R\) is clear from context, we leave it out.

In the example above, \([a] = [b] = [e] = [f] = \{a,b,e,f\}\), while \([c] = [d] = \{c,d\}\) and \([g] = [h] = \{g,h\}\). The equivalence classes are easy to see in the diagram:

equivalence classes (click for LaTeX source)

equivalence classes (click for LaTeX source)

Definition: The set of all equivalence classes of \(A\) is denoted \(A / R\) (pronounced "\(A\) modulo \(R\)" or "\(A\) mod \(R\)"). Notationally, \(A/R = \{[x] \mid x \in A\}\).

In the example above, \(A/R = \{[a], [c], [g]\}\).

Definition: If \(c \in A/R\) and \(x \in c\), then \(x\) is called a representative of \(c\).

In the example above, \(a\) is a representative of \([b]\), and \(d\) is a representative of \(\{c,d\}\).

Examples

Equivalence classes let us think of groups of related objects as objects in themselves. For example

Foreshadowing

We'll see equivalence classes in several places in the remainder of the course:

Properties

Claim: if \(R\) is an equivalence relation on \(A\), then the equivalence classes of \(R\) form a partition of \(A\). That is, every element of \(x\) is in some equivalence class, and no two different equivalence classes overlap.

Proof sketch: (you could fill in the details as an exercise)

Functions

We ended lecture with the following question. Let \(A\) be a set of people, and let \(R\) be the "is related to" relation (where everyone is assumed to be related to themselves).

Suppose I wrote down the following rule:

Let \(f : A/R → A\) be defined by letting \(f([a])\) be \(a\)'s oldest living relative

Is \(f\) a function?

To see why it might or might not be, compare it with the following rule:

Let \(g : A/R → \mathbb{N}\) be defined by letting \(g([a])\) be \(a\)'s age.

One of these is a function, and the other is not. \(f\) is a function, but not obviously so. \(g\) is not a function. To see why, suppose that \(a\)'s age is 13 and \(b\)'s age is 25. Then \(g([a]) = 13\) and \(g([b]) = 25\). But \([a] = [b]\), so we have a single input giving multiple outputs, depending on how we write it down.

\(f\) is a function, because if \([a] = [b]\) and if \(a\)'s oldest living relative is \(c\), then \(b\)'s oldest living relative must also by \(c\). So choosing different representatives of the input leads to the same value; the function is well-defined.