Proof. Let
$d$ be a
squarefree integer with
$d \neq 1$ and
$K=\mathbb{Q}(\sqrt{d})$ .
If $p$ is a rational prime that divides $d$ , then
Note that $\langle p, \sqrt{d} \rangle \neq \mathcal{O}_K$ . (If they were equal, then $\langle p, \sqrt{d} \rangle^2$ would equal $\mathcal{O}_K$ .)
If $d \equiv 3 \operatorname{mod} 4$ , then $\operatorname{disc}(K)=4d$ . Note that $2$ divides $\operatorname{disc}(K)$ . Thus, $2$ ramifies in $\mathcal{O}_K$ . Therefore, $2\mathcal{O}_K=P^2$ for some prime ideal $P$ of $\mathcal{O}_K$ . Moreover, $P$ is the unique ideal of $\mathcal{O}_K$ of norm $2$ . Since $\sqrt{d} \equiv -1 \operatorname{mod} \langle 2, 1+\sqrt{d} \rangle$ , then
Since $\langle 2, 1+\sqrt{d} \rangle$ has norm $2$ , it follows that $P=\langle 2, 1+\sqrt{d} \rangle$ and $2\mathcal{O}_K=\langle 2, 1+\sqrt{d} \rangle^2$ .
If $d \equiv 1 \operatorname{mod} 8$ , then $\operatorname{disc}(K)=d$ . Note that $2$ does not divide $\operatorname{disc}(K)$ . Thus, $2$ does not ramify in $\mathcal{O}_K$ . Since
we have that $\displaystyle \left\langle 2, \frac{1+\sqrt{d}}{2} \right\rangle$ and $\displaystyle \left\langle 2, \frac{1-\sqrt{d}}{2} \right\rangle$ must be distinct. Proving that these ideals are indeed prime is similar to an argument given below.
If $d \equiv 5 \operatorname{mod} 8$ , then consider the minimal polynomial $f(x) \in \mathbb{Z}[x]$ for $\displaystyle \frac{1+\sqrt{d}}{2}$ . Since $\displaystyle \frac{1+\sqrt{d}}{2} \notin \mathbb{Q}$ , it must be the case that $\operatorname{deg}f \ge 2$ .
Thus, $\displaystyle f(x)=x^2-x+\frac{1-d}{4}$ .
Let $P$ be a prime lying over $2$ in $\mathcal{O}_K$ . Note that $f(x)$ has a root in $\mathcal{O}_K$ and thus in $\mathcal{O}_K/P$ . On the other hand, since $f(x) \equiv x^2+x+1 \operatorname{mod} 2$ , $f(x)$ considered as an element of $\mathbb{F}_2[x]$ has no root in $\mathbb{F}_2$ . Thus, $\mathcal{O}_K/P$ and $\mathbb{F}_2$ are not isomorphic. Therefore, $[\mathcal{O}_K/P \!:\! \mathbb{F}_2]>1$ . Since $1<[\mathcal{O}_K/P
\!:\! \mathbb{F}_2]=f(P|2) \le [K \!:\! \mathbb{Q}]=2$ , we have that $f(P|2)=2$ . Thus, $2$ is inert in $\mathcal{O}_K$ . It follows that $2\mathcal{O}_K$ is prime in $\mathcal{O}_K$ .
If $p$ is an odd prime that does not divide $d$ and $d \equiv n^2 \operatorname{mod} p$ , then $p$ does not divide $\operatorname{disc}(K)$ (which equals either $d$ or $4d$ ). Thus, $p$ does not ramify in $\mathcal{O}_K$ . Also, $p$ does not divide $n$ . Since
we have that $\langle p, n+\sqrt{d} \rangle$ and $\langle p, n-\sqrt{d} \rangle$ must be distinct. It will be proven that these ideals are indeed prime.
Let $\Vert I \Vert$ denote the norm of the ideal $I$ of $\mathcal{O}_K$ and $\sigma \in \operatorname{Gal}(K/\mathbb{Q})$ with $\sigma(\sqrt{d})=-\sqrt{d}$ . Then
Note that $p^2=\Vert p\mathcal{O}_K \Vert = \Vert \langle p,n+\sqrt{d} \rangle \Vert \, \Vert \langle p,n-\sqrt{d} \rangle \Vert = \Vert \langle p,n-\sqrt{d} \rangle \Vert^2$ . Therefore, $\Vert \langle p,n+\sqrt{d} \rangle \Vert = \Vert \langle p,n-\sqrt{d} \rangle \Vert = p$ . It follows that the indicated ideals are prime.
Finally, if $p$ is an odd prime that does not divide $d$ and $d$ is not a square $\operatorname{mod} p$ , then consider the minimal polynomial $g(x)=x^2-d$ for $\sqrt{d}$ over $\mathbb{Q}$ . Let $P$ be a prime lying over $p$ in $\mathcal{O}_K$ . Note that $g(x)$ has a root in $\mathcal{O}_K$ and thus in $\mathcal{O}_K/P$ . On the other hand, since $\operatorname{disc} g(x)=-4(-d)=4d$ , which is not a square in $\mathbb{F}_p$ , then $g(x)$ considered as an element of
$\mathbb{F}_p[x]$ has no root in $\mathbb{F}_p$ . Thus, $\mathcal{O}_K/P$ and $\mathbb{F}_p$ are not isomorphic. Therefore, $[\mathcal{O}_K/P \!:\! \mathbb{F}_p]>1$ . Note that $1<[\mathcal{O}_K/P \!:\! \mathbb{F}_p]=f(P|p) \le [K \!:\! \mathbb{Q}]=2$ . Thus, $f(P|p)=2$ . Therefore, $p$ is inert in $\mathcal{O}_K$ . It follows that $p\mathcal{O}_K$ is prime in $\mathcal{O}_K$ . 