Without using the idea of "Every ED is a UFD" i am trying to prove $$Z[i]=\left\{a+bi:a,b \in Z\right\}$$ is a UFD
My try:
case $1.$ Let $GCD(a,b) =d\ne 1$ then $$(a+bi)=d \times (m+ni)$$ where $GCD(m,n)=1$
Case $2.$ If $GCD(a,b)=1$
Let $$(a+ib)=(p+iq)(r+is)$$
So we get:
$$(a^2+b^2)=(p^2+q^2)(r^2+s^2)$$
If $a^2+b^2$ is Prime Then the Unique Factorization of $a+ib$ is Itself.
If $a^2+b^2$ is Composite say $N_1N_2$
Then $p^2+q^2=N_1$ and $r^2+s^2=N_2$ then how can we guarantee that there exists integers $p,q,r,s$ satisfying these two equations?
Here are some examples i tried:
Ex $1.$ $2+3i$=$2+3i$
Ex $2.$ $8+4i=2 \times 2 \times (2+i)$
Ex $3.$ $7+4i=(2+3i)(2-i)$
EDIT:
With some observation i came up with a fact which i am not sure whether it is universally true.
"If $GCD(a,b)=1$ and $a^2+b^2$ is Composite then $a^2+b^2$ can be decomposed in to product of exactly two Primes"
If this is TRUE, then i am done with my Original Proof.
It is well known that every $\mathrm{PID}$ is $\mathrm{UFD}$. It's enough to prove that $\mathbb{Z}[i]$ is a $\mathrm{PID}$. Here is a formal proof which shows that $\mathbb{Z}[i]$ is an $\mathrm{ED}$ and hence a $\mathrm{PID}$.
$\mathbb{Z}[i]$ is a Euclidean Domain:
$\mathbb{Z}[i]$ is a $\mathrm{PID}$: