# Thread: Fermat's theorem on sums of two squares

1. ## 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 $\displaystyle p \neq 2$ a prime number. Then the ideal $\displaystyle p\mathbb Z[i]$ is a prime ideal in $\displaystyle \mathbb Z[i]$ if and only if $\displaystyle p \equiv 3\ (\text{mod}\ 4)$.
Ok, now I have a question about the proof. The ideal $\displaystyle p\mathbb Z[i]$ in $\displaystyle \mathbb Z[i]$ is a prime ideal if and only if the quotient ring $\displaystyle \mathbb Z[i]/p \mathbb Z[i]$ is a integral domain (this is clear).

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

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

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

Bye,
Lisa

2. 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).

3. Hello.

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

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

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

Bye,
Lisa

4. Suppose -1 is a quadratic residue mod p. Then there exists some $\displaystyle a \in \mathbb{F}_p$ with $\displaystyle a^2 \equiv -1$. We then have

$\displaystyle (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 $\displaystyle x^2+1 \equiv f(x)g(x)$ for some non-constant elements f and g of $\displaystyle \mathbb{F}_p[x]$. Since p is prime $\displaystyle \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.