## Here is an Elegant Proof

It is well known that $(\mathbb{Z}[i]=\{a+bi \mid a,b \in \mathbb{Z}\},+,\cdot )$ in integral domain. Consider, $N:\Bbb Z[i] \to \Bbb N$ defined by
$$\color{blue}{N(z) = z\bar{z}=|z|^2 =a^2+b^2~~~ \text{for}~~z= a+ib.}$$
We want to show that $N$ define an integral function for our Ring $\Bbb Z[i].$

- $N(0) = 0$ and $N(z) \gt 0$ for $z\neq 0.$
- $z,w,q\in \Bbb Z[i]\setminus\{0\} $ such that $z=wq$ i.e $w|z$ we have $N(q) \gt 0 \implies N(q) \ge 1$ since $N(q) \in \Bbb N$
Then, $$N(w) \le N(w)N(q) = |w|^2|q|^2 = |wq|^2 =N(wq) =N(z)$$

So, if $w|z$ then $N(w) \le N(z)$.

- Now we want to show the Euclidean division property. we use the following

**Lemma:** for every $x\in \Bbb R$ there exists a unique $u\in \Bbb Z$ such that $\color{blue}{ |x-u|\le \frac{1}{2}}$

**Proof:** Let denote by $\lfloor \ell \rfloor$ is the floor of $\ell$. Then We know that
$$\lfloor x+\frac{1}{2} \rfloor\le x+\frac{1}{2} \lt \lfloor x+\frac{1}{2}\rfloor +1\implies-\frac{1}{2}\le x -\lfloor x+\frac{1}{2} \rfloor\lt \frac{1}{2} $$
Taking $ u= \lfloor x+\frac{1}{2}$
The uniqueness follows from the uniqueness of the floor.

Now let $z,w\in \Bbb Z[i]\setminus\{0\} $ then $\frac{z}{w}$ can be written as

$$\color{red}{ \frac{z}{w}= x+iy :=\frac{z\bar{w}}{|w|^2}~~~~~ \text{with }~~~x,y\in \Bbb Q.}$$

From the Lemma there exist $u,v\in \Bbb Z$ such that
$\color{blue}{ |x-u|\le \frac{1}{2}~~~~\text{and}~~~|y-v|\le \frac{1}{2}}.$
Then,we can write
$$\color{red}{ \frac{z}{w}= x+iy = q +t~~~~~ \text{with }~~~q\in \Bbb Z, t\in \Bbb Q.}$$
Where, $ \color{blue}{q= u+iv ~~\text{and}~~~t =x-u+i(y-v)}$. Then we have, $$\color{blue}{ z= qw +tw \implies r:= tw = z-qw \in \Bbb Z.}$$

Hence $\color{red}{z= qw +r}$ with $q,r \in \Bbb Z$ with $r=tw$ where we have,
$$\color{blue}{ t =x-u+i(y-v),~~~|x-u|\le \frac{1}{2}~~~~\text{and}~~~|y-v|\le \frac{1}{2}}$$

Which means that, $$N(t) =|x-u|^2+|y-v|^2\le \frac{1}{2}$$

Therefore,
$$ N(r) =N(tw) =N(t)N(w) \le \frac12N(w) \lt N(w)$$

That is $$ \color{red}{N(r) \lt N(w).}$$

conclusion N is divivion for the Ring $\Bbb Z[i].$