\def\module{M3P15 Algebraic Number Theory}
\def\lecturer{Dr Ana Caraiani}
\def\term{Spring 2019}
\def\cover{
$$
\begin{tikzpicture}[scale=0.7]
\draw [help lines] (-9, -9) grid (9, 9);
\draw [->, dashed] (0, -10) to (0, 10);
\draw [->, dashed] (-10, 0) to (10, 0);
\draw [domain=-9:-1] plot (\x, {3*sqrt(10)/\x});
\draw [domain=1:9] plot (\x, {3*sqrt(10)/\x});
\draw [domain=-9:-1] plot (\x, {-3*sqrt(10)/\x});
\draw [domain=1:9] plot (\x, {-3*sqrt(10)/\x});
\draw (-6, 7) node[below]{$ \lambda\br{\QQ\br{\sqrt{10}}} $};
\draw (-6.5, 6) node[below]{$ = \sqrt{4 \cdot 10} / 2 $};
\draw (-7, 5) node[below]{$ = \sqrt{10} $};
\draw (0, {2*sqrt(3*sqrt(10))}) to ({-2*sqrt(3*sqrt(10))}, 0);
\draw (0, {2*sqrt(3*sqrt(10))}) to ({2*sqrt(3*sqrt(10))}, 0);
\draw (0, -{2*sqrt(3*sqrt(10))}) to ({-2*sqrt(3*sqrt(10))}, 0);
\draw (0, -{2*sqrt(3*sqrt(10))}) to ({2*sqrt(3*sqrt(10))}, 0);
\draw [domain=-9:-3.7, dotted, thick] plot (\x, {\x + 4*sqrt(10)});
\draw [domain=-9:2.7, dotted, thick] plot (\x, {\x + 2*sqrt(10)});
\draw [domain=-9:9, dotted, thick] plot (\x, \x);
\draw [domain=-2.7:9, dotted, thick] plot (\x, {\x - 2*sqrt(10)});
\draw [domain=3.7:9, dotted, thick] plot (\x, {\x - 4*sqrt(10)});
\draw [domain=-9:-5.3, dotted, thick] plot (\x, {(2 + sqrt(10))/(2 - sqrt(10))*(\x + 6) - 6});
\draw [domain=-5.7:-1.7, dotted, thick] plot (\x, {(2 + sqrt(10))/(2 - sqrt(10))*(\x + 3) - 3});
\draw [domain=-2:2, dotted, thick] plot (\x, {(2 + sqrt(10))/(2 - sqrt(10))*\x});
\draw [domain=1.7:5.7, dotted, thick] plot (\x, {(2 + sqrt(10))/(2 - sqrt(10))*(\x - 3) + 3});
\draw [domain=5.3:9, dotted, thick] plot (\x, {(2 + sqrt(10))/(2 - sqrt(10))*(\x - 6) + 6});
\fill (-3, -3) circle (0.1) node[above right]{$ \alpha \in \sbr{\abr{3, 2 + \sqrt{10}}} $};
\draw [->, thick] (0, 0) to (3, 3);
\draw (2, 1) node[above]{$ 3 $};
\draw [->, thick] (0, 0) to ({2 - sqrt(10)}, {2 + sqrt(10)});
\draw (-2, 2) node[above]{$ 2 + \sqrt{10} $};
\draw (1, 3) node[above]{$ \abr{3, 2 + \sqrt{10}} $};
\draw (6, -5) node{$ \Cl \QQ\br{\sqrt{10}} $};
\draw (6, -6) node{$ \cong \abr{\abr{3, 2 + \sqrt{10}}} $};
\draw (5, -7) node{$ \cong \ZZ / 2\ZZ $};
\end{tikzpicture}
$$
}
\def\syllabus{Rings. Unique factorisation domains. Principal ideal domains. Euclidean domains. Gaussian integers. Eisenstein integers. Number fields. Structure theorem for finitely generated abelian groups. Integral closure. Norms. Traces. Discriminants. Rings of integers. Dedekind domains. Unique factorisation of Dedekind domains. Splitting of prime ideals in quadratic fields. Class groups. Finiteness of class groups. Groups of units.}
\def\thm{subsection}

\input{../style/header}

\begin{document}

\input{../style/cover}

\section{Motivation and overview}

\lecture{1}{Friday}{11/01/19}

