I have a few questions surrounding the Gaussian integers, which I hope can be answered together in one fell swoop.
- The Gaussian integers are defined as $\mathbb{Z}[i] = \{x + iy : x, y \in \mathbb{Z}\}$. What is the intuition for working with them, and why should we care about them?
- What is arithmetic like in $\mathbb{Z}[i]$?
- Are there "prime numbers" in $\mathbb{Z}[i]$?
- Do Gaussian integers factor into primes? If so, do they factor uniquely?
I think all four of your questions can be answered by looking at the following question:
i.e. when do there exist integers $a,b$ such that $$p = a^2+b^2.$$
This is certainly a natural, number theoretic question to ask. And the answer relies heavily on the Gaussian integers. Indeed, if $p$ can be expressed in the above form, then, as an element of $\mathbb Z[i]$, $$p=(a+bi)(a-bi),$$ so we can rephrase our question as follows:
It turns out that the answer to your questions $3$ and $4$ is yes:
In particular, we can rephrase our question once more:
It turns out that this is a question we can answer using the arithmetic of $\mathbb Z[i]$. It is possible (but not easy) to show that $$p\text{ is no longer prime in }\mathbb Z[i]\iff X^2+1\text{ is reducible modulo }p.$$ Note that $X^2+1$ is the minimal polynomial of $i$. Using facts from elementary number theory, $-1$ is a square mod $p$ if and only if $p=2$ or $p\equiv 1 \pmod 4$. This gives an answer to our question.
However, the story doesn't stop here. Let's say instead, we wanted to know which prime numbers $p$ can be written in the form $$p=a^2+5b^2?$$
If we were to play the same game as before, we might want to consider the ring $\mathbb Z[\sqrt{-5}]$. However, in this setting we have a problem: we no longer have unique factorisation, since, for example, $$6 = (1+\sqrt{-5})(1-\sqrt{-5})=2\cdot 3.$$ It is problems like this which the field of algebraic number theory comes to answer.