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

\newpage
\section{Factorisation in Polynomial Rings}

Goal of this lecture:

\begin{flashcard}[R-UFD-implies-RX-UFD]
\begin{theorem}
    If $R$ is a \cloze{UFD} then $R[X]$ is a \cloze{UFD}.
\end{theorem}
\end{flashcard}

\noindent
In this section: $R$ is a UFD with field of
fractions $F$. We have $R[X] \le F[X]$.

\myskip
Moreover $F[X]$ is an ED hence a PID and a UFD.

\begin{flashcard}[content-defn]
\begin{definition*}
    The \emph{content} of $f = a_n X^n + \cdots +
    a_1 X + a_0 \in R[X]$ is \cloze{
    \[ c(f) = \gcd(a_0, a_1,
    \ldots, a_n) \]
    (well-defined up to
    multiplication by a unit). We say $f$ is
    \emph{primitive} if $c(f)$ is a unit.}
\end{definition*}
\end{flashcard}

\begin{flashcard}[content-lemma]
\begin{lemma}
    \begin{enumerate}[(i)]
        \item If $f, g \in R[X]$ are primitive,
            then $fg$ is also primitive.
        \item If $f, g \in R[X]$, then $c(fg) =
            c(f) c(g)$ (equality is up to units).
    \end{enumerate}
\end{lemma}

\begin{proof}
    \begin{enumerate}[(i)]
        \item \cloze{Let $f = a_n X^n + \cdots + a_1 X +
            a_0$, $g = b_m X^m + \cdots + b_1 X +
            b_0$. If $fg$ is not primitive,
            $c(fg)$ is not a unit, so there is
            some prime $p$ such that $p \mid
            c(fg)$. Since $f, g$ primitive, $p
            \nmid c(f)$ and $p \nmid c(g)$.
            Suppose $p \mid a_0$, $p \mid a_1$,
            \ldots, $p \nmid a_k$, $p \mid b_0$,
            $p \mid b_1$, \ldots, $p \nmid b_l$.
            Then the coefficient of $X^{k_l}$ in
            $fg$ is
            \[ \sum_{i + j = k + 1} a_i b_j =
            \ub{\cdots + a_{k - 1} b_{l - 1}}_{
            \text{divisible by }
            p} + a_k b_l + \ub{a_{k - 1} b_{l - 1}
            + \cdots}_{\text{divisible by } p} \]
            Note that the LHS is divisible by $p$,
            hence $p \mid a_k b_l$ so $p \mid a_k$
            or $p \mid b_l$, contradiction.}
        \item \cloze{Write $f = c(f) f_0$ and $c(g) g_0$
            where $f_0, g_0 \in R[X]$ primitive.
            Then
            \[ fg = c(f) c(g) f_0 g_0 \]
            where $f_0 g_0$ is primitive by (i).
            Hence $c(fg) = c(f) c(g)$ (up to a
            unit).}
    \end{enumerate}
\end{proof}
\end{flashcard}

\begin{flashcard}[p-prime-in-R-implies-prime-in-RX]
\begin{corollary}
    Let $p \in R$ be prime. Then $p$ is prime in
    $R[X]$.
\end{corollary}

\begin{proof}
    \cloze{
    $R[X]^\times = R^\times$, so $p$ is not a unit
    in $R[X]$. Let $f \in R[X]$. Then $p \mid f$
    in $R[X]$ if and only if $p \mid c(f)$ in $R$.
    Thus if $p \mid gh$ in $R[X]$, we have
    \begin{align*}
        p \mid c(gh) = c(g) c(h)
        &\implies p \mid c(g) \text{ or } c(h) \text{
        in $R$} \\
        &\implies p \mid g \text{ or } p \mid h
        \text{ in $R[X]$, i.e. $p$ prime in
        $R[X]$.} \qedhere
    \end{align*}
}
\end{proof}
\end{flashcard}

\begin{flashcard}[f-divides-g-in-FX-implies-f-divides-g-in-RX]
\begin{lemma}
    Let $f, g \in R[X]$ \cloze{with $g$ primitive}. If $g
    \mid f$ in $F[X]$, then $g \mid f$ in $R[X]$.
\end{lemma}

\begin{proof}
    \cloze{
    Let $f = gh$, $h \in F[X]$. Let $a \in R$ such
    that $ah \in R[X]$ (``clear denominators''),
    and write $ah = c(ah) h_0$, $af = c(ah) h_0 g$
    with $h_0$ primitive, and hence $h_0 g$
    primitive. Taking contents, we find that $a
    \mid c(ah)$. Thus $h \in R[X]$ and $g \mid f$
    in $R[X]$.
}
\end{proof}
\end{flashcard}

\begin{flashcard}[gauss-lemma]
\begin{lemma*}[Gauss's Lemma]
    \cloze{
    Let $f \in R[X]$ be \fcemph{primitive}. Then $f$
    \fcemph{irreducible} in $R[X]$ implies $f$
    \cloze{irreducible} in $F[X]$.}
\end{lemma*}

\begin{proof}
    \cloze{
    Since $f \in R[X]$ is irreducible and
    primitive, we have $\deg(f) > 0$, and so $f$
    not a unit in $F[X]$. Suppose that $f$ is
    \emph{not} irreducible in $F[X]$, say $f =
    gh$, where $g, h \in F[X]$ with $\deg(g),
    \deg(h) > 0$. Let $\lambda \in F^\times$ such
    that $\lambda^{-1} g \in R[X]$ is primitive.
    (For example, let $0 \neq b \in R$ such that
    $bg \in R[X]$. Then $bg = c(bg) g_0$ with
    $g_0$ primitive. So can take $\lambda =
    \frac{c(bg)}{b} \in F^\times$).

    \myskip
    Upon replacing $g$ by $\lambda^{-1} g$ and $h$
    by $\lambda h$, may assume $g \in R[X]$
    primitive. Then Lemma 11.4 implies $h(X) \in
    R[X]$ and so $f = gh$ in $R[X]$, $\deg(g),
    \deg(h) > 0$, contradiction.
}
\end{proof}
\end{flashcard}

\begin{remark*}
    We'll see ``$\Leftarrow$'' also holds.
\end{remark*}

\begin{flashcard}[g-prime-in-FX-implies-g-prime-in-RX]
\begin{lemma}
    Let $g \in R[X]$ be \cloze{\fcemph{primitive}}. Then $g$ is
    prime in $F[X]$ implies $g$ prime in $R[X]$.
\end{lemma}

\begin{proof}
    \cloze{
    Suppose $f_1, f_2 \in R[X]$ and $g \mid f_1
    f_2$ in $R[X]$. $g$ prime in $F[X]$ implies $g
    \mid f_1$ or $g \mid f_2$ in $F[X]$ hence by
    Lemma 11.4, $g \mid f_1$ or $g \mid f_2$ in
    $R[X]$, i.e. $g$ prime in $R[X]$.
}
\end{proof}
\end{flashcard}

\myskip
Now we can finally prove Theorem 11.1:

\begin{proof}[Proof of Theorem 11.1]
    Let $f \in R[X]$. Write $f = c(f) f_0$ with
    $f_0 \in R[X]$ primitive. $R$ a UFD implies
    $c(f)$ a product of irreducibles in $R$ (which
    are irreducible in $R[X]$). If $f_0$ not
    irreducible, say $f_0 = gh$, then $\deg(g),
    \deg(h) > 0$ since $f_0$ primitive, and $g, h$
    primitive.

    \myskip
    By induction on degree, $f_0$ a product of
    irreducibles in $R[X]$ -- establishes (i) in
    definition of UFD. By Proposition 10.6,
    suffices to show that if $f \in R[X]$ is
    irreducible, then $f$ is prime. Write $f =
    c(f) f_0$, $f_0 \in R[X]$ primitive. Then $f$
    irreducible implies $f$ constant or primitive.
    \begin{itemize}
        \item Case $f$ constant: $f$ irreducible
            in $R[X]$ implies $f$ irreducible in
            $R$, hence prime in $R$ (since UFD), hence $f$
            prime in $R[X]$ by Corollary 11.3.
        \item Case $f$ primitive: $f$ irreducible
            in $R[X]$ implies $f$ irreducible in
            $F[X]$ (Gauss's Lemma), hence $f$
            prime in $F[X]$ ($F[X]$ an ED hence UFD), hence
            $f$ prime in $R[X]$ by Lemma 11.5.
            \qedhere
    \end{itemize}
\end{proof}

\begin{remark*}
    By Lemma 10.2, the three implications in the
    $f$ primitive case are actually equivalences.
\end{remark*}