The goal of this course will be to introduce algebraic number theory, specifically the arithmetic of finite extensions of $ \QQ $, with an emphasis on quadratic extensions as a rich source of examples. We will start with some motivation and then review the necessary background from ring theory. We will then discuss unique factorisation domains, principal ideal domains and Euclidean domains. These tools will be enough to study Gaussian integers and Eisenstein integers in-depth. To understand more general number fields, we will need some more commutative algebra. We will discuss the structure theorem for finitely generated abelian groups and the notion of integral closure. We will also introduce norms, traces, and discriminants. We will show that rings of integers in number fields are Dedekind domains and we will state and prove unique factorisation for Dedekind domains. We will then study the splitting of prime ideals in quadratic fields. We will define the class group and prove that it is always finite. We will end with a discussion of the groups of units. For quadratic fields, a good reference with many examples is $ 2 $. Another reference we will use is $ 1 $.
\begin{enumerate}
\item P Samuel, Algebraic theory of numbers, 1970
\item M Trifkovic, Algebraic theory of quadratic numbers, 2013
\end{enumerate}
Algebraic number theory developed from
\begin{itemize}
\item trying to generalise known properties of integers, such as unique factorisation, to finite extensions of $ \QQ $, and
\item trying to solve Diophantine equations in a systematic way.
\end{itemize}
For example, \textbf{Fermat's equation} is
$$ x^n + y^n = z^n, \qquad n \ge 2, \qquad x, y, z \in \ZZ. $$
Let $ n \in \ZZ_{\ge 0} $. A question is when can we write $ n $ as
$$ n = a^2 + b^2, \qquad a, b \in \ZZ? $$
The following are some observations.
\begin{itemize}
\item If $ n = a_1^2 + b_1^2 $ and $ m = a_2^2 + b_2^2 $, then
$$ m \cdot n = \br{a_1a_2 + b_1b_2}^2 + \br{a_1b_2 - a_2b_1}^2. $$
\item Every $ n \ge 0 $ can be written as a product
$$ n = p_1^{k_1} \dots p_r^{k_r}, \qquad k_i \in \ZZ_{\ge 1}, $$
where $ p_i $ are prime numbers. Irreducibles are such that only divisors are $ 1 $ and $ p_i $. Primes are such that $ p_i \mid mn $ implies that $ p_i \mid m $ or $ p_i \mid n $. Irreducibles and primes are equivalent in $ \ZZ $.
\item Only care about $ p_i $ with odd exponent.
\end{itemize}

When can we write
$$ p = a^2 + b^2, \qquad a, b \in \ZZ, $$
where $ p $ is prime? An observation is that $ p = 2, 5, 13, 17, 29, 37, \dots $ is ok, and $ p \ne 3, 7, 11, 19, 23, \dots $ is not ok. A conjecture is if $ p \equiv 3 \mod 4 $, then $ p \ne a^2 + b^2 $ for $ a, b \in \ZZ $, otherwise this is ok.

\pagebreak

\begin{theorem}
If $ p \equiv 3 \mod 4 $ then
$$ p \ne a^2 + b^2, \qquad a, b \in \ZZ. $$
\end{theorem}

\begin{proof}
$ a^2 + b^2 \equiv 0 \mod p $ and $ a, b \not\equiv 0 \mod p $ if and only if $ \br{a / b}^2 \equiv -1 \mod p $, if and only if $ \br{\tfrac{-1}{p}} = 1 $, so $ p \equiv 3 \mod 4 $.
\end{proof}

\begin{remark*}
The proof tells us that $ n \ne a^2 + b^2 $ whenever $ n $ has a prime factor $ p_i \equiv 3 \mod 4 $ with odd exponent $ k_i $ for $ i = 1, \dots, r $. If every $ p \equiv 1 \mod 4 $ is of the form $ p = a^2 + b^2 $, then we understand the general case,
$$ n = a^2 + b^2 \qquad \iff \qquad \forall p_i \mid n, \qquad p_i \equiv 3 \mod 4, \qquad k_i \in 2\ZZ. $$
\end{remark*}

\begin{theorem}
If $ p \equiv 1 \mod 4 $ then
$$ p = a^2 + b^2, \qquad a, b \in \ZZ. $$
\end{theorem}

The factorisation in
$$ \ZZ\sbr{i} = \ZZ \oplus \ZZ i = \cbr{a + bi \st a, b \in \ZZ}, \qquad i^2 = -1 $$
is
$$ p = a^2 + b^2 = \br{a + bi}\br{a - bi}, \qquad a, b \in \ZZ. $$
This is the subring of the Gaussian integers in $ \QQ\br{i} / \QQ $, an extension $ \QQ\sbr{x} / \abr{x^2 + 1} $ of $ \QQ $ of degree two, a quadratic field. We will understand prime factorisation in $ \ZZ\sbr{i} $, and in more general finite extensions of $ \QQ $.

\begin{theorem}[Unique factorisation in $ \ZZ $]
\label{thm:uniquefactorisationinz}
Any $ n \in \ZZ \setminus \cbr{0, \pm 1} $ can be written uniquely as a product of primes, up to permuting the prime factors or changing their signs.
\end{theorem}

\begin{proposition}[Division algorithm]
Given $ a, b \in \ZZ $ for $ b \ne 0 $, there exist $ q, r \in \ZZ $ such that
$$ a = qb + r, \qquad 0 \le r < \abs{b}. $$
\end{proposition}

\begin{proposition}[Euclid's algorithm]
Let $ a, b \in \ZZ \setminus \cbr{0} $. There exist a greatest common divisor $ \gcd\br{a, b} \mid a $ and $ \gcd\br{a, b} \mid b $, and $ r, s \in \ZZ $ such that
$$ ar + bs = \gcd\br{a, b}. $$
\end{proposition}

\begin{proof}
Consider
$$ I = \cbr{ma + nb \st m, n \in \ZZ}. $$
Then $ \gcd\br{a, b} $ will be the smallest positive element of $ I $.
\end{proof}

Let $ I \subseteq \ZZ $ be the ideal of $ \ZZ $ generated by $ a $ and $ b $. The proof of Euclid's algorithm shows $ I $ is generated by $ \gcd\br{a, b} $. In fact, every ideal of $ \ZZ $ is generated by one element, that is it is principal.

\begin{proposition}[Euclid's lemma]
If $ p \in \ZZ $ is prime, then $ p \mid ab $ for $ a, b \in \ZZ $ implies that $ p \mid a $ or $ p \mid b $.
\end{proposition}

\begin{proof}[Proof of Theorem \ref{thm:uniquefactorisationinz}]
\hfill
\begin{itemize}
\item All $ n \in \ZZ $ has a prime divisor by taking $ p \in \ZZ_{\ge 2} $, the smallest divisor of $ n $.
\item Prime factorisation exists. Let $ n $ be the smallest integer which does not have one.
\item Uniqueness. Let $ n = p_2 \dots p_n = q_2 \dots q_m $. Euclid's lemma implies that $ p_1 \mid q_1 $, up to reordering, so $ p_1 = \pm q_1 $, and continue.
\end{itemize}
\end{proof}

\pagebreak

\section{Background from ring theory}

\subsection{Rings}

\lecture{2}{Monday}{14/01/19}

A ring is commutative and with unity.

\begin{definition}
A \textbf{unit} in a ring $ R $ is an element $ a \in R $ such that there exists $ b \in R $ with $ a \cdot b = 1 $.
\begin{itemize}
\item The set of units forms a group under multiplication, denoted by $ R^\times $.
\item If $ b \in R $ exists such that $ ab = 1 $ then $ b $ is unique.
\end{itemize}
If $ R \setminus \cbr{0} = R^\times $, then $ R $ is a \textbf{field}.
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item $ \ZZ^\times = \cbr{\pm 1} $.
\item $ \QQ^\times = \QQ \setminus \cbr{0} $.
\item Let $ \ZZ\sbr{\sqrt{2}} = \cbr{a + b\sqrt{2} \st a, b \in \ZZ} $. Then $ \ZZ\sbr{\sqrt{2}}^\times \supseteq \cbr{\pm 1, \epsilon^n} $ for $ \epsilon = 1 + \sqrt{2} $, where $ \epsilon^n = \epsilon^m $ for $ n, m \in \ZZ $ if and only if $ \epsilon^{n - m} = 1 $.
\end{itemize}
\end{example*}

\begin{definition}
Let $ R $ be a ring. An \textbf{ideal} $ I \subseteq R $ is
\begin{itemize}
\item an additive subgroup, so $ x, y \in I $ implies that $ x + y \in I $,
\item which absorbs multiplication, so if $ x \in I $ and $ a \in R $ then $ ax \in I $.
\end{itemize}
\end{definition}

\begin{fact*}
If $ \phi : R \to S $ is a ring homomorphism then $ \ker \phi \subseteq R $ is an ideal. Conversely, if $ I \subseteq R $ is an ideal, can define $ R / I = R / \sim $ as the set of equivalence classes modulo $ I $, that is $ a + I $ for $ a \in R $, via $ a \sim b $ for $ a, b \in R $ if $ a - b \in I $.
\end{fact*}

\begin{proposition}
$ R / I $ has a ring structure induced by
$$ \br{a + I} + \br{b + I} = \br{a + b} + I, \qquad \br{a + I} \cdot \br{b + I} = \br{a \cdot b} + I, $$
and a canonical surjective ring homomorphism
$$ \function{R}{R / I}{a}{a + I}. $$
\end{proposition}

Check that $ a - a' \in I $ and $ b - b' \in I $ implies that
$$ \br{a + b} - \br{a' + b'} = \br{a - a'} + \br{b - b'} \in I, \qquad ab - a'b' = a\br{b - b'} + b'\br{a - a'} \in I. $$

\begin{theorem}[First isomorphism theorem for rings]
\label{thm:firstisomorphism}
Let $ \phi : R \to S $ be a ring homomorphism. Then we have a canonical ring isomorphism
$$ \function{R / \ker \phi}{\phi\br{R} \subset S}{r + \ker \phi}{\phi\br{r}}, \qquad r \in R. $$
\end{theorem}

\begin{example*}
Let $ R = \ZZ\sbr{\sqrt{5}} = \cbr{a + b\sqrt{5} \st a, b \in \ZZ} $.
\begin{itemize}
\item Let $ I $ be the ideal $ 11\ZZ \oplus \br{4 - \sqrt{5}}\ZZ $. A question is what is $ R / I $? Claim that $ R / I \cong \ZZ / 11\ZZ = \FF_{11} $ is the finite field with $ 11 $ elements. Write down $ \phi : R \twoheadrightarrow \ZZ / 11\ZZ $ such that $ \ker \phi = I $, then result follows from Theorem \ref{thm:firstisomorphism}. Such a $ \phi $ would have to satisfy $ \phi\br{4 - \sqrt{5}} = 0 $ and $ \phi\br{11} = 0 $. Then $ \phi\br{\sqrt{5}} = \phi\br{4} = 4 \mod 11 $, so
$$ \function[\phi]{\ZZ \oplus \ZZ\sbr{\sqrt{5}}}{\ZZ / 11\ZZ}{\sqrt{5}}{4}. $$
Still have to check that $ 16 = \phi\br{\sqrt{5}}^2 = \phi\br{\sqrt{5}^2} = \phi\br{5} = 5 \mod 11 $, which is ok.
\item What can we say about $ R / J $, where $ J = \abr{9, 4 - \sqrt{5}} = 9R + \br{4 - \sqrt{5}}R $ is generated over $ R $? $ R / J $ is trivial and $ \abr{9, 4 - \sqrt{5}} = R $.
\end{itemize}
\end{example*}

\pagebreak

\begin{definition}
\hfill
\begin{itemize}
\item If $ I $ and $ J $ are ideals in a ring $ R $, we say that $ I $ \textbf{divides} $ J $ if $ J \subseteq I $.
\item We can form ideals
$$ I \cap J = \cbr{r \st r \in I, \ r \in J}, \qquad I + J = \cbr{r + s \st r \in I, \ s \in J}, $$
$$ I \cdot J = \cbr{\sum_{i = 1}^n r_is_i \st r_i \in I, \ s_i \in J, \ i = 1, \dots, n}. $$
\item $ I $ and $ J $ are said to be \textbf{relatively prime} if $ I + J = R $.
\end{itemize}
\end{definition}

\begin{theorem}[Chinese remainder theorem]
\label{thm:chineseremainder}
Let $ I $ and $ J $ be two relatively prime ideals of $ R $. Then
$$ R / IJ \cong R / I \times R / J. $$
\end{theorem}

\begin{remark*}
If $ R = \ZZ $, all ideals are principal and Theorem \ref{thm:chineseremainder} specialises to the usual Chinese remainder theorem.
\end{remark*}

\begin{proof}
Find a surjective ring homomorphism
$$ \function{R}{R / I \times R / J}{r}{\br{r \mod I, r \mod J}}, $$
with kernel $ I \cdot J $.
\end{proof}

\begin{definition}
A ring $ R $ is \textbf{Noetherian} if it satisfies the \textbf{ascending chain condition} on ideals, that is any infinite sequence of ideals
$$ I_1 \subseteq I_2 \subseteq \dots $$
stabilises.
\end{definition}

\begin{example*}
$ \ZZ $ and $ \ZZ\sbr{x} $ are Noetherian, but $ \ZZ\sbr{x_1, x_2, \dots} $ is not Noetherian.
\end{example*}

\subsection{Unique factorisation domains}

\lecture{3}{Tuesday}{15/01/19}

\begin{definition}
A ring $ R $ is an \textbf{integral domain (ID)} if $ ab = 0 $ for $ a, b \in R $ implies that $ a = 0 $ or $ b = 0 $.
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item $ \ZZ $ and $ \ZZ\sbr{\sqrt{5}} $ are IDs.
\item $ \ZZ\sbr{\sqrt{5}} / \abr{4 - \sqrt{5}} = \ZZ / 11\ZZ = \FF_{11} $, since $ I = \br{4 - \sqrt{5}} \cdot \ZZ\sbr{\sqrt{5}} = 11\ZZ \oplus \br{4 - \sqrt{5}}\ZZ $, because $ 11 = 16 - 5 = \br{4 - \sqrt{5}}\br{4 + \sqrt{5}} $. Thus
$$ \ZZ\sbr{\sqrt{5}} / \abr{11} \cong \ZZ\sbr{\sqrt{5}} / \abr{4 - \sqrt{5}} \times \ZZ\sbr{\sqrt{5}} / \abr{4 - \sqrt{5}} = \FF_{11} \times \FF_{11}, $$
which is no longer an ID.
\end{itemize}
\end{example*}

\begin{remark*}
An ideal $ \ppp \subsetneq R $ is \textbf{prime} if $ ab \in \ppp $ implies that $ a \in \ppp $ or $ b \in \ppp $. Then $ \br{a + \ppp}\br{b + \ppp} = 0 $ in $ R / \ppp $ implies that $ a + \ppp = 0 $, that is $ a \in \ppp $, or $ b + \ppp = 0 $, that is $ b \in \ppp $. This is equivalent to asking that $ R / \ppp $ is an ID.
\end{remark*}

IDs are well-suited to studying \textbf{divisibility}, where $ a \mid b $ in $ R $ if there exists $ c $ such that $ ac = b $.

\begin{lemma}
Let $ R $ be an ID. If $ a \mid b $ and $ b \mid a $, then there exist $ c, d \in R^\times $ such that $ ac = b $ and $ bd = a $.
\end{lemma}

\begin{proof}
$ a \mid b $ implies that there exists $ c $ such that $ ac = b $ and $ b \mid a $ implies that there exists $ d $ such that $ bd = a $ for $ c, d \in R $. Then $ acd = bd = a $ if and only if $ a\br{cd - 1} = 0 $. Then $ R $ is an ID, so $ a = 0 $ or $ cd = 1 $. If $ a = 0 $, then $ b = 0 $, so $ c = d = 1 $.
\end{proof}

\pagebreak

\begin{definition}
Let $ R $ be an ID.
\begin{itemize}
\item We say $ a \in R $ is \textbf{irreducible} if
\begin{itemize}
\item $ a $ is not a unit, and
\item $ a = bc $ for $ b, c \in R $ implies that either $ b $ or $ c $ is in $ R^\times $.
\end{itemize}
\item We say $ a \in R $ is \textbf{prime} if
\begin{itemize}
\item $ a $ is not a unit, and
\item $ a \mid bc $ implies that $ a \mid b $ or $ a \mid c $.
\end{itemize}
\end{itemize}
\end{definition}

$ \abr{0} $ is prime if and only if $ R $ is an ID.

\begin{remark*}
Over $ \ZZ $, these two notions are equivalent, but not in general. If $ R $ is an ID and $ a \in R \setminus \cbr{0} $ is prime, then $ a $ is irreducible. Let $ b, c \in R $ be such that $ a = bc $, so $ b \mid a $ and $ c \mid a $. Because $ a $ is prime, $ a = bc $ implies that $ a \mid b $ or $ a \mid c $. Say $ a \mid b $ happens. There exists $ d \in R^\times $ such that $ a = bd $, and $ a = bc $, so $ b\br{d - c} = 0 $. Then $ b \ne 0 $, because $ a \ne 0 $, so $ d = c $, that is $ c $ is a unit.
\end{remark*}

\begin{remark*}
If $ a \in R \setminus \cbr{0} $ is irreducible, $ a $ does not have to be prime.
\end{remark*}

\begin{example*}
$ \ZZ\sbr{\sqrt{-5}} = \cbr{a + b\sqrt{-5} \st a, b \in \ZZ} $ is the ring of integers of $ \QQ\br{\sqrt{-5}} $, an extension of $ \QQ $ of degree two, a subring of $ \CC $. Then $ 6 = 2 \cdot 3 = \br{1 + \sqrt{-5}} \cdot \br{1 - \sqrt{-5}} $. Claim that these are two factorisations of $ 6 $ into irreducible elements.
\begin{itemize}
\item $ 2 $ is irreducible. Why? Assume $ 2 = \alpha\beta $ for $ \alpha, \beta \in \ZZ\sbr{\sqrt{-5}} $. The goal is that $ \alpha $ or $ \beta $ is a unit. We will use
$$ \function[\N]{\ZZ\sbr{\sqrt{-5}}}{\ZZ_{\ge 0}}{a + \sqrt{-5}b}{\br{a + \sqrt{-5}b}\br{a - \sqrt{-5}b} = a^2 + 5b^2}, $$
which is multiplicative. Then $ 4 = \N\br{2} = \N\br{\alpha}\N\br{\beta} $. If $ \N\br{\alpha} = 1 $, then $ \alpha $ is a unit, and $ \N\br{\alpha} = \N\br{\beta} = 2 $ implies that $ a^2 + 5b^2 = 2 $, which has no solutions, a contradiction.
\item $ 2 $ and $ 1 + \sqrt{-5} $ do not differ by units, since $ \N\br{2} = 4 $ and $ \N\br{1 + \sqrt{-5}} = 6 $.
\end{itemize}
The upshot is that $ 2 $ is irreducible in $ \ZZ\sbr{\sqrt{-5}} $ but not prime.
\end{example*}

Let $ R $ be an ID. We define an equivalence relation $ \sim $ on $ R $ by $ a \sim b $ if $ a \mid b $ and $ b \mid a $, or there exist $ c, d \in R^\times $ such that $ a = bc $ and $ b = da $.

\begin{definition}
An ID $ R $ has \textbf{unique factorisation} if for all $ a \in R \setminus \cbr{0} $ there is a factorisation $ a = u \cdot p_1 \cdot \dots \cdot p_r $, where $ u \in R^\times $ and the $ p_i $ are irreducible. This is unique in the sense that, if there exists another factorisation $ v \cdot q_1 \cdot \dots \cdot q_s $, where $ v \in R^\times $ and the $ q_i $ are irreducible, then $ r = s $, and up to reordering $ p_i \sim q_i $ for $ i = 1, \dots, r = s $. An ID with this property is called an \textbf{unique factorisation domain (UFD)}.
\end{definition}

\begin{example*}
$ \ZZ $, but not $ \ZZ\sbr{\sqrt{-5}} $.
\end{example*}

\begin{lemma}
If $ R $ is a UFD, then $ p \in R \setminus \cbr{0} $ is irreducible implies that $ p $ is prime.
\end{lemma}

\begin{proof}
Exercise. \footnote{Exercise}
\end{proof}

\begin{theorem}
\label{thm:ufd}
Let $ R $ be an ID. The following conditions are equivalent.
\begin{itemize}
\item $ R $ is a UFD.
\item $ R $ satisfies ascending chain condition for principal ideals, that is every infinite sequence
$$ \abr{a_1} \subseteq \abr{a_2} \subseteq \dots $$
stabilises after finitely many steps, and every irreducible in $ R $ is prime.
\end{itemize}
\end{theorem}

If $ R $ is a UFD, can define $ \d\br{a} \in \ZZ_{\ge 0} $ as the number of irreducible factors of $ a $. Then $ \d\br{a} = 0 $ if and only if $ a \in R^\times $ is a unit.

\pagebreak

\begin{lemma}
Let $ R $ be a UFD and $ a \mid b $ for $ a, b \in R $. Then
\begin{itemize}
\item $ \d\br{a} \le \d\br{b} $, and
\item $ b \mid a $ if and only if $ \d\br{a} = \d\br{b} $.
\end{itemize}
\end{lemma}

\lecture{4}{Friday}{18/01/19}

\begin{proof}
Let $ a = u \cdot p_1 \cdot \dots \cdot p_{\d\br{a}} $ and $ b = v \cdot q_1 \cdot \dots \cdot q_{\d\br{b}} $. Then $ a \mid b $, so $ b = a \cdot c $ for $ c \in R \setminus \cbr{0} $. Let $ c = w \cdot r_1 \cdot \dots \cdot r_{\d\br{c}} $, so $ v \cdot q_1 \cdot \dots \cdot q_{\d\br{b}} = u \cdot w \cdot p_1 \cdot \dots \cdot p_{\d\br{a}} \cdot r_1 \cdot \dots \cdot r_{\d\br{c}} $. Uniqueness of factorisation implies that $ \d\br{b} = \d\br{a} + \d\br{c} $, so $ \d\br{b} \ge \d\br{a} $. Equality if and only if $ \d\br{c} = 0 $ if and only if $ c $ is a unit, if and only if $ b \mid a $.
\end{proof}

\begin{proof}[Proof of Theorem \ref{thm:ufd}]
\hfill
\begin{itemize}
\item[$ \implies $] Assume $ R $ is a UFD. Irreducibles are prime. Let
$$ \abr{a_1} \subseteq \abr{a_2} \subseteq \dots, \qquad \dots \mid a_2 \mid a_1, \qquad \d\br{a_1} \ge \d\br{a_2} \ge \dots \ge 0. $$
This sequence stabilises after finitely many steps, so there exists $ n $ such that
$$ \d\br{a_n} = \d\br{a_{n + 1}} = \dots, \qquad a_n \sim a_{n + 1} \sim \dots, \qquad \abr{a_n} = \abr{a_{n + 1}} = \dots. $$
\item[$ \impliedby $] For all $ a \in R \setminus \cbr{0} $, claim that $ a $ has a factorisation into irreducibles. If $ a_1 = a $, it is irreducible. Otherwise $ a = b \cdot c $ for $ b, c \in R \setminus \cbr{0} $ not units. If both irreducible, done. If not, say $ b $ is not irreducible, $ a_2 = b $. Then $ a = b \cdot c $ for $ c $ not a unit, so $ \abr{a} \subsetneq \abr{b} $. Redoing the process here, $ \abr{a_1} \subsetneq \abr{a_2} \subsetneq \dots $. By ascending chain condition, this process terminates, getting a contradiction, so $ a $ has factorisation into irreducibles. The factorisation of $ a $ is unique, up to units and reordering. Let
$$ a = u \cdot p_1 \cdot \dots \cdot p_r = v \cdot q_1 \cdot \dots \cdot q_s. $$
Then $ p_1 $ is irreducible, so $ p_1 $ is prime, so $ p_1 \mid q_i $ for some $ i $, where $ q_i $ is irreducible, so $ p_1 \sim q_i $. Cancel out $ p_1 $ and $ q_i $ and repeat.
\end{itemize}
\end{proof}

\begin{remark*}
$ \ZZ\sbr{\sqrt{-5}} $ is not a UFD because $ 2 $ is irreducible but not prime.
\end{remark*}

\subsection{Principal ideal domains}

\begin{definition}
An ID $ R $ is a \textbf{principal ideal domain (PID)} if every ideal of $ R $ is principal.
\end{definition}

\begin{example*}
Fields and $ \ZZ $. Follows from Euclid's algorithm.
\end{example*}

\begin{theorem}
\label{thm:pid}
A PID $ R $ is a UFD.
\end{theorem}

\begin{proof}
Check two characterising properties.
\begin{itemize}
\item Ascending chain condition. Let
$$ \abr{a_1} \subseteq \abr{a_2} \subseteq \dots. $$
Consider
$$ I = \bigcup_{n = 1}^\infty \abr{a_n}. $$
Claim that $ I $ is an ideal of $ R $. Say $ x \in I $ and $ r \in R $. Want $ rx \in I $. There exists $ n \in \ZZ_{\ge 1} $ such that $ x \in \abr{a_n} $, so $ rx \in \abr{a_n} $ and $ rx \in I $. Say $ x, y \in I $. Then $ x \in \abr{a_n} $ for $ n \in \ZZ_{\ge 1} $ and $ y \in \abr{a_m} $ for $ m \in \ZZ_{\ge 1} $. If $ m \ge n $ then $ x \in \abr{a_m} $, so $ x + y \in \abr{a_m} $, so $ x + y \in I $. Otherwise $ y \in \abr{a_n} $, so $ x + y \in \abr{a_n} $, so $ x + y \in I $. Hence $ I \subseteq R $ is an ideal, so $ I $ is principal, that is there exists $ a \in R $ such that $ I = \abr{a} $. There exists $ n \in \ZZ_{\ge 1} $ such that $ a \in \abr{a_n} $. Have inclusions $ \abr{a} \subseteq \abr{a_n} \subseteq \abr{a_m} \subseteq \abr{a} $. All inclusions are equalities, so $ \abr{a_m} = \abr{a_n} $ for all $ m \ge n $.
\item Irreducibles are prime. \footnote{Exercise}
\end{itemize}
\end{proof}

\pagebreak

\begin{remark*}
\hfill
\begin{itemize}
\item $ \ZZ\sbr{\sqrt{-5}} $ is not a PID. This follows from Theorem \ref{thm:pid} and failure of unique factorisation, since $ \abr{2, 1 + \sqrt{-5}} $ is not a principal ideal. \footnote{Exercise}
\item $ \QQ\sbr{x, y} $ is a UFD but $ \abr{x, y} $ is not principal, and $ \ZZ\sbr{x} $ is a UFD but $ \abr{2, x} $ is not principal.
\end{itemize}
\end{remark*}

\subsection{Euclidean domains}

\begin{definition}
A \textbf{Euclidean norm} on an ID $ R $ is a function $ \phi : R \setminus \cbr{0} \to \ZZ_{\ge 1} $ such that for all $ a, b \in R \setminus \cbr{0} $ there exist $ q, r \in R $ such that $ a = qb + r $ and either $ r = 0 $ or $ \phi\br{r} < \phi\br{b} $. An ID that admits a Euclidean norm is called a \textbf{Euclidean domain}.
\end{definition}

Sometimes, add condition
\begin{equation}
\label{eq:1}
\phi\br{ab} \ge \phi\br{b}.
\end{equation}
If $ \phi $ is a Euclidean norm as in definition, can use $ \phi $ to construct a Euclidean norm satisfying $ \br{\ref{eq:1}} $.

\begin{theorem}
If $ R $ is a Euclidean domain, then $ R $ is a PID, so $ R $ is a UFD.
\end{theorem}

\lecture{5}{Monday}{21/01/19}

\begin{proof}
Let $ I \subseteq R $ be an ideal. Assume $ I \ne \abr{0} $. The goal is that $ I $ is generated by one element $ a \in R \setminus \cbr{0} $. Let $ 0 \ne a \in I $ be an element such that $ \phi\br{a} $ is minimal along the values of $ \phi $ on $ I $, so $ \abr{a} \subseteq I $. We will show that we have an equality. Let $ b \in I \setminus \abr{a} $. Applying property of $ \phi $ to $ b $ and $ a $, $ b = qa + r $. Then $ r \ne 0 $, otherwise $ a \mid b $, so $ b \in \abr{a} $. Thus $ r = b - qa \in I $ but $ \phi\br{r} < \phi\br{a} $, a contradiction.
\end{proof}

\begin{example*}
\hfill
\begin{itemize}
\item $ \ZZ $, with Euclidean norm
$$ \function{\ZZ \setminus \cbr{0}}{\ZZ_{\ge 1}}{n}{\abs{n}}. $$
\item Gaussian integers $ \ZZ\sbr{i} $, with Euclidean norm given by restriction to $ \ZZ\sbr{i} \subset \CC $ of the complex absolute value
$$ \function{\ZZ^2 \setminus \cbr{\br{0, 0}}}{\ZZ_{\ge 1}}{a + ib}{\br{a + ib}\br{a - ib} = a^2 + b^2}. $$
\item Eisenstein integers. Let $ 1 \ne \omega \in \CC $ be a primitive cube root of unity, so $ \omega = \tfrac{-1 + \sqrt{-3}}{2} $. The subring
$$ \ZZ\sbr{\omega} = \cbr{a + b\omega \st a, b \in \ZZ} \subset \CC $$
is Euclidean, with Euclidean norm given by
$$ \function{\ZZ^2 \setminus \cbr{\br{0, 0}}}{\ZZ_{\ge 1}}{a + b\omega}{a^2 - ab + b^2}. $$
\end{itemize}
\end{example*}

\begin{remark*}
\hfill
\begin{itemize}
\item In all these examples, the norm is multiplicative. This does not have to hold true, such as $ \QQ\sbr{x} $, with Euclidean norm $ f \mapsto \deg f $.
\item There are PIDs that do not admit a Euclidean norm, such as $ \ZZ\sbr{\tfrac{1 + \sqrt{-19}}{2}} $.
\end{itemize}
\end{remark*}

Thus
$$ \cbr{\text{commutative rings}} \supsetneq \cbr{\text{IDs}} \supsetneq \cbr{\text{UFDs}} \supsetneq \cbr{\text{PIDs}} \supsetneq \cbr{\text{Euclidean domains}}. $$
\begin{itemize}
\item $ \QQ\sbr{x, y} / xy, \ZZ / 6\ZZ, \FF_3\sbr{x} / x^2 $ are commutative rings but not IDs.
\item $ \ZZ\sbr{\sqrt{-5}} $ is an ID but not a UFD, since $ 6 = 2 \cdot 3 = \br{1 + \sqrt{-5}} \cdot \br{1 - \sqrt{-5}} $.
\item $ \ZZ\sbr{x} $ is a UFD but not a PID, since $ \abr{2, x} $ is not principal.
\item $ \ZZ\sbr{\tfrac{1 + \sqrt{-19}}{2}} $ is a PID but not a Euclidean domain.
\end{itemize}

\pagebreak

\subsection{Gaussian integers}

The \textbf{Gaussian integers} are
$$ \ZZ\sbr{i} = \cbr{a + bi \st a, b \in \ZZ} \subset \QQ\br{i} \subset \CC. $$
We will crucially use the norm
$$ \function[\N]{\ZZ\sbr{i}}{\ZZ_{\ge 0}}{a + bi}{\br{a + bi}\br{a - bi} = a^2 + b^2}, $$
which is not the same as the Euclidean norm.

\begin{note*}
This is multiplicative.
\end{note*}

\begin{proposition}
If $ u \in \ZZ\sbr{i}^\times $ then $ \N\br{u} = 1 $.
\end{proposition}

\begin{proof}
$ \eval{\N}_{\ZZ\sbr{i} \setminus \cbr{0}}\br{u} \ge 1 $, $ \N $ is multiplicative, and $ \N\br{1} = 1 $. Then $ uv = 1 $ implies that $ \N\br{u} \cdot \N\br{v} = 1 $, so $ \N\br{u} \ge 1 $ and $ \N\br{v} \ge 1 $, so $ \N\br{u} = \N\br{v} = 1 $.
\end{proof}

\begin{theorem}[Units in $ \ZZ\sbr{i} $]
$$ \ZZ\sbr{i}^\times = \cbr{\pm 1, \pm i} \cong \br{\ZZ / 4\ZZ, +}. $$
\end{theorem}

\begin{proof}
$ \N\br{u} = u \cdot \overline{u} = 1 $, so
$$ u = a + bi \in \ZZ\sbr{i}^\times \qquad \iff \qquad a^2 + b^2 = 1 \qquad \iff \qquad
\begin{cases}
\br{a, b} = \br{\pm 1, 0} \qquad \iff \qquad u = \pm 1 \\
\br{a, b} = \br{0, \pm 1} \qquad \iff \qquad u = \pm i
\end{cases}.
$$
\end{proof}

\begin{theorem}[Unique factorisation in $ \ZZ\sbr{i} $]
Given $ \alpha, \beta \in \ZZ\sbr{i} $ for $ \beta \ne 0 $, there exist $ \kappa, \lambda \in \ZZ\sbr{i} $ such that $ \alpha = \kappa\beta + \lambda $ and either $ \lambda = 0 $ or $ \N\br{\lambda} < \N\br{\beta} $, so $ \N $ is Euclidean and $ \ZZ\sbr{i} $ has unique factorisation.
\end{theorem}

\begin{proof}
$ \ZZ\sbr{i} \subset \CC $ is a lattice. Then $ \alpha / \beta \in \CC $ lands inside one of the unit squares in the lattice spanned by $ \ZZ\sbr{i} $. The open unit discs centred at the vertices of the unit square cover the entire square. Choose $ \kappa $ to be one vertex such that $ \alpha / \beta $ is in the open unit disc centred at $ \kappa $.
\end{proof}

\begin{lemma}[Special case of quadratic reciprocity]
If $ p $ is an odd prime, then $ -1 $ is a square modulo $ p $ if and only if $ p \equiv 1 \mod 4 $.
\end{lemma}

\begin{theorem}[Decomposition of primes in $ \ZZ\sbr{i} $]
\hfill
\begin{enumerate}
\item $ 2 $ is a ramified prime.
\item $ p \equiv 1 \mod 4 $ is a split prime.
\item $ p \equiv 3 \mod 4 $ is an inert prime.
\end{enumerate}
\end{theorem}

\begin{proof}
\hfill
\begin{enumerate}
\item $ 2 = \br{1 + i}\br{1 - i} = \br{-i}\br{1 + i}^2 $. Notice that $ i\br{1 + i} = i - 1 = -\br{1 - i} $. Up to units in $ \ZZ\sbr{i}^\times $ these prime factors are the same.
\item $ p = \br{a + bi}\br{a - bi} $, which are distinct primes in $ \ZZ\sbr{i} $.
\item $ p $ stays prime. If not, $ a + bi \mid p $, so $ \N\br{a + bi} \mid \N\br{p} = p^2 $, so $ \N\br{a + bi} = p = a^2 + b^2 $, which cannot happen.
\end{enumerate}
\end{proof}

\lecture{6}{Tuesday}{22/01/19}

Quadratic reciprocity implies that there exists $ n \in \ZZ $ such that $ p \mid n^2 + 1 = \br{n + i}\br{n - i} $. Assume $ p $ stays prime, or irreducible, in $ \ZZ\sbr{i} $, so $ p \mid n + i $ or $ p \mid n - i $. By conjugating, we see $ p \mid n + i $ if and only if $ p \mid n - i $, so $ p \mid \br{n + i} - \br{n - i} = 2i $. Taking $ \N $, see $ \N\br{p} = p^2 \nmid 4 = \N\br{2i} $, a contradiction.

\begin{theorem}
$ n \in \ZZ_{> 0} $ is of the form $ n = a^2 + b^2 $ for $ a, b \in \ZZ $ if and only if for all $ p \mid n $ such that $ p \equiv 3 \mod 4 $ the exponent of $ p $ in $ n $ is even.
\end{theorem}

\pagebreak

\begin{theorem}
The only solutions to the Diophantine equation $ x^2 + 1 = y^3 $ are $ x = 0 $ and $ y = 1 $.
\end{theorem}

\begin{proof}
$ \br{x + i}\br{x - i} = y^3 $. Are $ x + i $ and $ x - i $ coprime in $ \ZZ\sbr{i} $? If $ \ppp $ is a prime of $ \ZZ\sbr{i} $ dividing both, then $ \ppp \mid 2i $, that is $ \N\br{\ppp} \mid 4 $, so $ 2 \mid y $, so $ 8 \mid y^3 $. But $ x^3 + 1 \equiv 1, 2, 5 \mod 8 $, so $ \gcd\br{x + i, x - i} = 1 $, so
$$ x + i = uz^3 = \br{uz}^3, \qquad x - i = \overline{u}\overline{z}^3 = \br{\overline{u}\overline{z}}^3, \qquad u = \pm 1, \pm i, $$
so
$$ x - i = \br{a + bi}^3 = a^3 - b^3i + 3a^2bi - 3ab^2, \qquad a, b \in \ZZ. $$
Looking at coefficients of $ i $, $ 1 = 3a^2b - b^3 $, so $ a = 0 $ and $ b = -1 $. Plugging this back in we get $ x = 0 $ and $ y = 1 $.
\end{proof}

\subsection{Eisenstein integers}

The \textbf{Eisenstein integers} are $ \ZZ\sbr{\omega} $ for $ \omega = \tfrac{-1 + \sqrt{-3}}{2} $. This is a subring of $ \CC $, since
$$ \br{a + b\omega}\br{c + d\omega} = ac + \br{ad + bc}\omega + bd\omega^2 = \br{ac - bd} + \br{ad + bc - bd}\omega. $$
What is $ \ZZ\sbr{\sqrt{-3}} \subset \ZZ\sbr{\omega} $? Both are subrings of $ \QQ\br{\sqrt{-3}} = \QQ\sbr{x} / \abr{x^3 + 3} $.
\begin{itemize}
\item In $ \ZZ\sbr{\sqrt{-3}} $, $ 4 = 2 \cdot 2 = \br{1 + \sqrt{-3}} \cdot \br{1 - \sqrt{-3}} $, where $ 2, 1 + \sqrt{-3}, 1 - \sqrt{-3} $ are all irreducible.
\item $ \pi = \tfrac{1 + \sqrt{-3}}{2} $ is a unit in $ \ZZ\sbr{\omega} $ and $ \pi^6 = 1 $, but $ \pi \notin \ZZ\sbr{\sqrt{-3}} $.
\item $ \ZZ\sbr{\sqrt{-3}} $ is not integrally closed in $ \QQ\br{\sqrt{-3}} $, but $ \ZZ\sbr{\omega} $ is its integral closure and it is integrally closed in $ \QQ\br{\sqrt{-3}} $.
\item $ \omega^2 + \omega + 1 = 0 $, so $ \omega $ is an algebraic integer in $ \ZZ\sbr{\omega} \setminus \ZZ\sbr{\sqrt{-3}} $.
\end{itemize}

\begin{proposition}
If $ u \in \ZZ\sbr{\omega}^\times $ then $ \N\br{u} = 1 $, where
$$ \function[\N]{\ZZ\sbr{\omega}}{\ZZ}{a + b\omega}{\br{a + b\omega}\br{a + b\overline{\omega}} = a^2 - ab + b^2}. $$
\end{proposition}

\begin{proof}
Multiplicative because it is the restriction of $ z \in \CC \mapsto \abs{z}^2 $ to $ \ZZ\sbr{\omega} $. Holds true in any imaginary quadratic field $ \QQ\br{\sqrt{-d}} $.
\end{proof}

\begin{theorem}[Units in $ \ZZ\sbr{\omega} $]
$$ \ZZ\sbr{\omega}^\times = \cbr{\pm 1, \pm\omega, \pm\pi} \cong \br{\ZZ / 6\ZZ, +}. $$
\end{theorem}

\begin{proof}
$$ a^2 - ab + b^2 = 1 \qquad \iff \qquad
\begin{cases}
\br{a, b} = \br{\pm 1, 0} \qquad \iff \qquad u = \pm 1 \\
\br{a, b} = \br{0, \pm 1} \qquad \iff \qquad u = \pm\omega \\
\br{a, b} = \pm\br{1, 1} \qquad \iff \qquad u = \pm\br{1 + \omega} = \pm\pi
\end{cases}.
$$
\end{proof}

\begin{theorem}[Unique factorisation in $ \ZZ\sbr{\omega} $]
$ \ZZ\sbr{\omega} $ is a Euclidean domain, with Euclidean norm given by $ \N\br{a + b\omega} = a^2 - ab + b^2 $.
\end{theorem}

\begin{proof}
$ \ZZ\sbr{\omega} \subset \CC $ is tiled by parallelograms of $ \CC $. Want to take $ \kappa $ to be a vertex of a parallelogram such that $ \N\br{\kappa - \alpha / \beta} < 1 $. The parallelogram is covered by the interior of the unit discs centred at the lattice points, so ok.
\end{proof}

\lecture{7}{Friday}{25/01/19}

Lecture 7 is a problems class.

\lecture{8}{Monday}{28/01/19}

\begin{lemma}[Special case of quadratic reciprocity]
If $ p \ne 3 $ is an odd prime, then $ -3 $ is a square modulo $ p $ if and only if $ p \equiv 1 \mod 3 $.
\end{lemma}

\pagebreak

\begin{theorem}[Decomposition of primes in $ \ZZ\sbr{\omega} $]
\hfill
\begin{enumerate}
\item $ 3 $ ramifies.
\item $ p \equiv 2 \mod 3 $ stays inert in $ \ZZ\sbr{\omega} $.
\item $ p \equiv 1 \mod 3 $ splits as a product of distinct prime factors $ \ppp, \overline{\ppp} \in \ZZ\sbr{\omega} $.
\end{enumerate}
\end{theorem}

\begin{proof}
\hfill
\begin{enumerate}
\item $ 3 = -\br{\sqrt{-3}}^2 $, which is irreducible in $ \ZZ\sbr{\omega} $.
\item $ \N $ is multiplicative and $ p $ cannot be written as $ a^2 - ab + b^2 $ with $ a, b \in \ZZ $.
\item $ p $ divides $ a^2 - ab + b^2 $ with $ a, b \in \ZZ $ and $ p \nmid a, b $, so $ p $ divides $ \br{2a - b}^2 + 3b^2 $. Take $ z \in \ZZ $ odd such that $ z^2 \equiv -3 \mod p $, and let $ b = 1 \in \ZZ $ and $ a = \br{z + 1} / 2 \in \ZZ $. To show that $ p $ splits in $ \ZZ\sbr{\omega} $, let $ p \mid a^2 - a + 1 = \br{a + \omega}\br{a + \overline{\omega}} $ for $ z \in \ZZ $. Using unique factorisation, $ p \mid a + \omega $ or $ p \mid a + \overline{\omega} $. In fact, since $ a + \omega, a + \overline{\omega} $ are complex conjugates, $ p \mid a + \omega $ and $ p \mid a + \overline{\omega} $, so $ p \mid \omega - \overline{\omega} = \sqrt{-3} $. But $ \br{3, p} = 1 $, a contradiction. Thus $ p = \ppp\overline{\ppp} = \N\br{\ppp} $. Check that $ \ppp / \overline{\ppp} \ne u \in \ZZ\sbr{\omega}^\times $, \footnote{Exercise} so $ p $ splits.
\end{enumerate}
\end{proof}

\begin{remark*}
These three possible behaviours have to do with the structure of $ \ZZ\sbr{\omega} / \abr{p} $.
\begin{itemize}
\item If this is a field, $ p $ is inert.
\item If this is of the form $ \FF_1 \times \FF_2 $, $ p $ is split.
\item If this is of the form $ \FF\sbr{\epsilon} / \abr{\epsilon^2} $, $ p $ is ramified.
\end{itemize}
\end{remark*}

\subsection{Other Euclidean domains}

\begin{itemize}
\item $ \ZZ\sbr{\omega} $ and $ \ZZ\sbr{i} $ are norm Euclidean. Using a geometric proof, $ \ZZ\sbr{i} \subset \CC $ and $ \ZZ\sbr{\omega} \subset \CC $ are lattices.
\item $ \ZZ\sbr{\sqrt{-5}} $ is not a UFD, so not Euclidean, since $ 6 = 2 \cdot 3 = \br{1 + \sqrt{-5}}\br{1 - \sqrt{-5}} $. What goes wrong if we try to adapt the geometric proof from $ \ZZ\sbr{i} $ and $ \ZZ\sbr{\omega} $? The unit discs do not cover all of the area of $ \CC $.
\item The ring of integers $ \OOO_7 \subset \QQ\br{\sqrt{-7}} $ and $ \OOO_{11} \subset \QQ\br{\sqrt{-11}} $ both are norm Euclidean. Adopt the proof from $ \ZZ\sbr{i} $ and $ \ZZ\sbr{\omega} $.
\item It is hard to tell which fields are Euclidean and which are not. For example, $ \ZZ\sbr{\tfrac{1 + \sqrt{-19}}{2}} $ is not Euclidean but is a PID and a UFD.
\item Among real quadratic fields, $ \ZZ\sbr{\sqrt{2}} $ is Euclidean. The same geometric proof will not work because $ \ZZ\sbr{\sqrt{2}} \subset \RR $, and $ \ZZ\sbr{\sqrt{2}} $ is dense in $ \RR $. \footnote{Exercise} We do have a geometric way to think about this, since $ \QQ\br{\sqrt{2}} $ is a two-dimensional $ \QQ $-vector space, so
$$ \function[\sigma]{\QQ\br{\sqrt{2}}}{\QQ\br{-\sqrt{2}}}{a + b\sqrt{2}}{a - b\sqrt{2}} $$
is a field automorphism that preserves $ \QQ $. Then
$$
\begin{array}{rcl}
\ZZ\sbr{\sqrt{2}} \subset \QQ\br{\sqrt{2}} & \hookrightarrow & \RR^2 \\
a + b\sqrt{2} & \mapsto & \br{a + b\sqrt{2}, a - b\sqrt{2}} \\
1 & \mapsto & \theta_1 = \br{1, 1} \\
\sqrt{2} & \mapsto & \theta_2 = \br{\sqrt{2}, -\sqrt{2}}
\end{array},
$$
and $ \theta_1 $ and $ \theta_2 $ generate a lattice in $ \RR^2 $. Can do a geometric proof in this, but use $ \N\br{x, y} = x \cdot y $ and areas under hyperbolas.
\end{itemize}

\pagebreak

\section{Ring of integers in number fields}

\lecture{9}{Tuesday}{29/01/19}

Useful for describing the ring of integers $ \OOO_K \subset K $ for a finite extension $ K / \QQ $ and $ \OOO^\times $, the group of units in $ \OOO_K $, by Dirichlet's unit theorem.

\subsection{Modules}

\begin{definition}
Let $ R $ be a ring. An \textbf{$ R $-module} $ M $ is a set, together with
\begin{itemize}
\item an additive structure on $ M $, so $ m_1, m_2 \in M $ implies that $ m_1 + m_2 \in M $, and
\item an action of $ R $ on $ M $,
$$ \function{R \times M}{M}{\br{r, m}}{rm}, $$
satisfying
$$ r\br{m_1 + m_2} = rm_1 + rm_2, \qquad \br{r_1 + r_2}m = r_1m + r_2m, $$
$$ r_1\br{r_2m} = \br{r_1r_2}m, \qquad 1 \cdot m = m, \qquad 0 \cdot m = 0. $$
\end{itemize}
\end{definition}

\begin{note*}
\hfill
\begin{itemize}
\item If $ R $ is a field, then an $ R $-module is just an $ R $-vector space.
\item If $ R = \ZZ $, a $ \ZZ $-module $ M $ is an abelian group.
\end{itemize}
\end{note*}

\begin{definition}
A \textbf{free $ \ZZ $-module of rank $ n $} is a $ \ZZ $-module $ M $ which has a basis $ \br{e_1, \dots, e_n} $ such that all $ m \in M $ can be written uniquely as
$$ a_1e_1 + \dots + a_ne_n, \qquad a_1, \dots, a_n \in \ZZ. $$
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item $ \ZZ $ is a free $ \ZZ $-module of rank one.
\item $ \ZZ^n = \cbr{\br{a_1, \dots, a_n} \st a_i \in \ZZ} $ is a free $ \ZZ $-module of rank $ n $.
\item Any free $ \ZZ $-module of rank $ n $ is isomorphic to $ \ZZ^n $, so there exists $ \phi : M \xrightarrow{\sim} \ZZ^n $, where $ M $ is free of rank $ n $, such that $ \phi\br{m_1 + m_2} = \phi\br{m_1} + \phi\br{m_2} $, and $ \phi\br{nm} = n\phi\br{m} $ that is redundant once you respect addition.
\item $ \ZZ / 3\ZZ $ is not free because $ 3 \cdot 1 = 0 $, and $ 0 $ is not written uniquely in terms of the basis.
\item Any finite abelian group is a $ \ZZ $-module, but not free.
\item $ \QQ = \cbr{r / s \st \br{r, s} = 1, \ r, s \in \ZZ, \ s > 0} $ is a $ \ZZ $-module but it is not free of finite rank. Assume that $ \QQ $ was free of rank $ n $, for some $ n \in \ZZ_{\ge 0} $. Let $ e_1 = r_1 / s_1, \dots, e_n = r_n / s_n $ be a basis. Then
$$ \dfrac{1}{s_1 \cdot \dots \cdot s_n + 1} \notin e_1\ZZ \oplus \dots \oplus e_n\ZZ, $$
a contradiction.
\item $ \ZZ\sbr{i}, \ZZ\sbr{\omega}, \ZZ\sbr{\sqrt{-5}} $ are free $ \ZZ $-modules of rank two.
\item We will later see that the ring of integers $ \OOO_K \subset K $ is a free $ \ZZ $-module of rank equal to the rank of $ K / \QQ $, or $ \dim_\QQ K $.
\end{itemize}
\end{example*}

\pagebreak

\subsection{Structure theorem for finitely generated abelian groups}

\begin{theorem}[Structure theorem, weak form]
Let $ M $ be a free $ \ZZ $-module of finite rank $ n $, and $ M' \subseteq M $ be a $ \ZZ $-submodule. Then $ M' $ is free of rank $ m \le n $.
\end{theorem}

\begin{proof}
We will prove this by induction on $ n = \rk M $. We have a basis $ e_1, \dots, e_n $ of $ M $ and projections
$$ \function[p_i]{M}{\ZZ}{a_1e_1 + \dots + a_ne_n}{a_i}, $$
which are module homomorphisms. If $ p_i\br{M'} = 0 $ for every $ i = 1, \dots, n $, then $ M' = 0 $. If $ M' \ne 0 $, we can assume without loss of generality that $ p_1\br{M'} \ne 0 $. Then $ p_1\br{M'} $ will be an ideal of $ \ZZ $, therefore it will be a principal ideal. There exists $ x \in M' $ such that $ p_1\br{M'} = \abr{p_1\br{x}} $. Then $ N = \ker p_1 \hookrightarrow M $ is a submodule of $ M $ free of rank $ n - 1 $ because it is generated by $ e_2, \dots, e_n $. Consider $ N' = N \cap M' $, a submodule of $ N, M', M $. We have an isomorphism of $ \ZZ $-modules \footnote{Exercise}
$$ N' \oplus x\ZZ = \cbr{n' + n \cdot x \st n' \in N', \ n \in \ZZ} \cong M'. $$
$ N $ is free of rank $ n - 1 $, so by the induction hypothesis $ N' $ is free of rank $ m' \le n - 1 $, so $ M' $ is free of rank $ m' + 1 \le n $. Have a basis $ \br{e_1', \dots, e_m', x} $ for $ M' $, where $ \br{e_1, \dots, e_m'} $ is a basis for $ N' $.
\end{proof}

\begin{theorem}[Structure theorem, strong form]
\label{thm:structure}
Let $ M $ be a free $ \ZZ $-module of rank $ n $. Let $ M' \subseteq M $ be a submodule. Then there exist
\begin{itemize}
\item a basis $ \br{e_1, \dots, e_n} $ of $ M $, and
\item $ a_1, \dots, a_q \in \ZZ \setminus \cbr{0} $ for $ q \le n $ such that $ M' $ has a basis $ \br{a_1e_1, \dots, a_qe_q} $ and such that $ a_1 \mid \dots \mid a_q $.
\end{itemize}
\end{theorem}

\begin{corollary}
\label{cor:structure}
Let $ G $ be a finitely generated abelian group. Then there exist $ a_1, \dots, a_n \in \ZZ $ such that $ a_1 \mid \dots \mid a_n $ and
$$ G \cong \ZZ / a_1\ZZ \times \dots \times \ZZ / a_n\ZZ. $$
\end{corollary}

\lecture{10}{Friday}{01/02/19}

\begin{remark*}
In Corollary \ref{cor:structure}, we are allowing $ a_i = 0 $ for some $ i \in \cbr{1, \dots, n} $.
\end{remark*}

\begin{proof}
Consider $ e_1, \dots, e_n $, the generators of $ G $, and let $ M $ be the free $ \ZZ $-module spanned by $ e_1, \dots, e_n $. Then $ \phi : M \twoheadrightarrow G $ is a surjective $ \ZZ $-module homomorphism. Have an isomorphism of $ \ZZ $-modules $ M / M' \subseteq G $, induced by $ \phi $. Theorem \ref{thm:structure} implies that
$$ M = e_1\ZZ \oplus \dots \oplus e_n\ZZ, \qquad M' = a_1e_1\ZZ \oplus \dots \oplus a_qe_q\ZZ, \qquad a_{q + 1} = \dots = a_n = 0. $$
Thus
$$ M / M' \cong \ZZ / a_1\ZZ \times \dots \times \ZZ / a_q\ZZ \times \ZZ / a_{q + 1}\ZZ \times \dots \times \ZZ / a_n\ZZ \cong \ZZ / a_1\ZZ \times \dots \times \ZZ / a_q\ZZ \times \ZZ \times \dots \times \ZZ. $$
\end{proof}

\begin{lemma}
\label{lem:1}
Let $ M $ be a free $ \ZZ $-module of rank $ n $, and $ x \in M $. Let $ p_1 : M \to \ZZ $ and $ p_2 : M \to \ZZ $. There exists a homomorphism $ M \to \ZZ $ such that $ p\br{x} \mid p_1\br{x} $ and $ p\br{x} \mid p_2\br{x} $.
\end{lemma}

\begin{proof}
Find $ a, b \in \ZZ $ such that $ \gcd\br{p_1\br{x}, p_2\br{x}} = ap_1\br{x} + bp_2\br{x} $, by Euclid's algorithm. Define $ p = ap_1 + bp_2 $.
\end{proof}

\begin{lemma}
\label{lem:2}
Let $ R $ be a PID. Let $ S $ be a set of ideals of $ R $. There exists an ideal $ I \in S' $ such that $ I \subseteq J $ and $ J \in S' $ implies that $ I = J $, that is such that $ I $ is maximal with respect to inclusion.
\end{lemma}

\begin{proof}
We will use the ascending chain condition, ok because $ R $ is a PID, to argue by contradiction. If Lemma \ref{lem:2} were not true, would set $ I_1 \subsetneq I_2 \subsetneq \dots $ with $ I_i \in S $, a contradiction.
\end{proof}

\begin{lemma}
\label{lem:3}
Let $ M $ be a free $ \ZZ $-module of rank $ n $, and $ x \in M $. Then there exists a homomorphism $ p : M \to \ZZ $ such that $ p\br{x} \mid q\br{x} $ for every $ q : M \to \ZZ $.
\end{lemma}

\pagebreak

\begin{proof}
Look at the set of all ideals $ \abr{q\br{x}} \subseteq \ZZ $. Applying Lemma \ref{lem:2}, there exists $ \abr{p\br{x}} \subseteq \ZZ $, where $ p : M \to \ZZ $, which is maximal with respect to inclusion. Want $ p\br{x} \mid q\br{x} $ for all $ q : M \to \ZZ $. Applying Lemma \ref{lem:1} to $ p $ and $ q $ gives $ r : M \to \ZZ $ such that $ r\br{x} \mid q\br{x} $ and $ r\br{x} \mid p\br{x} $, so $ \abr{r\br{x}} \supseteq \abr{p\br{x}} $. Because $ p $ is maximal, have equality $ r\br{x} \sim p\br{x} $, so $ p\br{x} \mid q\br{x} $.
\end{proof}

\begin{proof}[Proof of Theorem \ref{thm:structure}]
Argue by induction on $ n = \rk_\ZZ M $.
\begin{itemize}
\item Let $ M' \subseteq M $. If $ p : M \to \ZZ $, then $ p\br{M'} \subseteq M $. Choose $ p $ such that $ p\br{M'} $ is maximal with respect to inclusion among all $ q : M \to \ZZ $.
\item What is $ p\br{M} \subseteq \ZZ $? We have $ p\br{M} = a\ZZ $ for $ a \in \ZZ \setminus \cbr{0} $. If $ a \ne \pm 1 $, could define $ p'\br{x} = p\br{x} / a $ for all $ x \in M $, and $ p'\br{M'} \supsetneq p\br{M'} $ contradicts the maximality of $ p $ with respect to $ M' $. Thus $ p\br{M} = \ZZ $.
\item Let $ N = \ker p \subseteq M $, where $ p : M \twoheadrightarrow \ZZ $. Then $ N $ is free of rank $ n - 1 $, and let $ N' = M' \cap N $ be a submodule.
$$
\begin{tikzcd}[row sep=small]
N' \arrow[hookrightarrow]{r} \arrow[hookrightarrow]{d} & N \arrow[hookrightarrow]{d} \\
M' \arrow[hookrightarrow]{r} \arrow[twoheadrightarrow]{d} & M \arrow[twoheadrightarrow]{d} \\
p\br{M'} \arrow[hookrightarrow]{r} & \ZZ
\end{tikzcd}.
$$
\item Apply the induction hypothesis to $ \br{N, N'} $. Then $ N $ has a basis $ \br{e_2, \dots, e_n} $. Can complete $ \br{e_2, \dots, e_n} $ to a basis for $ M $. Choose $ e_1' \in M $ such that $ p\br{e_1'} = 1 $. Have a basis $ \br{e_1', e_2, \dots, e_n} $ of $ M $.
\item There exist $ a_2, \dots, a_q \in \ZZ \setminus \cbr{0} $ such that $ N' $ has a basis $ \br{a_2e_2, \dots, a_qe_q} $ and $ a_2 \mid \dots \mid a_q $. Then $ M' \twoheadrightarrow p\br{M'} = a_1\ZZ $ for $ a_1 \in \ZZ \setminus \cbr{0} $, assuming $ M' \ne 0 $. Choose $ x \in M' $ such that $ p\br{x} = a_1 $. We may assume $ p\br{x} \mid q\br{x} $ for every $ q : M \to \ZZ $. Look at $ \br{e_1', e_2, \dots, e_n} $, a basis of $ M $. Let $ p_i : M \to \ZZ $ be the projection onto the $ i $-th coordinate, so $ a_1 \mid p_i\br{x} $ for all $ i = 1, \dots, n $, by maximality property of $ p $ and $ p\br{x} = a_1 $. Can find a basis $ \br{e_1, \dots, e_n} $ of $ M $ such that $ x = a_1e_1 $, where
$$ e_1 = e_1' + \dfrac{p_2\br{x}}{a_1}e_2 + \dots + \dfrac{p_n\br{x}}{a_1}e_n, \qquad \dfrac{p_2\br{x}}{a_1}, \dots, \dfrac{p_n\br{x}}{a_1} \in \ZZ. $$
\item Left to prove that $ a_1 \mid a_2 $. Let $ d = \br{a_1, a_2} = b_1a_1 + b_2a_2 $. There exists $ d : M \to \ZZ $ such that $ d\br{x} = b_1p_1\br{x} + b_2p_2\br{x} $, where $ p_1\br{x} = p\br{x} = a_1 $ and $ p_2\br{x} = a_2 $. This will contradict maximality of $ p_1 = p $.
\end{itemize}
\end{proof}

\lecture{11}{Monday}{04/02/19}

\begin{definition}
\hfill
\begin{itemize}
\item If $ M $ is a $ \ZZ $-module, an element $ x \in M \setminus \cbr{0} $ is called a \textbf{torsion element} if there exists $ a \in \ZZ \setminus \cbr{0} $ such that $ ax = 0 $.
\item We say that a $ \ZZ $-module $ M $ is \textbf{torsion-free} if it does not contain torsion elements, that is if $ ax = 0 $ for $ a \in \ZZ $ and $ x \in M $, then $ a = 0 $ or $ x = 0 $.
\end{itemize}
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item If $ G $ is any finite group, all elements of $ G $ are torsion.
\item If $ M $ is a free $ \ZZ $-module, then $ M $ is torsion-free, such as $ \ZZ^n $ for $ n \in \ZZ_{\ge 1} $.
\item $ \QQ $ is torsion-free, even though it is not free of finite rank.
\end{itemize}
\end{example*}

\begin{proposition}
If $ M $ is a finitely generated $ \ZZ $-module and torsion-free, then $ M $ is free of finite rank.
\end{proposition}

\begin{proof}
Using structure theorem,
$$ M \cong \ZZ / a_1\ZZ \times \dots \times \ZZ / a_n\ZZ, \qquad a_1, \dots, a_n \in \ZZ, \qquad a_1 \mid \dots \mid a_n. $$
Want $ a_1 = \dots = a_n = 0 $. If not, there exists $ a_i \ne 0 $ such that all $ x \in \ZZ / a_i\ZZ \setminus \cbr{0} $ are torsion elements, so $ M $ cannot be a torsion-free, a contradiction.
\end{proof}

\pagebreak

\subsection{Integral closure}

\begin{definition}
An element $ x \in \CC $ is called
\begin{itemize}
\item an \textbf{algebraic number} if it satisfies an equation
$$ x^n + a_{n - 1}x^{n - 1} + \dots + a_0 = 0, \qquad a_i \in \QQ, $$
\item an \textbf{algebraic integer} if $ a_i \in \ZZ $.
\end{itemize}
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item $ x = i $ is an algebraic integer, since $ x^2 + 1 = 0 $.
\item $ x = \sqrt{2} $ is an algebraic integer, since $ x^2 - 2 = 0 $.
\item $ x = \sqrt{2} + i $ is an algebraic integer, since
$$ x - \sqrt{2} = i \qquad \implies \qquad x^2 - 2\sqrt{2}x + 3 = 0 \qquad \implies \qquad x^4 - 2x^2 + 9 = 0. $$
\end{itemize}
\end{example*}

In general, the sum and product of algebraic integers are algebraic integers.

\begin{definition}
Let $ R $ be a ring and $ A \subseteq R $. An element $ x \in R $ is said to be \textbf{integral} over $ A $ if there exists a monic polynomial equation
$$ x^n + a_{n - 1}x^{n - 1} + \dots + a_0 = 0, \qquad a_0, \dots, a_{n - 1} \in A. $$
\end{definition}

\begin{theorem}
\label{thm:integralsubring}
Let $ R $ be an ID and $ A \subseteq R $ a subring. Then if $ a, b \in R $ are integral over $ A $, so are $ a + b, a - b, ab $.
\end{theorem}

\begin{lemma}
\label{lem:cayleyhamilton}
Let $ R $ be an ID. Let
$$ M = \br{a_{ij}}_{1 \le i, j \le n} \in \Mat_n R $$
be an $ n \times n $ matrix with coefficients in $ R $. Assume $ v = \br{v_1, \dots, v_n} \in R^n $ for $ x \in R $ such that $ Mv = x \cdot v $, that is $ v $ is an eigenvector of $ M $ with eigenvalue $ x $. Let $ P \in R\sbr{X} $ be the characteristic polynomial of $ M $. Then $ P\br{x} = 0 $, that is $ x $ is a root of $ P $.
\end{lemma}

\begin{proof}
$ P\br{X} = \det \br{X \cdot \I_n - M} = X^n + a_{n - 1}X^{n - 1} + \dots + a_0 $ is monic of degree $ n $ with coefficients in $ R $. Cayley-Hamilton theorem implies that $ M^n + a_{n - 1}M^{n - 1} + \dots + a_0\I_n = 0_n \in R^n $, so $ M^nv + a_{n - 1}M^{n - 1}v + \dots + a_0\I_nv = 0_n \in R^n $. Since $ Mv = x \cdot v $, we get $ x^n \cdot v + a_{n - 1}x^{n - 1} \cdot v + \dots + a_0 \cdot v = 0_n \in R^n $, so $ \br{x^n + a_{n - 1}x^{n - 1} + \dots + a_0} \cdot v = 0_n \in R^n $. Then $ v \ne 0 $, so $ x^n + a_{n - 1}x^{n - 1} + \dots + a_0 = 0 \in R $, so $ x $ is a root of $ P $.
\end{proof}

\begin{proof}[Proof of Theorem \ref{thm:integralsubring}]
Let $ x = a + b $. The proof is similar for $ a - b $ and $ ab $. Then $ a $ is integral over $ A $, so there exists a polynomial $ f \in A\sbr{x} $ for $ n = \deg f $ such that
\begin{equation}
\label{eq:2}
f\br{a} = a^n + a_{n - 1}a^{n - 1} + \dots + a_0 = 0,
\end{equation}
so $ a^n = -a_{n - 1}a^{n - 1} - \dots - a_0 $ is in the $ A $-linear span of $ a^{n - 1}, \dots, 1 $. Similarly for $ b $, there exists $ g \in A\sbr{x} $ for $ m = \deg g $ such that
\begin{equation}
\label{eq:3}
g\br{b} = b^m + b_{m - 1}b^{m - 1} + \dots + b_0 = 0,
\end{equation}
so $ b^m $ is in the $ A $-linear span of $ b^{m - 1}, \dots, 1 $. Then
$$ \br{a + b} \cdot a^ib^j = a^{i + 1}b^j + a^ib^{j + 1}, \qquad i = 0, \dots, n - 1, \qquad j = 0, \dots, m - 1. $$
If $ i + 1 = n $ use equation $ \br{\ref{eq:2}} $. If $ j + 1 = m $ use equation $ \br{\ref{eq:3}} $. Then $ \br{a + b} \cdot a^ib^j $ is an $ A $-linear combination of $ a^kb^l $ for $ k \in \cbr{0, \dots, n - 1} $ and $ l \in \cbr{0, \dots, m - 1} $. Consider
$$ v = \threebyone{1}{\vdots}{a^{n - 1}b^{m - 1}} \in R^{m \cdot n}. $$
Then $ \br{a + b} \cdot v = M \cdot v $ for some $ n \cdot m \times n \cdot m $ matrix $ M \in \Mat_{n \cdot m} A $. Lemma \ref{lem:cayleyhamilton} implies that $ a + b $ is a root of $ \det \br{\I_{n \cdot m}X - M} \in A\sbr{X} $, that is $ a + b $ is integral over $ A $.
\end{proof}

\pagebreak

\begin{corollary}
If $ R $ is an integral domain and $ A \subseteq R $, then the set
$$ A' = \cbr{x \in R \st x \ \text{integral over} \ A} $$
is a subring of $ R $, containing $ A $. Then $ A' $ is the \textbf{integral closure} of $ A $ in $ R $.
\end{corollary}

\begin{definition}
Let $ R $ be an ID with field of fractions $ K $.
\begin{itemize}
\item The \textbf{integral closure} of $ R $ is the integral closure of $ R $ in $ K $.
\item We say $ R $ is \textbf{integrally closed} if $ R $ is the integral closure of $ R $.
\end{itemize}
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item $ \ZZ, \ZZ\sbr{\omega}, \ZZ\sbr{x} $ are integrally closed.
\item $ R = \ZZ\sbr{\sqrt{-3}} $ is not integrally closed. If $ \omega = \tfrac{-1 + \sqrt{-3}}{2} $ then $ \omega \in K = \QQ\br{\sqrt{-3}} $ and $ \omega^2 + \omega + 1 = 0 $, so $ \omega $ is integral over $ \ZZ\sbr{\sqrt{-3}} $ but not in $ \ZZ\sbr{\sqrt{-3}} $. The integral closure of $ \ZZ\sbr{\sqrt{-3}} $ is $ \ZZ\sbr{\omega} $, the Eisenstein integers.
\item $ \QQ\sbr{x, y} / \abr{x^2 - y^3} $ is not integrally closed, since $ t = x / y \in \Frac \QQ\sbr{x, y} / \abr{x^2 - y^3} $ satisfies monic polynomial equations $ t^2 - y = 0 $ and $ t^3 - x = 0 $.
\end{itemize}
\end{example*}

\lecture{12}{Tuesday}{05/02/19}

\begin{proposition}
Let $ R $ be a UFD. Then $ R $ is integrally closed.
\end{proposition}

\begin{proof}
Let $ K = \Frac R $. Let $ x \in K $ be integral over $ R $. Want $ x \in R $. Then $ x $ satisfies a monic polynomial equation
\begin{equation}
\label{eq:4}
x^n + a_{n - 1}x^{n - 1} + \dots + a_0 = 0, \qquad a_{n - 1}, \dots, a_0 \in R.
\end{equation}
Write $ x = a / b $ with $ a, b \in R \setminus \cbr{0} $. Can we ensure that $ a $ and $ b $ have no irreducible factor in common? Yes. Among all possible representations $ x = a / b $, choose the one for which $ d\br{b} \in \ZZ_{\ge 0} $, the number of irreducible factors of $ b $, is the smallest. If $ p \mid a $ and $ p \mid b $ then $ a' = a / p $ and $ b' = b / p $, so $ x = a / b = a' / b' $, where $ d\br{b'} = d\br{b} - 1 $, a contradiction. Multiplying $ \br{\ref{eq:4}} $ by $ b^n $, $ a^n + a_{n - 1}a^{n - 1}b + \dots + a_0b^n = 0 $, so $ b \mid a^n $, but $ \gcd\br{a, b} = 1 $. Thus $ b \in R^\times $ is a unit, so $ x = a / b \in R $.
\end{proof}

\begin{theorem}
Let $ R \subset S $ be an inclusion of IDs. Let $ R' $ be the integral closure of $ R $ in $ S $. Then $ R' $ is integrally closed in $ S $.
\end{theorem}

\begin{example*}
Let $ \ZZ \subset R $, where $ R / \QQ $ is a finite extension. Let $ \OOO_K $ be the integral closure of $ \ZZ $ in $ K $, the ring of integers of $ K $. Then $ \OOO_K $ is integrally closed. Applies to $ \ZZ\sbr{i}, \ZZ\sbr{\omega}, \ZZ\sbr{\sqrt{-5}} $.
\end{example*}

\subsection{Quadratic fields}

A \textbf{number field} $ K $ is a field containing $ \QQ $ such that $ \dim_\QQ K $ is finite. Any finite field extension of $ \QQ $ is a number field. The \textbf{degree} of the number field is by definition $ \dim_\QQ K $. A \textbf{quadratic field} is an extension of $ \QQ $ of degree two. The \textbf{ring of integers} $ \OOO_K \subset K $ is the integral closure of $ \ZZ $ in $ K $.

\begin{lemma}
Every quadratic field $ K / \QQ $ is of the form
$$ \QQ\br{\sqrt{d}} = \cbr{a + b\sqrt{d} \st a, b \in \QQ}, $$
for some square-free $ d \in \ZZ $.
\end{lemma}

\begin{proof}
Let $ x \in K \setminus \QQ $. Then $ \abr{1, x} $ is a $ \QQ $-basis of $ K $, and $ x^2 + \alpha x + \beta \in K $ for $ \alpha, \beta \in \QQ $ implies that $ x = \br{\alpha \pm\sqrt{\alpha^2 + 4\beta}} / 2 $, and $ d = \alpha^2 + 4\beta \in \QQ $, so $ K = \QQ\br{\sqrt{d}} $. Multiplying $ d $ by $ n^2 $, for all $ n \in \ZZ $, $ \QQ\br{\sqrt{d}} = \QQ\br{\sqrt{dn^2}} $, so can assume $ d \in \ZZ $. Similarly, can assume $ d $ is square-free. Thus $ \abr{1, \sqrt{d}} $ is a basis over $ \QQ $.
\end{proof}

\begin{remark*}
If $ d < 0 $, $ \QQ\br{\sqrt{d}} $ is called an \textbf{imaginary quadratic field}. If $ d > 0 $, $ \QQ\br{\sqrt{d}} $ is called a \textbf{real quadratic field}.
\end{remark*}

\pagebreak

\begin{theorem}
Let $ K = \QQ\br{\sqrt{d}} $ with $ d \in \ZZ $ square-free. Note that $ d \not\equiv 0 \mod 4 $.
\begin{enumerate}
\item If $ d \equiv 2, 3 \mod 4 $, then
$$ \OOO_K = \ZZ\sbr{\sqrt{d}} = \cbr{a + b\sqrt{d} \st a, b \in \ZZ}. $$
\item If $ d \equiv 1 \mod 4 $, then
$$ \OOO_K = \cbr{\tfrac{u + v\sqrt{d}}{2} \st u, v \in \ZZ, \ u \equiv v \mod 2} \supsetneq \ZZ\sbr{\sqrt{d}}. $$
In this case $ \OOO_K $ is the $ \ZZ $-linear span of $ 1 $ and $ \tfrac{1 + \sqrt{d}}{2} $.
\end{enumerate}
\end{theorem}

\begin{example*}
\hfill
\begin{enumerate}
\item $ \ZZ\sbr{i}, \ZZ\sbr{\sqrt{-2}}, \ZZ\sbr{\sqrt{2}}, \ZZ\sbr{\sqrt{-5}} $.
\item $ \ZZ\sbr{\omega} $ and $ \ZZ\sbr{\tfrac{1 + \sqrt{5}}{2}} $.
\end{enumerate}
\end{example*}

\begin{proof}
Let $ \OOO_K $ be the integral closure of $ \ZZ $ in $ \QQ\br{\sqrt{d}} = K $. Let $ x = a + b\sqrt{d} $ for $ a, b \in \QQ $. Assume $ x $ is an algebraic integer. Let $ \overline{x} = a - b\sqrt{d} $. Then $ x $ and $ \overline{x} $ satisfy the same polynomial equation with $ \ZZ $ coefficients, so $ \overline{x} = a - b\sqrt{d} $ is also an algebraic integer.
\begin{itemize}
\item $ x\overline{x} = \br{a + b\sqrt{d}}\br{a - b\sqrt{d}} = a^2 - b^2d \in \QQ $ is an algebraic integer, so $ a^2 - b^2d \in \ZZ $.
\item $ x - \overline{x} = 2b\sqrt{d} $, so $ 4b^2d \in \ZZ $, so $ 2b \in \ZZ $, because $ d $ is square-free.
\item $ x + \overline{x} = 2a $, so $ 2a \in \ZZ $.
\end{itemize}
Let $ a = u / 2 $ and $ b = v / 2 $.
\begin{enumerate}
\item If $ d \equiv 2, 3 \mod 4 $, then
$$ a^2 - b^2d = \dfrac{u^2 - v^2d}{4} \in \ZZ \qquad \implies \qquad 4 \mid u^2, v^2 \qquad \implies \qquad 2 \mid u, v \qquad \implies \qquad a, b \in \ZZ. $$
\item If $ d \equiv 1 \mod 4 $, then
$$ a^2 - db^2 = \dfrac{u^2 - v^2d}{4} \in \ZZ \qquad \implies \qquad 4 \mid u^2 - dv^2 \qquad \implies \qquad u \equiv v \mod 2. $$
\end{enumerate}
\end{proof}

\lecture{13}{Friday}{08/02/19}

Lecture 13 is a problems class.

\subsection{Traces and norms}

\lecture{14}{Monday}{11/02/19}

Let $ K / \QQ $ be a quadratic field. The conjugate is
$$ \function{K}{K}{\alpha = a + b\sqrt{d}}{\overline{\alpha} = a - b\sqrt{d}}. $$
Then
$$ \function[\Tr]{K}{\QQ}{\alpha}{\alpha + \overline{\alpha}}, \qquad \function[\Nm]{K}{\QQ}{\alpha}{\alpha \cdot \overline{\alpha}}, $$
and $ \Tr : \OOO_K \to \ZZ $ and $ \Nm : \OOO_K \to \ZZ $. Then $ \OOO_K $ is a free $ \ZZ $-module of rank two. The goal is to discuss trace and norm for general number fields. The motivation is that $ \OOO_K $ is a free $ \ZZ $-module of rank $ \deg \br{K / \QQ} $.

\pagebreak

\begin{proposition}
\label{prop:embeddings}
Let $ F \subseteq \CC $ be a subfield. Let $ K / F $ be a finite extension of degree $ n $. Then there exist exactly $ n $ embeddings $ \sigma : K \hookrightarrow \CC $ such that $ \eval{\sigma}_F = \id_F $.
\end{proposition}

\begin{proof}
Assume first that $ K = F\br{x} $, where $ x $ is a root of a minimal polynomial $ P\br{t} \in F\sbr{t} $. Then $ P $ has degree $ n $, since $ x^n $ is an $ F $-linear combination of $ 1, \dots, x^{n - 1} $, so $ P $ has $ n $ distinct roots in $ \CC $. Let $ \alpha $ be a root of $ P\br{t} $ in $ \CC $. This determines
$$ \function[\sigma]{K}{\CC}{x}{\sigma\br{x} = \alpha}, \qquad \eval{\sigma}_F = \id_F. $$
Conversely, if $ \sigma : K \hookrightarrow \CC $ such that $ \eval{\sigma}_F = \id_F $, $ \sigma\br{P\br{t}} = P\br{t} $ and $ \sigma\br{x} $ is some root of $ P\br{t} $ in $ \CC $. In general, use induction on $ \deg \br{K / F} = n $.
\begin{itemize}
\item $ n = 1 $ is ok, since $ K = F $, so only one embedding.
\item $ n > 1 $. Choose $ x \in K \setminus F $. Then $ K / F\br{x} / F $, so applying the induction hypothesis on $ \deg \br{K / F\br{x}} < \deg \br{K / F} $,
$$ n = \deg \br{K / F} = \deg \br{K / F\br{x}} \cdot \deg \br{F\br{x} / F} = k \cdot m. $$
Have $ m $ embeddings $ \tau : F\br{x} \hookrightarrow \CC $ such that $ \eval{\tau}_F = \id_F $. By induction, have $ k $ embeddings $ \sigma : K \hookrightarrow \CC $ such that $ \eval{\sigma}_{F\br{x}} = \tau $. Overall, have $ n = k \cdot m $ embeddings $ K \hookrightarrow \CC $ which are $ \id_F $ on $ F $.
\end{itemize}
\end{proof}

\begin{notation*}
Let $ e\br{K / F} $ denote the set of embeddings as in Proposition \ref{prop:embeddings}.
\end{notation*}

Let $ x \in K $. Think of
$$ \function{K}{K}{y}{x \cdot y} $$
as an $ F $-linear transformation on $ K $. Let $ \ch_{K / F}\br{x} $ denote the characteristic polynomial of multiplication by $ x $ in $ K $. Then $ \ch_{K / F}\br{x} \in F\sbr{t} $ has degree $ n = \sbr{K : F} $.

\begin{example*}
Let $ K / \QQ $ be quadratic and $ x = \sqrt{d} $. Then $ a + b\sqrt{d} \mapsto x \cdot \br{a + b\sqrt{d}} = a\sqrt{d} + bd $. If $ K \cong \QQ^2 $, then
$$ x = \twobytwo{0}{d}{1}{0}, \qquad \ch_{K / \QQ}\br{x} = t^2 - d = \br{t - \sqrt{d}}\br{t + \sqrt{d}}. $$
\end{example*}

\begin{proposition}
Let $ K / F $ be a finite extension of degree $ n $. Then
$$ \ch_{K / F}\br{x} = \prod_{\sigma \in e\br{K / F}} \br{t - \sigma\br{x}} \in F\sbr{t}, \qquad x \in K. $$
\end{proposition}

\begin{proof}
First assume $ K = F\br{x} $. Then the right hand side is just the minimal polynomial $ P\br{t} \in F\sbr{t} $ of $ x $. For any root $ \alpha $ of $ P\br{t} $, $ \ch_{K / F}\br{x}\br{\alpha} = 0 $, since
$$ \function{K}{\CC}{x}{\alpha} $$
has an $ F $-basis given by $ 1, \dots, \alpha^{n - 1} $, and multiplication by $ \alpha $ shifts this. Every root of $ P\br{t} $ is also a root of $ \ch_{K / F}\br{x} $, and they are both monic polynomials of degree $ n $, so $ P\br{t} = \ch_{K / F}\br{x} $. In general, $ K / F\br{x} / F $. Choose a basis $ e_1, \dots, e_m $ of $ K $ over $ F\br{x} $. For any $ i = 1, \dots, m $ multiplication by $ x $ leaves $ e_iF\br{x} \subset K $ stable and has characteristic polynomial equal to
$$ \prod_{\sigma \in e\br{F\br{x} / F}} \br{t - \sigma\br{x}}, $$
where $ e_iF\br{x} \subset K $ is an $ F $-vector subspace of dimension $ \deg \br{F\br{x} / F} $. Thus
$$ \ch_{K / F}\br{x} = \prod_{\sigma \in e\br{F\br{x} / F}} \br{t - \sigma\br{x}}^m = \prod_{\sigma \in e\br{F\br{x} / F}} \br{\prod_{\tau \in e\br{K / F\br{x}}, \ \eval{\tau}_{F\br{x}} = \sigma} \br{t - \tau\br{x}}}. $$
\end{proof}

\pagebreak

\lecture{15}{Tuesday}{12/02/19}

\begin{definition}
$ \Tr : K \to F $ is the trace of multiplication by $ x $ and $ \Nm : K \to F $ is the determinant of multiplication by $ x $. These are coefficients of $ \ch_{K / F}\br{x} $.
\end{definition}

\begin{theorem}
\label{thm:integralclosure}
Let $ R \subseteq F $ be an integrally closed domain. Let $ S $ be the integral closure of $ R $ in $ K $. Then if $ x \in S $, $ \ch_{K / F}\br{x} \in R\sbr{t} $.
\end{theorem}

\begin{corollary}
Let $ K, F, S, R $ as in Theorem \ref{thm:integralclosure}. We have $ \Tr : S \to R $ and $ \Nm : S \to R $.
\end{corollary}

\begin{example*}
Let $ K / \QQ $ be quadratic. Then $ \Tr : \OOO_K \to \ZZ $ and $ \Nm : \OOO_K \to \ZZ $.
\end{example*}

\begin{proof}[Proof of Theorem \ref{thm:integralclosure}]
Let $ x \in S $. Is
$$ \ch_{K / F}\br{x} = \prod_{\sigma \in e\br{K / F}} \br{t - \sigma\br{x}} \in R\sbr{t}? $$
Let $ L $ be the \textbf{composite} of extensions $ \sigma\br{K} \subseteq \CC $, the smallest field extension of $ F $ containing all $ \sigma\br{K} $. Let $ T $ be the integral closure of $ R $ in $ L $, so
$$
\begin{tikzcd}[row sep=small]
T \arrow[subset]{r} & L \\
S \arrow[hookrightarrow]{u} \arrow[subset]{r} & K \arrow[hookrightarrow]{u} \\
R \arrow[hookrightarrow]{u} \arrow[subset]{r} & F \arrow[hookrightarrow]{u}
\end{tikzcd}.
$$
For all $ \sigma \in e\br{K / F} $, $ \sigma\br{x} $ is a root of the minimal polynomial $ P\br{t} \in F\sbr{t} $ of $ x $ over $ F $, and $ x \in S $, so $ P\br{t} \in R\sbr{t} $, so $ \sigma\br{x} \in T $. The coefficients of $ \ch_{K / F}\br{x} $ are symmetric polynomials in the $ \sigma\br{x} $,
$$ \sum_{\sigma \in e\br{K / F}} \sigma\br{x}, \sum_{\sigma, \sigma' \in e\br{K / F}} \sigma\br{x}\sigma'\br{x}, \dots \in T, $$
therefore they are elements of $ T $. The upshot is that $ \ch_{K / F}\br{x} \in \br{F \cap T}\sbr{t} = R\sbr{t} $, since $ F \cap T $ is the integral closure of $ R $ in $ F $, which is $ R $.
\end{proof}

\begin{corollary}
If $ K / \QQ $ is a finite extension, so $ F = \QQ $, and $ \OOO_K \subset K $ is the ring of integers, so $ R = \ZZ $. Then $ \Tr : \OOO_K \to \ZZ $ and $ \Nm : \OOO_K \to \ZZ $.
\end{corollary}

\subsection{\texorpdfstring{$ \OOO_K $}{OK} is a lattice}

\begin{definition}
Let $ V $ be a finite dimensional $ \QQ $-vector space. A function
$$ \function[\abr{\cdot, \cdot}]{V \times V}{\QQ}{\br{v, w}}{\abr{v, w}} $$
is
\begin{itemize}
\item \textbf{$ \QQ $-bilinear} if it is $ \QQ $-linear as a function of $ v $ and $ \QQ $-linear as a function of $ w $,
\item \textbf{symmetric} if $ \abr{v, w} = \abr{w, v} $, and
\item \textbf{non-degenerate} if for all $ v \in V $ such that $ v \ne 0 $, there exists $ w \in V $ such that $ \abr{v, w} \ne 0 $.
\end{itemize}
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item Let $ V = \QQ $. Then
$$ \function{V \times V}{\QQ}{\br{v, w}}{0} $$
is symmetric and bilinear.

\pagebreak

\item Let $ V = \QQ^2 $. Then
$$ \function{V \times V}{\QQ}{\br{v, w}}{\abr{v, w} = v \cdot w = v\twobytwo{1}{0}{0}{1}w^t} $$
is the inner product, which is non-degenerate.
\item Let $ K / \QQ $ be quadratic. Then
$$ \function[\Tr_{K / \QQ}\br{\cdot, \cdot}]{K \times K}{\QQ}{\br{x, y}}{\Tr_{K / \QQ} xy \in \QQ} $$
is
\begin{itemize}
\item symmetric, because $ x \cdot y = y \cdot x $, that is multiplication in $ K $ is commutative,
\item non-degenerate, because for all $ x \in K^\times $, taking $ y = x^{-1} $,
$$ \Tr_{K / \QQ}\br{x, y} = \Tr_{K / \QQ} xx^{-1} = \Tr_{K / \QQ} 1 = 2 \ne 0, $$
\item bilinear, because $ \Tr_{K / \QQ} $ is $ \QQ $-linear.
\end{itemize}
\item Let $ K = \QQ\br{i} $, $ x = a + bi $, and $ y = c + di $. Then
$$ \Tr_{\QQ\br{i} / \QQ}\br{x, y} = \Tr_{\QQ\br{i} / \QQ} \br{a + bi}\br{c + di} = \Tr_{\QQ\br{i} / \QQ} \br{ac - bd + ibc + iad} = 2\br{ac - bd}, $$
so $ x, y \in \ZZ\sbr{i} $, so $ \Tr_{\QQ\br{i} / \QQ}\br{x, y} \in \ZZ $.
\end{itemize}
\end{example*}

\lecture{16}{Friday}{15/02/19}

\begin{definition}
Let $ V $ be a finite dimensional $ \QQ $-vector space. A \textbf{free $ \ZZ $-lattice}, or \textbf{lattice}, in $ V $ is a $ \ZZ $-submodule $ M \subseteq V $ that is free of rank $ \dim_\QQ V $.
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item $ \QQ\br{\sqrt{-3}} \supset \ZZ\sbr{\sqrt{-3}}, \ZZ\sbr{2\sqrt{-3}}, \ZZ\sbr{\tfrac{\omega}{2}} $ are lattices.
\item $ \ZZ $ and $ \sqrt{-3}\ZZ $ are not lattices.
\end{itemize}
\end{example*}

\begin{lemma}
Let $ M \subseteq V $ be a lattice. If $ e_1, \dots, e_n $ is a $ \ZZ $-basis for $ M $ then $ e_1, \dots, e_n $ is a $ \QQ $-basis for $ V $.
\end{lemma}

\begin{proof}
Notice that $ \dim_\QQ V = n $, since $ \rk_\ZZ M = n $. If $ e_1, \dots, e_n $ are $ \QQ $-linearly independent then $ e_1, \dots, e_n $ generate $ W \subseteq V $ with $ \dim_\QQ W = n = \dim_\QQ V $, so $ W = V $. Assume there exist $ a_1, \dots, a_n \in \QQ $ such that
$$ a_1e_1 + \dots + a_ne_n = 0. $$
Multiplying this equation by the product of the denominators of the $ a_i $, which is not zero,
$$ a_1'e_1 + \dots + a_n'e_n = 0, \qquad a_1', \dots, a_n' \in \ZZ, $$
so $ a_1' = \dots = a_n' = 0 $. Thus $ a_1 = \dots = a_n = 0 $.
\end{proof}

Let $ M \subseteq V / \QQ $ be a lattice. Let $ \abr{\cdot, \cdot} $ be a non-degenerate symmetric bilinear form on $ V $. Define
$$ M^\vee = \cbr{w \in V \st \abr{v, w} \in \ZZ \ \text{for all} \ v \in M}. $$

\begin{proposition}
\label{prop:duallattice}
$ M^\vee \subseteq V $ is also a lattice.
\end{proposition}

\begin{example*}
Let $ K = \QQ\br{\sqrt{-3}} $ and $ M = \ZZ\sbr{\sqrt{-3}} $. Then
$$ \Tr_{K / \QQ}\br{a + b\sqrt{-3}, c + d\sqrt{-3}} = \Tr_{K / \QQ} \br{ac - 3bd + \sqrt{-3}\br{ad + bc}} = 2\br{ac - 3bd}, $$
so $ \abr{1, c + d\sqrt{-3}} = 2c \in \ZZ $ and $ \abr{\sqrt{-3}, c + d\sqrt{-3}} = -6d \in \ZZ $. Thus
$$ M^\vee = \cbr{c + d\sqrt{-3} \st c \in \tfrac{1}{2}\ZZ, \ d \in \tfrac{1}{6}\ZZ} = \abr{\tfrac{1}{2}, \tfrac{\sqrt{-3}}{6}} \supseteq \ZZ\sbr{\omega} \supseteq M, \qquad 1^\vee = \tfrac{1}{2}, \qquad \br{\sqrt{-3}}^\vee = \tfrac{\sqrt{-3}}{6}. $$
\end{example*}

\pagebreak

\begin{proof}
Want that $ M^\vee \subseteq V $ is a lattice. Let $ e_1, \dots, e_n $ be a $ \ZZ $-basis of $ M $, so a $ \QQ $-basis of $ V $. Given $ \abr{\cdot, \cdot} : V \times V \to \QQ $ define $ e_1^\vee, \dots, e_n^\vee $ to be the dual basis to $ e_1, \dots, e_n $,
$$ \abr{e_i, e_j^\vee} =
\begin{cases}
1 & i = j \\
0 & i \ne j
\end{cases}.
$$
Claim that $ e_1^\vee, \dots, e_n^\vee $ is a $ \ZZ $-basis for $ M^\vee $.
\begin{itemize}
\item $ e_1^\vee, \dots, e_n^\vee $ are $ \ZZ $-linearly independent because they are $ \QQ $-linearly independent. Let
$$ w = a_1e_1^\vee + \dots + a_ne_n^\vee = 0, \qquad a_i \in \ZZ \subseteq \QQ, $$
so $ a_i = \abr{e_i, w} = 0 $.
\item $ e_i^\vee \in M^\vee $, by using definition of $ M^\vee $. Want $ \abr{v, e_i^\vee} \in \ZZ $ for all $ v \in M $. Let $ v \in M $, so
$$ v = b_1e_1 + \dots + b_ne_n, \qquad b_i \in \ZZ, $$
so $ \abr{v, e_i^\vee} = b_i \in \ZZ $.
\item For all $ w \in M^\vee \subseteq V $,
$$ w = c_1e_1^\vee + \dots + c_ne_n^\vee, \qquad c_i \in \ZZ. $$
Can do this with $ c_i \in \QQ $ for $ i = 1, \dots, n $. Need to show they are in $ \ZZ $. Have $ \abr{e_i, w} = c_i $ and $ w \in M^\vee $, so $ c_i \in \ZZ $.
\end{itemize}
\end{proof}

\begin{theorem}
Let $ K / \QQ $ be a number field of degree $ n $, with ring of integers $ \OOO_K $. Then $ \OOO_K $ is a lattice in $ K $.
\end{theorem}

\begin{proof}
The idea is
\begin{enumerate}
\item to find a lattice $ M \subseteq \OOO_K $, and
\item to show $ M^\vee \supseteq \OOO_K $, the dual with respect to $ \Tr_{K / \QQ}\br{\cdot, \cdot} $.
\end{enumerate}
By structure theorem, $ M^\vee \supseteq \OOO_K \supseteq M $, so
$$ \rk M \le \rk \OOO_K \le \rk M^\vee. $$
\begin{enumerate}
\item We can find $ n $ $ \QQ $-linearly independent algebraic numbers $ e_1, \dots, e_n \in K $, because $ \dim_\QQ K = n $, so any $ \QQ $-basis of $ K $ will work. Then $ e_i $ is an algebraic number, but may not be an algebraic integer. Let
$$ e_i^n + \alpha_1e_i^{n - 1} + \dots + \alpha_{n - 1} = 0, \qquad \alpha_1, \dots, \alpha_{n - 1} \in \QQ. $$
Multiply equation by $ n $-th power $ A^n $ of denominators of $ \alpha_i $. Let $ e_i' = Ae_i $, so
$$ \br{Ae_i}^n + \br{A\alpha_1}\br{Ae_i}^{n - 1} + \dots + \br{A^n\alpha_{n - 1}} = 0, \qquad A\alpha_1, \dots, A^n\alpha_{n - 1} \in \ZZ. $$
Can assume $ e_i \in \OOO_K $, that is algebraic integers. Let $ M \subseteq \OOO_K $ be the $ \ZZ $-span of $ e_1, \dots, e_n $.
\item $ M^\vee \subseteq K $ is a lattice by Proposition \ref{prop:duallattice}. Then $ \alpha \in \OOO_K \subseteq M^\vee $, since for all $ \beta \in M $, $ \Tr_{K / \QQ}\br{\beta, \alpha} = \Tr_{K / \QQ} \alpha\beta \in \ZZ $, since we know $ \alpha \cdot \beta \in \OOO_K $ and $ \eval{\Tr_{K / \QQ}}_{\OOO_K} : \OOO_K \to \ZZ \subset \QQ $.
\end{enumerate}
\end{proof}

\pagebreak

\section{Finiteness of ideal class groups}

\subsection{Dedekind domains}

\lecture{17}{Monday}{18/02/19}

The goal is to discuss Dedekind domains. A number field $ K / \QQ $ gives the ring of integers $ \OOO_K $, which is not usually a UFD.
\begin{itemize}
\item We will show that unique factorisation of ideals holds in Dedekind domains and $ \OOO_K $ is a Dedekind domain.
\item We will introduce the ideal class group, which measures how far $ \OOO_K $ is from being a PID or UFD.
\end{itemize}
Recall that $ \mmm \subsetneq R $ is a maximal ideal if for all $ \mmm \subseteq \nnn \subseteq R $ either $ \nnn = \mmm $ or $ \nnn = R $.

\begin{definition}
A ring $ R $ is called a \textbf{Dedekind domain} if $ R $ is an integrally closed Noetherian domain and every non-zero proper prime ideal of $ R $ is a maximal ideal.
\end{definition}

\begin{proposition}
\label{prop:dedekinddomain}
If $ R $ is a PID, then $ R $ is a Dedekind domain.
\end{proposition}

\begin{lemma}
\label{lem:irreducible}
An element $ a \in R \setminus \cbr{0} $ is irreducible if and only if $ \abr{a} $ is a maximal ideal among principal ideals.
\end{lemma}

\begin{proof}
$ a = bc $ is irreducible if and only if
$$
\begin{cases}
b \in R^\times, \ a \mid c \\
c \in R^\times, \ a \mid b
\end{cases}
\qquad \iff \qquad
\begin{cases}
\abr{b} = R, \ \abr{c} = \abr{a} \\
\abr{c} = R, \ \abr{b} = \abr{a}
\end{cases}.
$$
\begin{itemize}
\item[$ \implies $] Assume $ \abr{a} \subseteq \abr{b} \subseteq R $. Then $ b \mid a $, so $ b \in R^\times $, so $ \abr{b} = R $, or $ a \mid b $, so $ \abr{b} = \abr{a} $. Thus $ a $ is irreducible.
\item[$ \impliedby $] Assume $ a = bc $. Then $ b \mid a $, so $ R \supseteq \abr{b} \supseteq \abr{a} $, so either $ \abr{b} = R $ if and only if $ b \in R^\times $, or $ \abr{b} = \abr{a} $ if and only if $ a \mid b $ and $ c \in R^\times $.
\end{itemize}
\end{proof}

\begin{proof}[Proof of Proposition \ref{prop:dedekinddomain}]
$ R $ is a PID implies that $ R $ is an integrally closed Noetherian domain. Let $ a \in R \setminus \cbr{0} $ be such that $ \abr{a} $ is prime, if and only if $ a $ is prime, so $ a $ is irreducible. Lemma \ref{lem:irreducible} implies that $ \abr{a} $ is maximal.
\end{proof}

\begin{example*}
\hfill
\begin{itemize}
\item $ \ZZ, \ZZ\sbr{i}, \ZZ\sbr{\sqrt{2}}, \ZZ\sbr{\omega} $ are PIDs.
\item $ \ZZ\sbr{\sqrt{-3}} $ is not a Dedekind domain because it is not integrally closed.
\item $ \ZZ\sbr{\sqrt{-5}} $ and $ \QQ\sbr{x} $ are Dedekind domains.
\item $ \ZZ\sbr{x} $ is not a Dedekind domain, since $ 0 \subsetneq \abr{x} \subsetneq \abr{2, x} $ are prime but $ \abr{x} $ is not zero or maximal.
\end{itemize}
\end{example*}

\begin{definition}
Let $ K $ be a number field, with ring of integers $ \OOO_K $ and a prime ideal $ 0 \ne \nnn \subseteq \OOO_K $. If $ 0 \ne a \in \nnn \cap \ZZ $, then $ \nnn \supseteq \abr{a} $ and
$$ \OOO_K / \abr{a} = \br{\ZZ / a\ZZ}^{\deg \br{K / \QQ}} $$
is finite. Then $ \OOO_K / \abr{a} \twoheadrightarrow \OOO_K / \nnn $, so $ \#\OOO_K / \nnn \le \#\OOO_K / \abr{a} $ is finite, and define
$$ \Nm \nnn = \#\OOO_K / \nnn. $$
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item Let $ \abr{p} \subsetneq \ZZ $ for $ p $ prime. Then $ \Nm \abr{p} = \#\ZZ / \abr{p} = \#\ZZ / p\ZZ = p $.
\item Let $ a \in \ZZ \hookrightarrow \OOO_K $. Then $ \Nm \abr{a} = \#\OOO_K / \abr{a} = a^{\deg \br{K / \QQ}} = \Nm_{K / \QQ} a $. If $ x \in \OOO_K $, then $ \Nm \abr{x} = \Nm_{K / \QQ} x $.

\pagebreak

\item Let $ \OOO_K = \ZZ\sbr{\sqrt{-5}} \supsetneq \abr{2, 1 + \sqrt{-5}} $. Then $ \Nm \abr{2, 1 + \sqrt{-5}} = 2 $.
\begin{itemize}
\item $ \OOO_K / \abr{2, 1 + \sqrt{-5}} = \ZZ\sbr{x} / \abr{x^2 + 5, 2, 1 + x} = \ZZ / 2\ZZ $.
\item Alternatively, use structure theorem of finitely generated abelian groups. Have a basis $ \br{e_1, e_2} $ for $ \OOO_K $ over $ \ZZ $ and $ a_1, a_2 \in \ZZ \setminus \cbr{0} $ such that $ a_1 \mid a_2 $ and $ \br{a_1e_1, a_2e_2} $ is a basis for $ \abr{2, 1 + \sqrt{-5}} $.
\begin{itemize}
\item $ \OOO_K $ is generated by $ 1 + \sqrt{-5} $ and $ 1 $, and
\item $ \abr{2, 1 + \sqrt{-5}} $ is generated by $ 1 + \sqrt{-5} $ and $ 2 $,
\end{itemize}
so $ a_1 = 1 $ and $ a_2 = 2 $. Thus $ \Nm \abr{2, 1 + \sqrt{-5}} = a_1 \cdot a_2 $.
\item Alternatively, in the standard basis of $ \OOO_K $, where $ e_1 = 1 $ and $ e_2 = \sqrt{-5} $,
$$ \abr{2, 1 + \sqrt{-5}} = \twobytwo{2}{0}{1}{1} \cdot \OOO_K. $$
Then
$$ \Nm \abr{2, 1 + \sqrt{-5}} = \abs{\det \twobytwo{2}{0}{1}{1}}, $$
the absolute value of the determinant.
\end{itemize}
\end{itemize}
\end{example*}

\lecture{18}{Tuesday}{19/02/19}

\begin{remark*}
$ \Nm \nnn \in \nnn $ because $ \Nm \nnn $ in $ \OOO_K / \nnn $ is equal to zero, because the order of a finite group is always equal to zero in that finite group.
\end{remark*}

\begin{proposition}
Let $ I \subseteq J \subseteq \OOO_K $ be a sequence of ideals. Then $ \Nm J \mid \Nm I $.
\end{proposition}

\begin{proof}
Let $ \phi : \OOO_K / I \twoheadrightarrow \OOO_K / J $ be a ring homomorphism. Then $ \br{\OOO_K / I} / \ker \phi \cong \OOO_K / J $, so $ \Nm I = \Nm J \cdot \#\ker \phi $. Thus $ \Nm J \mid \Nm I $.
\end{proof}

\begin{example*}
Show that the ideals $ I = \abr{11, 3 + \sqrt{31}} $ and $ J = \abr{6, 1 + \sqrt{31}} $ in $ \ZZ\sbr{\sqrt{31}} $ are relatively prime, that is $ I + J = \ZZ\sbr{\sqrt{31}} $, if and only if $ \Nm \br{I + J} = 1 $. Since
$$ \Nm I = \abs{\det \twobytwo{11}{0}{3}{1}} = 11, \qquad \Nm J = \abs{\det \twobytwo{6}{0}{1}{1}} = 6, $$
$ I \subset I + J $, so $ \Nm \br{I + J} \mid \Nm I = 11 $, and $ J \subset I + J $, so $ \Nm \br{I + J} \mid \Nm J = 6 $. Thus $ \Nm \br{I + J} = 1 $.
\end{example*}

Let $ a \in \OOO_K $. Structure theorem of finite generated abelian groups implies that if $ e_1, \dots, e_n $ is a basis for $ \OOO_K $, where $ n = \deg \br{K / \QQ} $, then $ a_1e_1, \dots, a_ne_n $ is a basis for $ \abr{a} $. Then
$$ \OOO_K / \abr{a} = \ZZ / a_1\ZZ \times \dots \times \ZZ / a_n\ZZ, $$
so $ \Nm \abr{a} = a_1 \cdot \dots \cdot a_n = \det a = \Nm_{K / \QQ} a $.

\subsection{\texorpdfstring{$ \OOO_K $}{OK} is a Dedekind domain}

The goal is to show that $ \OOO_K $ is a Dedekind domain, that is it is an integrally closed Noetherian domain and non-zero prime ideals are maximal ideals. It is an integrally closed domain.

\begin{proposition}
The ring of integers $ \OOO_K $ in a number field $ K $ is Noetherian.
\end{proposition}

\begin{proof}
Assume that
$$ \aaa_1 \subseteq \dots \subseteq \aaa_n \subseteq \dots $$
is an ascending sequence of ideals in $ \OOO_K $. Then
$$ \Nm \aaa_1 \ge \dots \ge \Nm \aaa_n \ge \dots, $$
since $ \OOO_K / \aaa_1 \twoheadrightarrow \dots \twoheadrightarrow \OOO_K / \aaa_n \twoheadrightarrow \dots $. This must stabilise, so $ \Nm \aaa_n = \Nm \aaa_{n + 1} $ and $ \aaa_n \subseteq \aaa_{n + 1} $, so $ \OOO_K / \aaa_n \twoheadrightarrow \OOO_K / \aaa_{n + 1} $. Equality of norms implies that this must be a bijection, so $ \aaa_n = \aaa_{n + 1} $, since if $ \aaa \subseteq \bbb \subseteq \OOO_K $ such that $ \Nm \aaa = \Nm \bbb $, then $ \aaa = \bbb $. \footnote{Exercise}
\end{proof}

\pagebreak

\begin{lemma}
Let $ R $ be an integral domain which is also a finite set. Then $ R $ is a field.
\end{lemma}

\begin{proof}
$$ \function{R}{R}{y}{x \cdot y} $$
is injective because $ R $ is an integral domain and bijective because $ R $ is a finite set.
\end{proof}

\begin{lemma}
Let $ \ppp $ be a prime ideal in $ \OOO_K $. Then $ \ppp $ must be a maximal ideal.
\end{lemma}

\begin{proof}
$ \OOO_K / \ppp $ is an integral domain and a finite set of cardinality $ \Nm \ppp $.
\end{proof}

\begin{remark*}
Let $ \ppp \ne 0 $ be a prime ideal of $ \OOO_K $. Then $ \Nm \ppp = p^r $ for some $ p \in \ZZ $ prime and $ r \in \ZZ_{\ge 1} $ because of the classification of finite fields.
\end{remark*}

Thus
$$
\begin{tikzcd}[row sep=tiny, column sep=tiny]
& & \cbr{\text{UFDs}} \arrow[subset]{dr} & & & \\
\dots \arrow[subset]{r} & \cbr{\text{PIDs}} \arrow[subset]{ur} \arrow[subset]{dr} & \ne & \cbr{\text{integrally closed domains}} \arrow[subset]{r} & \cbr{\text{IDs}} \arrow[subset]{r} & \dots \\
& & \cbr{\text{Dedekind domains}} \arrow[subset]{ur} & & &
\end{tikzcd}.
$$
\begin{itemize}
\item $ \ZZ\sbr{\sqrt{-5}} $ is a Dedekind domain but not a UFD.
\item $ \ZZ\sbr{x} $ is a UFD but not a Dedekind domain.
\end{itemize}

\lecture{19}{Friday}{22/02/19}

Lecture 19 is a problems class.

\subsection{Unique factorisation of prime ideals}

\lecture{20}{Monday}{25/02/19}

The goal is to show that unique factorisation of ideals into prime ideals always holds in a Dedekind domain.

\begin{definition}
Let $ R $ be an integral domain, with fraction field $ K $. A \textbf{fractional ideal} $ \nnn $ of $ R $ is an $ R $-submodule of $ K $, that is
\begin{itemize}
\item an additive subgroup, so $ x \in \nnn $ and $ y \in \nnn $ implies that $ x + y \in \nnn $, and
\item stable under multiplication by $ R $, so $ x \in \nnn $ and $ r \in R $ implies that $ rx \in \nnn $,
\end{itemize}
such that there exists $ a \in R $ such that $ a\nnn = \cbr{ax \st x \in \nnn} \subseteq R $.
\end{definition}

\begin{example*}
\hfill
\begin{itemize}
\item Any ideal of $ R $ is also a fractional ideal with $ a = 1 $. Conversely, if $ \nnn $ is a fractional ideal and $ \nnn \subseteq R $, then $ \nnn $ is an integral ideal.
\item Let $ R = \ZZ \hookrightarrow \QQ $. Then the fractional ideals of $ \QQ $ are $ \tfrac{p}{q} \cdot \ZZ $ for $ p, q \in \ZZ $ and $ q \ne 0 $. Then $ \QQ $ is not a fractional ideal, but it is a $ \ZZ $-module.
\end{itemize}
\end{example*}

We can multiply fractional ideals of $ R $ by
$$ \mmm \cdot \nnn = \cbr{\sum_{i = 1}^k x_i \cdot y_i \st x_i \in \mmm, \ y_i \in \nnn, \ k \in \ZZ_{\ge 0}}. $$

\begin{lemma}
If $ \mmm $ and $ \nnn $ are fractional ideals of $ R $ then $ \mmm \cdot \nnn $ is also a fractional ideal of $ R $.
\end{lemma}

\begin{proof}
$ \mmm \cdot \nnn $ is additive, and $ \mmm \cdot \nnn $ is stable under multiplication by $ r \in R $, since
$$ r\br{\sum_{i = 1}^k x_i \cdot y_i} = \sum_{i = 1}^k rx_i \cdot y_i \in \mmm \cdot \nnn. $$
There exists $ a, b \in R $ such that $ a\mmm \subseteq R $ and $ b\nnn \subseteq R $, so $ ab \cdot \mmm \cdot \nnn \subseteq R $.
\end{proof}

Multiplication of fractional ideals is commutative, so $ \mmm \cdot \nnn = \nnn \cdot \mmm $, is associative, and has unit $ R \cdot \mmm = \mmm \cdot R = \mmm $. If $ R $ is a Dedekind domain, we will show that every fractional ideal has a multiplicative inverse, that is given a fractional ideal $ \mmm $ of $ R $, there exists a fractional ideal $ \mmm^{-1} $ of $ R $ such that $ \mmm \cdot \mmm^{-1} = R $.

\pagebreak

\begin{example*}
$ \ZZ\sbr{x} $ is not a Dedekind domain, since $ \abr{2, x} $ does not have an inverse with respect to multiplication.
\end{example*}

\begin{theorem}
\label{thm:group}
Let $ R $ be a Dedekind domain. The set of non-zero fractional ideals of $ R $ forms a commutative group under multiplication.
\end{theorem}

To prove Theorem \ref{thm:group}, need some preliminary results.

\begin{lemma}
\label{lem:primeideal}
Let $ \ppp \subsetneq R $ be a prime ideal in an integral domain. Assume $ \ppp \supseteq \aaa_1\aaa_2 $ for ideals $ \aaa_1, \aaa_2 \subseteq R $. Then $ \ppp \supseteq \aaa_1 $ or $ \ppp \supseteq \aaa_2 $.
\end{lemma}

\begin{proof}
If $ \ppp \nsupseteq \aaa_1 $ there exists $ x \in \aaa_1 \setminus \ppp $, so $ x\aaa_2 \subseteq \ppp $. Let $ y \in \aaa_2 $. Then $ xy \in \ppp $ and $ x \notin \ppp $, so $ y \in \ppp $, since $ \ppp $ is prime, so $ \aaa_2 \subseteq \ppp $.
\end{proof}

\begin{remark*}
The same Lemma \ref{lem:primeideal} holds if $ \ppp \supseteq \aaa_1, \dots, \aaa_n $ for $ n \in \ZZ_{\ge 1} $ then $ \ppp \supseteq \aaa_i $ for some $ i $.
\end{remark*}

\begin{lemma}
\label{lem:primeproduct}
If $ I \subseteq R $ is a non-zero ideal of a Noetherian domain, there exists $ \ppp_1, \dots, \ppp_n \subseteq R $ non-zero prime ideals not necessarily distinct, such that $ I \supseteq \ppp_1 \dots \ppp_n $ for some finite $ n \in \ZZ $.
\end{lemma}

\begin{proof}
Assume Lemma \ref{lem:primeproduct} is false. Choose $ I $ for which condition in Lemma \ref{lem:primeproduct} fails and such that $ I $ is maximal with respect to inclusion, that is for all $ J \supseteq I $, $ J $ satisfies the condition. Then $ I $ is not prime, otherwise it would satisfy the condition. There exists $ a, b \in R $ such that $ a \notin I $ and $ b \notin I $ but $ ab \in I $. Look at $ I \subsetneq I + bR $ and $ I \subsetneq I + aR $, both satisfying the condition. Let $ I + bR \supseteq \ppp_1 \dots \ppp_r $ and $ I + aR \supseteq \qqq_1 \dots \qqq_s $. Thus $ \ppp_1 \dots \ppp_r \cdot \qqq_1 \dots \qqq_s \subseteq \br{I + bR} \cdot \br{I + aR} \subseteq I $.
\end{proof}

\lecture{21}{Tuesday}{26/02/19}

\begin{proposition}
\label{prop:inverse}
Let $ R $ be a Dedekind domain. Let $ \mmm \subsetneq R $ be a non-zero prime ideal, if and only if a maximal ideal of $ R $. Define
$$ \mmm^{-1} = \cbr{a \in K \st a\mmm \subseteq R}. $$
Then $ \mmm^{-1} $ is a fractional ideal of $ R $ and $ \mmm \cdot \mmm^{-1} = R $.
\end{proposition}

\begin{proof}
\hfill
\begin{itemize}
\item $ \mmm^{-1} $ is a fractional ideal. Then $ \mmm^{-1} $ is an additive subgroup of $ K $, since $ x, y \in \mmm^{-1} $ implies that $ x \cdot \mmm, y \cdot \mmm \subseteq R $, so $ \br{x + y}\mmm \subseteq x\mmm + y\mmm \subseteq R $, so $ x + y \in \mmm^{-1} $. Similarly $ \mmm^{-1} $ is stable under multiplication by $ R $, since $ x \in \mmm^{-1} $ implies that $ x \cdot \mmm \subseteq R $, so $ rx \cdot \mmm \subseteq R $, so $ rx \in \mmm^{-1} $. Let $ a \in \mmm $ such that $ a \ne 0 $. Then $ a\mmm^{-1} \subseteq R $ by definition of $ \mmm^{-1} $.
\item $ \mmm = \mmm \cdot 1 \subseteq \mmm \cdot \mmm^{-1} \subseteq R $ is automatic by definition. Since $ \mmm $ is maximal, either $ \mmm = \mmm \cdot \mmm^{-1} $ or $ \mmm \cdot \mmm^{-1} = R $. Assume $ \mmm = \mmm \cdot \mmm^{-1} $ and get a contradiction. Taking $ x \in \mmm^{-1} $,
$$ \dots \subseteq x^n \cdot \mmm \subseteq \dots \subseteq x \cdot \mmm \subseteq \mmm \subsetneq R, $$
so $ x^n \in \mmm^{-1} $ for all $ n \in \ZZ_{\ge 1} $. Let $ R\sbr{x} $ be the subring of $ K $ generated by $ x $, so $ R\sbr{x} \subseteq \mmm^{-1} $. Let $ a \in R \setminus \cbr{0} $ be such that $ a\mmm^{-1} \subseteq R $. In particular $ aR\sbr{x} \subseteq R $ is an integral ideal of $ R $. Then $ R $ is Noetherian, so $ aR\sbr{x} $ is generated over $ R $ by finitely many elements $ y_1, \dots, y_k \in R $. Then $ x \cdot y_i \in aR\sbr{x} $, so
$$ x \cdot \threebyone{y_1}{\vdots}{y_k} = A\threebyone{y_1}{\vdots}{y_k}, \qquad A = \threebythree{a_{11}}{\dots}{a_{1k}}{\vdots}{\ddots}{\vdots}{a_{k1}}{\dots}{a_{kk}} \in \Mat_k R, $$
a $ k \times k $ matrix, so $ x $ is an eigenvalue of $ A $ with eigenvector $ \br{y_1, \dots, y_k}^t $. Thus $ x $ is a root of $ \det \br{t\I_k - A} $, so $ x $ is integral over $ R $. All $ x \in \mmm^{-1} $ satisfy $ x \in R $ because $ R $ is integrally closed, so $ \mmm^{-1} = R $. Choose $ a \in \mmm \setminus \cbr{0} $. Then $ \mmm \supsetneq \abr{a} \supseteq \ppp_1 \cdot \dots \cdot \ppp_k $, where $ \ppp_i $ are prime, by Lemma \ref{lem:primeproduct}. Lemma \ref{lem:primeideal} from last time implies that $ \mmm $ must contain $ \ppp_i $ for some $ i = 1, \dots, k $. Assume $ \mmm \supseteq \ppp_1 \ne 0 $, so $ \mmm = \ppp_1 $. Choose $ k $ such that it is minimal among all possible $ \ppp_1 \cdot \dots \cdot \ppp_k $ contained in $ \abr{a} $, so $ \ppp_2 \cdot \dots \cdot \ppp_k \nsubseteq \abr{a} $, since $ \ppp_2 \cdot \dots \cdot \ppp_k $ has length $ k - 1 $. Choose $ 0 \ne b \in \ppp_2 \cdot \dots \cdot \ppp_k \setminus \abr{a} $. Then $ b / a \in K $ such that $ b / a \notin R $ and $ b / a \in \mmm^{-1} $ is a contradiction. Since $ b \in aR = \abr{a} $ is false, $ b / a \notin R $, and $ b / a \in \mmm^{-1} $, since $ b / a \cdot \mmm \subseteq R $, since $ b \cdot \mmm \in \ppp_1 \cdot \dots \cdot \ppp_k \subseteq \abr{a} $. Thus $ \mmm^{-1} \ne R $, so $ \mmm \cdot \mmm^{-1} \ne \mmm $, so $ \mmm \cdot \mmm^{-1} = R $, which is done.
\end{itemize}
\end{proof}

\pagebreak

\begin{theorem}[Unique factorisation of ideals]
\label{thm:uniquefactorisationofideals}
\hfill
\begin{enumerate}
\item Any non-zero fractional ideal $ I $ of $ R $ can be written as
$$ I = \ppp_1^{k_1} \cdot \dots \cdot \ppp_r^{k_r}, \qquad k_i \in \ZZ \setminus \cbr{0}, $$
where $ \ppp_1 $ are non-zero prime ideals.
\item This factorisation is unique up to order of the $ \ppp_i $.
\end{enumerate}
\end{theorem}

\begin{remark*}
Given $ I $,
$$ I^{-1} = \ppp_1^{-k_1} \cdot \dots \cdot \ppp_r^{-k_r}. $$
Get $ I \cdot I^{-1} = R $, so any non-zero fractional ideal has a multiplicative inverse.
\end{remark*}

\begin{proof}
\hfill
\begin{enumerate}
\item There exists $ a \in R \setminus \cbr{0} $ such that $ aI \subseteq R $ is an integral ideal so we may assume $ I $ is an integral ideal. Assume Theorem \ref{thm:uniquefactorisationofideals} is false. Because $ R $ is Noetherian, there exists $ I $ such that $ I $ does not admit a factorisation and $ I $ is maximal with this property. Let $ \mmm \supseteq I $ be a maximal ideal. Then $ J = \mmm^{-1} \cdot I \subseteq R $, so $ J $ is an integral ideal. Then $ J $ admits a factorisation because $ \mmm^{-1} \cdot I = J \supsetneq I = 1 \cdot I $, since if $ \mmm^{-1} \cdot I = I $, argue as in proof of Proposition \ref{prop:inverse}. Thus $ I = \mmm \cdot J $, a contradiction.
\item Let $ \ppp_1^{k_1} \cdot \dots \cdot \ppp_r^{k_r} = \qqq_1^{k_1} \cdot \dots \cdot \qqq_r^{k_r} $. We may assume all $ k_i, l_j > 0 $. Then $ \ppp_1 \supseteq \qqq_1^{l_1} \cdot \dots \cdot \qqq_s^{l_s} $, so $ \ppp_1 \supseteq \qqq_1 $. Both maximal, so $ \ppp_1 = \qqq_1 $.
\end{enumerate}
\end{proof}

\lecture{22}{Friday}{01/03/19}

\begin{definition}
Let $ R $ be a Dedekind domain. The \textbf{ideal class group} of $ R $ is the quotient of the group of all non-zero fractional ideals by the subgroup of principal fractional ideals. This is denoted by $ \Cl R $.
\end{definition}

If $ K $ is a number field, then $ \OOO_K $ is a Dedekind domain and $ \Cl K = \OOO_K $.

\begin{example*}
\hfill
\begin{itemize}
\item $ \Cl K = 1 $ if $ \OOO_K $ is a PID or UFD. For example, if $ K = \QQ\br{i}, \QQ\br{\omega}, \QQ\br{\sqrt{-11}} $.
\item $ \Cl K \ne 1 $ if $ K = \QQ\br{\sqrt{-5}}, \QQ\br{\sqrt{-6}} $. For example, $ \abr{2, 1 + \sqrt{-5}} $ is not principal, and
$$ \abr{2, 1 + \sqrt{-5}}^2 = \abr{4, 2 + 2\sqrt{-5}, -4 + 2\sqrt{-5}} = \abr{2}, $$
so $ \ZZ / 2\ZZ $ is a subgroup of $ \Cl K $. Claim that $ \ZZ / 2\ZZ \cong \Cl K $. For example,
$$ \abr{3, 1 - \sqrt{-5}} = \abr{a} \cdot \abr{2, 1 + \sqrt{-5}}, \qquad a = \tfrac{1 - \sqrt{-5}}{2} \in \QQ\br{\sqrt{-5}}^\times, $$
because $ \br{1 + \sqrt{-5}}a = \br{1 + \sqrt{-5}}\br{1 - \sqrt{-5}} / 2 = 3 $ and $ 2a = 1 - \sqrt{-5} $.
\end{itemize}
\end{example*}

\begin{theorem}
If $ K $ is a number field, then $ \Cl K $ is finite.
\end{theorem}

The proof relies on an explicit bound. Every \textbf{ideal class}, a fractional ideal of $ \OOO_K $ up to multiplication by principal ideals, contains a representative of norm less than an explicit bound depending on $ K $.

\subsection{Discriminants}

Let $ K $ be a number field. Recall $ \OOO_K $ is a free $ \ZZ $-module of rank $ n = \deg \br{K / \QQ} $. Choose $ e_1, \dots, e_n $, a $ \ZZ $-basis of $ \OOO_K $. Then
$$ \function[\Tr_{K / \QQ}\br{\cdot, \cdot}]{K \times K}{\QQ}{\br{v, w}}{\Tr_{K / \QQ} vw} $$
is symmetric, $ \QQ $-bilinear, and non-degenerate. The \textbf{discriminant} of $ K $ is
$$ \Disc K = \det \Tr_{K / \QQ}\br{e_i, e_j}_{i, j = 1, \dots, n}. $$

\begin{remark*}
$ \Disc K \ne 0 $ and $ \Disc K \in \ZZ $.
\end{remark*}

\pagebreak

\begin{lemma}
$ \Disc K $ is independent of choice of $ \ZZ $-basis $ e_1, \dots, e_n $.
\end{lemma}

\begin{proof}
If $ f_1, \dots, f_n $ is another $ \ZZ $-basis, there exists $ A \in \Mat_n \ZZ $ such that $ A\onebythree{e_1}{\dots}{e_n}^\intercal = \onebythree{f_1}{\dots}{f_n}^\intercal $. Then $ \det A = \pm 1 $ and $ A^t \cdot \Tr_{K / \QQ}\br{e_i, e_j}_{i, j} \cdot A = \Tr_{K / \QQ}\br{f_i, f_j}_{i, j} $, so
$$ \det \Tr_{K / \QQ}\br{e_i, e_j}_{i, j} = \det \Tr_{K / \QQ}\br{e_i, e_j}_{i, j} \cdot \br{\det A}^2 = \det \Tr_{K / \QQ}\br{f_i, f_j}_{i, j}. $$
\end{proof}

\begin{example*}
Let $ K / \QQ $ be quadratic, so $ K = \QQ\br{\sqrt{d}} $. Then
$$ \Disc K =
\begin{cases}
4d & d \equiv 2, 3 \mod 4, \ \OOO_K = \abr{1, \sqrt{d}} \\
d & d \equiv 1 \mod 4, \ \OOO_K = \abr{1, \tfrac{1 + \sqrt{d}}{2}}
\end{cases},
$$
since
$$ \twobytwo{\Tr_{K / \QQ} 1}{\Tr_{K / \QQ} \sqrt{d}}{\Tr_{K / \QQ} \sqrt{d}}{\Tr_{K / \QQ} d} = \twobytwo{2}{0}{0}{2d}, \qquad \twobytwo{\Tr_{K / \QQ} 1}{\Tr_{K / \QQ} \tfrac{1 + \sqrt{d}}{2}}{\Tr_{K / \QQ} \tfrac{1 + \sqrt{d}}{2}}{\Tr_{K / \QQ} \tfrac{1 + d + 2\sqrt{d}}{4}} = \twobytwo{2}{1}{1}{\tfrac{d + 1}{2}}. $$
\end{example*}

\subsection{Decomposition of primes in quadratic fields}

Let $ p \in \ZZ $ be a rational prime. How does $ \abr{p} $ decompose, or factor, into prime ideals of $ \OOO_K $?
\begin{itemize}
\item If $ \OOO_K / \abr{p} \cong \FF_p\sbr{x} / \abr{x^2} $ we say $ \abr{p} $ \textbf{ramifies} in $ \OOO_K $. Then $ \abr{p} = \ppp^2 $, where $ \ppp $ is a prime ideal of $ \OOO_K $.
\item If $ \OOO_K / \abr{p} \cong \FF_p \times \FF_p $ we say $ \abr{p} $ \textbf{splits} in $ \OOO_K $. Then $ \abr{p} = \ppp_1 \cdot \ppp_2 $, where $ \ppp_1 \ne \ppp_2 $ are distinct prime ideals of $ \OOO_K $.
\item If $ \OOO_K / \abr{p} \cong \FF_{p^2} $ we say $ \abr{p} $ is \textbf{inert} in $ \OOO_K $. Then $ \abr{p} $ is a prime ideal of $ \OOO_K $.
\end{itemize}
To see that these are the only possibilities when $ K / \QQ $ is quadratic, the key observation is $ \#\OOO_K / \abr{p} = p^2 $, so $ \OOO_K / \abr{p} $ is an $ \FF_p $-vector space of dimension two.

\lecture{23}{Monday}{04/03/19}

\begin{theorem}[Criterion for decomposition of primes in quadratic fields]
\hfill
\begin{itemize}
\item $ p $ is ramified if and only if $ p \mid \Disc K $. More precisely,
\begin{itemize}
\item $ p \mid 4d $ if $ d \equiv 2, 3 \mod 4 $, and
\item $ p \mid d $ if $ d \equiv 1 \mod 4 $.
\end{itemize}
\item If $ d \equiv 1 \mod 4 $, then $ 2 $ is
\begin{itemize}
\item split if $ d \equiv 1 \mod 8 $, and
\item inert if $ d \equiv 5 \mod 8 $.
\end{itemize}
\item If $ p \ne 2 $ and $ p \nmid \Disc K $, then $ p $ is
\begin{itemize}
\item split if $ d $ is a quadratic residue modulo $ p $, and
\item inert if $ d $ is not a quadratic residue modulo $ p $.
\end{itemize}
\end{itemize}
\end{theorem}

\begin{proof}
Choose the standard basis $ 1 $ and $ \delta $ of $ \OOO_K $, where
$$ \delta =
\begin{cases}
\sqrt{d} & d \equiv 2, 3 \mod 4 \\
\tfrac{1 + \sqrt{d}}{2} & d \equiv 1 \mod 4
\end{cases}.
$$
The minimal polynomial equation of $ \delta $ is
$$ f\br{x} =
\begin{cases}
x^2 - d & d \equiv 2, 3 \mod 4 \\
x^2 - x - \tfrac{d - 1}{4} & d \equiv 1 \mod 4
\end{cases}.
$$
Compute $ \OOO_K / \abr{p} = \ZZ\sbr{x} / \abr{f\br{x}, p} = \FF_p\sbr{x} / \abr{f\br{x}} $. For example, $ p $ is inert if and only if $ \FF_p\sbr{x} / \abr{f\br{x}} \cong \FF_{p^2} $, if and only if $ f\br{x} = 0 $ has no solutions in $ \FF_p $, if and only if $ d $ is not a quadratic residue modulo $ p $.
\end{proof}

\pagebreak

\subsection{Standard form of ideals}

The goal is that if $ K $ is an imaginary quadratic field, so $ d < 0 $, then $ \Cl K $ is finite. Use that every ideal class in $ \Cl K $ contains an integral ideal of norm less than an explicit bound depending on $ K $. Uses the geometry of numbers and Minkowski's theorem. Let $ K $ be a quadratic field and $ \OOO_K = \ZZ \oplus \ZZ\delta $ be the ring of integers, where
$$ \delta =
\begin{cases}
\sqrt{d} & d \equiv 2, 3 \mod 4 \\
\tfrac{1 + \sqrt{d}}{2} & d \equiv 1 \mod 4
\end{cases}.
$$

\begin{proposition}
Let $ I \subseteq \OOO_K $ be an integral ideal. There exists $ a, b, d \in \ZZ $ such that the following hold.
\begin{itemize}
\item $ I = d\br{\ZZ a + \ZZ\br{-b + \delta}} $.
\item $ a \mid \Nm_{K / \QQ} \br{-b + \delta} $.
\end{itemize}
\end{proposition}

Conversely, every subset of $ \OOO_K $ of this form is an integral ideal. The expression
$$ I = d\br{\ZZ a + \ZZ\br{-b + \delta}} $$
is called the \textbf{standard form} of $ I $.

\begin{proof}
Let $ K $ be an imaginary quadratic, so $ \OOO_K $ is a lattice $ \Lambda_0 $ generated by $ 1 $ and $ \delta $ in $ K $, and $ I $ is a lattice $ \Lambda \subseteq \Lambda_0 $. There exists $ \gamma \in \Mat_2 \ZZ $ such that $ \Lambda = \gamma \cdot \Lambda_0 $. Can assume
$$ \gamma = \twobytwo{a'}{b'}{0}{d}, \qquad a', b', d \in \ZZ, $$
so $ I = \ZZ a' + \ZZ\br{b' + d\delta} $ is an ideal and $ a' \in I $, so $ a'\delta = a'b + \br{b' + d\delta}a \in I $ for $ a, b \in \ZZ $, so
$$ a'\br{\delta - b} = \br{b' + d\delta}a. $$
The coefficients of $ \delta $ implies that $ a' = da $, and the coefficients of $ 1 $ implies that $ -a'b = ab' $, so $ b' = -db $. Left to check that $ a \mid \Nm_{K / \QQ} \br{-b + \delta} $. For simplicity assume $ d = 1 $. Then $ I $ is an ideal and $ -b + \delta \in I $, so $ \delta\br{-b + \delta} = af + \br{-b + \delta}e \in I $ for $ e, f \in \ZZ $, so
$$ \br{e - \delta}\br{-b + \delta} = -af \in \ZZ. $$
If $ e - \delta = -b + \overline{\delta} $ the product would be $ \br{-b + \overline{\delta}}\br{-b + \delta} = \Nm_{K / \QQ} \br{-b + \delta} = -af \in \ZZ $, if and only if $ a \mid \Nm_{K / \QQ} \br{-b + \delta} $. Conversely,
$$ -af = \br{e - \delta}\br{-b + \delta} = \br{e - \delta + b - \overline{\delta} + \br{-b + \overline{\delta}}}\br{-b + \delta} = \br{e - \delta + b - \overline{\delta}}\br{-b + \delta} + \Nm_{K / \QQ} \br{-b + \delta}. $$
Then
$$ -af \in \ZZ, \qquad \Nm_{K / \QQ} \br{-b + \delta} \in \ZZ, \qquad e - \delta + b - \overline{\delta} \in \ZZ, \qquad -b + \delta \in \OOO_K \setminus \ZZ, $$
so $ e - \delta + b - \overline{\delta} = 0 $.
\end{proof}

An observation is that if $ I = d\br{\ZZ a + \ZZ\br{-b + \delta}} $ is in standard form, $ \Nm I = d^2 \cdot a $, since
$$ \det \twobytwo{a}{-b}{0}{1} = 0. $$

\lecture{24}{Tuesday}{05/03/19}

\begin{example*}
Let
$$ I = \abr{2 + i} = \br{2 + i}\ZZ + \br{2 + i}i\ZZ = \br{2 + i}\ZZ + \br{2i - 1}\ZZ = \twobytwo{2}{-1}{1}{2} \cdot \ZZ\sbr{i} \subsetneq \ZZ\sbr{i}. $$
Column-reducing,
$$ \twobytwo{2}{-1}{1}{2} \sim \twobytwo{2}{-5}{1}{0} \sim \twobytwo{5}{2}{0}{1}. $$
The standard form is $ I = 5\ZZ + \br{2 + i}\ZZ $. Check that $ 5 = \Nm_{\ZZ\sbr{i} / \ZZ} \br{2 + i} $. \footnote{Exercise}
\end{example*}

\pagebreak

Let $ K $ be an imaginary quadratic field and
$$ J = q\br{\ZZ a + \ZZ\br{-b + \delta}} \subsetneq K, \qquad a, b \in \ZZ, \qquad q \in \QQ^\times, $$
be a fractional ideal of $ \OOO_K $. Then $ \Nm J = q^2a $, by extending the norm from ideals to fractional ideals multiplicatively. The standard form of $ J $ has a \textbf{fundamental parallelogram} with vertices $ 0, qa, q\br{-b + \delta}, qa + q\br{-b + \delta} $. Let $ \A\br{J} $ be the area of the fundamental parallelogram of $ J $.

\begin{proposition}
$$ \A\br{J} = \dfrac{\Nm J \cdot \sqrt{\Disc K}}{2}. $$
\end{proposition}

\begin{proof}
$$ \A\br{J} = qa \cdot q\abs{\Im \delta} = q^2a \cdot \abs{\Im \delta} = \dfrac{q^2a \cdot \sqrt{\Disc K}}{2} = \dfrac{\Nm J \cdot \sqrt{\Disc K}}{2}. $$
\end{proof}

\subsection{Minkowski's theorem}

If $ J $ is a fractional ideal of $ K $, the goal is to show that there exists $ \alpha \in J $ such that $ \Nm \alpha < C_K \cdot \Nm J $, where $ C_K $ is an explicit bound in terms of $ K $, so $ \Nm \alpha J^{-1} < C_K $. Up to multiplication by a principal ideal, can get $ \Nm J^{-1} < C_K $. The idea is to use Minkowski's theorem. Have a lattice $ \Lambda \subset \RR^2 $ and a nice region $ S \subset \RR^2 $. Let $ \A\br{\Lambda} $ be the area of the fundamental parallelogram of $ \Lambda $.

\begin{theorem}[Minkowski's theorem]
If $ \A\br{S} > 4\A\br{\Lambda} $ then $ S $ contains a non-zero lattice point, that is $ S \cap \Lambda \ne \emptyset $.
\end{theorem}

$ S $ is \textbf{nice} if $ x \in S $ then $ -x \in S $, and $ S $ is convex, that is if $ x, y \in S $ then the segment $ \sbr{x, y} \subset S $.

\begin{example*}
Let $ S $ be the closed or open disc of radius $ r > 2 / \sqrt{\pi} $ and $ \Lambda = \ZZ\sbr{i} \subset \CC $. Then $ \A\br{S} = \pi r^2 > 4 = 4\A\br{\Lambda} $.
\end{example*}

\begin{proof}
Consider all parallelograms of $ 2\Lambda $ that intersect $ S $. Translate elements of $ 2\Lambda $ until they all overlap.
$$ \A\br{2\Lambda} = 4\A\br{\Lambda} < \A\br{S} = \A\br{S_1} + \dots + \A\br{S_n}. $$
There exists $ S_i $ and $ S_j $ for $ i \ne j $ such that $ S_i \cap S_j \ne \emptyset $ translated. There exists $ x \in S \cap S_i $ and $ y \in S \cap S_j $ for $ i \ne j $ such that $ x - y \in 2\Lambda $. Claim that $ \br{x - y} / 2 \in S \cap \Lambda $.
\begin{itemize}
\item $ x - y \in 2\Lambda $, so $ \br{x - y} / 2 \in \Lambda $.
\item $ \br{x - y} / 2 \in S $ because $ y \in S $, so $ -y \in S $, and $ x \in S $, so $ \br{x - y} / 2 \in S $, which is the midpoint.
\end{itemize}
\end{proof}

Let $ K / \QQ $ be an imaginary quadratic field.

\begin{theorem}
Every ideal class in $ \Cl K $ contains a representative integral ideal $ I \subseteq \OOO_K $ of norm
$$ \Nm I < \dfrac{2\sqrt{\abs{\Disc K}}}{\pi}. $$
\end{theorem}

\begin{proof}
Back to $ J = q\br{\ZZ a + \ZZ\br{-b + \delta}} $, a fractional ideal of $ \OOO_K $. Let $ S $ be the disc centred at the origin of radius
$$ r = \sqrt{\dfrac{2\sqrt{\abs{\Disc K}} \cdot \Nm J}{\pi}} + \epsilon. $$
Then
$$ \A\br{S} = \pi r^2 > 2\sqrt{\abs{\Disc K}} \cdot \Nm J = 4\A\br{J}. $$
Minkowski implies that there exists $ \alpha \in J $ such that $ \alpha \ne 0 $ and
$$ \Nm_{K / \QQ} \alpha = \abs{\alpha}^2 < \dfrac{2\sqrt{\abs{\Disc K}} \cdot \Nm J}{\pi} + \epsilon. $$
\end{proof}

\lecture{25}{Friday}{08/03/19}

Lecture 25 is a problems class.

\pagebreak

\lecture{26}{Monday}{11/03/19}

Let $ K / \QQ $ be a real quadratic field. If $ J \subsetneq K $ is a fractional ideal, such as $ \OOO_K $, then $ J \subsetneq \RR $ is a dense subset. We will use instead the embedding
$$ \function[\iota]{K}{\RR^2}{\alpha}{\br{\overline{\alpha}, \alpha}}. $$
Let $ \alpha = a + b\sqrt{d} $ and $ \overline{\alpha} = a - b\sqrt{d} $ for $ a, b \in \QQ $, where $ d \in \ZZ_{> 0} $ is square-free.

\begin{lemma}
The image of a fractional ideal $ J \subsetneq K $ under $ \iota $ is a lattice in $ \RR^2 $.
\end{lemma}

\begin{proof}
$ J $ is a free $ \ZZ $-module of rank two. The standard form is
$$ J = q\br{a\ZZ + \br{-b + \delta}\ZZ}, \qquad q \in \QQ^\times, \qquad a, b \in \ZZ, \qquad \delta =
\begin{cases}
\sqrt{d} & d \equiv 2, 3 \mod 4 \\
\tfrac{1 + \sqrt{d}}{2} & d \equiv 1 \mod 4
\end{cases}.
$$
Then $ \iota\br{qa} = \br{qa, qa} $ and $ \iota\br{q\br{-b + \delta}} = \br{q\br{-b + \overline{\delta}}, q\br{-b + \delta}} $ are linearly independent over $ \ZZ $, since $ \delta \notin \QQ $, so $ \overline{\delta} \ne \delta $, so $ \iota\br{J} $ is the $ \ZZ $-lattice spanned by $ \br{qa, qa} $ and $ \br{q\br{-b + \overline{\delta}}, q\br{-b + \delta}} $.
\end{proof}

\begin{example*}
Let $ K = \QQ\br{\sqrt{5}} $. Then $ \OOO_K \hookrightarrow \RR^2 $ is the lattice generated by $ e_1 = \br{1, 1} $ and $ e_2 = \br{\tfrac{1 - \sqrt{5}}{2}, \tfrac{1 + \sqrt{5}}{2}} $.
\end{example*}

\begin{proposition}
If $ J = q\br{a\ZZ + \br{-b + \delta}\ZZ} $ is an ideal in standard form, then
$$ \A\br{J} = \Nm J \cdot \sqrt{\Disc K} = q^2a \cdot \sqrt{\Disc K}. $$
\end{proposition}

\begin{proof}
If $ d \equiv 2, 3 \mod 4 $, then $ \delta = \sqrt{d} = \tfrac{\sqrt{\Disc K}}{2} $ and $ \overline{\delta} = -\sqrt{d} = -\tfrac{\sqrt{\Disc K}}{2} $, and if $ d \equiv 1 \mod 4 $, then $ \delta = \tfrac{1 + \sqrt{d}}{2} = \tfrac{1 + \sqrt{\Disc K}}{2} $ and $ \overline{\delta} = \tfrac{1 - \sqrt{d}}{2} = \tfrac{1 - \sqrt{\Disc K}}{2} $. The component of $ \br{q\br{-b + \overline{\delta}}, q\br{-b + \delta}} $ along the line $ x = -y $ is $ \br{-q\tfrac{\sqrt{\Disc K}}{2}, q\tfrac{\sqrt{\Disc K}}{2}} $, and the component along $ x = y $ is
$$
\begin{cases}
\br{-qb, -qb} & d \equiv 2, 3 \mod 4 \\
\br{-qb + \tfrac{q}{2}, -qb + \tfrac{q}{2}} & d \equiv 1 \mod 4
\end{cases}.
$$
Thus
$$ \A\br{J} = qa\sqrt{2} \cdot \dfrac{q\sqrt{\Disc K}}{2} = q^2a \cdot \sqrt{\Disc K} = \Nm J \cdot \sqrt{\Disc K}. $$
\end{proof}

\begin{theorem}
Every ideal class in $ \Cl K $ contains a representative integral ideal $ I \subseteq \OOO_K $ of norm
$$ \Nm I < \dfrac{\sqrt{\Disc K}}{2}. $$
\end{theorem}

\begin{proof}
Let
$$ \function{K}{\RR^2}{\alpha}{\br{\overline{\alpha}, \alpha}}. $$
Then $ \Nm \alpha = \overline{\alpha} \cdot \alpha $ is the restriction of $ \Nm \br{x, y} = x \cdot y $. Let $ H $ be
$$ \abs{x \cdot y} < \dfrac{\sqrt{\Disc K} \cdot \Nm J}{2} + \epsilon. $$
If we chose $ S $ to be that, we could not apply Minkowski, since it is not convex. Let $ S $ be
$$ \abs{x + y} < \sqrt{2\sqrt{\Disc K} \cdot \Nm J + \epsilon}, \qquad \abs{x - y} < \sqrt{2\sqrt{\Disc K} \cdot \Nm J + \epsilon}. $$
Then $ S $ is contained in $ H $. Assume $ x, y > 0 $ and $ \br{x, y} \in S $, so $ x + y < \sqrt{2\sqrt{\Disc K} \cdot \Nm J + \epsilon} $, so
$$ 4\abs{x \cdot y} \le \br{x + y}^2 < 2\sqrt{\Disc K} \cdot \Nm J + \epsilon, $$
because $ \br{x - y}^2 \ge 0 $. Thus
$$ \A\br{S} = 4\sqrt{\Disc K} \cdot \Nm J + 2\epsilon > 4\A\br{J}. $$
\end{proof}

\pagebreak

\subsection{Computing ideal class groups}

\lecture{27}{Tuesday}{12/03/19}

Recall that Minkowski's theorem gives the following Minkowski bounds $ \lambda\br{K} $.
\begin{itemize}
\item If $ K $ is an imaginary quadratic field then every ideal class in $ \Cl K $ contains a representative $ I \subseteq \OOO_K $ with
$$ \Nm I < \dfrac{2\sqrt{\abs{\Disc K}}}{\pi}. $$
\item If $ K $ is a real quadratic field then every ideal class in $ \Cl K $ contains a representative $ I \subseteq \OOO_K $ with
$$ \Nm I < \dfrac{\sqrt{\Disc K}}{2}. $$
\end{itemize}

\begin{note*}
$ \ppp \subsetneq \OOO_K $, so $ \overline{\ppp} = \cbr{\overline{a} \st a \in \ppp} \subsetneq \OOO_K $ is also a prime ideal, and $ \ppp \cdot \overline{\ppp} = \Nm \ppp = \Nm \overline{\ppp} $, so there exist at most two prime ideals with a given norm. Thus $ \Cl K $ is finite.
\end{note*}

\begin{example*}
Let $ K = \QQ\br{\sqrt{-5}} $. Then $ \Cl K \cong \ZZ / 2\ZZ $. \footnote{Exercise}
\end{example*}

\begin{example*}
Let $ K = \QQ\br{\sqrt{-10}} $. What is $ \Cl K $?
\begin{itemize}
\item The Minkowski bound is
$$ \lambda\br{K} = \dfrac{2\sqrt{40}}{\pi} = \dfrac{4\sqrt{10}}{\pi} = \sqrt{\dfrac{160}{\pi^2}} < \sqrt{\dfrac{160}{9}} < \sqrt{18} < 5, $$
so every ideal class in $ \Cl K $ contains a representative with norm at most four. Have to understand ideals $ \ppp $ such that $ \Nm \ppp = p \in \ZZ $ for $ p $ a prime number. Remark that in general, only need to consider, and factor, primes $ p < \lambda\br{K} $ and such that $ p $ is ramified or split in $ K $.
\item We want to factor $ 2 $ and $ 3 $ in $ K $.
\begin{itemize}
\item $ 2 \mid \Disc K = 40 $, so $ 2 $ ramifies. Then $ 2 = \ppp^2 $ for some $ \ppp \subsetneq \OOO_K $ prime ideal of norm two. Let
$$ \ppp = d\br{a\ZZ + \br{-b + \sqrt{-10}}\ZZ}, \qquad a, b, d \in \ZZ, \qquad a \mid \Nm_{K / \QQ} \br{-b + \sqrt{-10}} $$
in standard form. Then $ 2 \in \ppp $, so $ ad \mid 2 $.
\begin{itemize}
\item $ a = d = 1 $ implies that $ \OOO_K \ne \ppp $.
\item $ d = 2 $ and $ a = 1 $ implies that $ \abr{2} \ne \ppp $.
\item $ d = 1 $ and $ a = 2 $ implies that $ 2 \mid \Nm_{K / \QQ} \br{-b + \sqrt{-10}} = b^2 + 10 $, so $ b \equiv 0 \mod 2 $. Take $ b = 0 $.
\end{itemize}
In general, get congruence condition $ b \equiv 0 \mod a $ in the ramified case or $ b = \pm c \mod a $ for $ a \nmid c $ in the split case. Thus $ \ppp = 2\ZZ + \sqrt{-10}\ZZ = \abr{2, \sqrt{-10}} $ and $ \ppp^2 = \abr{4, 2\sqrt{-10}, -10} = \abr{2} $.
\item $ 3 \nmid \Disc K = 40 $ and $ x^2 + 10 \equiv 0 \mod 3 $ has no solutions, so $ 3 $ is inert.
\end{itemize}
\item Check whether $ \ppp = \abr{2, \sqrt{-10}} $ is principal or not. If $ \ppp = \abr{\alpha} $ for $ \alpha = a + b\sqrt{-10} $, then $ 2 = \Nm_{K / \QQ}\br{\alpha} = a^2 + 10b^2 $ has no solutions with $ a, b \in \ZZ $, so $ \ppp $ is not principal, and $ \ppp^2 = \abr{2} $ is principal.
\end{itemize}
Thus $ \Cl K \cong \ZZ / 2\ZZ $.
\end{example*}

\begin{example*}
Let $ K = \QQ\br{\sqrt{-21}} $. What is $ \Cl K $?
\begin{itemize}
\item The Minkowski bound is
$$ \lambda\br{K} = \dfrac{2\sqrt{84}}{\pi} = \sqrt{\dfrac{336}{\pi^2}} < 6. $$

\pagebreak

\item We want to factor $ 2, 3, 5 $ in $ K $.
\begin{itemize}
\item $ 2 \mid \Disc K $, so $ 2 $ ramifies, and $ \abr{2, 1 + \sqrt{-21}}^2 = \abr{4, 2\sqrt{-21}, 2} = \abr{2} $. Let $ \ppp_2 = \abr{2, 1 + \sqrt{-21}} $. Then $ 2 = \Nm \ppp_2 = a^2 + 21b^2 $ has no solutions with $ a, b \in \ZZ $, so $ \ppp_2 $ is not principal.
\item $ 3 \mid \Disc K $, so $ 3 $ ramifies, and $ \abr{3, \sqrt{-21}}^2 = \abr{9, 3\sqrt{-21}, -21} = \abr{3} $. Let $ \ppp_3 = \abr{3, \sqrt{-21}} $. Then $ 3 = \Nm \ppp_3 = a^2 + 21b^2 $ has no solutions with $ a, b \in \ZZ $, so $ \ppp_3 $ is not principal.
\item $ 5 $ splits, since $ x^2 + 21 \equiv 0 \mod 5 $ has solutions $ x \equiv \pm 2 \mod 5 $. Then $ \abr{5} = \ppp_5 \cdot \overline{\ppp_5} $ for $ \ppp_5 = \abr{5, -b + \sqrt{-21}} $ and $ 5 \mid b^2 + 21 $, so $ b = \pm 2 $. Then $ 5 = \Nm \ppp_5 = a^2 + 21b^2 $ has no solutions with $ a, b \in \ZZ $, so $ \ppp_5 $ is not principal.
\end{itemize}
\item Compute
$$ \ppp_2 \cdot \ppp_3 = \abr{2, 1 + \sqrt{-21}}\abr{3, \sqrt{-21}} = \abr{6, 3\br{1 + \sqrt{-21}}, 2\sqrt{-21}, \sqrt{-21} - 21} = \abr{6, 3 + \sqrt{-21}}, $$
and
$$ \ppp_2 \cdot \ppp_3 \cdot \abr{\dfrac{3 - \sqrt{-21}}{6}} = \abr{3 - \sqrt{-21}, 5} = \abr{5, -2 + \sqrt{-21}} = \ppp_5. $$
\end{itemize}
Thus $ \Cl K \cong \ZZ / 2\ZZ \times \ZZ / 2\ZZ $ is the Klein four group.
\end{example*}

\begin{example*}
Let $ K = \QQ\br{\sqrt{-23}} $. Then $ \Cl K \cong \ZZ / 3\ZZ $. \footnote{Exercise}
\end{example*}

\subsection{Solving Diophantine equations}

\lecture{28}{Friday}{15/03/19}

The goal is solving Diophantine equations, an application of the class group. \textbf{Mordell's equation} is
$$ x^2 + n = y^3, \qquad n \in \ZZ. $$

\begin{theorem}
For any $ n \in \ZZ $, the equation $ x^2 + n = y^3 $ has only finitely many solutions with $ x, y \in \ZZ $.
\end{theorem}

\begin{example*}
$ x^2 + 1 = y^3 $ has solution $ \br{0, 1} $. Use $ \QQ\br{i} $ is a UFD or a PID or a Euclidean domain.
\end{example*}

\begin{example*}
$ x^2 + 2 = y^3 $ has solutions $ \br{\pm 5, 3} $. Use $ \QQ\br{\sqrt{-2}} $ is a UFD or a PID or a Euclidean domain.
\end{example*}

\begin{example*}
Let $ x^2 + 5 = y^3 $. Then $ K = \QQ\br{\sqrt{-5}} $ is not a UFD, since $ \Cl K = \ZZ / 2\ZZ $. Then $ x^2 \equiv 0, 1, 4 \mod 8 $, so $ x^2 + 5 \equiv 5, 6, 1 \mod 8 $, but if $ 2 \mid y $, then $ 8 \mid y^3 $, so $ x^2 + 5 \equiv 0 \mod 8 $, a contradiction, so $ 2 \nmid y $ and $ y $ is odd. Then
$$ \br{x + \sqrt{-5}}\br{x - \sqrt{-5}} = y^3 $$
is the factorisation in $ \ZZ\sbr{\sqrt{-5}} $. Are the ideals $ \abr{x + \sqrt{-5}} $ and $ \abr{x - \sqrt{-5}} $ relatively prime? If $ \ppp \subsetneq \ZZ\sbr{\sqrt{-5}} $ is a prime ideal such that $ \ppp \mid \abr{x + \sqrt{-5}} $ and $ \ppp \mid \abr{x - \sqrt{-5}} $, then $ \ppp \mid 2x $, $ \ppp \mid 2\sqrt{-5} $, and $ \Nm \ppp \mid y^3 $, so $ \Nm \ppp \mid \gcd\br{20, y^3} = \gcd\br{5, y^3} $, which is either one or five.
\begin{itemize}
\item Assume $ \Nm \ppp = 5 $. Then $ \Nm \ppp \mid y^3 $ and $ \Nm \ppp \mid x^2 $, so $ 5 \mid x $ and $ 5 \mid y $, so $ 5 = y^3 - x^3 $ is a multiple of $ 25 $, which has no solutions, a contradiction.
\item $ \Nm \ppp = 1 $ and $ \ppp $ is prime is a contradiction.
\end{itemize}
Then $ \abr{x + \sqrt{-5}} $ and $ \abr{x - \sqrt{-5}} $ are relatively prime ideals, so there exist $ I, J \subseteq \ZZ\sbr{\sqrt{-5}} $ ideals such that $ \abr{x + \sqrt{-5}} = I^3 $ and $ \abr{x - \sqrt{-5}} = J^3 $, using unique factorisation into prime ideals. Are $ I $ and $ J $ principal ideals? Assume $ I $ is not principal, so $ I = \abr{a} \cdot \abr{2, 1 + \sqrt{-5}} $ for $ a \in \QQ\br{\sqrt{-5}}^\times $, but then
$$ I^3 = \abr{a^3} \cdot \abr{2} \cdot \abr{2, 1 + \sqrt{-5}} = \abr{2a^3} \cdot \abr{2, 1 + \sqrt{-5}}, $$
which is not a principal ideal, so $ I $ was principal to begin with. The key idea is that $ 3 \nmid \#\Cl K $. The argument does not work if $ 3 \mid \#\Cl K $ for $ K $ a quadratic field. Similarly, $ J $ is a principal ideal.

\pagebreak

In general, $ x + \sqrt{-5} = \br{a + b\sqrt{-5}}^3 $ for $ a, b \in \ZZ $ only up to units in $ \ZZ\sbr{\sqrt{-5}} $, and $ \ZZ\sbr{\sqrt{-5}}^\times = \cbr{\pm 1} $ are cubes. So, indeed, we have
$$ x + \sqrt{-5} = \br{a + b\sqrt{-5}}^3, \qquad x - \sqrt{-5} = \br{a - b\sqrt{-5}}^3, \qquad a, b \in \ZZ. $$
Then $ x + \sqrt{-5} = a^3 + 3a^2b\sqrt{-5} - 15ab^2 - 5b^3\sqrt{-5} $, so get a Diophantine equation $ 3a^2b - 5b^3 = 1 $ for $ a, b \in \ZZ $, so $ b\br{3a^2 - 5b^2} = 1 $, so $ b = \pm 1 $.
\begin{itemize}
\item $ b = 1 $ implies that $ 3a^2 = 6 $, which has no solution.
\item $ b = -1 $ implies that $ 3a^2 = 4 $, which has no solution.
\end{itemize}
\end{example*}

\begin{example*}
Let $ x^2 + 11 = y^3 $. We factor this as
$$ \br{x + \sqrt{-11}}\br{x - \sqrt{-11}} = y^3. $$
The relevant number field for this equation is $ \QQ\br{\sqrt{-11}} $, which is a principal ideal domain. We had seen earlier in the course that it is even a Euclidean domain. One can also prove that the class group is trivial by considering the Minkowski bound
$$ \lambda\br{K} = \dfrac{2\sqrt{11}}{\pi} < 3. $$
This means we only need to understand how to factor $ 2 $ and since $ -11 \equiv 5 \mod 8 $, we know that $ 2 $ must stay inert, so it does not give rise to any non-principal ideal. We prove as before that $ y $ must be odd and that the ideals $ \abr{x + \sqrt{-11}} $ and $ \abr{x - \sqrt{-11}} $ are relatively prime. Using unique factorisation, also noting that the units $ \pm 1 $ are both cubes, we deduce that
$$ x + \sqrt{-11} = \dfrac{\br{a + b\sqrt{-11}}^3}{8}, \qquad x - \sqrt{-11} = \dfrac{\br{a - b\sqrt{-11}}^3}{8}, \qquad a, b \in \ZZ $$
must have the same parity. We obtain the Diophantine equation $ 8 = 3a^2b - 11b^3 $. This has solutions $ \br{a, b} = \br{\pm 1, 1} $ and $ \br{a, b} = \br{\pm 4, 2} $. These give the solutions $ \br{x, y} = \br{\pm 4, 3} $ and $ \br{x, y} = \br{\pm 15, 58} $.
\end{example*}

\begin{example*}
Let $ x^2 - 7 = y^3 $. We factor this as
$$ x^2 - 7 = \br{x + \sqrt{7}}\br{x - \sqrt{7}} = y^3 $$
in $ K = \QQ\br{\sqrt{7}} $, a real quadratic field. Claim $ \Cl K = 1 $. The Minkowski bound is
$$ \lambda\br{K} = \sqrt{7} < 3, $$
that is at most $ 2 $, and $ 2 $ ramifies, since $ 2 \mid 28 = \Disc K $, and $ \abr{2} = \abr{2, 1 + \sqrt{7}}^2 = \abr{3 + \sqrt{7}}^2 $, so $ K $ is a PID. Then
$$ x + \sqrt{7} = u \cdot \br{a + b\sqrt{7}}^3, \qquad u \in \ZZ\sbr{\sqrt{7}}^\times. $$
The problem is
$$ \ZZ\sbr{\sqrt{7}}^\times = \cbr{\pm\epsilon^k \st k \in \ZZ} \cong \cbr{\pm 1} \times \ZZ, \qquad \epsilon = 8 + \sqrt{7} \cdot 3 $$
such that $ \Nm \epsilon = \br{8 + \sqrt{7} \cdot 3}\br{8 - \sqrt{7} \cdot 3} = 64 - 63 = 1 $. The following is an elementary solution. Let
$$ x^2 + 1 = y^3 + 8 = \br{y + 2}\br{y^2 - 2y + 4} = \br{y + 2}\br{\br{y - 1}^2 + 3}. $$
Then $ y $ is odd and $ y - 1 $ is even, so $ x^2 + 1 = \br{y + 2}\br{4k + 3} $ for $ k \in \ZZ $. Then there exists $ p \equiv 3 \mod 4 $ prime such that $ p \mid x^2 + 1 $ but $ -1 $ is not a square modulo $ p $ if $ p \equiv 3 \mod 4 $, since
$$ \br{\tfrac{-1}{p}}^2 = \br{-1}^{\tfrac{p - 1}{2}} = -1, $$
a contradiction. Thus $ x^2 - 7 = y^3 $ has no solutions with $ x, y \in \ZZ $.
\end{example*}

\begin{remark*}
Let $ x^2 + n = y^3 $ with $ n > 0 $. If $ 3 \nmid \#\Cl K $ for $ K = \QQ\br{\sqrt{-n}} $, then the equation has at most two pairs of solutions $ \br{\pm x, y} $.
\end{remark*}

\pagebreak

\section{Units in real quadratic fields}

\subsection{Fundamental units}

\lecture{29}{Monday}{18/03/19}

The goal is to discuss the group of units $ \OOO_K^\times $ when $ K $ is a real quadratic field. If $ K $ is an imaginary quadratic, then
$$ \OOO_K^\times =
\begin{cases}
\ZZ / 4\ZZ & K = \QQ\br{i} \\
\ZZ / 6\ZZ & K = \QQ\br{\omega} \\
\ZZ / 2\ZZ & \text{otherwise}
\end{cases}.
$$

\begin{theorem}
If $ K $ is a real quadratic, then
\begin{align*}
\OOO_K^\times & \cong \cbr{\pm 1} \times \ZZ \\
\pm\epsilon^k & \longmapsfrom \br{\pm 1, k},
\end{align*}
with $ \epsilon \in \OOO_K^\times $ a \textbf{fundamental unit}, that is the smallest element of $ \OOO_K^\times $ such that $ \epsilon > 1 $.
\end{theorem}

In general, $ \Nm_{K / \QQ} \epsilon = \pm 1 $. To find $ \OOO_K^\times $, we will look at solutions to \textbf{Pell's equation}
$$ x^2 - dy^2 = \pm 1, $$
where $ K = \QQ\br{\sqrt{d}} $ for $ d > 0 $ square-free and $ \epsilon = x + \sqrt{d} \cdot y $.

\begin{example*}
Let $ K = \QQ\br{\sqrt{5}} $. Then $ x^2 - 5y^2 = -1 $ has solution $ \br{x, y} = \br{\pm 2, \pm 1} $, since $ 2 + \sqrt{5} $ has
$$ \Nm_{K / \QQ} \br{2 + \sqrt{5}} = \br{2 + \sqrt{5}}\br{2 - \sqrt{5}} = -1. $$
\end{example*}

\begin{lemma}
Let $ \epsilon \in \OOO_K^\times $ be such that $ \epsilon > 1 $ and $ \epsilon $ is the smallest element of $ \OOO_K^\times $ with this property. Then any $ \epsilon' \in \OOO_K^\times $ satisfies $ \epsilon' = \pm\epsilon^k $ for some $ k \in \ZZ $.
\end{lemma}

\begin{proof}
Let
$$ \intco{\epsilon, \infty} = \intco{\epsilon, \epsilon^2} \cup \intco{\epsilon^2, \epsilon^3} \cup \dots. $$
Then $ \epsilon' \in \RR^\times \setminus \cbr{\pm 1} $, so one of $ \epsilon', -\epsilon', 1 / \epsilon', -1 / \epsilon' $ is greater than one. If either of these is $ \pm\epsilon^k $ for $ k \in \ZZ $, then $ \epsilon' $ is of this form as well. We may assume $ \epsilon' > 1 $, so $ \epsilon' > \epsilon $, so $ \epsilon' \in \intco{\epsilon^k, \epsilon^{k + 1}} $ for some $ k \in \ZZ_{\ge 1} $. Then $ \epsilon' / \epsilon^k \in \OOO_K^\times $ and $ \epsilon' / \epsilon^k \in [1, \epsilon) $. This gives a contradiction unless $ \epsilon' / \epsilon^k = 1 $, so $ \epsilon' = \epsilon^k $.
\end{proof}

\subsection{Continued fractions}

The goal is to understand solutions to Pell's equation $ x^2 - dy^2 = \pm 1 $. If $ \br{x, y} $ is a solution for $ x, y > 0 $ then $ x / y \in \QQ $ is close to $ \sqrt{d} \in \RR \setminus \QQ $. In fact it is the best rational approximation to $ \sqrt{d} $. The theory of \textbf{continued fractions} gives a way of constructing such rational approximations for $ \alpha \in \RR \setminus \QQ $. Let $ a_0 = \fbr{\alpha} \in \ZZ $. If $ a_0 = \alpha $ terminate here. If not, then $ \alpha - a_0 \in \br{0, 1} $, so
$$ a_0 + \dfrac{1}{a_1} = \dfrac{a_0a_1 + 1}{a_1} \in \QQ, \qquad a_1 = \fbr{\dfrac{1}{\alpha - a_0}} \in \ZZ_{\ge 1}. $$
If $ a_1 = 1 / \br{\alpha - a_0} $ terminate here. If not, then $ 1 / \br{\alpha - a_0} - a_1 \in \br{0, 1} $, so
$$ a_0 + \dfrac{1}{a_1 + \tfrac{1}{a_2}} = a_0 + \dfrac{1}{\tfrac{a_1a_2 + 1}{a_2}} = \dfrac{a_0a_1a_2 + a_0 + a_2}{a_1a_2 + 1} \in \QQ, \qquad a_2 = \fbr{\dfrac{1}{\tfrac{1}{\alpha - a_0} - a_1}}. $$
Let
$$ \sbr{a_0; a_1, \dots, a_n} = a_0 + \dfrac{1}{a_1 + \tfrac{1}{\dots + \tfrac{1}{a_n}}} \in \QQ. $$
Then $ \sbr{a_0; a_1, \dots, a_n} \to \alpha $ when $ n \to \infty $.

\pagebreak

\begin{lemma}
The continued fraction expansion of $ \alpha \in \RR $ terminates if and only if $ \alpha \in \QQ $. If $ \alpha \in \RR \setminus \QQ $ the continued fraction expansion is $ \sbr{a_0; a_1, \dots} $, where $ a_0 \in \ZZ $ and $ a_1, a_2, \dots \in \ZZ_{\ge 1} $. Then
$$ a_0 + \dfrac{1}{a_1 + \tfrac{1}{\dots}} $$
converges to $ \alpha $.
\end{lemma}

\begin{example*}
$$ \dfrac{1 + \sqrt{5}}{2} = 1 + \dfrac{\sqrt{5} - 1}{2} = 1 + \dfrac{1}{\tfrac{2}{\sqrt{5} - 1}} = 1 + \dfrac{1}{\tfrac{2\br{1 + \sqrt{5}}}{4}} = 1 + \dfrac{1}{\tfrac{1 + \sqrt{5}}{2}} = 1 + \dfrac{1}{1 + \tfrac{1}{\dots}} = \sbr{1; 1, 1, \dots} = \sbr{\overline{1}} $$
is \textbf{purely periodic}.
$$ \sqrt{7} = 2 + \br{\sqrt{7} - 2} = 2 + \dfrac{1}{\tfrac{\sqrt{7} + 2}{3}} = 2 + \dfrac{1}{1 + \tfrac{\sqrt{7} - 1}{3}} = \dots = \sbr{2; 1, 1, 1, 4, 1, 1, 1, 4, \dots} = \sbr{2; \overline{1, 1, 1, 4}} $$
is \textbf{periodic}.
\end{example*}

\begin{theorem}
The continued fraction expansion of an element $ \alpha \in \RR \setminus \QQ $ is periodic if and only if $ \alpha $ is a quadratic number, that is $ \alpha \in \QQ\br{\sqrt{d}} $ for $ d > 0 $ square-free.
\end{theorem}

\lecture{30}{Tuesday}{19/03/19}

\begin{definition}
Let $ \sbr{a_0; a_1, a_2, \dots} $. The \textbf{$ i $-th convergent} is the truncated expansion
$$ \sbr{a_0; a_1, \dots, a_i} = a_0 + \dfrac{1}{a_1 + \tfrac{1}{\dots + \tfrac{1}{a_i}}}. $$
\end{definition}

\begin{definition}
Let $ \cbr{p_i}_{i = -2}^\infty $ and $ \cbr{q_i}_{i = -2}^\infty $ be the sequences defined by
$$ p_{-2} = 0, \qquad p_{-1} = 1, \qquad p_{i + 1} = a_{i + 1}p_i + p_{i - 1}, \qquad q_{-2} = 1, \qquad q_{-1} = 0, \qquad q_{i + 1} = a_{i + 1}q_i + q_{i - 1}, $$
so $ p_0 = a_0, p_1 = a_1a_0 + 1, q_0 = 1, q_1 = a_1 $.
\end{definition}

\begin{lemma}
We have
$$ \dfrac{p_i}{q_i} = \sbr{a_0; a_1, \dots, a_i}. $$
\end{lemma}

\begin{proof}
$ \sbr{a_0} = a_0 = p_0 / q_0 $ and $ \sbr{a_0; a_1} = a_0 + 1 / a_1 = \br{a_0a_1 + 1} / a_1 = p_1 / q_1 $. Proof by induction on $ i $. The key idea is to apply the $ \br{i - 1} $-st step to
$$ \sbr{a_0; a_1, \dots, a_i} = \sbr{a_0; a_1, \dots, a_{i - 1} + \dfrac{1}{a_i}}, $$
the $ \br{i - 1} $-st convergent.
\end{proof}

\begin{proposition}
\label{prop:convergent}
The $ i $-th convergent $ p_i / q_i $ satisfy the following.
\begin{enumerate}
\item $ p_iq_{i - 1} - q_ip_{i - 1} = \br{-1}^{i - 1} $. In particular, $ \gcd\br{p_i, q_i} = 1 $ and also
$$ \abs{\dfrac{p_i}{q_i} - \dfrac{p_{i - 1}}{q_{i - 1}}} = \abs{\dfrac{p_iq_{i - 1} - p_{i - 1}q_i}{q_iq_{i - 1}}} = \abs{\dfrac{1}{q_iq_{i - 1}}}. $$
\item If $ x = \sbr{a_0; a_1, \dots} \in \RR \setminus \QQ $ and $ p_i / q_i = \sbr{a_0; a_1, \dots, a_i} $ then $ p_i / q_i < x $ for $ i $ even and $ p_i / q_i > x $ for $ i $ odd. In particular,
$$ \dfrac{p_i}{q_i} < x < \dfrac{p_{i - 1}}{q_{i - 1}}, $$
for $ i $ even, so
$$ \abs{x - \dfrac{p_i}{q_i}} < \abs{\dfrac{p_{i - 1}}{q_{i - 1}} - \dfrac{p_i}{q_i}} = \dfrac{1}{q_iq_{i - 1}} < \dfrac{1}{\br{i - 1}^2} $$
because $ q_i \ge i $.
\end{enumerate}
\end{proposition}

\pagebreak

\begin{corollary}
$ \sbr{a_0; a_1, \dots, a_i} \to x $ as $ i \to \infty $.
\end{corollary}

In other words
$$ x = \sbr{a_0; a_1, \dots} = a_0 + \dfrac{1}{a_1 + \tfrac{1}{\dots}} $$
makes sense.

\begin{proof}[Proof of Proposition \ref{prop:convergent}]
By induction on $ i $.
\begin{enumerate}
\item Use $ i - 1 $ case and recurrence for $ \cbr{p_i}_i $ and $ \cbr{q_i}_i $.
\item $ \sbr{a_1; a_2, \dots, a_i} $ is the $ \br{i - 1} $-st convergent to $ 1 / \br{x - a_0} $. If $ i $ is even and $ i - 1 $ is odd, by the induction hypothesis
$$ \sbr{a_1; a_2, \dots, a_i} > \dfrac{1}{x - a_0} \qquad \iff \qquad x > a_0 + \dfrac{1}{\sbr{a_1; a_2, \dots, a_i}} = \sbr{a_0; a_1, \dots, a_i}. $$
Similarly $ i $ is odd and $ i - 1 $ is even.
\end{enumerate}
\end{proof}

In conclusion, $ p_i / q_i \to x $ as $ i \to \infty $ and
$$ \abs{\dfrac{p_i}{q_i} - x} < \dfrac{1}{q_iq_{i + 1}} < \dfrac{1}{q_i^2}. $$

\begin{theorem}[Best rational approximation]
If $ r, s \in \ZZ $ such that $ 0 < \abs{s} \le q_i $ then
$$ \abs{x - \dfrac{r}{s}} \ge \abs{x - \dfrac{p_i}{q_i}}, $$
with equality only if $ r / s = p_i / q_i $.
\end{theorem}

\subsection{Best approximation and solutions to Pell's equation}

If $ d = 0 $ is square-free, then $ \sqrt{d} = \sbr{a_0; \overline{a_1, \dots, a_m}} $ is periodic, but not purely periodic, but $ \fbr{\sqrt{d}} + \sqrt{d} $ is purely periodic.

\begin{theorem}
The solutions to Pell's equation $ x^2 - dy^2 = \pm 1 $ are the $ \br{p_n, q_n} $ with $ n = km - 1 $ for $ k \in \ZZ_{\ge 1} $ and moreover
$$ p_n^2 - dq_n^2 = \br{-1}^{km}. $$
In particular $ x^2 - dy^2 = -1 $ has a solution if and only if $ m $ is odd.
\end{theorem}

\begin{example*}
\hfill
\begin{itemize}
\item Let $ \QQ\br{\sqrt{7}} \supseteq \ZZ\sbr{\sqrt{7}} $. Then $ \sqrt{7} = \sbr{2, \overline{1, 1, 1, 4}} $ has period length four, so $ x^2 - 7y^2 = -1 $ has no solutions, and $ x^2 - 7y^2 = 1 $ has solutions $ \br{p_{4k - 1}, q_{4k - 1}} $. The fundamental solution is $ \br{p_3, q_3} $. Then
$$ 2 + \dfrac{1}{1 + \tfrac{1}{2}} = 2 + \dfrac{1}{\tfrac{3}{2}} = 2 + \dfrac{2}{3} = \dfrac{8}{3}, $$
so $ \br{p_3, q_3} = \br{8, 3} $. Thus $ 8 + \sqrt{7} \cdot 3 $ is the fundamental unit, so
$$ \ZZ\sbr{\sqrt{7}}^\times = \cbr{\pm 1} \times \cbr{\epsilon^k \st k \in \ZZ}, \qquad \epsilon = 8 + \sqrt{7} \cdot 3. $$
\item Let $ \QQ\br{\sqrt{13}} \supseteq \ZZ\sbr{\tfrac{1 + \sqrt{13}}{2}} $. Then $ \sqrt{13} = \sbr{3; \overline{1, 1, 1, 1, 6}} $ has period length five, so $ x^2 - 13y^2 = -1 $ has solutions $ \br{p_4, q_4} $. Then
$$ 3 + \dfrac{1}{1 + \tfrac{1}{1 + \tfrac{1}{1 + \tfrac{1}{1}}}} = \dfrac{18}{5}, $$
so $ \br{p_4, q_4} = \br{18, 5} $. Thus $ 18 + \sqrt{13} \cdot 5 $ is the fundamental unit.
\end{itemize}
\end{example*}

\pagebreak

\appendix

\section{Fermat's last theorem}

\subsection{History}

The following theorem is conjectured by Fermat and proved by Taylor-Wiles.

\begin{theorem}[Fermat's last theorem]
$ x^n + y^n = z^n $ has no non-trivial solutions if $ n \ge 3 $.
\end{theorem}

Initial idea is that it is enough to consider case $ n = 4 $ and $ n = p $ for $ p $ odd prime.

\begin{theorem}[Fermat]
$ x^4 + y^4 = z^4 $ has no non-trivial solutions.
\end{theorem}

\begin{proof}
Use infinite descent argument. Assume a solution $ \br{x, y, z} $ and construct a solution $ \br{x', y', z'} $ that is smaller for some measure.
\end{proof}

\begin{theorem}[Euler]
$ x^3 + y^3 = z^3 $ has no non-trivial solutions.
\end{theorem}

\begin{proof}
Use factorisation $ \br{x + y}\br{x + \omega y}\br{x + \omega^2y} = z^3 $ in the Eisenstein integers $ \ZZ\sbr{\omega} $, where $ \omega^3 = 1 $ is the primitive cube of unity, which is a UFD.
\begin{itemize}
\item Find common prime factors of $ \abr{x + y}, \abr{x + \omega y}, \abr{x + \omega^2y} $.
\item Use unique factorisation to show that $ \abr{x + y} = I^3 \cdot \gcd\br{\abr{x + y}, \abr{x + \omega y}, \abr{x + \omega^2y}} $.
\end{itemize}
Then use infinite descent.
\end{proof}

More generally, $ x^p + y^p = z^p $ factors as $ \prod_{i = 0}^{p - 1} \br{x + \zeta_p^iy} = z^p $ for $ \zeta_p $ a primitive $ p $-th root of unity in the ring of integers $ \OOO_K \subseteq K $ of a \textbf{cyclotomic field} $ K = \QQ\br{\zeta_p} / \QQ $, an extension of degree $ p - 1 $. Can try to adopt strategy from $ p = 3 $ to general $ p $. The problem is that there is no reason to believe $ \OOO_K $ is a UFD or a PID, so there is no reason to expect $ \Cl K = 1 $. If $ p \nmid \#\Cl K $, the same idea works. Such $ p $ are called \textbf{regular}.

\begin{theorem}[Kummer]
$ x^p + y^p = z^p $ has no non-trivial solutions if $ p $ is regular.
\end{theorem}

\begin{example*}
If $ \gcd\br{x - \zeta_p^iy, x + \zeta_p^jy} = 1 $ for $ i \ne j $, then $ x + \zeta_p^iy = u_i\alpha_i^p $ for $ i = 0, \dots, p - 1 $.
\end{example*}

The problem is that there exist infinitely many primes such that $ p \mid \#\Cl \QQ\br{\zeta_p} $, such as $ p = 37 $.

\subsection{Class field theory}

Let $ K / \QQ $ be a number field. Then $ \Cl K = I / P $ is a finite abelian group, where $ I $ is all the non-zero fractional ideals of $ K $ and $ P $ is all the non-zero principal ideals of $ K $. If $ L / K $ is a finite field extension, the \textbf{Galois group} $ \Gal\br{L / K} $ is the group of field automorphisms of $ L $ that are identity on $ K $.

\begin{example*}
Let $ L = \QQ\br{\sqrt{d}} $ be a quadratic field and $ K = \QQ $. Then $ \Gal\br{L / K} = \ZZ / 2\ZZ = \cbr{1, \tau} $ is generated by $ \tau : \sqrt{d} \mapsto -\sqrt{d} $.
\end{example*}

There exists a finite extension $ L / K $ \textbf{unramified everywhere}. All prime ideals $ \ppp \subsetneq \OOO_K $ of $ K $ either split or stay inert in $ L $, so $ \ppp = \ppp_1 \cdot \dots \cdot \ppp_g $ for some $ g \in \ZZ $ and prime ideals $ \ppp_1, \dots, \ppp_g \subsetneq \OOO_L $ all distinct, and $ L / K $ is unramified at \textbf{infinite places}. Moreover $ \Gal\br{L / K} $ is abelian. Then $ L $ is the \textbf{Hilbert class field} of $ K $, the biggest finite abelian extension of $ K $ which is unramified everywhere.

\begin{theorem}
$ \Cl K \cong \Gal\br{L / K} $.
\end{theorem}

\begin{example*}
Let $ \Cl K \cong \ZZ / 4\ZZ $.
\begin{itemize}
\item There exists a quadratic extension $ L_1 / K $ unramified everywhere with $ \Gal\br{L_1 / K} \cong \ZZ / 2\ZZ $.
\item There exists a quadratic extension $ L_2 / L_1 $ unramified everywhere with $ \Gal\br{L_2 / L_1} \cong \ZZ / 2\ZZ $.
\end{itemize}
Then $ L_2 $ is the Hilbert class field of $ K $.
\end{example*}

\pagebreak

Can generalise this picture to ideals $ \mmm \subseteq \OOO_K $. The \textbf{ray class group} of \textbf{conductor} $ \mmm $ is $ I^\mmm / P^\mmm $, where $ I^\mmm $ is all the non-zero fractional ideals prime to $ \mmm $ and $ P^\mmm $ is all the ideals generated by $ a \equiv 1 \mod \mmm $.

\begin{theorem}
There exists a \textbf{ray class field} $ L / K $.
\end{theorem}

Can understand $ \Gal\br{\overline{K} / K}^{\ab} $. Let
$$ \Gal\br{\overline{K} / K} = \varprojlim_{L / K \ \text{finite}} \Gal\br{L / K} $$
be the \textbf{absolute Galois group} of $ K $. Can describe $ \Gal\br{\overline{K} / K}^{\ab} $, the maximal abelian quotient of $ \Gal\br{\overline{K} / K} $, in terms of generalisations of $ \Cl K $, the \textbf{idele class group} $ \I_K $.

\begin{theorem}[Global Artin reciprocity]
$ \I_K / \Nm_{L / K} \I_L \cong \Gal\br{\overline{K} / K}^{\ab} $.
\end{theorem}

This is interesting for $ K = \QQ $.

\subsection{Modular forms and elliptic curves}

If $ \Gal\br{L / K} $ is not abelian, need to understand $ n $-dimensional representations of $ \Gal\br{L / K} $.

\begin{example*}
$ \Gal\br{L / K} \cong \SSS_3 $ has $ 2 $-dimensional irreducible representations $ \rho : \SSS_3 \to \GL_2\br{\CC} $, so
$$ \Gal\br{\overline{K} / K} \twoheadrightarrow \Gal\br{L / K} \cong \SSS_3 \xrightarrow{\rho} \GL_2\br{\CC}. $$
\end{example*}

The $ n = 2 $ case is related to \textbf{modular forms}, holomorphic functions $ f $ on $ \HH = \cbr{z \in \CC \st \Im z > 0} $ satisfying certain symmetries. Then $ \SL_2\br{\ZZ} $ acts on $ \HH $ by
$$ \function{\SL_2\br{\ZZ} \curvearrowright \HH}{\HH}{\twobytwo{a}{b}{c}{d}\br{z}}{\dfrac{az + b}{cz + d}}, \qquad a, b, c, d \in \ZZ, \qquad ad - bc = 1, $$
so
$$ \twobytwo{1}{0}{0}{1} : z \mapsto z, \qquad \twobytwo{1}{1}{0}{1} : z \mapsto z + 1, \qquad \twobytwo{0}{1}{-1}{0} : z \mapsto -\dfrac{1}{z}. $$
Expanding $ f\br{z} = f\br{z + 1} $ in Fourier series,
$$ f\br{z} = q + a_2q^2 + a_3q^3 + \dots, \qquad q = e^{2\pi iz}. $$

\begin{example*}
$ f\br{z} = q\prod_{n = 1}^\infty \br{1 - q^n}^2\br{1 - q^{11n}}^2 $ is a modular form.
\end{example*}

On the other hand, \textbf{elliptic curves}, smooth projective curves $ E / \QQ $ of genus one, have a \textbf{group law} over $ \QQ $. Let $ E\sbr{p} $ be the \textbf{$ p $-torsion points}, where
$$ 0 = \sbr{p}\br{x_0, y_0} = \br{x_0, y_0} +_E \dots +_E \br{x_0, y_0}. $$
Then $ \Gal\br{\overline{\QQ} / \QQ} $ acts on $ E\sbr{p} $ to give $ \br{x_0, y_0} $ for algebraic numbers $ x_0, y_0 \in \overline{\QQ} $, and $ E\sbr{p^n} \cong \br{\ZZ / p^n\ZZ}^2 $.

\begin{example*}
$ y^2 + y = x^3 - x^2 $ is an elliptic curve.
\end{example*}

\subsection{From Artin reciprocity to modularity}

If $ L $ be the Hilbert class field of $ K $, then a one-dimensional reciprocity is
$$ \Gal\br{L / K} \cong \Cl K. $$
If $ E $ is an elliptic curve and $ a_p $ is the Fourier coefficient to a modular form for some prime $ p $, a two-dimensional reciprocity is
$$ p - \#\cbr{\text{solutions to} \ E \ \text{modulo} \ p} = a_p. $$
This was the key to the proof of Fermat's last theorem.

\end{document}