% vim: tw=50
% 23/02/2023 12AM

\begin{example*}
    \begin{enumerate}[(i)]
        \item Theorem 11.1 implies $\ZZ[X]$ is a UFD.
        \item Let $R[X_1, \ldots, X_n]$ be the
            polynomial ring in $X_1, \ldots, X_n$
            with coefficients in $R$. (Define
            inductively $R[X_1, \ldots, X_n] =
            R[X_1, \ldots, X_{n - 1}][X_n]$).
            Applying Theorem 11.1 inductively
            implies $R[X_1, \ldots, X_n]$ is a UFD
            if $R$ is as UFD.
    \end{enumerate}
\end{example*}

\begin{flashcard}[eisenstein-criterion]
\begin{theorem*}[Eisenstein's Criterion]
    Let $R$ be a UFD and $f(X) = a_n X^n + \cdots
    + a_1 X + a_0 \in R[X]$
    \cloze{\fcemph{primitive}}. Suppose
    $\exists p \in R$ \cloze{\fcemph{irreducible}}\fcscrap{
    ($=$ prime)} such
    that
    \begin{itemize}
        \item \cloze{$p \nmid a_n$}
        \item \cloze{$p \mid a_i$ $\forall 0 \le i \le n
            - 1$}
        \item \cloze{$p^2 \nmid a_0$}
    \end{itemize}
    Then $f$ is irreducible in $R[X]$.
\end{theorem*}
\end{flashcard}

\begin{flashcard}[eisenstein-proof]
    \prompt{Proof of Eisenstein's Criterion? \\}
\begin{proof}
    \cloze{
    Suppose $f = gh$, $g, h \in R[X]$ not units.
    $f$ primitive implies $\deg(g), \deg(h) > 0$.
    Let $g = r_k X^k + \cdots + r_1 X + r_0$, $h =
    s_l X^l + \cdots + s_1 X + s_0$ with $k + l =
    m$. Then $p \nmid a_n = r_k s_l$ so $p \nmid
    r_k$ and $p \nmid s_l$, and $p \mid a_0 = r_0
    s_0$ so $p \mid r_0$ or $p \mid s_0$. WLOG $p
    \mid r_0$. Then there exists $j \le k$ such
    that $p \mid r_0$, $p \mid r_1$, \ldots, $p
    \mid r_{j - 1}$, $p \nmid r_j$. Then
    \[ a_j = \ub{r_0 s_j + r_1 s_{j - 1} + \cdots +
    r_{j - 1} s_1}_{\text{divisible by $p$}} + r_j s_o \]
    but $p$ divides $a_j$ since $j < n$, thus $p
    \mid r_j s_0$, hence $p \mid s_0$. Then $p^2
    \mid r_0 s_0 = a_0$, contradicting the third
    assumption.
}
\end{proof}
\end{flashcard}

\begin{example*}
    \begin{enumerate}[(i)]
        \item $f(X) = X^3 + 2X + 5 \in \ZZ[X]$. If
            $f$ irreducible in $\ZZ[X]$, then
            \[ f(X) = (x + a) (X^2 + bX + c) \]
            for some $a, b, c \in \ZZ$. Thus $ac =
            5$. But $\pm 1$, $\pm 5$ are not roots
            of $f$, contradiction. By Gauss's
            Lemma, $f$ irreducible in $\QQ[X]$.
            Thus $\QQ[X] / (f)$ is a field (Lemma
            10.4).
        \item Let $p \in \ZZ$ be a prime.
            Eisenstein's criterion implies $x^n -
            p$ is irreducible in $\ZZ[X]$, have
            irreducible in $\QQ[X]$ by Gauss's
            Lemma.
        \item Let $f(X) = X^{p - 1} + X^{p - 2} +
            \cdots + X + 1 \in \ZZ[X]$ where $p$
            is prime. Eisenstein does not apply
            directly to $f$. But note that $f(X) =
            \frac{X^p - 1}{X - 1}$. Substituting
            $Y = X - 1$ gives
            \[ f(Y + 1) = \frac{(Y + 1)^p - 1}{(Y
            + 1) - 1} = Y^{p - 1} + {p \choose 1}
            Y^{p - 2} + \cdots + {p \choose p - 2}
            Y + {p \choose p - 1} \]
            Now $p \mid {p \choose i}$ for all $1
            \le i \le p - 1$ and $p^2 \nmid {p
            \choose p - 1} = p$. Thus $f(Y + 1)$
            is irreducible in $\ZZ[Y]$, so $f(X)$
            is irreducible in $\ZZ[X]$ (because
            if it did have a factorisation then we
            could construct a factorisation of
            $f(Y + 1)$).
    \end{enumerate}
\end{example*}

\newpage
\section{Algebraic Integers}

Recall $\ZZ[i] = \{a + bi : a, b \in \ZZ\} \le
\CC$ -- ring of Gaussian integers. Norm $N :
\ZZ[i] \to \ZZ_{\ge 0}$, $a + ib \mapsto a^2 +
b^2$ with $N(z_1) = N(z_1)N(z_2)$ is a Euclidean
function. Thus $\ZZ[i]$ is a Euclidean Domain,
hence PID and UFD, and so \fbox{primes $=$
irreducibles} in $\ZZ[i]$. The units in $\ZZ[i]$
are $\pm 1$, $\pm i$.

\begin{example*}
    \begin{enumerate}[(i)]
        \item $2 = (1 + i)(1 - i)$ and $5 = (2 +
            i)(2 - i)$ are not primes in $\ZZ[i]$.
        \item $N(3) = 9$ so if $3 = ab$ in
            $\ZZ[i]$ then $N(a)N(b) = 9$. But
            $\ZZ[i]$ has no elements of norm $3$.
            Thus $a$ or $b$ is a unit, hence $3$
            is a prime in $\ZZ[i]$. Similarly $7$
            is prime.
    \end{enumerate}
\end{example*}

\begin{flashcard}[fermats-christmas-theorem]
\begin{proposition}
    Let $p \in \ZZ$ be a prime number. Then the
    following are equivalent:
    \begin{enumerate}[(i)]
        \item \cloze{$p$ is not prime in
            $\ZZ[i]$.}
        \item \cloze{$p = a^2 + b^2$ for some $a, b \in
            \ZZ$.}
        \item \cloze{$p = 2$ or $p \equiv 1
            \pmod{4}$.}
    \end{enumerate}
\end{proposition}

\begin{proof}
    \phantom{}
    \begin{enumerate}[(i) $\implies$ (i)]
        \item[(i) $\implies$ (ii)] \cloze{Let $p = xy$,
            $x, y \in \ZZ[i]$ not units. Then $p^2
            = N(p) = N(x) N(y)$, $N(x), N(y) > 1$.
            Thus $N(x) = N(y) = p$. Writing $x = a
            + ib$ gives $p = N(x) = a^2 + b^2$.}
        \item[(ii) $\implies$ (iii)] \cloze{The squares
            modulo 4 are 0 and 1. Thus if $p = a^2
            + b^2$, then $p \not \equiv 3
            \pmod{4}$.}
        \item[(iii) $\implies$ (i)] \cloze{Already saw
            $2$ not prime in $\ZZ[i]$. Assume $p
            \equiv 1 \pmod{4}$. By Theorem 9.3,
            $(\ZZ / p\ZZ)^\times$ is cyclic of
            order $p - 1$. Then $(\ZZ /
            p\ZZ)^\times$ contains an element of
            order 4, i.e. there exists $x \in \ZZ$
            with $x^a \equiv 1 \pmod{p}$ but $x^2
            \not\equiv 1 \pmod{p}$. Thus $x^2
            \equiv -1 \pmod{p}$. Now $p \mid x^2 +
            1 = (x + i)(x - i)$ but $p \nmid x +
            i$ and $p \nmid x - i$. Thus $p$ not
            prime. \qedhere}
    \end{enumerate}
\end{proof}
\end{flashcard}

\begin{theorem}
    The primes in $\ZZ[i]$ (up to associates) are
    \begin{enumerate}[(i)]
        \item $a + ib$, where $a, b \in \ZZ$ and
            $a^2 + b^2 = p$ a prime number with $p
            = 2$ or $p \equiv 1 \pmod{4}$.
        \item Prime numbers $p \in \ZZ$ with $p
            \equiv 3 \pmod{4}$.
    \end{enumerate}
\end{theorem}

\begin{proof}
    First we check these are primes.
    \begin{enumerate}[(i)]
        \item $N(a + ib) = p$. If $a + ib = uv$
            then either $N(u) = 1$ or $N(v) = 1$.
            Thus $a + ib$ is irreducible, hence
            prime.
        \item Proposition 12.1, now let $z \in
            \ZZ[i]$ prime ($=$ irreducible). Then
            $\ol{z} \in \ZZ[i]$ is also
            irreducible and $N(z) = z\ol{z}$ is a
            factorisation into irreducibles. Let
            $p \in \ZZ$ be a prime number dividing
            $N(z)$. If $p \equiv 3 \pmod{4}$, then
            $p$ is prime in $\ZZ[i]$. Thus $p \mid
            z$ or $p \mid \ol{z}$, so $p$ is an
            associate of $z$ or $\ol{z}$. Hence
            $p$ is an associate of $z$.
            Otherwise, $p = 2$ or $p \equiv 1
            \pmod{4}$ and $P = a^2 + b^2 = (a +
            ib)(a - ib)$, $a, b \in \ZZ$. Then $(a
            + ib)(a - ib) \mid z \ol{z}$. Thus $z$
            is an associate of $a + ib$ or $a -
            ib$ by uniqueness of
            factorisation.\qedhere
    \end{enumerate}
\end{proof}
