Skip to main content

Section 2.13 Gaussian integers

This section will function basically as a long-format example of analyzing the ideal structure of \(\Z[i]\text{,}\) the so-called Gaussian integers. Many of the techniques we use can be applied more generally to the family of quadratic rings of integers \(\mathcal{O}_{\sqrt{D}}\text{.}\) Accordingly, we will begin on the this slightly higher level of generality and indicate some of these techniques.

Subsection 2.13.1 Quadratic ring of integers

Definition 2.13.1. Quadratic ring of integers.

Let \(D\) be a square-free integer, and let \(\sqrt{D}\) be a choice of square root of \(D\) lying in \(\C\text{.}\) The field \(F=\Q[\sqrt{D}]\) is called a quadratic extension of \(\Q\text{,}\) and we define the subring \(\mathcal{O}_{\sqrt{D}}\subseteq F\) as \(\Z[\omega]=\{m+n\omega\mid m,n\in \Z\}\text{,}\) where
\begin{align*} \omega \amp =\begin{cases} \sqrt{D} \amp \text{if } D\not\equiv 1 \pmod 4\\ \frac{1}{2}+\frac{\sqrt{D}}{2} \amp \text{if } D\equiv 1\pmod 4 \text{.}\end{cases} \end{align*}
Additionally, the map \(\alpha=q_1+q_2\sqrt{D}\mapsto \overline{\alpha}=q_1-q_2\sqrt{D}\) defines a ring automorphism both of \(\Q[\sqrt{D}]\) and \(\mathcal{O}_{\sqrt{D}}=\Z[\omega]\text{,}\) which in turn gives rise to a norm functions \(N_{\sqrt{D}}\colon \Q[\sqrt{D}]\rightarrow \Q\) defined as
\begin{align*} N(\alpha) \amp =\alpha\overline{\alpha}=q_1^2-q_2^2D\text{,} \end{align*}
for \(\alpha=q_1+q_2\sqrt{D}\in \Q[\sqrt{D}]\text{.}\)

Remark 2.13.2. Quadratic ring of integers.

The definition of \(\omega\) in DefinitionΒ 2.13.1 is not as ad hoc as first appears. The ring \(\mathcal{O}=\mathcal{O}_{\sqrt{D}}\) is better described as the set of all elements of \(\Q[\sqrt{D}]\) that satisfy a monic integer polynomial. This, in general, is what we call the ring of integers of a field \(F\) containing \(\Q\) as a subfield. This is a fairly abstract definition, and it is not obvious that such a set actually comprises a subring of the given field. In the simple case of a quadratic extension \(\Q[\sqrt{D}]\text{,}\) we can compute this set by hand to obtain the explicit description \(\Z[\omega]\) given in the definition. In particular, though not completely obvious, the set \(\Z[\omega]\) is indeed a subring in the case where \(D\equiv 1\pmod 4\) and \(\omega=\tfrac{1}{2}+\tfrac{\sqrt{D}}{2}\text{.}\)

Proof.

