# Arithmetics in Gaussian Integers \( \mathbb Z[i] \)

We have already seen that the norm of element \( a+bi\in\mathbb{Z}[i] \)
(\( a,b\in\mathbb{Z} \)) is \( N(a+bi)=a^2+b^2 \) and the units are \( \pm1 \)
and \( \pm i \). Therefore, all divisors of a prime element
\( \pi\in\mathbb{Z}[i] \) are \( \pm1,\pm i,\pm\pi,\pm i\pi \).

** Theorem 6 **

The Fundamental Theorem of Arithmetic (FTA)
holds in the set of Gaussian integers \( \mathbb{Z}[i] \).

Based on theorem 5, it is enough to show that
for all \( a,b\in\mathbb{Z}[i] \) with \( b\neq0 \) there exists an element
\( p\in\mathbb{Z}[i] \) such that \( N(a-pb)< N(b) \).

Let \( \sigma,\tau\in\mathbb{R} \) be such that \( a/b=\sigma+\tau i \), and
let \( s,t\in\mathbb{Z} \) be such that \( |\sigma-s|\leq 1/2 \) and
\( |\tau-t|\leq1/2 \). Setting \( p=s+ti \) yields \( a-pb=(\sigma+\tau
i)b-pb=[(\sigma-s)+(\tau-t)i]b \), which implies \[ N(a-pb)=
N[(\sigma-s)+(\tau-t)i]N(b)=[(\sigma-s)^2+(\tau-t)^2]N(b)\leq
N(b)/2< N(b).\] This proves the theorem.

The following proposition describes all prime elements in the set of
Gaussian integers.

** Theorem 7 **

An element \( x\in\mathbb{Z}[i] \) is prime if
and only if \( N(x) \) is a prime or \( |x| \) is a prime integer of the
form \( 4k-1 \), \( k\in\mathbb{N} \).

Consider an arbitrary prime \( x=a+bi
\in\mathbb{Z}[i] \) (\( a,b\in \mathbb{Z} \)). Element \( \overline{x} \) is
prime also (indeed, if \( \overline{x}=yz \), then \( x=\overline{y}\:
\overline{z} \)), so \( N(x) \) factorizes into primes as \( x\overline{x} \).

Suppose that \( N(x) \) is composite, \( N(x)=mn \) for some two natural
numbers \( m,n> 1 \). It follows from \( x\overline{x}=mn \) and the FTA that
\( x\sim m \) or \( x\sim n \), so we may suppose w.l.o.g. that \( x \) is a
prime integer. If \( x=2 \) or \( x\equiv1 \) (mod 4), then there exist
integers \( a,b\in\mathbb{Z} \) such that
\( N(a+bi)=(a+bi)(a-bi)=a^2+b^2=x \); hence \( x \) is composite in
\( \mathbb{Z}[i] \). On the other hand, if \( x \) is a prime integer with
\( x\equiv3 \) {\rm(mod 4)}, then \( x \) is also prime in \( \mathbb{Z}[i] \).
Indeed, if \( x=uv \) for some nonunit elements \( u,v\in\mathbb{Z}[i] \),
then \( x^2=N(x)=N(u)N(v) \) implies \( N(u)=N(v)=x \) which is impossible.
This proves our claim.

** Problem 3 **

Solve the equation \( x^5-1=y^2 \) in integers.

Rewrite the equation in the form
\( x^5=(y+i)(y-i) \). Note that \( x \) is not even, as otherwise
\( y^2\equiv-1 \) (mod 4). Thus \( y \) is even and consequently the
elements \( y+i \) and \( y-i \) are coprime in \( \mathbb{Z}[i] \). Since
\( (y+i)(y-i) \) is a fifth power, it follows that \( y+i \) and \( y-i \) are
both fifth powers. Let \( a,b\in \mathbb{Z} \) be such that
\( y+i=(a+bi)^5=a(a^4-10a^2b^2+5b^4)+b(5a^4-10a^2b^2+b^4)i \). It holds
that \( b(5a^4-10a^2b^2+b^4)=1 \), and therefore \( b=\pm1 \). It is easily
seen that we must have \( y=0 \) and \( x=1 \).

** Problem 4 **

Suppose that \( x,y \) and \( z \) are natural
numbers satisfying \( xy=z^2+1 \). Prove that there exist integers
\( a,b,c,d \) such that \( x=a^2+b^2 \), \( y=c^2+d^2 \) and \( z=ac+bd \).

We use the following important fact: If
\( m,n,p,q \) are elements of a unique factorization domain \( K \) (in this
case, \( K=\mathbb{Z}[i] \)) satisfying \( mn=pq \), then there exist
\( u_1,u_2,v_1,v_2\in K \) such that \( m=u_1v_1 \), \( n=u_2v_2 \), \( p=u_1v_2 \),
\( q=u_2v_1 \). The proof of this fact is the same as in the case of
\( m,n,p,q\in\mathbb{Z} \) and follows directly from the factorizations
of \( m,n,p,q \) into primes.

Since \( xy=z^2+1=(z+i)(z-i) \), the above fact gives us
\[ \begin{array}{cccccccc}x=u_1v_1&(1),
&y=u_2v_2&(2),&z+i=u_1v_2&(3),&z-i=u_2v_1&(4)\end{array}\] for some
\( u_1,u_2,v_1,v_2\in\mathbb{Z}[i] \). The numbers \( x,y \) are real, and
therefore \( v_1=q_1\overline{u_1} \), \( v_2=q_2\overline{u_2} \) for some
rational numbers \( q_1,q_2 \). From (3) and (4) we easily conclude that
\( q_1=q_2=1 \). Now putting \( u_1=a+bi \), \( u_2=c+di \) yields
\( x=u_1\overline{u_1}=a^2+b^2 \), \( y=c^2+d^2 \) and \( z=ac+bd \).