Look at the Gauss Sum
for a multiplicative character
It’s easy to see by executing the double sum (with a change of variables) that
(determining sign is more harder- you can apply poisson summation or Gauss’s -binomial identities etc to determine the sign)
Consider the Jacobi Sums.
Gauss Sums are the analogues of the Gamma function and Jacobi Sums are analogue of Beta function.
We have the following identity that relates Jacobi Sums to Gauss Sum- the analogue to the identity
provided is not a trivial character.
It is easy to see the above equality starting from which is a sum over and a change of variables
Fermat’s theorem: We want to prove that every prime is a sum of squares, that is there are integers such that
If , then
Hence there is an order 4 character
Look at
,
which will a sum of numbers from , because takes values in the set of fourth roots of unity
Thus for some integers
Let us look at It equals
by the factorization of Jacobi Sums into Gauss Sums seen before.
Therefore
We found a way to write as a sum of squares!