We leave most of this proof to the reader, restricting ourselves to a few comments. Statement (1) follows immediately from the fact that \(\alpha\mapsto \overline{\alpha}\) is a ring homomorphism.
Statement (2) follows from a computation. Note that since \(D\equiv 1\pmod 4\) here, the quotient \((1-D)/4\) is in fact an integer!
We give a full proof of (3). If \(\alpha\in \mathcal{O}^*\text{,}\) then we have \(1=\alpha\beta\) for some \(\beta\in \mathcal{O}\text{,}\) in which case \(1=N(1)=N(\alpha)N(\beta)\text{.}\) It follows that \(N(\alpha)\in \Z^*=\{\pm 1\}\text{.}\) Conversely if \(N(\alpha)=\alpha\overline{\alpha}=\pm 1\text{,}\) then \(\alpha^{-1}=\pm \overline{\alpha}\text{,}\) showing that \(\alpha\in \mathcal{O}^*\text{.}\)
We give a full proof of (4). Assume \(\abs{N(\pi)}=p\text{,}\) a prime integer. Since \(N(\pi)\ne 0\text{,}\) \(\pi \ne 0\text{;}\) since \(N(\pi)\notin \{\pm 1\}\text{,}\) \(\pi\) is not a unit. Given a factorization \(\pi=\alpha\beta\) in \(\mathcal{O}\text{,}\) we have \(p=\abs{N(\pi)}=\abs{N(\alpha)}\abs{N(\beta)}\text{.}\) Since \(N(\alpha)\) and \(N(\beta)\) are integers and \(p\) is prime, it follows that \(\{\abs{N(\alpha)},\abs{N(\beta)}\}\subseteq \{1,p\}\text{.}\) Since we cannot have \(\{\abs{N(\alpha)},\abs{N(\beta)}\}\subseteq \{p\}\text{,}\) one of \(\alpha\) and \(\beta\) must have a unit norm, making it itself a unit. We conclude that \(\pi\) has no nontrivial factorization, and thus that it is irreducible.
We have seen that not all quadratic rings of integers are UFDs. Indeed, \(\Z[\sqrt{-5}]\) is an example. (And see RemarkΒ 2.12.12 for a more complete picture of the state of affairs here.) However, as a nice illustration of the utility of the norm function, it is easy to see that irreducible factorizations do always exist in these rings, as the next result shows. The issue is that this irreducible factorization may not be unique: e.g., \(6=2\cdot 3=(1+\sqrt{-5})(1-\sqrt{-5})\text{.}\)

Proof.

The proof is done by strong induction on \(\abs{N(\alpha)}\) for \(\alpha\in \mathcal{O}\text{.}\) First observe that if \(\abs{N(\alpha)}=p\text{,}\) then \(\alpha\) is irreducible by PropositionΒ 2.13.3, and we are done. This gives us infinitely many bases cases as it were: i.e., we know the result for all \(\alpha\) satisfying \(\abs{N(\alpha)}\in \{2,3,5,7,11,\dots\}\text{.}\)
Now assume that the result holds for all \(\alpha\in \mathcal{O}\) with \(\abs{N(\alpha)}=n\geq 3\text{.}\) Suppose \(\alpha\in \mathcal{O}\) satisfies \(\abs{N(\alpha)}=n\text{.}\) (This means, in particular, that \(\alpha\) is nonzero, and a non-unit.) If \(\alpha\) is irreducible, we are done. Otherwise, we have a nontrivial factorization \(\alpha=\beta\gamma\text{.}\) Since \(n=\abs{N(\alpha)}=\abs{N(\beta)}\abs{N(\gamma)}\) and since \(\beta\) and \(\gamma\) are not units, it follows that \(\abs{N(\beta)}< n\) and \(\abs{N(\gamma)}< n\text{.}\) By the induction hypothesis, both \(\beta\) and \(\gamma\) can be factored as a product of irreducible elements, and thus so can \(\alpha\text{.}\)

Subsection 2.13.2 Ideal structure of \(\Z[i]\)

We now specialize to \(\Z[i]\text{.}\) Let’s gather some facts we already know about this ring.
  • \(\Z[i]\) is a PID, and hence also a UFD. Thus all ideals in \(\Z[i]\) are of the form \(I=(\alpha)\text{.}\) Furthermore, since prime is equivalent to irreducible in UFDs, and since prime is equivalent to maximal in PIDs, the following statements are equivalent.
  • An element \(\alpha=m+ni\in \Z[i]\) is a unit if and only if \(N(\alpha)=m^2+n^2\in \{\pm 1\}\text{,}\) if and only if \(\alpha\in \{\pm 1, \pm i\}\text{.}\)
  • Let \(\pi=m+ni\text{,}\) so that \(N(\pi)=m^2+n^2\text{.}\) We know that if \(\abs{N(\pi)}=N(\pi)=p\) is a prime integer, then \(\pi\) is irreducible. Thus for example, since \(N(1\pm i)=1^2+1^2=2\text{,}\) the elements \(1+i\) and \(1-i\) are irreducible, and the factorization \(2=(1+i)(1-i)\) is thus an irreducible factorization of \(2\) in \(\Z[i]\text{.}\) In particular, \(2\) is no longer prime in \(\Z[i]\text{.}\)
