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

\begin{remark*}
    If $\characteristic(R) = n$, then $\ZZ / n\ZZ \le R$. So
    if $R$ is an integral domain, then $\ZZ / n\ZZ$
    is an integral domain. Therefore $n\ZZ
    \normalsub \ZZ$ a prime ideal, therefore $n =
    0$ or $p$ a prime. In particular, a field has
    characteristic $0$ (and contains $\QQ$) or has
    characteristic $p$ (and contains $\FF_p \cong
    \ZZ / p\ZZ$).
\end{remark*}

\newpage
\section{Factorisation in integral domains}

This section: $R$ is an integral romain.

\begin{definition*}
    \begin{enumerate}[(i)]
        \item $a \in R$ is a unit if there exists
            $b \in R$ with $ab = 1$ (equivalently
            $(a) = R$). $R^\times \defeq
            \text{units in $R$}$.
        \item
            \begin{flashcard}[a-divides-b-defn]
            $a \in R$ divides $b \in R$ (written
            $a \mid b$) if \cloze{there exists $c \in R$
            such that $b = ac$ (equivalently $(b)
            \subseteq (a)$).}
            \end{flashcard}
        \item
            \begin{flashcard}[associate-defn]
            $a, b \in R$ are associate if \cloze{$a =
            bc$ for some unit $c \in R^\times$
            (equivalently $(a) = (b)$, or $a \mid
            b$ and $b \mid a$).}
            \end{flashcard}
        \item
            \begin{flashcard}[irreducible-defn]
            $r \in R$ is irreducible if \cloze{$r \neq
            0$, $r$ is not a unit and
            \[ r = ab \implies \text{$a$ or $b$ is
            a unit} \]}
            \end{flashcard}
        \item
            \begin{flashcard}[prime-defn]
            $r \in R$ is prime if \cloze{$r \neq 0$,
            $r$ is not a unit and
            \[ r \mid ab \implies r \mid a \text{
            or } r \mid b \]}
            \end{flashcard}
    \end{enumerate}
\end{definition*}

\begin{note*}
    These properties depend on ambient ring $R$.
    For example:
    \begin{itemize}
        \item 2 is prime and irreducible in
            $\ZZ$, but not in $\QQ$.
        \item $2X$ is irreducible in $\QQ[X]$, but
            not in $\ZZ[X]$.
    \end{itemize}
\end{note*}

\begin{hiddenflashcard}[prime-ideal-iff-prime]
For which rings is the following true?
\[ (r) \normalsub R \text{ is a prime ideal}
\iff r = 0 \text{ or } r \text{ is prime} \]
\cloze{Integral domains.}
\end{hiddenflashcard}

\begin{flashcard}[prime-ideal-iff-prime-proof]
\begin{lemma}
    $(r) \normalsub R$ is a prime ideal if and
    only if \cloze{$r = 0$ or is a prime.}
    \prompt{($R$ an \cloze{\fcemph{integral
    domain}}).}
\end{lemma}

\begin{proof}
    \begin{itemize}
        \item[$\Rightarrow$] \cloze{Suppose $(r)$ is
            prime and $r \neq 0$. Since prime
            ideals are proper, $(r) \neq R$, so $r
            \not\in R^\times$. If $r \mid ab$,
            then $ab \in (r)$ so $a \in (r)$ or $b
            \in (r)$ hence $r \mid a$ or $r \mid
            b$, i.e. $r$ is prime.}
        \item[$\Leftarrow$] \cloze{$\{0\} \normalsub R$
            is a prime ideal since $R$ an integral
            domain. Let $r \in R$ be a prime. If
            $ab \in (r)$, then $r \mid ab$ hence
            $r \mid a$ or $r \mid b$. Hence $a \in
            (r)$ or $b \in (r)$, i.e. $(r)$ is a
            prime ideal.}
    \end{itemize}
\end{proof}
\end{flashcard}

\begin{flashcard}[prime-implies-irreducible]
\begin{lemma}
    If $r \in R$ is prime, then it is irreducible.
    \prompt{($R$ an \cloze{\fcemph{integral
    domain}}).}
\end{lemma}

