\chapter{Bonus: A Bit on Artin Reciprocity}
\label{ch:artin_reciprocity}
In this chapter, I'm going to state some big theorems of
global class field theory and use them to deduce the
Kronecker-Weber plus Hilbert class fields.
No proofs, but hopefully still appreciable.
For experts: this is global class field theory, without ideles.

Here's the executive summary: let $K$ be a number field.
Then all abelian extensions $L/K$ can be understood
using solely information intrinsic to $K$:
namely, the ray class groups (generalizing ideal class groups).

\section{Overview}

At the end of this section, for an Abelian field extension $L/K$, we will define
the Artin symbol
\[ \left( \frac{L/K}{\kp} \right), \]
which generalizes the Legendre symbol $\left( \frac{a}{p} \right)$:
\begin{itemize}
	\item Above the solidus, instead of an integer $a$, we have a field
		extension $L/K$.
	\item Below the solidus, instead of a rational prime $p$, we have a prime
		ideal $\kp$ of $K$.
\end{itemize}

We require $\kp$ to not ramify in the extension $L/K$ for the symbol to be
defined.

And, at the end, we want to state the Artin reciprocity theorem, which looks
something like the following:
\begin{moral}
	For primes $\kp$,
	$\left( \frac{L/K}{\kp} \right)$ depends
	only on ``$\kp \pmod \kf$''.
\end{moral}

Here, $\kf$ is a ``modulus'', which only depends on the field extension $L/K$.

In order to do that, we first need to define what it means for two ideals to be
coprime modulo something. We will divide up the ideals of $\OO_K$ that is
``coprime'' to $\kf$ into ``residue classes modulo $\kf$'' (we will call them
``ray classes'' from now on) in such a way that:
\begin{itemize}
	\item It generalizes the class group -- two ideals that belong to different
		ideal classes (i.e. are nonisomorphic as $\OO_K$-modules) belong to
		different ray classes.
	\item It respects the multiplicative structure -- if $\kp$ is in the same
		ray class as $\kp'$, and $\kq$ is in the same ray class as $\kq'$, then
		$\kp \kq$ is in the same ray class as $\kp' \kq'$.

		Note that there is no analogue of element addition for the ideals (for
		instance, $(1) = (-1)$ but $(1) + (1) \ne (1) + (-1)$), so this is the
		best we can hope for.

		In other words, the ray classes will form an \emph{abelian group} under
		multiplication, with the operation induced from ideal multiplication.
	\item For a fixed modulus $\kf$, there are only finitely many ray
		classes.
\end{itemize}

In the section above, you may think of a prime ideal $\kp \in \OO_K$ as an
irreducible factor, such that all ideals can be written as products of.
However, they can also naturally be used as a modulus:
\begin{moral}
	A prime $\kp$ gives a way to divide the elements of $\OO_K$ into residue
	classes that respects the addition and multiplication of elements.
\end{moral}
This can further be generalized to divide
up the \emph{ideals} of $\OO_K$ into ray classes --
unfortunately, using only the finite primes is insufficient to divide up the
ideals the way we want, as later seen in
\Cref{ex:ray_class_group_finite_modulus}.
So, the infinite primes will be introduced in order to divide up the
\emph{elements}, as well as the ideals, into classes that satisfies the
multiplicative structure.

\section{Infinite primes}
\prototype{$\QQ(\sqrt{-5})$ has a complex infinite prime,
$\QQ(\sqrt5)$ has two real infinite ones.}
Let $K$ be a number field of degree $n$ and signature $(r,s)$.
We know what a prime ideal of $\OO_K$ is,
but we now allow for the so-called infinite primes,
which I'll describe using the embeddings.\footnote{This is
	not really the right definition; the ``correct'' way to think of
	primes, finite or infinite, is in terms of valuations.
	But it'll be sufficient for me to state the theorems I want.}
Recall there are $n$ embeddings $\sigma \colon K \to \CC$, which consist of
\begin{itemize}
	\ii $r$ real embeddings where $\img\sigma \subseteq \RR$, and
	\ii $s$ pairs of conjugate complex embeddings.
\end{itemize}
Hence $r+2s = n$.
The first class of embeddings form the \vocab{real infinite primes},
while the \vocab{complex infinite primes} are the second type.
We say $K$ is \vocab{totally real} (resp \vocab{totally complex})
if all its infinite primes are real (resp complex).
\begin{example}
	[Examples of infinite primes]
	\listhack
	\begin{itemize}
		\ii $\QQ$ has a single real infinite prime.
		We often write it as $\infty$.
		\ii $\QQ(\sqrt{-5})$ has a single complex infinite prime,
		and no real infinite primes. Hence totally complex.
		\ii $\QQ(\sqrt{5})$ has two real infinite primes,
		and no complex infinite primes. Hence totally real.
	\end{itemize}
\end{example}

\section{Modular arithmetic with infinite primes}
A \vocab{modulus} (or \vocab{module}) of $K$ is a formal product
\[ \km = \prod_{\kp} \kp^{\nu(\kp)} \]
where the product runs over all primes, finite and infinite.
(Here $\nu(\kp)$ is a nonnegative integer,
of which only finitely many are nonzero.)
We also require that
\begin{itemize}
	\ii $\nu(\kp) = 0$ for any complex infinite prime $\kp$, and
	\ii $\nu(\kp) \le 1$ for any real infinite prime $\kp$.
\end{itemize}
Obviously, every $\km$ can be written as $\km = \km_0\km_\infty$
by separating the finite from the (real) infinite primes.

We say $a \equiv b \pmod{\kp}$ if
\begin{itemize}
	\ii If $\kp$ is a finite prime, then $a \equiv b \pmod{\kp^{\nu(\kp)}}$
	means exactly what you think it should mean:
	$a-b \in \kp^{\nu(\kp)}$.
	\ii If $\kp$ is a \emph{real} infinite prime $\sigma \colon K \to \RR$, then
	$a \equiv b \pmod{\kp}$ means that $\sigma(a/b) > 0$.