These observations already cover some ground, but leave open some questions.
  • We see that if \(p=m^2+n^2\text{,}\) then the elements \(m+ni\) and \(m-ni\) are irreducible, and the factorization \(p=(m+ni)(m-ni)\) is an irreducible factorization of \(p\) in \(\Z[i]\text{.}\) In particular, if \(p=m^2+n^2\text{,}\) then \(p\) is not prime in \(\Z[i]\text{.}\) Is this in fact an equivalence? If so, is there a better way of describing such primes \(p\text{?}\)
  • Are there irreducible elements \(\pi\) of \(\Z[i]\) that do not satisfy \(N(\pi)=p\) for some prime integer \(p\text{?}\) If so, what is the complete description of the set of irreducible elements of \(\Z[i]\text{?}\)
The next result answers the first bullet point’s questions. Weaving the last statement into this tapestry of equivalences will require CorollaryΒ 2.8.20. For the sake of transparency, recall that our proof of that result makes use of the structure theorem for abelian groups, a proof of which is still owed the reader, and will follow as a special case of the structure theorem for modules over PIDs.

Proof.

Since \(N(m+ni)=(m+ni)(m-ni)=m^2+n^2\text{,}\) and since \(N(\pi)=p\) implies \(\pi\) is irreducible, (2) and (3) are clearly equivalent. Furthermore, we know \((3)\) implies (1) by PropositionΒ 2.13.3.
Let’s prove that (1) implies (3). Assume \(p\) is not prime/irreducible in \(\Z[i]\text{.}\) It follows that we have \(p=\alpha\beta\) for some non-units \(\alpha,\beta\in \Z[i]\text{.}\) From \(p^2=N(p)=N(\alpha)N(\beta)\text{,}\) it follows that \(N(\alpha)=N(\beta)=p\text{:}\) otherwise, one of \(\alpha\) or \(\beta\) would have norm equal to 1, making it a unit. Thus \(N(\alpha)=\alpha\, \overline{\alpha}=p\text{,}\) and since \(N(\alpha)\) is irreducible in \(\Z\text{,}\) we conclude that \(\alpha=\pi\) is irreducible.
It remains to show that (1), (4), (5), and (6) are all equivalent. First note that (4) and (5) are equivalent since a quadratic polynomial in \(\F_p[x]\) is reducible if and only if it has a root in \(\F_p\text{.}\) (See RemarkΒ 2.8.13.) Thus \(x^2+\overline{1}\) is reducible in \(\F_p\) if and only if \(a^2+1=0\) for some \(a\in \F_p\) if and only if \(a^2=-1\text{.}\)
We now show that (1) and (4) are equivalent, by proving \(p\) is prime in \(\Z[i]\) if and only if \(x^2+1\) is irreducible in \(\F_p\text{.}\) We will do so by looking at \(\Z[i]/(p)\text{.}\) First since \((p)\) is a nonzero ideal of \(\Z[i]\text{,}\) and \(\Z[i]\) is a PID, we have \((p)\) prime if and only if \((p)\) maximal, if and only if \(\Z[i]/(p)\) is a field. We claim that \(\Z[i]/(p)\cong \F_p[x]/(x^2+1)\text{.}\) Since \(\F_p[x]\) is also a UFD, from the claim we conclude that \(p\) is prime if and only if \(x^2+1\) is irreducible, as desired.
To prove the claim, first note that \(\Z[i]\cong \Z[x]/(x^2+1)\text{.}\) We leave it to the reader to show that in fact
\begin{align*} \phi\colon \Z[x]/(x^2+1) \amp \rightarrow \Z[i]\\ g(x)+(x^2+1) \amp \mapsto g(i) \end{align*}
is a well-defined isomorphism. Next, from this isomorphism it follows that
\begin{align*} \Z[i]/(p)\amp\cong (\Z[x]/(x^2+1))/\pi((p)) \end{align*}
where \(\pi(p)=(p)+(x^2+1)\) is the image of \(((p))\) under the quotient map \(\pi\colon \Z[x]\rightarrow \Z[x]/(x^2+1)\text{.}\) This quotient of quotients situation should remind you of the third isomorphism theorem. Indeed, setting \(R=\Z[x]\) and \(I=(x^2+1)\text{,}\) we see that the ring on the right is of the form \((R/I)/\pi(J)\) for the ideal \(J=(p)\) of \(R=\Z[x]\text{.}\) But to apply the third isomorphism theorem, we need an ideal \(J\) that contains the ideal \(I=(x^2+1)\text{.}\) This is easily amended: we replace \((p)\) with \(J=(p, x^2+1)\text{.}\) Now all the conditions are met, and we have
\begin{align*} \Z[i]/(p)\amp\cong (\Z[x]/(x^2+1))/\pi((p)) \\ \amp \cong \Z[x]/(x^2+1)/(p,x^2+1)/(x^2_1)\\ \amp \cong \Z[x]/(p,x^2+1)\text{.} \end{align*}
Lastly, we apply the same third isomorphism theorem maneuver to conclude
\begin{align*} \Z[i]/(p) \amp \cong \Z[x]/(p,x^2+1)\\ \amp \Z[x]/(p) / (p, x^2+1)/ (p)\\ \amp \F_p[x]/(x^2+1)\text{.} \end{align*}
Finally, we show that (5) and (6) are equivalent. This result falls into a category of similar results from number theory that relate the existence of certain square roots modulo \(p\) to congruence relations modulo \(p\text{.}\) The one under review, that \(-1\) is a square in \(\F_p\) if and only if \(p=2\) or \(p\equiv 1\pmod 4\text{,}\) can be easily proved with some group theory. First, we dispense with the case \(p=2\text{:}\) since \(\F_2=\{0,1\}\) it follows easily that \(-1=1\) is a square in \(\F_2\text{.}\) It remains to show that for odd prime \(p\text{,}\)\(-1\) is a square in \(\F_p\) if and only if \(p\equiv 1\pmod 4\text{.}\) First note that if \(a\in \F_p\) satisfies \(a^2=-1\text{,}\) then \(a\in \F_p^*\text{,}\) \(a^4=1\text{,}\) and \(a^2=-1\ne 1\text{.}\) It follows that \(-1\) is a square in \(\F_p\) if and only if \(\F_p^*\) has an element of order \(4\text{.}\) Finally by CorollaryΒ 2.8.20, since \(\F_p^*\) is a cyclic group, it has an element of order \(4\) if and only if \(4\mid p-1\) if and only if \(p\equiv 1\pmod 4\text{.}\)
It turns out that TheoremΒ 2.13.5 is all that we need to give a complete description of the irreducible elements of \(\Z[i]\text{.}\) The key connection is that if \(\pi\) is irreducible, then the ideal \((\pi)\) contains a unique prime integer \(p\text{:}\) or equivalently, there is a unique prime integer \(p\) such that \(\pi\mid p\text{.}\) To see why, consider the inclusion homomorphism \(\phi\colon \Z\rightarrow \Z[i]\text{.}\) Since \((\pi)\) is prime ideal, its inverse image
\begin{gather*} \phi^{-1}(\pi)=(\pi)\cap \Z \end{gather*}
is a prime ideal of \(\Z\text{.}\) Since the integer \(N(\pi)=\pi\overline{\pi}\) is an element of \((\pi)\text{,}\) \((\pi)\cap \Z\) is a nonzero prime ideal, hence equal to \(p\Z\) for some prime integer \(p\in \Z\text{.}\) Furthermore, we have \(\pi\mid p\) if and only if \(p\in (\pi)\) if and only if \((\pi)\cap \Z=p\Z\text{,}\) showing uniqueness. It follows that \(p\in (\pi)\text{.}\) We say that \((\pi)\) lies over the prime \(p\) in this case. The corollary below describes the distinct irreducible elements of \(\Z[i]\text{,}\) up to associates, in terms of the unique primes they lie over.

Definition 2.13.6. Lying over.

Let \(\mathcal{O}=\mathcal{O}_{\sqrt{D}}\) be a quadratic ring of integers. We say an irreducible element \(\pi\in \mathcal{O}\) lies over the prime integer \(p\) if \(\pi\mid p\text{.}\) More generally, we say that a prime ideal \(P\) of \(\mathcal{O}\) lies over the prime integer \(p\) if \(P\cap \Z=p\Z\text{.}\)

Proof.

Let \(\pi=1+i\text{.}\) We have \(2=\pi\overline{\pi}\text{.}\) Since \(N(\overline{\pi})=N(\overline{\pi})=2\text{,}\) which is prime, both \(\pi\) and \(\overline{\pi}\) are irreducible. Furthermore, since \(1-i=-i(1+i)\text{,}\) we see that \(\pi\) and \(\overline{\pi}\) are associates. If \(\pi'\) is an irreducible element lying over \(2\text{,}\) so that \(\pi'\mid 2=\pi\overline{\pi}=(-i)\pi^2\text{,}\) then we must have \(\pi'\mid \pi\text{.}\) Since \(\pi\) is irreducible, it follows that \(\pi'\) and \(\pi\) are associates. Thus \(\pi\) is, up to associates, the unique irreducible element lying over \(2\text{.}\)
Let \(p\equiv 1\pmod 4\text{.}\) By TheoremΒ 2.13.5, there are integers \(m\) and \(n\) satisfying \(m^2+n^2=p\text{.}\) The same argument as above shows that \(\pi=m+ni\) and \(\overline{\pi}=m-ni\) are the only irreducible elements lying over \(p\text{,}\) up to associates. Since \(N(\pi)=m^2+n^2=p\text{,}\) and \(p\equiv 1\pmod 4\text{,}\) it follows easily that we cannot have \(m=\pm n\text{,}\) and hence that \(m-in\ne u(m+ni)\) for any unit \(u\in \{\pm 1, \pm i\}\text{.}\) In other words, \(\pi\) and \(\overline{\pi}\) are not associates.
Let \(p\equiv 3\pmod 4\text{.}\) By TheoremΒ 2.13.5, \(p\) is itself irreducible in \(\Z[i]\text{,}\) and thus any irreducible element \(\pi\) lying over \(p\) must be an associate to \(p\text{.}\) Thus \(p\in (p)\text{,}\) and so \((p)\) lies over \(p\text{.}\) If \(\pi\) is an irreducible element lying over \(p\text{,}\) then we have \(\pi\mid p\text{.}\) Since \(p\) is irreducible, it follows that \(\pi\) and \(p\) are associates. Thus, up to associates, the unique irreducible element lying over \(p\) is \(\pi=p\text{.}\)
FigureΒ 2.13.8 visualizes the β€œlying over” relation between primes of \(\Z[i]\) and primes of \(\Z\text{.}\) Each prime ideal of \(\Z\) is represented by a point labeled with the ideal’s nonnegative generator. The prime ideals \((0)\) in both rings are distinguished in the diagram as they are the unique prime ideals that are not maximal in both rings. (Getting way ahead of ourselves, with respect to the Zariski topology, the set \(\{(0\}\) is dense in the space of all prime ideals of \(Z\) (or \(\Z[i]\)). This is why we’ve made the points fuzzy.) Observe how the prime ideal \((p)\) for each prime integer in \(\Z\) has either one or two prime ideals of \(\Z[i]\) lying above it, depending on whether \(p\equiv 3\pmod 4\) or not. The prime \(2\) is somewhat special in that it does not remain prime in \(\Z[i]\text{,}\) but it only has one prime ideal lying above it: \((1+i)\text{.}\) Since \(2=(1+i)(1-i)\text{,}\) and \((1+i)=(1-i)\) as ideals, the ideal \((2)\subseteq \Z[i]\) factors as \((2)=(1+i)^2\text{.}\) This phenomenon is called ramification (more precisely, we say that \(2\) ramifies in \(\Z[i]\)) and is indicated in the diagram by the funny dot above \(2\text{.}\)
Diagram of relationship between primes of integers and primes of Gaussian integers
Figure 2.13.8. Primes of \(\Z[i]\) lying over primes of \(\Z\)

Proof.

We have \(n=a^2+b^2\) if and only if \(n=N(\alpha)\text{,}\) where \(\alpha=a+bi\text{.}\) Since, for an irreducible element \(\pi\in \Z[i]\) we have \(N(\pi)\in \{p, p^2\}\text{,}\) where \(p\) is the unique prime lying below \(\pi\text{,}\) it follows that any irreducible element \(\pi\) appearing in the factorization of \(n\) lies over \(2\text{,}\) \(p_i\) for some \(1\leq i\leq r\text{,}\) or \(q_j\) for some \(1\leq j\leq s\text{.}\) With the help of CorollaryΒ 2.13.7, we can pick irreducible elements \(\pi_i\) lying over \(p_i\) for each \(i\text{,}\) so that up to associates \(\pi_i\) and \(\overline{\pi_i}\) are the distinct irreducible elements lying over \(p_i\text{.}\) The corollary also tells us that up to associates \(1+i\) and \(q_j\) are the unique irreducible elements lying over \(2\) and \(q_j\text{,}\) respectively. It follows that if \(N(\alpha)=n\text{,}\) then we can write \(\alpha\) uniquely in the form
\begin{align*} \alpha \amp =u (1+i)^{k'}\prod_{i=1}^r \pi_i^{a_i}\overline{\pi}_i^{b_i} \prod_{j=1}^s q_j^{m_j'}\text{,} \end{align*}
where \(u\in \{1,-1,i,-i\}\) is a unit. But then we have
\begin{align*} N(\alpha)=n \amp \iff N(u)N(1+i)^{k'}\prod_{i=1}^r N(\pi_i)^{a_i}N(\overline{\pi}_i)^{b_i} \prod_{j=1}^s N(q_j)^{m_j'} =2^{k}\prod_{i=1}^r p_i^{n_i} \prod_{j=1}^s q_j^{m_j}\\ \amp\iff 2^{k'}\prod_{i=1}^rp_i^{a_i+b_i}\cdot \prod_{j=1}^s q_j^{2m_j'} = 2^{k}\prod_{i=1}^r p_i^{n_i} \prod_{j=1}^s q_j^{m_j} \\ \amp \iff k'=k, a_i+b_i=n_i, 2m_j'=m_j \end{align*}
for all \(1\leq i\leq r\text{,}\) \(1\leq j\leq s\text{.}\) Equivalently, we must have \(m_j\) even for all \(j\text{,}\) and \((a_i,b_i)=(a_i, n_i-a_i)\) for \(a_i\in \{0,1,\dots, n_i\}\text{.}\) We conclude that \(n=a^2+b^2\) if and only if \(n=N(\alpha)\) for an element \(\alpha\in \Z[i]\) that can we written uniquely as
\begin{align*} \alpha \amp = u (1+i)^k \cdot \prod_{i=1}^r \pi_i^{a_i}\overline{\pi}_i^{n_i-a_i}\cdot \prod_{j=1}^s q_j^{m_j/2}\text{,} \end{align*}
where \(u\in \{1,-1,i,-i\}\) is any unit, and \(a_i\in \{0,1,\dots, n_i\}\text{.}\) Since we have \(4\) choices for \(u\) and \(n_i+1\) choices for each \(a_i\text{,}\) the result follows.