Fermat's Two Squares Theorem/Uniqueness Lemma/Proof 1

Proof
Suppose:
 * $p = a^2 + b^2 = c^2 + d^2$

where $a, b, c, d \in \Z_{>0}$.

1) $(ac+bd)(ad+bc)=(a^2+b^2)cd+(c^2+d^2)ab=p(ab+cd)$

This implies (for example) $p \mid (ac+bd)$ and thus $ac+bd\geq p$ (permuting $c$ and $d$ would end up similarly).

2) $p^2=(ac+bd)^2+(ad-bc)^2\geq p^2+(ad-bc)^2$ thus $ad-bc=0$

So $\dfrac{c^2}{a^2}=\dfrac{d^2}{b^2}=\dfrac{c^2+d^2}{a^2+b^2}=1$

Hence $c=a$, $b=d$