Equivalence-relations overcounting I posted this Cardinality of equivalence relations of $\mathbb R$ with 2 equivalence classes. but cant understand some important things.
In general, lets say i want to find the cardinality of equivalence relations of $\mathbb R$ with $x\in \mathbb N$ equivalence classes.
Take $x^\mathbb R$ , i cant understand why there are overcounting ?
Suppose $x=\left\{0,1 \right\}$ then $|x|=2.$
Define:
$A:=\left\{\text{The constant zero function }\right\}$,
$B:=\left\{\text{The constant one function }\right\}.$
$A,B$ are equivalence-relations with $1$ equivalence class.
I cant understand why there are equivalence-relations overcounting and the cardinality is not just $|x^\mathbb R \setminus A \cup B.|$
I'd be grateful for your help!
 A: You are correct that there is overcounting if we look at the set of all functions.
Each function $f:\Bbb R\to X$ defines an equivalence relation $r\sim r'\Leftrightarrow f(r)=f(r')$, but if $f$ is not surjective, then there may be less than $|X|$ equivalence classes. If we're only counting equivalence relations with exactly $|X|$ many equivalence classes, then we should only count surjective functions.

It turns out, though, that the number of functions $\Bbb R\to X$ is equal to the number of surjections $\Bbb R\to X$ for any $|X|\leq |\Bbb R|$.
First, clearly every surjection is a function, so if we can show that each function can define a unique surjection, then we've proven that the set of functions and the set of surjections have equal cardinality.
Since $|X|\leq |\Bbb R|$, there exists a surjection $h:\Bbb R_{\leq 0}\to X$ surjecting the non-positive real numbers onto $X$. Let $f:\Bbb R\to X$ be a function, and define $g_f:\Bbb R_{>0}\to X$ as $g_f(r)=f(\ln(r))$. Finally, combining $h$ and $g_f$ gives a surjection $h\cup g_f:\Bbb R\to X$.
If $f\neq f'$, then also $g_f\neq g_{f'}$, and thus $h\cup g_f\neq h\cup g_{f'}$. This shows that each function $\Bbb R\to X$ can define a unique surjection $\Bbb R\to X$.