\end{itemize}

\begin{moral}
	A real infinite prime $\kp = \sigma$ divides up the elements of $K^\times$
	into two classes
	$\{k \in K^\times \mid \sigma(k)>0 \}$
	and
	$\{k \in K^\times \mid \sigma(k)<0 \}$,
	this division satisfies the multiplicative operation.
\end{moral}

Of course, $a \equiv b \pmod{\km}$ means $a \equiv b$
modulo each prime power in $\km$.
With this, we can define a generalization of the class group:
\begin{definition}
	Let $\km$ be a modulus of a number field $K$.
	\begin{itemize}
		\ii Let $I_K(\km)$ denote the set of all fractional ideals of $K$
		which are relatively prime to $\km$, which is an abelian group.
		\ii Let $P_K(\km)$ be the subgroup of $I_K(\km)$ generated by
		\[
			\left\{
				\alpha \OO_K
				\mid
				\alpha \in K^\times \text{ and }
				\alpha \equiv 1 \pmod{\km}
			\right\}.
		\]
		This is sometimes called a ``ray'' of principal
		ideals.\footnote{Probably because, similar to a geometrical ray, it only
			extends infinitely in one direction -- at least when there is an
		infinite prime in the modulus $\km$.}
	\end{itemize}
	Finally define the \vocab{ray class group} of $\km$
	to be $C_K(\km) = I_K(\km) / P_K(\km)$.
\end{definition}
This group is known to always be finite.
Note the usual class group is $C_K(1)$.

One last definition that we'll use right after Artin reciprocity:
\begin{definition}
	A \vocab{congruence subgroup} of $\km$ is a subgroup $H$ with
	\[ P_K(\km) \subseteq H \subseteq I_K(\km). \]
\end{definition}
Thus $C_K(\km)$ is a group which contains a lattice of various
quotients $I_K(\km) / H$, where $H$ is a congruence subgroup.

This definition takes a while to get used to, so here are examples.
\begin{example}
	[Ray class groups in $\QQ$, finite modulus]
	\label{ex:ray_class_group_finite_modulus}
	Consider $K = \QQ$ with infinite prime $\infty$. Then
	\begin{itemize}
		\ii If we take $\km = 1$ then $I_\QQ(1)$ is all fractional ideals,
		and $P_\QQ(1)$ is all principal fractional ideals.
		Their quotient is the usual class group of $\QQ$, which is trivial.

		\ii Now take $\km = 8$.
		Thus $I_\QQ(8) \cong \left\{ \frac ab\ZZ \mid
			a/b \equiv 1,3,5,7 \pmod 8 \right\}$.
		Moreover
		\[ P_\QQ(8) \cong \left\{ \frac ab\ZZ \mid
			a/b \equiv 1 \pmod 8 \right\}. \]
		You might at first glance think that
		the quotient is thus $(\ZZ/8\ZZ)^\times$.
		But the issue is that we are dealing with \emph{ideals}:
		specifically, we have
		\[ 7\ZZ = -7\ZZ \in P_\QQ(8) \]
		because $-7 \equiv 1 \pmod 8$.
		So \emph{actually}, we get
		\[
			C_\QQ(8)
			\cong \left\{ 1,3,5,7 \text{ mod } 8 \right\}
			/ \left\{ 1,7 \text{ mod } 8 \right\}
			\cong (\ZZ/4\ZZ)^\times.
		\]
	\end{itemize}
	More generally,
	\[ C_\QQ(m) = (\ZZ/m\ZZ)^\times / \{\pm1\}. \]
\end{example}
\begin{example}
	[Ray class groups in $\QQ$, infinite moduli]
	Consider $K = \QQ$ with infinite prime $\infty$ again.
	\begin{itemize}
		\ii Now take $\km = \infty$.
		As before $I_\QQ(\infty) = \QQ^\times$.
		Now, by definition we have
		\[ P_\QQ(\infty) = \left\{ \frac ab \ZZ \mid a/b > 0 \right\}. \]
		At first glance you might think this was $\QQ_{>0}$,
		but the same behavior with ideals shows in fact $P_\QQ(\infty) = \QQ^\times$.
		So in this case, $P_\QQ(\infty)$ still has all principal fractional ideals.
		Therefore, $C_\QQ(\infty)$ is still trivial.

		\ii Finally, let $\km = 8\infty$.
		As before $I_\QQ(8\infty) \cong \left\{ \frac ab\ZZ \mid
			a/b \equiv 1,3,5,7 \pmod 8 \right\}$.
		Now in this case:
		\[ P_\QQ(8\infty) \cong \left\{ \frac ab\ZZ \mid
			a/b \equiv 1 \pmod 8 \text{ and } a/b > 0 \right\}.  \]
		This time, we really do have $-7\ZZ \notin P_\QQ(8\infty)$:
		we have $7 \not\equiv 1 \pmod 8$ and also $-7 < 0$.
		So neither of the generators of $7\ZZ$ are in $P_\QQ(8\infty)$.
		Thus we finally obtain
		\[
			C_\QQ(8\infty)
			\cong \left\{ 1,3,5,7 \text{ mod } 8 \right\}
			/ \left\{ 1 \text{ mod } 8 \right\}
			\cong (\ZZ/8\ZZ)^\times
		\]
		with the bijection $C_\QQ(8\infty) \to (\ZZ/8\ZZ)^\times$
		given by $a\ZZ \mapsto |a| \pmod 8$.
	\end{itemize}
	More generally,
	\[ C_\QQ(m\infty) = (\ZZ/m\ZZ)^\times. \]
\end{example}

\section{Infinite primes in extensions}
I want to emphasize that everything above is
\emph{intrinsic} to a particular number field $K$.
After this point we are going to consider extensions $L/K$
but it is important to keep in mind the distinction that
the concept of modulus and ray class group are objects
defined solely from $K$ rather than the above $L$.

Now take a \emph{Galois} extension $L/K$ of degree $m$.
We already know prime ideals $\kp$ of $K$ break into
a product of prime ideals $\kP$ of $L$ in a nice way,
so we want to do the same thing with infinite primes.
This is straightforward: each of the $n$ infinite primes
$\sigma \colon K \to \CC$ lifts to $m$ infinite primes $\tau \colon L \to \CC$,
by which I mean the diagram
\begin{center}
\begin{tikzcd}
	L \ar[r, "\tau", dashed] & \CC \\
	K \ar[u, hook]  \ar[ur, "\sigma", swap]
\end{tikzcd}
\end{center}
commutes.
Hence like before, each infinite prime $\sigma$ of $K$
has $m$ infinite primes $\tau$ of $L$ which lie above it.

For a real prime $\sigma$ of $K$, if any of the resulting $\tau$ above it
are complex, we say that the prime $\sigma$ \vocab{ramifies}
in the extension $L/K$. Otherwise it is \vocab{unramified} in $L/K$.
An infinite prime of $K$ is always unramified in $L/K$.
In this way, we can talk about an unramified Galois extension $L/K$:
it is one where all primes (finite or infinite) are unramified.

\begin{example}
	[Ramification of $\infty$]
	Let $\infty$ be the real infinite prime of $\QQ$.
	\begin{itemize}
		\ii $\infty$ is ramified in $\QQ(\sqrt{-5})/\QQ$.
		\ii $\infty$ is unramified in $\QQ(\sqrt{5})/\QQ$.
	\end{itemize}
	Note also that if $K$ is totally complex
	then any extension $L/K$ is unramified.
\end{example}

\section{Frobenius element and Artin symbol}
Recall the key result:
\begin{theorem}
	[Frobenius element]
	Let $L/K$ be a \emph{Galois} extension.
	If $\kp$ is a prime unramified in $L/K$, and $\kP$ a prime above it in $L$,
	then there is a unique element of $\Gal(L/K)$, denoted $\Frob_\kP$, obeying
	\[ \Frob_\kP(\alpha) \equiv \alpha^{\Norm(\kp)} \pmod{\kP}
		\qquad \forall \alpha \in \OO_L. \]
\end{theorem}

Recall some examples from \Cref{ex:frob_gaussian_integers} and \Cref{lem:cyclo_frob}.
\begin{example}
	[Example of Frobenius elements]
	Let $L = \QQ(i)$, $K = \QQ$.
	We have $\Gal(L/K) \cong \ZZ/2\ZZ$.

	If $p$ is an odd prime with $\kP$ above it,
	then $\Frob_\kP$ is the unique element such that
	\[ (a+bi)^p \equiv \Frob_\kP(a+bi) \pmod{\kP} \]
	in $\ZZ[i]$. In particular,
	\[ \Frob_\kP(i) = i^p =
		\begin{cases}
			i & p \equiv 1 \pmod 4 \\
			-i & p \equiv 3 \pmod 4.
		\end{cases}
	\]
	From this we see that $\Frob_\kP$ is the identity when $p \equiv 1 \pmod 4$
	and $\Frob_\kP$ is complex conjugation when $p \equiv 3 \pmod 4$.
\end{example}
\begin{example}
	[Cyclotomic Frobenius element]
	Generalizing previous example, let $L = \QQ(\zeta)$ and $K = \QQ$,
	with $\zeta$ an $m$th root of unity.
	It's well-known that $L/K$ is unramified outside $\infty$
	and prime factors of $m$.
	Moreover, the Galois group $\Gal(L/K)$ is $(\ZZ/m\ZZ)^\times$:
	the Galois group consists of elements of the form
	\[ \sigma_n \colon \zeta \mapsto \zeta^n \]
	and $\Gal(L/K) = \left\{ \sigma_n \mid n \in (\ZZ/m\ZZ)^\times \right\}$.

	Then it follows just like before that
	if $p \nmid m$ is prime and $\kP$ is above $p$
	\[ \Frob_\kP = \sigma_p. \]
\end{example}

Here, as hinted in \Cref{sec:more_general_extensions}, we have to generalize the
theory where the base field $K$ is not necessarily $\QQ$ (for example, in
\Cref{ex:cubic_legendre_artin}, we need $K=\QQ(\omega)$).
In this case, $\kp$ is
not necessarily an integer, and the induced map on the quotient is the
``power-by-$\Norm(\kp)$'' map.

\begin{example}
	[Frobenius element when the base field is $\QQ(\omega)$]
	Let $L=\QQ(\omega, \sqrt[3]{2})$ and $K=\QQ(\omega)$.

	Consider $\kp=(5)$, which is prime in $K$, and $\Norm(\kp)=25$.
	The field $\OO_K/\kp$ is isomorphic to $\FF_{25}$.
	In $L$, $\kp$ splits to $\kP_1 \kP_2 \kP_3$, and each residue field
	$\OO_L/\kP_i$ is isomorphic to $\FF_{25}$.

	The Frobenius element $\Frob_\kP \in \Gal(L/K)$ induces the power-of-25
	isomorphism in the quotient field, thus is the identity.
\end{example}


An important property of the Frobenius element is its order
is related to the decomposition of $\kp$ in the higher field $L$
in the nicest way possible:
\begin{lemma}
	[Order of the Frobenius element]
	The Frobenius element $\Frob_\kP \in \Gal(L/K)$
	of an extension $L/K$ has order equal to the
	inertial degree of $\kP$, that is,
	\[ \ord \Frob_\kP = f(\kP \mid \kp). \]
	In particular, $\Frob_\kP = \id$ if and only if $\kp$
	splits completely in $L/K$.
\end{lemma}
This naturally generalizes \Cref{lem:order_frob}.
\begin{proof}
	We want to understand the order of the map $T \colon x \mapsto x^{\Norm(\kp)}$ on
	the field $\OO_L / \kP$.
	But the latter is isomorphic to the splitting field
	of $X^{\Norm(\kP)} - X$ in $\FF_p$, by Galois theory of finite fields.
	Hence the order is $\log_{\Norm(\kp)} (\Norm(\kP)) = f(\kP \mid \kp)$.
\end{proof}

The Galois group acts transitively among the set of $\kP$ above a given $\kp$,
so that we have
\[ \Frob_{\sigma(\kP)} = \sigma \circ (\Frob_{\kP}) \circ \sigma\inv.  \]
Thus $\Frob_\kP$ is determined by its underlying $\kp$ up to conjugation.

In class field theory, we are interested in \vocab{abelian extensions},
i.e.\ those for which $\Gal(L/K)$ is abelian.
Here the theory becomes extra nice:
the conjugacy classes have size one.
\begin{definition}
	Assume $L/K$ is an \textbf{abelian} extension.
	Then for a given unramified prime $\kp$ in $K$,
	the element $\Frob_\kP$ doesn't depend on the choice of $\kP$.
	We denote the resulting $\Frob_\kP$ by the \vocab{Artin symbol},
	\[ \left( \frac{L/K}{\kp} \right). \]
\end{definition}
The definition of the Artin symbol is written deliberately to
look like the Legendre symbol.
To see why:
\begin{example}[Legendre symbol subsumed by Artin symbol]
	Suppose we want to understand
	$\left( \frac 2p \right) \equiv 2^{\frac{p-1}{2}}$ where $p > 2$ is prime.
	Consider the element
	\[ \left( \frac{\QQ(\sqrt 2)/\QQ}{p\ZZ} \right)
		\in \Gal(\QQ(\sqrt 2) / \QQ). \]
	It is uniquely determined by where it sends $\sqrt 2$.
	But in fact we have
	\[
		\left( \frac{\QQ(\sqrt 2)/\QQ}{p\ZZ} \right) \left( \sqrt 2 \right)
		\equiv \left( \sqrt 2 \right)^{p}
		\equiv 2^{\frac{p-1}{2}} \cdot \sqrt 2
		\equiv \left( \frac 2p \right) \sqrt 2
		\pmod{\kP}
	\]
	where $\left( \frac 2p \right)$ is the usual Legendre symbol,
	and $\kP$ is above $p$ in $\QQ(\sqrt 2)$.
	Thus the Artin symbol generalizes the quadratic Legendre symbol.
\end{example}
\begin{example}[Cubic Legendre symbol subsumed by Artin symbol]
	\label{ex:cubic_legendre_artin}
	Similarly, it also generalizes the cubic Legendre symbol.
	To see this, assume $\theta$ is a primary prime
	in $K = \QQ(\sqrt{-3}) = \QQ(\omega)$
	(thus $\OO_K = \ZZ[\omega]$ is the Eisenstein integers).
	Then for example
	\[
		\left( \frac{K(\cbrt 2)/K}{\theta \OO_K} \right) \left( \cbrt 2 \right)
		\equiv \left( \cbrt 2 \right)^{\Norm(\theta)}
		\equiv 2^{\frac{\Norm(\theta)-1}{3}} \cdot \cbrt 2
		\equiv \left( \frac{2}{\theta} \right)_3 \cbrt 2
		\pmod{\kP}
	\]
	where $\kP$ is above $(\theta)$ in $K(\cbrt 2)$.
\end{example}

\section{Artin reciprocity}
Now, we further capitalize on the fact that $\Gal(L/K)$ is abelian.
For brevity, in what follows let $\Ram(L/K)$ denote the primes of $K$
(either finite or infinite) which ramify in $L$.

\begin{definition}
	Let $L/K$ be an abelian extension and let $\km$ be
	divisible by every prime in $\Ram(L/K)$.
	Then since $L/K$ is abelian we can extend the Artin symbol
	multiplicatively to a map
	\[ \left( \frac{L/K}{\bullet} \right) \colon I_K(\km) \surjto \Gal(L/K). \]
	This is called the \vocab{Artin map},
	and it is surjective (for example by Chebotarev Density).

	Let $H(L/K, \km) \subseteq I_K(\km)$ denote the kernel of this map, so
	\[ \Gal(L/K) \cong I_K(\km) / H(L/K, \km). \]
\end{definition}

We can now present the long-awaited Artin reciprocity theorem.
\begin{theorem}
	[Artin reciprocity]
	Let $L/K$ be an abelian extension.
	Then there is a modulus $\kf = \kf(L/K)$,
	divisible by exactly the primes of $\Ram(L/K)$, such that:
	for any modulus $\km$ divisible by all primes of $\Ram(L/K)$, we have
	\[
		P_K(\km) \subseteq H(L/K, \km) \subseteq I_K(\km)
		\quad\text{if and only if}\quad
		\kf \mid \km.
	\]
	We call $\kf$ the \vocab{conductor} of $L/K$.
\end{theorem}
So the conductor $\kf$ plays a similar role to the discriminant
(divisible by exactly the primes which ramify),
and when $\km$ is divisible by the conductor,
$H(L/K, \km)$ is a \emph{congruence subgroup}.

Here's the reason this is called a ``reciprocity'' theorem.
The above theorem applies on $\km=\kf$ tells us $P_K(\kf) \subseteq H(L/K, \kf)$,
so the Artin map factors through the quotient map $I_K(\kf) \surjto I_K(\kf) / P_K(\kf)$.
Recalling that $C_K(\kf) = I_K(\kf) / P_K(\kf)$,
we get a sequence of maps
\begin{center}
\begin{tikzcd}
	I_K(\kf) \ar[r, surjective head] & C_K(\kf) \ar[rd, surjective head]
		\ar[rr, "\left( \frac{L/K}{\bullet} \right)", surjective head]
		&& \Gal(L/K) \\
	&& I_K(\kf) / H(L/K, \kf) \ar[ru, "\cong", swap] &
\end{tikzcd}
\end{center}
Consequently:
\begin{moral}
	For primes $\kp \in I_K(\kf)$,
	$\left( \frac{L/K}{\kp} \right)$ depends
	only on ``$\kp \pmod \kf$''.
\end{moral}

Let's see how this result relates to quadratic reciprocity.
\begin{example}
	[Artin reciprocity implies quadratic reciprocity]
	The big miracle of quadratic reciprocity states that:
	for a fixed (squarefree) $a$,
	the Legendre symbol $\left( \frac ap \right)$
	should only depend the residue of $p$ modulo something.
	Let's see why Artin reciprocity tells us this \emph{a priori}.

	Let $L = \QQ(\sqrt a)$, $K = \QQ$.
	Then we've already seen that the Artin symbol
	\[ \left( \frac{\QQ(\sqrt a)/\QQ}{\bullet} \right) \]
	is the correct generalization of the Legendre symbol.
	Thus, Artin reciprocity tells us that there is a conductor
	$\kf = \kf(\QQ(\sqrt a)/\QQ)$ such that
	$\left( \frac{\QQ(\sqrt a)/\QQ}{p} \right)$ depends only on
	the residue of $p$ modulo $\kf$, which is what we wanted.
\end{example}

Here is an example along the same lines.
\begin{example}
	[Cyclotomic field]
	\label{ex:artin_cyclotomic}
	Let $\zeta$ be a primitive $m$th root of unity.
	For primes $p$, we know that $\Frob_p \in \Gal(\QQ(\zeta)/\QQ)$
	is ``exactly'' $p \pmod m$.
	Let's translate this idea into the notation of Artin reciprocity.

	We are going to prove
	\[
		H(\QQ(\zeta) / \QQ,  m\infty)
		= P_\QQ(m\infty)
		= \left\{ \frac ab \ZZ \mid a/b \equiv 1 \pmod m \right\}.
	\]
	This is the generic example of achieving the lower bound in Artin reciprocity.
	It also implies that $\kf(\QQ(\zeta)/\QQ) \mid m\infty$.

	It's well-known $\QQ(\zeta)/\QQ$ is unramified outside finite primes dividing $m$,
	so that the Artin symbol is defined on $I_K(\km)$.
	Now the Artin map is given by
	\begin{center}
	\begin{tikzcd}
		I_\QQ(\km) \ar[r, "\left( \frac{\QQ(\zeta)/\QQ}{\bullet} \right)"]
			& \Gal(\QQ(\zeta)/\QQ) \ar[r, "\cong"] & (\ZZ/m\ZZ)^\times \\[-2em]
		p \ar[r, mapsto] & (x \mapsto x^p) \ar[r, mapsto] & p \pmod m.
	\end{tikzcd}
	\end{center}
	So we see that the kernel of this map is trivial,
	i.e.\ it is given by the identity of the Galois group,
	corresponding to $1 \pmod m$.
	On the other hand, we've also computed $P_\QQ(m\infty)$ already,
	so we have the desired equality.
\end{example}

In fact, we also have the following ``existence theorem'':
every congruence subgroup appears uniquely once we fix $\km$.
\begin{theorem}
	[Takagi existence theorem]
	Fix $K$ and let $\km$ be a modulus.
	Consider any congruence subgroup $H$, i.e.\
	\[ P_K(\km) \subseteq H \subseteq I_K(\km). \]
	Then $H = H(L/K, \km)$ for a \emph{unique} abelian extension $L/K$.
\end{theorem}

Finally, such subgroups reverse inclusion in the best way possible:
\begin{lemma}
	[Inclusion-reversing congruence subgroups]
	Fix a modulus $\km$.
	Let $L/K$ and $M/K$ be abelian extensions
	and suppose $\km$ is divisible by the conductors of $L/K$ and $M/K$.
	Then
	\[ L \subseteq M
		\quad\text{if and only if}\quad
		H(M/K, \km) \subseteq H(L/K, \km).  \]
\end{lemma}
Here by $L \subseteq M$ we mean that $L$ is isomorphic to some subfield of $M$.
\begin{proof}
	[Sketch of proof]
	Let us first prove the equivalence with $\km$ fixed.
	In one direction, assume $L \subseteq M$;
	one can check from the definitions that the diagram
	\begin{center}
	\begin{tikzcd}
		I_K(\km)
			\ar[r, "\left( \frac{M/K}\bullet \right)"]
			\ar[rd, "\left( \frac{L/K}\bullet \right)", swap]
			& \Gal(M/K) \ar[d, surjective head] \\
		& \Gal(L/K)
	\end{tikzcd}
	\end{center}
	commutes, because it suffices to verify this for prime powers,
	which is just saying that Frobenius elements behave well
	with respect to restriction.
	Then the inclusion of kernels follows directly.
	The reverse direction is essentially the Takagi existence theorem.
\end{proof}
Note that we can always take $\km$ to be the product of conductors here.

If you didn't realize it: Apart from generalizing quadratic reciprocity, Artin reciprocity and
Takagi existence theorem together enumerates \emph{all abelian field extensions}!
Now if you are given a field $K$ and want to list all (finite) abelian field extensions of $K$,
you can list all the modulus $\km$ of $K$, list all subgroups of $C_K(\km)$, then each subgroup
corresponds to a field extension.

(Of course, the question of how to compute the field $L$ given a modulus and a congruence subgroup
is still difficult. At least when $K = \QQ$, \Cref{prob:kronecker_weber_theorem} gives the answer:
all finite abelian field extensions $L/\QQ$ are contained in some cyclotomic field.)

\bigskip

To finish, here is a quote from Emil Artin on his reciprocity law:
\begin{quote}
	I will tell you a story about the Reciprocity Law.
	After my thesis, I had the idea to define $L$-series
	for non-abelian extensions. But for them to agree
	with the $L$-series for abelian extensions,
	a certain isomorphism had to be true.
	I could show it implied all the standard reciprocity laws.
	So I called it the General Reciprocity Law and tried to prove it but couldn't,
	even after many tries. Then I showed it to the other number theorists,
	but they all laughed at it, and I remember Hasse in particular
	telling me it couldn't possibly be true.

	Still, I kept at it, but nothing I tried worked.
	Not a week went by --- \emph{for three years!} ---
	that I did not try to prove the Reciprocity Law.
	It was discouraging, and meanwhile I turned to other things.
	Then one afternoon I had nothing special to do, so I said,
	`Well, I try to prove the Reciprocity Law again.'
	So I went out and sat down in the garden.  You see,
	from the very beginning I had the idea to use the cyclotomic fields,
	but they never worked, and now I suddenly saw that all this time
	I had been using them in the wrong way
	--- and in half an hour I had it.
\end{quote}

\section{Application: Generalization of sum of two squares}

We start with the follow classical theorem:
\begin{theorem}[Fermat's theorem on sums of two squares]
	An odd prime $p$ can be expressed as $p = x^2 + y^2$ for integers $x$ and $y$ if and only if $p
	\equiv 1 \pmod{4}$.
\end{theorem}
You may see a proof that goes something like the following. Because we have learnt number theory and
quadratic reciprocity, this should be intuitive to follow.
\begin{proof}
	Note that if $p = x^2 + y^2$, then $\left(\frac{x}{y}\right)^2 \equiv -1 \pmod{p}$, so a
	necessary condition is that $-1$ is a quadratic residue modulo $p$.

	We will show that this condition is also sufficient.

	Let $a \in \ZZ$ be such that $a^2 \equiv -1 \pmod{p}$.
	Note that $\Norm_{\QQ(i)/\QQ}(a + i) = a^2 + 1$ is divisible by $p$, and $\Norm_{\QQ(i)/\QQ}(p)
	= p^2$.

	Assume it is possible to write $p = x^2 + y^2$.
	Then $p$ can be factored in $\ZZ[i]$ as $(x + y i)(x - y i)$, for integers $x$ and $y$.

	We claim that letting $x + y i = \gcd(p, a + i)$ works.
	Indeed, $p \mid (a + i) (a - i) = a^2 + 1$ but $p$ does not divide either of the factor, which
	means $p$ is not a prime in $\ZZ[i]$ and taking the $\gcd$ with either $a + i$ or $a - i$ should
	extract a nontrivial factor.

	Note that $\Norm_{\QQ(i)/\QQ}(x + y i) = p$, thus $x + y i$ and $x - y i$ are already primes,
	so the factor extraction above must already give us a prime factor, which is what we want.

	Finally, we know that $-1$ is a quadratic residue modulo $p$ precisely when
	$p \equiv 1 \pmod{4}$, so we're done.
\end{proof}

You may dismiss it as an arcane trick\dots\ until you realize that it can be generalized perfectly
well to many other cases!
Try to prove the following theorem using the same method.
\begin{theorem}
	An odd prime $p > 7$ can be expressed as $p = x^2 + 7 y^2$ for integers $x$ and $y$ if and only
	if $-7$ is a quadratic residue modulo $p$.
\end{theorem}
Which, by quadratic reciprocity, would boil down to whether $(p \bmod 7) \in \{ 1, 2, 4 \}$.

Nevertheless, it isn't always that nice.
\begin{example}
	Let $p = 3$. Then $1^2 \equiv -5 \pmod{p}$, but there is no integers $x$ and $y$ such that $p =
	x^2 + 5 y^2$.
\end{example}
\begin{ques}
	If you haven't, try to figure out what went wrong in the proof before reading the explanation
	below.
\end{ques}

The bug, of course, is to assume that $\gcd(p, 1 + \sqrt{-5})$ is an element --- that is,
in this case, the ring of integers of $\QQ(\sqrt{-5})$ is not an unique factorization domain.
But we have all the tools of ideal theory to fix it:
the ideal $(p) = (3) \subseteq \QQ$ splits into $(p) = \kp_1 \kp_2$ when lifted to $\QQ(\sqrt{-5})$,
where $\kp_1 = (3, 1 + \sqrt{-5})$ and $\kp_2 = (3, 1 - \sqrt{-5})$.

Thus,
\begin{proposition}
	A prime $p \in \QQ$ can be written as $p = x^2 + 5 y^2$ if and only if $(p)$ splits into $\kp_1
	\kp_2$ when lifted to $\QQ(\sqrt{-5})$, where both $\kp_1$ and $\kp_2$ are principal ideals.
\end{proposition}

This is where Artin reciprocity and the Hilbert class field shines --- we want to determine the
class of $\kp_1$, in other words, $\kp_1 \pmod{1}$.
\begin{ques}
	Check that $\kp \equiv (1) \pmod{1}$ if and only if $\kp \subseteq \QQ(\sqrt{-5})$ is principal.
	(Definition chasing.)
\end{ques}
\begin{ques}
	If $\kp_1$ is principal, then we automatically have $\kp_2$ principal. Why?
\end{ques}

From now on, let $K = \QQ(\sqrt{-5})$, and let $L$ be some abelian extension of $K$.

Recall we defined above the group $H(L/K, \km) = \ker \left(\frac{L/K}{\bullet}\right)$, and the
statement of Artin reciprocity claims, among others, that $P_K(\km) \subseteq H(L/K, \km)$.
Naturally, you may wonder, if all we cares is that ``$\left(\frac{L/K}{\kp}\right)$ depends only on
$\kp \pmod{\kf}$'', then why would we need to define yet another piece of notation for $H$?

Well, the simplified version of Artin reciprocity theorem above states that we can compute
$\left(\frac{L/K}{\kp}\right)$ once we know $\kp \pmod{\kf}$.
Of course there is more than that:
\begin{moral}
	If $P_K(\kf) = H(L/K, \kf)$, then we can compute $\kp \pmod{\kf}$ once we know
	$\left(\frac{L/K}{\kp}\right)$.
\end{moral}
In other words, if $L$ is such that the congruence subgroup reaches the ``lower bound'',
then we also get the converse.
\begin{ques}
	Check that the algebra above works out.
\end{ques}

We have seen one example above, \Cref{ex:artin_cyclotomic}, where the congruence subgroup
$H(\QQ(\zeta_m)/\QQ, m \infty)$ is equal to the lower bound $P_\QQ(m \infty)$.
We will see one more example below.

\begin{example}
	In the example above, we can vary both the modulus $\km$ and the abelian field extension $L$
	over $K$ to get different congruence subgroups.
	This can be confusing, so let us take an example.

	Consider abelian field extensions $L/\QQ$. Let the modulus in $\QQ$ be $\km = 15 \infty$.

	The ray class group $C_\QQ(\km)$ is of course isomorphic to $\Zm{15} \cong \Zm{3} \times \Zm{5}
	\cong \Zc{2} \times \Zc{4}$.

	As small as this group is (with only 8 elements), it has 8 subgroups.%
	\footnote{\url{https://beta.lmfdb.org/Groups/Abstract/diagram/8.2} has a diagram.}
	Nevertheless, we will only focus on the relevant parts of the subgroup lattice.

	By Artin reciprocity and Takagi existence theorem, each congruence subgroup corresponds to
	some abelian extension over $L/\QQ$.

	We draw the correspondence between abelian field extension and the congruence subgroup
	$H(L/\QQ, 15 \infty)$ below, depicted using the fact that
	$H(L/\QQ, 15 \infty)/P_\QQ(15 \infty)$ is a subgroup of $C_\QQ(15 \infty)$,
	which is canonically isomorphic to $\Zm{15}$.
	\begin{center}
	\begin{tikzcd}
		\QQ(\zeta_{15}) \ar[r, leftrightarrow] & \{ 1 \} \ar[d] \\
		\QQ(\zeta_{5}) \ar[u] & \{ 1, 11 \} \ar[d] \\
		\QQ(\sqrt 5) \ar[u] & \{ 1, 11, 4, 14 \} \ar[d] \\
		\QQ \ar[u] \ar[r, leftrightarrow] & \Zm{15}
	\end{tikzcd}
	\end{center}
	(Where does the diagram above come from? Well, if the base field is $\QQ$,
	\Cref{prob:kronecker_weber_theorem} gives a way.)

	Interested readers may want to try to work out the canonical isomorphism between the Galois
	group $\Gal(L/K)$ and the ray class group $C_K(\kf(L/K))$
	in the general case of an abelian extension.

	Next, how does this relate to the abelian extensions that corresponds to different modulus,
	let's say $5 \infty$?
	Intuitively speaking, if we know the value of an ideal mod $15 \infty$, we would know its
	value mod $5 \infty$. Formally, we have this diagram:
	\begin{center}
	\begin{tikzcd}
		P_\QQ(15 \infty) \ar[d, hook] \ar[r, hook] &
		I_\QQ(15 \infty) \ar[d, hook] \ar[r, surjective head] &
		C_\QQ(15 \infty) \ar[d, surjective head] \\
		P_\QQ(5 \infty) \ar[r, hook] &
		I_\QQ(5 \infty) \ar[r, surjective head] &
		C_\QQ(5 \infty)
	\end{tikzcd}
	\end{center}
	(If you have read the category theory chapter:
	Morphism of short exact sequence appears everywhere! You just have to look for it.)

	That is, we get an induced $C_\QQ(15 \infty) \surjto C_\QQ(5 \infty)$ map,
	or equivalently, $\Zm{15} \surjto \Zm{5}$.
	This time around, the abelian field extensions that corresponds to the modulus $5 \infty$ are:
	\begin{center}
	\begin{tikzcd}
		\QQ(\zeta_{5}) \ar[r, leftrightarrow] & \{ 1 \} \ar[d] \\
		\QQ(\sqrt 5) \ar[u] & \{ 1, 4 \} \ar[d] \\
		\QQ \ar[u] \ar[r, leftrightarrow] & \Zm{5}
	\end{tikzcd}
	\end{center}
\end{example}

In our case, given $p \in \QQ$ be a prime factors as $(p) = \kp_1 \kp_2$ when lifted to
$K = \QQ(\sqrt{-5})$, we want to determine if $\kp_1$ is principal --- in other words, we want to
compute ``$\kp_1 \pmod{1}$''.
With the insight above, we will rephrase the condition in terms of the Artin symbol.

Let $L = K(i)$. (Later on, we will know that $L$ is the \vocab{Hilbert class field} of $K$.)
We claim the following is true:
\begin{itemize}
	\ii $L/K$ is an abelian extension,
	\ii the conductor is $\kf = \kf(L/K) = 1$,
	\ii $H(L/K, \kf) = P_K(\kf)$ --- that is, this is exactly the situation where we can determine
	$\kp \pmod{1}$ for $\kp \subseteq K$ based on $\left(\frac{L/K}{\kp}\right)$.
\end{itemize}

(In the general case, the field $L$ exists according to \Cref{prob:hilbert_class_field}.)

Then, for a prime $\kp \subseteq K$, the following are equivalent:
\begin{enumerate}
	\ii $\kp$ is principal;
	\ii $\left(\frac{L/K}{\kp}\right) = \id$;
	\ii $\kp$ splits completely when lifted to $L$.
\end{enumerate}

Notice that we used Artin reciprocity (and its ``converse'') for the abelian extension $L/K$
to prove the equivalence of the first and the second statement.
\begin{exercise}
	Why is the second and the third statement equivalent?
	(\Cref{prob:hilbert_class_field}.)
\end{exercise}

Thus, the condition that $(p) = \kp_1 \kp_2$ for principal ideals $\kp_1$ and $\kp_2$ is equivalent
to that $(p) \subseteq \QQ$ splits completely when lifted to $L$.

Reasoning similar to above for the abelian extension $L/\QQ$, the following are equivalent:
\begin{enumerate}
	\ii $(p) \subseteq \QQ$ splits completely when lifted to $L$;
	\ii $\left(\frac{L/\QQ}{(p)}\right) = \id$.
\end{enumerate}

This time, we don't have the first bullet point anymore --- $L$ is \emph{not} the
Hilbert class field of $\QQ$ --- but, by Artin reciprocity, we do know:
\begin{moral}
	The value of $\left(\frac{L/\QQ}{(p)}\right)$ only depends on $(p) \pmod{\kf(L/\QQ)}$.
\end{moral}
In this case, the conductor of the extension $L/\QQ$ is $\kf(L/\QQ) = 20 \infty$.

So, in summary:
\begin{align*}
	&\quad \text{$p$ can be written as $x^2 + 5y^2$} \\
	&\iff \text{$(p) = \kp_1 \kp_2$ for principal $\kp_1$ when lifted to $\QQ(\sqrt{-5})$} \\
	&\iff \text{$(p) = \kp_1 \kp_2$, and $\kp_1 \subseteq \QQ(\sqrt{-5})$ splits completely
		when lifted to $\QQ(\sqrt{-5}, i)$} \\
	&\iff \text{$(p) \subseteq \QQ$ splits completely when lifted to $\QQ(\sqrt{-5}, i)$} \\
	&\iff \left( \frac{\QQ(\sqrt{-5}, i)/\QQ}{(p)} \right) = \id \\
	&\iff (p \bmod 20) \in \{ 1, 9 \}.
\end{align*}

We're done! The final form of the theorem is:
\begin{theorem}
	Let $p$ be a prime with $p \nmid 20$, then $p$ can be written as $x^2 + 5y^2$ if and only if
	$(p \bmod 20) \in \{ 1, 9 \}$.
\end{theorem}


\section{\problemhead}
\begin{dproblem}
	\label{prob:kronecker_weber_theorem}
	[Kronecker-Weber theorem]
	Let $L$ be an abelian extension of $\QQ$.
	Then $L$ is contained in a cyclotomic extension $\QQ(\zeta)$
	where $\zeta$ is an $m$th root of unity (for some $m$).
	\begin{hint}
		Pick $m$ so that $\kf(L/\QQ) \mid m\infty$.
	\end{hint}
	\begin{sol}
		Suppose $\kf(L/\QQ) \mid m\infty$ for some $m$.
		Then by the example from earlier we have the chain
		\[ P_{\QQ}(m\infty) = H(\QQ(\zeta)/\QQ, m\infty)
			\subseteq H(L/\QQ, m\infty) \subseteq I_\QQ(m\infty). \]
		So by inclusion reversal we're done.
	\end{sol}
\end{dproblem}

\begin{dproblem}
	[Hilbert class field]
	\label{prob:hilbert_class_field}
	Let $K$ be any number field.
	Then there exists a unique abelian extension $E/K$
	which is unramified at all primes (finite or infinite)
	and such that
	\begin{itemize}
		\ii $E/K$ is the maximal such extension by inclusion.
		\ii $\Gal(E/K)$ is isomorphic to the class group of $K$.
		\ii A prime $\kp$ of $K$ splits completely in $E$
		if and only if it is a principal ideal of $\OO_K$.
	\end{itemize}
	We call $E$ the \vocab{Hilbert class field} of $K$.
	\begin{hint}
		Apply the Takagi existence theorem with $\km = 1$.
	\end{hint}
	\begin{sol}
		Apply the Takagi existence theorem with $\km = 1$
		to obtain an unramified extension $E/K$ such that
		$H(E/K, 1) = P_K(1)$.
		We claim this works:
		\begin{itemize}
			\ii To see it is maximal by inclusion, note that any other extension $M/K$
			with this property has conductor $1$ (no primes divide the conductor),
			and then we have $P_K(1) = H(E/K, 1) \subseteq H(M/K, 1) \subseteq I_K(1)$,
			so inclusion reversal gives $M \subseteq E$.
			\ii We have $\Gal(E/K) \cong I_K(1) / P_K(1) = C_K(1)$ the class group.
			\ii The isomorphism in the previous part is given by the Artin symbol.
			So $\kp$ splits completely if and only if $\left( \frac{E/K}{\kp} \right) = \id$
			if and only if $\kp$ is principal (trivial in $C_K(1)$).
		\end{itemize}
		This completes the proof.
	\end{sol}
\end{dproblem}

\begin{problem}
	There is no positive integer $m$ such that whether a prime number $p \nmid m$ can be written as
	$p = x^2 + 23 y^2$ depends only on $p \bmod m$. Guess why.
	\begin{hint}
		The extension $L/\QQ$ is not abelian.
	\end{hint}
\end{problem}
