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

\begin{example*}
    $\ZZ[X]$ is not a PID. Consider $I = (2, X)
    \normalsub \ZZ[X]$. Then
    \begin{align*}
        I
        &= \{2f_1(X) + Xf_2(X) : f_1, f_2 \in
        \ZZ[X]\} \\
        &= \{f \in \ZZ[X] : f(0) \text{ if even}\}
    \end{align*}
    Suppose $I = (f)$ for some $f \in \ZZ[X]$.
    Then $2 = fg$ for some $g \in \ZZ[X]$. Thus
    $\deg(f) = \deg(g) = 0$ and $f \in \ZZ$. Hence
    $f = \pm 1$ or $\pm 2$. Thus $I = \ZZ[X]$ or
    $2\ZZ[X]$. The first case is a contradiction
    since $1 \not\in I$, and the second is a
    contradiction since $X \in I$.
\end{example*}

\begin{flashcard}[UFD-defn]
\begin{definition*}
    An integral domain is a unique factorisation
    domain (UFD) if
    \begin{enumerate}[(i)]
        \item \cloze{Every non-zero, non-unit is a
            product of irreducibles.}
        \item \cloze{If $p_1 \cdots p_m = q_1 \cdots q_n$
            where $p_i$, $q_i$ are irreducibles,
            then $m = n$ and we can reorder so
            that $p_i$ is an associate of $q_i$
            for all $i = 1, \ldots, n$.}
    \end{enumerate}
\end{definition*}
\end{flashcard}

\noindent
Goal: PID $\implies$ UFD.

\begin{flashcard}[UFD-iff-every-irreducible-is-prime]
\begin{proposition}
    Let $R$ be an integral domain satisfying (i)
    in definition of UFD. Then $R$ is a UFD if and
    only if \cloze{every irreducible is prime.}
\end{proposition}

\begin{proof}
    \begin{itemize}
        \item[$\Rightarrow$] \cloze{Suppose $p \in R$ is
            irreducible and $p \mid ab$. Then $ab
            = pc$ for some $c \in R$. Writing $a,
            b, c$ as products of irreducibles, it
            follows from (ii) that $p \mid a$ or
            $p \mid b$. Thus $p$ is prime.
            }
        \item[$\Leftarrow$] \cloze{Suppose $p_1 \cdots
            p_m = q_1 \cdots q_n$ with each $p_i$
            and $q_i$ irreducible. Since $p_1$ is
            prime and $p_1 \mid q_1 \cdots q_n$,
            we have $p_1 \mid q_i$ for some $i$.
            Upon reordering, we may assume $p_1
            \mid q_1$, i.e. $q_1 = up_1$ for some
            $u \in R$. But $q_1$ is irreducible
            and $p_1$ not a unit, so $u$ is a
            unit. Thus $p_1$ and $q_1$ are
            associates. Cancelling $p_1$ gives
            $p_2 \cdots p_mm = (uq_2) \cdots q_n$.
            Result then follows by induction.
            \qedhere
            }
    \end{itemize}
\end{proof}
\end{flashcard}

\begin{lemma}
    Let $R$ be a PID and $I_1 \subseteq I_2
    \subseteq I_3 \subseteq \cdots$ a nested
    sequence of ideals. Then $\exists N \in \NN$
    such that $I_n = I_{n + 1}$ for all $n \ge N$.
    (Rings satisfying the ``ascending chain
    condition'' are called Noetherian -- more
    later).
\end{lemma}

\begin{proof}
    Let $I = \bigcup_{i = 1}^\infty I_i$. This is
    an ideal in $R$. (See Example Sheet 2). Since
    $R$ is a PID, we have $I = (a)$ for some $a
    \in R$. Then $(a) = \bigcup_{i = 1}^\infty I_i$,
    so $a \in I_N$ for some $N$. Then for any $n
    \ge N$ we have
    \[ (a) \subseteq I_N \subseteq I_n \subseteq
    I = (a) \]
    and so $I_n = I$.
\end{proof}

\begin{flashcard}[PID-implies-UFD]
\begin{theorem}
    If $R$ is a principal ideal domain, then it is
    a unique factorisation domain. (i.e. PID
    implies UFD).
\end{theorem}

\begin{proof}
    \begin{enumerate}[(i)]
        \item \cloze{Let $0 \neq x \neq R$, not a unit.
            Suppose $x$ is not a product of
            irreducibles. Then $x$ not
            irreducible, so can write $x = x_1
            y_1$ where $x_1$, $y_1$ are not units.
            Then either $x_1$ or $y_1$ is not a
            product of irreducibles, say $x_1$. We
            have $(x) \subseteq (x_1)$ and
            inclusion is strict since $y_1$ not a
            unit. Now write $x_1 = x_2 y_2$ where
            $x_2$, $y_2$ are not units. Repeat
            this procedure to get
            \[ (x) \subsetneq (x_1) \subsetneq
            (x_2) \subsetneq \cdots \]
            contradicting Lemma 10.7.}
        \item \cloze{By proposition 10.6, suffices to
            show irreducibles are prime. Conclude
            by Proposition 10.3. \qedhere}
    \end{enumerate}
\end{proof}
\end{flashcard}

\subsubsection*{Examples}

\begin{flashcard}[ring-examples-and-counterexamples]
\begin{center}
    \prompt{Examples of rings in each of these
    categories?}
    \begin{tabular}{cccccccc}
        & ED & $\implies$ & PID & $\implies$ & UFD
        & $\implies$ & Integral Domain \\
        \hline
        \cloze{$\ZZ / 4\ZZ$} & \xmark & & \xmark & &
        \xmark & & \xmark \\
        \cloze{$\ZZ[\sqrt{-5}]$} & \xmark & & \xmark & &
        \xmark & & \cmark \\
        \cloze{$\ZZ[X]$} & \xmark & & \xmark & & \cmark &
        & \cmark \\
        \cloze{$\ZZ \left[ \frac{1 + \sqrt{-19}}{2}
        \right]$} & \xmark & & \cmark & & \cmark &
        & \cmark \\
        \cloze{$\ZZ[i]$} & \cmark & & \cmark & & \cmark &
        & \cmark
    \end{tabular}
\end{center}
\end{flashcard}

\begin{definition*}
    $R$ an integral domain.
    \begin{enumerate}[(i)]
        \item
            \begin{flashcard}[gcd-definition]
            $d \in R$ is a greatest common
            divisor of $a_1, \ldots a_n \in R$
            (written $d = \gcd(a_1, \ldots, a_n)$)
            if \cloze{$d \mid a_i$ for all $i$ and if $d'
            \mid a_i$ for all $i$, then $d' \mid
            d$.}
            \end{flashcard}
        \item
            \begin{flashcard}[lcm-definition]
            $m \in R$ is a least common multiple
            of $a_1, \ldots, a_n \in R$ (written
            $m = \lcm(a_1, \ldots, a_n)$) if
            \cloze{$a_i
            \mid m$ for all $i$ and if $a_i \mid
            m'$ for all $i$, then $m \mid m'$.}
            \end{flashcard}
    \end{enumerate}
    Both gcd's and lcm's (when they exist) are
    unique up to associates.
\end{definition*}

\begin{proposition}
    In a UFD, both lcm's and gcd's exist.
\end{proposition}

\begin{proof}
    Write $a_i = u_i \prod_j p_j^{n_{ij}}$ for all
    $1 \le i \le n$, where $u_i$ is a unit, the
    $p_i$ are irreducible which are \emph{not}
    associates of each other, and $n_{ij} \in
    \ZZ_{\ge 0}$.
    
    \myskip
    We claim that $d = \prod_j p_j^{m_j}$ where
    $m_f = \min_{1 \le i \le n} n_{ij}$ is the gcd
    of $a_1, \ldots, a_n$. Certainly $d \mid a_i$
    for all $i$. If $d' \mid a_i$ for all $i$,
    then $d' = u \prod_j p_j^{t_j}$, we find $t_j
    \le n_{ij}$ for all $j$ so $t_j \le m_j$.
    Therefore $d' \mid d$. The argument for lcm's
    is similar.
\end{proof}
