Equivalence relation induced by a function (source code)

= Equivalence relation induced by a function

Every <function> $f:X\to Y$ induces an <equivalence relation> on $X$ by $x\sim y$ exactly when $f(x)=f(y)$. Reflexivity, symmetry, and transitivity follow from the corresponding properties of equality in $Y$; the equivalence classes are the nonempty fibers of $f$.