Quadratic Integers

2 Ring of Integers of a Quadratic Field (Human-Oriented)

Let \(d\) be an integer different from \(0\) and \(1\). We also assume that \(d\) is squarefree. We write \(K\) for the subring of \(\mathbb {C}\) generated by \(\sqrt{d}\). By our assumptions on \(d\), we have that \(K = \mathbb {Q}(\sqrt{d})\) is a field.

Lemma 27

We have that \(d = \pm 1 \bmod 4\) or \(d = 2 \bmod 4\).

Proof

If \(d = 0 \bmod 4\) then \(d\) would not be squarefree.

Lemma 28

We have that \(\sqrt{d} \in \mathcal{O}_K\).

Proof

Clear since \(\sqrt{d}\) is a root of \(x^2-d\).

Lemma 29

If \(d = 1 \bmod {4}\) then \(\frac{1+\sqrt{d}}{2} \in \mathcal{O}_K\).

Proof

Write \(d = 4a + 1\), with \(a \in \mathbb {Z}\). Then \(\frac{1+\sqrt{d}}{2}\) is a root of \(x^2 - x - a \in \mathbb {Z}[x]\).

Let \(t \in K\), so \(t = a + b \sqrt{d}\) for some \(a, b \in \mathbb {Q}\). We assume that \(t \notin \mathbb {Q}\), i.e. that \(b \neq 0\).

Lemma 30

The minimal polynomial of \(t\) over \(\mathbb {Q}\) is

\[ P(x) = x^2-2at+(a^2-db^2) \]
Proof

It’s clear that \(t\) is a root of \(P\) and that \(P \in \mathbb {Q}[x]\) is monic.

Irreducibility follows by the fact that \(P\) has a root that is not rational.

Lemma 31

We have that the trace of \(t\) is \(2a\).

Proof

Clear by Lemma 30.

Lemma 32

We have that the norm of \(t\) is \(a^2-db^2\).

Proof

Clear by Lemma 30.

We suppose now that \(t \in \mathcal{O}_K\).

Lemma 33

We have that \(2a \in \mathbb {Z}\)

Proof

Since the trace of an algebraic integer is an integers, this follows by Lemma 31.

Lemma 34

We have that \(a^2-db^2 \in \mathbb {Z}\)

Proof

Since the norm of an algebraic integer is an integers, this follows by Lemma 32.

Lemma 35

We have that \((2a)^2 - d(2b)^2\) is an integer divisible by \(4\).

Proof

Clear since \((2a)^2 - d(2b)^2 = 4(a^2-db^2)\) and \(a^2-db^2 \in \mathbb {Z}\) by Lemma 34.

Lemma 36

We have that \(2b \in \mathbb {Z}\).

Proof

By Lemma 35, \((2a)^2 - d(2b)^2\) is an integer and so, by Lemma 33, we know that \(d(2b)^2 \in \mathbb {Z}\). Since \(d\) is squarefree, we conclude that \(2b \in \mathbb {Z}\).

Lemma 37

If \(a \in \mathbb {Z}\) then \(b \in \mathbb {Z}\).

Proof

By Lemma 35 and our assumption, both \((2a)^2\) and \((2a)^2 - d(2b)^2\) are integers divisible by \(4\), so the same holds for \(d(2b)^2\). In particular \(db^2 \in \mathbb {Z}\) and \(b \in \mathbb {Z}\) since \(d\) is squarefree.

Lemma 38

If \(a \not\in \mathbb {Z}\) then \(d = 1 \bmod {4}\).

Proof

We have that \(2a\), that is an integer, must be odd. By Lemmas 35 and 36, we have \((2a)^2 = d(2b)^2 \bmod {4}\), so \(2b\) must be odd and \(d = 1 \bmod {4}\) as required.

Theorem 1

Assume that \(d = 2 \bmod {4}\) or \(d = 3 \bmod {4}\). Then

\[ \mathcal{O}_K = \mathbb {Z}[\sqrt{d}] \]
Proof

By Lemma 28 we know that \(\mathbb {Z}[\sqrt{d}] \subseteq \mathcal{O}_K\). Let \(t = a + b \sqrt{d} \in \mathcal{O}_K\), with \(a, b \in \mathbb {Q}\). By Lemma 38 we have that \(a \in \mathbb {Z}\) (since by Lemma 27 we cannot have \(d = 1 \bmod {4}\)), and so by Lemma 37 we have \(b \in \mathbb {Z}\), so \(t \in \mathbb {Z}[\sqrt{d}]\).

Lemma 39

Assume that \(d = 1 \bmod {4}\) and take \(t = a + b \sqrt{d} \in \mathcal{O}_K\) with \(a, b \in \mathbb {Q}\). If \(a \in \mathbb {Z}\) then \(t \in \mathbb {Z}\left[ \frac{1+\sqrt{d}}{2} \right]\).

Proof

By Lemma 37 we have that \(b \in \mathbb {Z}\) and so \(t \in \mathbb {Z}[\sqrt{d}] \subseteq \mathbb {Z}\left[ \frac{1+\sqrt{d}}{2} \right]\).

Theorem 2

Assume that \(d = 1 \bmod {4}\). Then

\[ \mathcal{O}_K = \mathbb {Z}\left[ \frac{1+\sqrt{d}}{2} \right] \]
Proof

By Lemma 29 we know that \(\mathbb {Z}\left[ \frac{1+\sqrt{d}}{2} \right] \subseteq \mathcal{O}_K\). Let \(t = a + b \sqrt{d} \in \mathcal{O}_K\), with \(a, b \in \mathbb {Q}\).

  • If \( a \in \mathbb {Z}\) we conclude by Lemma 39.

  • If \(a \notin \mathbb {Z}\), let us consider

    \[ t' = t - \frac{1+\sqrt{d}}{2} = a - \frac{1}{2} + \left( b - \frac{1}{2} \right) \sqrt{d} \in \mathcal{O}_K \]

    Since \(2a \in \mathbb {Z}\) and \(a \notin \mathbb {Z}\), we have that \(a - \frac{1}{2} \in \mathbb {Z}\), so by Lemma 39, we have that \(t' \in \mathbb {Z}\left[ \frac{1+\sqrt{d}}{2} \right]\) and so \(t \in \mathbb {Z}\left[ \frac{1+\sqrt{d}}{2} \right]\).