Talk:Fermat's Two Squares Theorem

Proof of uniqueness :

With the same technique, there exists the following faster and brighter way:

Assuming $p=a^2+b^2=c^2+d^2$

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$

Maybe this result should also be published in the page?


 * I'm struggling to see why $a d - b c = 0$ implies $\dfrac {c^2 + d^2} {a^2 + b^2} = 1$ necessarily.


 * Yes, we have that $a d - b c = 0$ implies that $\dfrac {c^2} {a^2} = \dfrac {d^2} {b^2}$, but it does not then necessarily follow that $\dfrac {c^2 + d^2} {a^2 + b^2} = 1$.


 * If $c = 2$ and $a = 1$ and $d = 4$ and $b = 2$ then $\dfrac {c^2} {a^2} = \dfrac {d^2} {b^2}$ indeed, but $\dfrac {c^2 + d^2} {a^2 + b^2} = \dfrac {20} {5} = 4$. --prime mover (talk) 13:00, 14 September 2023 (UTC)

14:48, 14 September 2023 (UTC) Hello prime mover

That's the initial hypothesis on $p$ that makes the ratio equal 1

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


 * oh yeah suppose so --prime mover (talk) 15:30, 14 September 2023 (UTC)