# Math Help - Problem 35

1. ## Problem 35

The mathematician, Fermat, said that any prime $p$ of the form $4k+1$ can be expressed as a sum of two squares. However, it turns out amazingly, that this representation is also unique. Accept by faith the existence of Fermat's theorem and prove uniqueness.

2. I think I have got a solution, but's its also prooving the existence of the two numbers : no acceptation by faith!
would it fit?
(i hope not, because i feel lazy and though it's not very long it's a little tricky because it's involving the distinction betwenn numbers and their 'correspondant' modulo 4k+1=p')

3. Say that $p = a^2+b^2 = c^2 + d^2$.

Note that $a^2d^2 - b^2c^2 = (p-b^2)d^2 - b^2(p-d^2) = p(d^2-b^2)\equiv 0 (\bmod p)$.
Thus,
$(ad - bc)(ad+bc)\equiv 0 (\bmod p) \mbox{ thus }ad -bc = 0 \mbox{ or }ad+bc = p$.

Our goal now is to show either $ad=bc \mbox{ or }ac=bd$. Now $ad=bc$ follows at once from the equation $ad -bc =0$. But if $ad+bc=p$ we will show this implies that $ac=bd$.

Now if $p=ad+bc$ then $p^2 = (a^2+b^2)(c^2+d^2) = (ad+bc)^2+(ac-bd)^2 = p^2+(ac-bd)^2$. Thus, $ac=bd$.

Now we have established that $ad=bc \mbox{ or }ac=bd$.

Say the first one is true $ad=bc$. Then $a|bc$. But since $\gcd(a,b)=1\implies a|c$. Say therefore that $c=ak$. Substitute $c=ak$ into $ad=bc$ we get $ad = abk \implies d=bk$. But then $p = c^2+d^2 = (ak)^2+(bk)^2 = k^2(a^2+b^2)\implies k=1 \implies a=c \mbox{ and }b=d$.

Now using a similar argument with $ac=bd$ we find that $a=d \mbox{ and }b=c$.

I hope you like this proof. I really find it beautiful how divisibility arguments lead us to this conclusion.

4. Suppose $p=a^2+b^2=c^2+d^2$.
Then
$p=(a+bi)(a-bi)=(c+di)(c-di)$

and each of $a \pm bi, c \pm di$ are primes in $\mathbb{Z}[i]$ because they have prime norms.
But $\mathbb{Z}[i]$ is a unique factorization domain hence the primes are the same up to unit factors and rearrangement (i.e. : $a+bi \in \{\pm(c+di), \pm i (c+di)\}$. This yields that $\{a^2,b^2\}=\{c^2,d^2\}$ and we are done.