# Fermat's theorem on sums of two squares

• August 2nd 2010, 10:11 AM
lisa
Fermat's theorem on sums of two squares
Hello,
I have to write an essay about Fermat's theorem on sums of two squares. Now I found a proof in a book of the following theorem:
Let $p \neq 2$ a prime number. Then the ideal $p\mathbb Z[i]$ is a prime ideal in $\mathbb Z[i]$ if and only if $p \equiv 3\ (\text{mod}\ 4)$.
Ok, now I have a question about the proof. The ideal $p\mathbb Z[i]$ in $\mathbb Z[i]$ is a prime ideal if and only if the quotient ring $\mathbb Z[i]/p \mathbb Z[i]$ is a integral domain (this is clear).

"Now there is a isomorphism $\mathbb Z[i]/p \mathbb Z[i]\cong \mathbb F_p[X]/(X^2-1)\mathbb F_p[X]$ and $p\mathbb Z[i]$ is a prime ideal in $\mathbb Z[i]$ if and only if $(X^2-1)$ is irreducible in $\mathbb F_p$, which is equivalent that $-1$ is no square mod $p$."

Is there a typing error? Is $(X^2-1)$ correct or should it be correctly $(X^2+1)$?

And what about " $-1$ is no square mod $p$"? I don't unterstand it.

Bye,
Lisa
• August 2nd 2010, 10:59 AM
evouga
It's a typo. Clearly x^2-1 is always reducible as (x+1)(x-1).

The second part is talking about -1 being a quadratic residue modulo p, ie, does there exist an x with x^2 = -1 (mod p)? For example, -1 is a quadratic residue mod 5 and 13 (since 2^2 = -1 (mod 5) and 5^2 = -1 (mod 13)).

In general, if p is an odd prime, then -1 is a quadratic residue mod p if and only if p = 1 (mod 4).
• August 2nd 2010, 12:12 PM
lisa
Hello.

Ok, then the correct equivalences are:
$(X^2+1)$ is irreducible in $\mathbb F_p \Leftrightarrow$ $-1$ is no quadratic residue mod $p$

This means, that there is no $x \in \mathbb F_p$ with $x^2\equiv -1\ (\mathrm{mod}\ p)$

But I don't understand the equivalence above. How to proof it?!

Bye,
Lisa
• August 2nd 2010, 12:33 PM
evouga
Suppose -1 is a quadratic residue mod p. Then there exists some $a \in \mathbb{F}_p$ with $a^2 \equiv -1$. We then have

$(x+a)(x-a) \equiv x^2 - a^2 \equiv x^2+1$,

and x^2+1 is reducible.

Now the converse. If x^2+1 is reducible, then $x^2+1 \equiv f(x)g(x)$ for some non-constant elements f and g of $\mathbb{F}_p[x]$. Since p is prime $\mathbb{F}_p$ has no zero-divisors, hence f and g must be linear. Thus f must have a root; call it a. a is also a root of x^2+1, so a^2 = -1 (mod p) and -1 is a quadratic residue of p.