Theorem of two squares. Proving $p$ can be written as a sum of two squares.

100 Views Asked by At

Hi I'm having trouble with this problem.

Let $p$ be a prime number such that $p\equiv 1\pmod4$. We want to prove that we can write it as a sum of two squares. Let $S:=\{(a,b,c)\in\mathbb N^2 \times \mathbb{Z}: 4ab+c^2=p\}$.

i) Show that $S$ is non-empty, finite and included in ${\mathbb N^*}^2\times \mathbb{Z}$.

Show that $S_1:= \{(a,b,c)\in S: a>b+c\}$ and $S_2:= \{(a,b,c)\in S: a< b+c\}$ form a partition of $S$. Explicit a bijection between $S_1$ and $S_2$.

ii) Show that $f:(a,b,c)\rightarrow (a-b-c,b-2b-c)$ is an involution of $S_1$ (i.e. $f \circ f=Id$). Study its fixed points and deduce that the cardinal of $S$ is congruent to $2 \pmod 4$.

iii) Show that $S_3:=\{(a,b,c)\in S: a\ne b\}$ has a cardinal divisible by $4$ and deduce that $p$ is a sum of two squares.


i) I have shown that it is indeed non-empty but still unsure on how to prove that it is included in the space.

ii) I could show that $f \circ f= Id$. However, I'm having trouble finding the cardinality of the function or showing how it is congruent to $2 \pmod 4$.

iii) Also having trouble with cardinality.