# Gaussian primes when $p \equiv 1\pmod {4}$ and $x^2 +1$ factors

In watching a video from Prof. Gross's algebra course, there were some remarks for which I would appreciate explanations.

They were in a discussion of Gaussian primes, and in the case where $p \equiv 1\pmod {4}$, and $(x^2 +1)$ factors into $(x - a)(x + a)$ where $a^2\equiv - 1\pmod {p}$.

The lecture went on to say that these two factors are related to two roots whose related ideals are $(p, i - a)$ and $(p, i + a)$.

He then went on to point out that these are not principal.

But here (at last) is my first question: he then said that these are both prime in $Z[i]$. How, please, can a non-principal ideal be considered prime? (I probably should know this, did try to look it up.)

Then he went on to show that there are only two elements of order $2$, $+1$ and $-1 \pmod {p}$ by the argument that $p\mid(a^2 - 1)$, and since $p$ is prime, $p\mid(a -1)$ or $p\mid(a + 1)$; thus $a = 1$ or $a = -1$.

My second question is where does $a^2 - 1$ come from, since, we are assuming $a^2 \equiv - 1\pmod {p}$.

Lastly, I was wondering how this leads to Fermat's Theorem where $p = a^2 + b^2$. I can see that since there are two roots above which are complex conjugates and there is the constraint on $p$, $p \equiv 1\pmod {4}$. But I would appreciate help pulling it together.

Thanks. These lectures were produced eight years ago, so although I would prefer it, there is no mechanism for me to go up after class, etc.

-
For the record, $(p, i-a)$ is a principal ideal of the Gaussian integers. Arturo's answer proves this, although he didn't explicitly state the fact. In fact, every ideal of the Gaussian integers is principal. – Hurkyl Apr 10 '12 at 5:43

If $R$ is a ring, an ideal $P$ is a prime ideal if and only if:

1. $P\neq R$; and
2. If $A$ and $B$ are ideals of $R$, and $AB\subseteq P$, then $A\subseteq P$ or $B\subseteq P$.

In commutative rings, this definition is equivalent to:

Let $R$ be a commutative ring. An ideal $P$ or $R$ is a prime ideal if and only if

1. $P\neq R$; and
2. If $a,b\in R$ are such that $ab\in P$, then either $a\in P$ or $b\in P$.

The definition does not require the ideal $P$ to be principal.

To your second question: you are confusing the $a$ from the first part of the problem (which was a solution to $x^2\equiv -1\pmod{p}$), with a new variable $a$. Perhaps this will clarify it: if $r$ is an element that is of order $2$ modulo $p$, then $r^2\equiv 1\pmod{p}$, which means that $r^2-1\equiv 0\pmod{p}$, which means that $p|r^2-1 = (r-1)(r+1)$. He's just using $a$ to denote the putative element of order $2$.

So that means that if $r$ is of exponent 2 (that is, $r^2\equiv 1\pmod{p}$), then either $p|r-1$ or $p|r+1$. If $p|r-1$, then $r\equiv 1\pmod{p}$; if $p|r+1$, then $r\equiv -1\pmod{p}$. Thus, the only two elements of exponent $2$ modulo $p$ are $1$ and $-1$, as stated.

As far as the connection to the so-called "Fermat's Christmas Theorem", or "Fermat's Theorem on the Sums of Two Squares", which says that an odd prime $p$ can be written as a sum of two squares if and only if $p\equiv 1\pmod{4}$, we have the following:

If $p= a^2+b^2$, then since $a^2,b^2\equiv 0,1\pmod{4}$ and $p$ is an odd prime, we must have $p\equiv 1\pmod{4}$.

Conversely, if $p\equiv 1\pmod{4}$, then in $\mathbb{Z}[i]$ we have that $p$ is not prime; therefore, $p$ can be written as $(a+bi)(a-bi)$ for some Gaussian integers $a+bi, a-bi$, and therefore $a^2+b^2=p$.

-
@ArturoMagidinFixed the Fermat. Also I was thinking what you said about the usage of the "a"s and actually changed it to a "b" in my notes, but still didn't get it. Thanks for answering. – TheBirdistheWord Apr 10 '12 at 2:09
@Andrew: If you "still didn't get it", then don't accept the answer! What are you still having trouble with? Again: suppose $b$ is an element of order two modulo $p$. "Order two" means that $b$ is not $1$ modulo $p$, but $b^2$ is $1$ modulo $p$. That is, $b^2\equiv1 \pmod{p}$. This is equivalent to $p|b^2-1=(b-1)(b+1)$. Since $p$ is prime, $p|(b-1)(b+1)$ implies $p|b-1$ or $p|b+1$. Since $b$ is not $1$ modulo $p$, $p$ does not divide $b-1$, so we conclude that $p|b+1$, so $b\equiv -1\pmod{p}$. So the only element of order $2$ modulo $p$ is $-1$, and the only elements of exponent $p$ are 1,-1 – Arturo Magidin Apr 10 '12 at 2:36
@ArturoMagidinSorry, I was referring to the fact that even though I thought "a" was different from the "a" earlier in the lecture, I still - at that time - did not get the point. From your answer I did. My apologies for you to have to write further. – TheBirdistheWord Apr 10 '12 at 11:07