I am trying to prove the following:
Consider $p$, a prime natural number with $p\equiv 1\pmod4$. Show that the equation $a^2 + b^2 = p$ has a unique solution $a, b \in \mathbb{Z}_{≥0}$, up to swapping $a$ and $b$.
I know if $p\equiv 1(\bmod4)$ then $p = (a + bi)(a − bi)$ is a prime factorisation, which I think gets me part of the way there, but I don't know how to prove it.
If we have two ways to write $p$ as a sum of two squares: $$ p=a^2+b^2=c^2+d^2 $$ then that would give rise to two prime factorizations $$ p=(a+bi)(a-bi)=(c+di)(c-di) $$ But the fundamental theorem of arithmetic is still valid in the Gaussian integers. So these two factorizations must be the same, up to order, and factors of $i$. Thus $a^2,b^2$ must be the same two squares as $c^2,d^2$ (albeit possibly not in the same order).