Recall that the Gaussian integers in Example
4.12 of Chapter
4 are defined by
\begin{equation*}
{\mathbb Z}[i] = \{ a + b i : a, b \in {\mathbb Z} \}.
\end{equation*}
We usually measure the size of a complex number \(a + bi\) by its absolute value, \(|a + bi| = \sqrt{ a^2 + b^2}\text{;}\) however, \(\sqrt{a^2 + b^2}\) may not be an integer. For our valuation we will let \(\nu(a + bi) = a^2 + b^2\) to ensure that we have an integer.
Next, we must show that for any \(z= a+bi\) and \(w = c+di\) in \({\mathbb Z}[i]\) with \(w \neq 0\text{,}\) there exist elements \(q\) and \(r\) in \({\mathbb Z}[i]\) such that \(z = qw + r\) with either \(r=0\) or \(\nu(r) \lt \nu(w)\text{.}\) We can view \(z\) and \(w\) as elements in \({\mathbb Q}(i) = \{ p + qi : p, q \in {\mathbb Q} \}\text{,}\) the field of fractions of \({\mathbb Z}[i]\text{.}\) Observe that
\begin{align*}
z w^{-1} & = (a +b i) \frac{c -d i}{c^2 + d^2}\\
& = \frac{ac + b d}{c^2 + d^2} + \frac{b c -ad}{c^2 + d^2}i\\
& = \left( m_1 + \frac{n_1}{c^2 + d^2} \right) + \left( m_2 + \frac{n_2}{c^2 + d^2} \right) i\\
& = (m_1 + m_2 i) + \left( \frac{n_1}{c^2 + d^2} + \frac{n_2}{c^2 + d^2}i \right)\\
& = (m_1 + m_2 i) + (s + ti)
\end{align*}
in \({\mathbb Q}(i)\text{.}\) In the last steps we are writing the real and imaginary parts as an integer plus a proper fraction. That is, we take the closest integer \(m_i\) such that the fractional part satisfies \(|n_i / (a^2 + b^2)| \leq 1/2\text{.}\) For example, we write
\begin{align*}
\frac{9}{8} & = 1 + \frac{1}{8}\\
\frac{15}{8} & = 2 - \frac{1}{8}.
\end{align*}
Thus, \(s\) and \(t\) are the “fractional parts” of \(z w^{-1} = (m_1 + m_2 i) + (s + ti)\text{.}\) We also know that \(s^2 + t^2 \leq 1/4 + 1/4 = 1/2\text{.}\) Multiplying by \(w\text{,}\) we have
\begin{equation*}
z = z w^{-1} w = w (m_1 + m_2 i) + w (s + ti) = q w + r,
\end{equation*}
where \(q = m_1 + m_2 i\) and \(r = w (s + ti)\text{.}\) Since \(z\) and \(qw\) are in \({\mathbb Z}[i]\text{,}\) \(r\) must be in \({\mathbb Z}[i]\text{.}\) Finally, we need to show that either \(r = 0\) or \(\nu(r) \lt \nu(w)\text{.}\) However,
\begin{equation*}
\nu(r) = \nu(w) \nu(s + ti) \leq \frac{1}{2} \nu(w) \lt \nu(w).
\end{equation*}