Integers are Countably Infinite

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

Proof
Let us arrange the integers in the following order:

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

Then we can directly see that we can define the mapping $$\phi: \mathbb{Z} \to \mathbb{N}$$ as follows:

$$ \forall x \in \mathbb{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 \mathbb{Z}$$;
 * 4) $$2y - 1 = -2x$$ in which case $$x = -y + \frac 1 2$$ and therefore $$x \notin \mathbb{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: