Units of Gaussian Integers

Theorem
Let $\left({\Z \left[{i}\right], +, \times}\right)$ be the Ring of Gaussian Integers.

The set of units of $\left({\Z \left[{i}\right], +, \times}\right)$ is $\left\{{1, i, -1, -i}\right\}$.

Proof 1
Let $a + bi$ be a unit of $\left({\Z \left[{i}\right], +, \times}\right)$.

Then $a$ and $b$ are not both $0$ as then $a + bi$ would be the zero of $\left({\Z \left[{i}\right], +, \times}\right)$.

Then:
 * $\exists c, d \in \Z: \left({a + bi}\right) \left({c + di}\right) = 1 + 0i$

This leads (after algebra) to:
 * $c = \dfrac a {a^2 + b^2}, d = \dfrac {-b} {a^2 + b^2}$

Let $a^2 + b^2 = n$.

We have that $n \in \Z, n > 0$.

If $c$ and $d$ are integers, then $a$ and $b$ must both be divisible by $n$.

Let $a = nx, b = n y$.

Then:
 * $n^2 x^2 + n^2 y^2 = n$

and so:
 * $n \left({x^2 + y^2}\right) = 1$

Thus $n = a^2 + b^2 = 1$ and so as $a, b \in \Z$ we have:
 * $a^2 = 1, b^2 = 0$

or:
 * $a^2 = 0, b^2 = 1$

from which the result follows.

Proof 2
Let $\alpha=a+bi$ be a unit of $\left({\Z \left[{i}\right], +, \times}\right)$. Then, $\exists\beta=c+di\in\Z\left[{i}\right]$ such that $\alpha\beta=1$.

The modulus, then, is $|\alpha|^{2}\cdot|\beta|^{2}=|\alpha\beta|^{2}=|1|^{2}= 1$ by Modulus of Product and Power of Product.

Since $|\alpha|$ and $|\beta|$ are positive integers, this leaves $a^{2} + b^{2} = |\alpha|^{2} = 1$ and so either $|a| = 1$ and $|b| = 0$ or $|b| = 1$ and $|a| = 0$.

Therefore, the set of units of $\left({\Z \left[{i}\right], +, \times}\right)$ is $\left\{\pm1,\pm i\right\}$, as required.