\begin{proof}
    \cloze{
    Since $r$ is prime, $r \neq 0$ and $r \not\in
    \RR^\times$. Suppose $r = ab$. Then $r \mid
    ab$ so $r \mid a$ or $r \mid b$. WLOG assume
    $r \mid a$, so $r = rc$ for some $c \in R$.
    Then $r = ab = rcb$, therefore $r(1 - bc) =
    0$. Then since $R$ is an integral domain and
    $r \neq 0$, $bc = 1$, i.e. $b$ is a unit.
}
\end{proof}
\end{flashcard}

\begin{example*}
    Let $R = \ZZ[\sqrt{-5}] = \{a + b\sqrt{-5} :
    a, b \in \ZZ\} \le \CC$ (note $R \cong \ZZ[X]
    / (X^2 + 5)$). $R$ a subring of $\CC$, so an
    integral domain. Define a function $N : R \to
    \ZZ_{\ge 0}$, $a + b\sqrt{-5} \mapsto a^2 +
    5b^2$ ``the norm''. Note that $N(z_1 z_2) =
    N(z_1) N(z_2)$.
\end{example*}

\begin{claim*}
    $R^\times = \{\pm 1\}$.
\end{claim*}

\begin{proof}
    If $r \in R^\times$, i.e. $rs = 1$ for some $s
    \in R$. Then $N(r)N(s) = N(1) = 1$ so $N(r) =
    1$. But only integer solutions to $a^2 + 5b^2
    = 1$ are $(a, b) = (0, 1), (-1, 0)$.
\end{proof}

\begin{claim*}
    $2 \in R$ is irreducible.
\end{claim*}

\begin{proof}
    Suppose $2 = rs$, $r, s \in R$. Then $4 = N(2)
    = N(r) N(s)$. Since $a^2 + 5b^2 = 2$ has no
    integer solutions $R$ has no elements of norm
    $2$. Thus $N(r) = 1$ and $N(2) = 4$ (or vice
    versa). But $N(r) = 1$ implies $r$ is a unit
    (for example $r \ol{r} = 1$).
\end{proof}

\myskip
By similar reasoning, $3$, $1 + \sqrt{-5}$, $1 - \sqrt{-5}$
are irreducible (as there are no elements of norm
3).

\myskip
Now $(1 + \sqrt{-5})(1 - \sqrt{-5}) = 6 = 2 \cdot
3$. Thus $2 \mid (1 + \sqrt{-5})(1 - \sqrt{-5})$,
but $2 \nmid 1 +\sqrt{-5}$ and $2 \nmid 1 -
\sqrt{-5}$ (check by taking norms, $4 \nmid 6$).
Thus $2$ is \emph{not} prime in $R$.

\subsubsection*{Takeaways}

\begin{enumerate}[(i)]
    \item Irreducible does not imply prime!
    \item $2 \cdot 3 = (1 + \sqrt{-5})(1 -
        \sqrt{-5})$ gives two different
        factorisations into irreducibles.
\end{enumerate}

\begin{remark*}
    Since $R^\times = \{\pm 1\}$, the irreducibles
    in (ii) are not associates.
\end{remark*}

\begin{flashcard}[PID-defn]
\begin{definition*}[Principal Ideal Domain]
    \cloze{
    An \fcemph{integral domain} $R$ is a principal ideal
    domain (PID) if every ideal $I \normalsub R$
    is principal, i.e. $I = (r)$ for some $r \in R$.
}
\end{definition*}
\end{flashcard}

\noindent
For example, $\ZZ$ is a PID by Lemma 8.3.

\begin{flashcard}[PID-irreducible-implies-prime]
\begin{proposition}
    Let $R$ be a PID. Then every irreducible
    element of $R$ \cloze{is prime.}
\end{proposition}

\begin{proof}
    \cloze{
    Let $r \in R$ be irreducible and $r \mid ab$,
    and assume $r \nmid a$. $R$ a PID implies $(a,
    r) = (d)$ for some $d \in R$. In particular $r
    = cd$ for some $c \in R$. Since $r$ is
    irreducible, either $c$ or $d$ is a unit. If
    $c$ a unit, then $(a, r) = (r)$ so $r \mid a$,
    contradiction. If $d$ a unit, then $(a, r) =
    R$. So there exists $s, t \in R$ such that $sa
    + tr = 1$. Then $b = sab + trb$, and since $r
    \mid ab$ we have $r \mid b$. Then $r$ is
    prime.
}
\end{proof}
\end{flashcard}
