Equivalence class (source code)

= Equivalence class
{title2=$[x]_R=\{y:xRy\}$}
{wiki}

An equivalence class collects all the <set elements> indistinguishable from a specified <set element> under an <equivalence relation>. For an <equivalence relation> $R$ on a <set> $X$, the precise definition is
$$
[x]_R=\{y\in X:xRy\},\qquad x\in X.
$$
The ambient <set> matters: a finite class for <integer congruence> restricted to $\{0,\ldots,8\}$ differs from the infinite <residue class> for the same <integer congruence> on all <integers>. We write $[x]$ when the <equivalence relation> and ambient <set> are clear.

In the finite modulo-three example,
$$
[0]=[3]=[6]=\{0,3,6\},\qquad
[1]=[4]=[7]=\{1,4,7\},\qquad
[2]=[5]=[8]=\{2,5,8\}.
$$
There are nine names $[x]$ but only three distinct <equivalence classes>. In particular, $3\in[0]$, whereas $[3]=[0]$: the first statement is membership of a <set element>; the second is equality of two <sets>.

For any <equivalence relation> on $X$, the essential rule is
$$
xRy\quad\Longleftrightarrow\quad[x]_R=[y]_R
\quad\Longleftrightarrow\quad[x]_R\cap[y]_R\ne\varnothing.
$$
<Reflexivity> puts $x$ in $[x]_R$, so the <equivalence classes> are nonempty and cover $X$. If two <equivalence classes> share $z$, the <symmetric relation> property and <transitivity> relate their defining elements through $z$; <transitivity> then makes their members coincide. Thus distinct <equivalence classes> are disjoint, giving a <partition of a set>. Conversely, declare two <set elements> equivalent when they belong to the same block of a <partition of a set>. The three relation properties follow immediately and its <equivalence classes> recover the blocks. https://www.math.umd.edu/~pbrosnan/notes/ugalg/sect0018.html[Patrick Brosnan, Undergraduate Algebra, §2.10, Lemma 2.81, Corollary 2.82 and Theorem 2.83]{ref}