Every equivalence relation on a set $S$ defines a corresponding partition, and vice versa

Consider an equivalence relation $\sim$ on a set $S$. Consider the equivalence classes $[a]=\{ x \in S : x \sim a \}$. By definition these are subsets of $S$. Their union is $S$ because by reflexivity $a\in[a]$ for every $a\in S$. Finally, they are disjoint because if $x \in [a]$ and $x \in [b]$ then $x \sim a$ and so $a \sim x$, by symmetry. But then $a \sim b$ by transitivity and so $a\in [b]$. Every $y \in [a]$ is also in $[b]$ again by transitivity. This means that $[a]\subseteq [b]$. Swapping $a$ and $b$, we conclude $[a]=[b]$. All this means that the equivalence classes form a partition of $S$.

Conversely, given a partition of $S$ in subsets $C_\lambda$, define an equivalence relation in $S$ by $a\sim b$ iff there is a $\lambda$ such that $a$ and $b$ are both in $C_\lambda$. Since the $C_\lambda$ cover $S$, every $a\in S$ is in one of those and so $\sim$ is reflexive. By definition, $\sim$ is symmetric. Since the $C_\lambda$ are disjoint, $\sim$ is transitive.

A classical application of this is Lagrange's theorem on groups: the cosets of a subgroup are equivalence classes and so form a partition. On the other hand, they all have the same cardinality. Hence, the size (order) of the subgroup divides the size of the group.


Fix a set $S$.

An equivalence relation on $S$ is a subset $E$ of $S \times S$ that satisfies reflexivity, symmetry, and transitivity. (Instead of writing $x \sim y$, we say that $(x, y) \in E$.) Let $\mathcal E = \mathcal E(S)$ denote the set of all equivalence relations on $S$.

A partition of $S$ is a set of subsets $P = \{ S_i \}$ that span $S$ and are pairwise disjoint. Let $\mathcal P = \mathcal P(S)$ denote the set of all partitions on $S$.

Define a map $\alpha: \mathcal E \to \mathcal P$, taking an equivalence relation and producing a partition from it. How? Begin with an equivalence relation $E \in \mathcal E$. For any element $s \in S$, the other elements in the same part of the partition $\alpha(E)$ are precisely those that are equivalent to $s$ in $E$. You have to show that the two conditions that make a partition are satisfied.

In the other direction, define $\beta: \mathcal P \to \mathcal E$, taking a partition and producing an equivalence relation from it. How? Now, begin with a partition $P \in \mathcal P$. For any element $s \in S$, another element is equivalent to $s$ in $\beta(P)$ exactly when they belong to the same part of the partition. Here you have to show that the three conditions that make an equivalence relation are satisfied.

In fact, the maps $\alpha$ and $\beta$ are mutually inverse bijections, meaning that $\alpha(\beta(P)) = P$ for any partition $P$ and $\beta(\alpha(E)) = E$ for any equivalence relation $E$.