Integers are Countably Infinite

Theorem
The set $$\Z$$ of integers is countably infinte, that is, can be placed in one-to-one correspondence with the natural numbers $$\N$$.

Proof
Let us arrange $$\Z$$ in the following order:


 * $$\Z = \left\{{0, 1, -1, 2, -2, 3, -3, \ldots}\right\}$$

Then we can directly see that we can define a mapping $$\phi: \Z \to \N$$ as follows:



\forall x \in \Z: \phi \left({x}\right) = \begin{cases} 2x - 1 & : x > 0 \\ - 2x & : x \le 0 \end{cases} $$

It is straightforward to show that this is a bijection:


 * First we show that $$\phi$$ is injective:

Let $$\phi \left({x}\right) = \phi \left({y}\right)$$. Then one of the following applies:


 * 1) $$-2x = -2y$$ in which case $$x = y$$;
 * 2) $$2x - 1 = 2y - 1$$ in which case $$2x = 2y$$ and so $$x = y$$;
 * 3) $$2x - 1 = -2y$$ in which case $$y = -x + \frac 1 2$$ and therefore $$y \notin \Z$$;
 * 4) $$2y - 1 = -2x$$ in which case $$x = -y + \frac 1 2$$ and therefore $$x \notin \Z$$.

So $$2x - 1 = -2y$$ and $$2y - 1 = -2x$$ can't happen and so $$x = y$$.

Thus $$\phi$$ is injective.


 * Now we show that $$\phi$$ is surjective: