Bijection between $[0,1]$ and $[0,1]\times[0,1]$ [duplicate]

This question already has an answer here:

I know that $|\mathbb R|=|\mathbb R\times\mathbb R|$, and that $|[0,1]|=|\mathbb R|$, which suggests that $|[0,1]|=|[0,1] \times [0,1]|$ but I would like to know a bijection between the interval and square.

marked as duplicate by Asaf Karagila♦, user7530, user61527, azimut, Stefan HansenOct 18 '13 at 8:24

• The first thing that popped into my head was $t\rightarrow (t,\lim_{\omega\rightarrow\infty} \cos(2\pi\omega t))$, does this fit the bill and is it even well defined? – Dan Oct 18 '13 at 7:41
This is surprisingly subtle. Lets do this for the open interval $(0,1)\cong (0,1)\times (0,1)$ The obvious map $(0.a_1a_2\ldots,0.b_1b_2\ldots)=(0,a_1b_1a_2b_2\ldots)$ doesn't work, this is not a bijection. This is because $0,899\ldots=0.900\ldots$. It is not hard to make an injection $(0,1)\times(0,1)\rightarrow (0,1)$ by modifying this example, by choosing a representation. There is also an injection $(0,1)\rightarrow (0,1)\times (0,1)$, sending $x\mapsto (x,x)$. The theorem Cantor-Bernstein-Schroeder now gives a bijection, but this is not very explicit.
• If you can find a subset $C\subset[0,1]$ so that $C'=[0,1]\setminus C$ is countable, and using your obvious map from $C\times C\to C$, then you can map countable $C'\times C'$ to countable $C'$. – Carlos Eugenio Thompson Pinzón Oct 18 '13 at 8:03