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)$

$p$ prime, so $p \mid (ac+bd)$ or $p \mid (ac+bd)$.

Let's consider $p \mid (ac+bd)$. It implies $ac+bd\geq p$

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

Because of 1), p^2 \geq p^2+(ad-bc)^2$

Thus $ad-bc=0$, and \dfrac{c}{a}=\dfrac{d}{b}

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

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