\documentclass{article}

\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[UKenglish]{babel}
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{mathtools}
\usepackage{tikz-cd}
\usepackage{csquotes}

\newcommand{\F}{\mathbb{F}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\A}{\mathbb{A}}
\renewcommand{\P}{\mathbb{P}}

\newcommand{\val}[1]{\left. #1 \right\rvert}
\newcommand{\rb}[1]{\left( #1 \right)}
\renewcommand{\sb}[1]{\left[ #1 \right]}
\newcommand{\cb}[1]{\left\{ #1 \right\}}
\newcommand{\ab}[1]{\left\langle #1 \right\rangle}
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
\newcommand{\two}[2]{\begin{pmatrix} #1 \\ #2 \end{pmatrix}}
\newcommand{\three}[3]{\begin{pmatrix} #1 & #2 & #3 \end{pmatrix}}

\theoremstyle{definition}\newtheorem{definition}{Definition}[subsection]
\theoremstyle{definition}\newtheorem{remark}[definition]{Remark}
\theoremstyle{definition}\newtheorem*{example}{Example}
\theoremstyle{definition}\newtheorem*{note}{Note}
\newtheorem{proposition}[definition]{Proposition}
\newtheorem{lemma}[definition]{Lemma}
\newtheorem{theorem}[definition]{Theorem}
\newtheorem{corollary}[definition]{Corollary}

\pagestyle{fancy}
\lhead{M3P8 Algebra III}
\rhead{Autumn 2018}

\title{M3P8 Algebra III}
\author{Lectured by Dr David Helm \\ Typeset by David Kurniadi Angdinata}
\date{Autumn 2018}

\setcounter{section}{-1}

\begin{document}

\maketitle

\vfill

\tableofcontents

\pagebreak

\marginpar{Lecture 1 \\ Friday \\ 05/10/18}

\section{Introduction}

This course is an introduction to ring theory. The topics covered will include ideals, factorisation, the theory of field extensions, finite fields, polynomial rings in several variables, and the theory of modules.

In addition to the lecture notes, the following will cover much of the material we will be studying.

\begin{enumerate}
\item M Artin, Algebra, 1991
\end{enumerate}

Rings are contexts in which it makes sense to add and multiply. For example, $ \Z $, $ \Q $, $ \R $, $ \C $, polynomials, functions $ \cb{0, 1} \to \R $, and $ \Z / n\Z $ are rings. The goals of this course include
\begin{enumerate}
\item to unify arguments that apply in all of the above contexts, and
\item to study relationships between different rings.
\end{enumerate}
The applications of rings include
\begin{enumerate}
\item number theory, by studying extensions of $ \Z $ in which particular Diophantine equations have solutions, for example $ n = x^2 + y^2 = \rb{x + iy}\rb{x - iy} $ to study solutions in $ \Z\cb{i} $ and pass to result about $ \Z $,
\item algebraic geometry, by the study of zero sets of polynomials in several variables via rings of functions, and
\item topology, by cohomology classes of topological spaces.
\end{enumerate}

\section{Basic definitions and examples}

\subsection{Rings}

Recall the definition of a commmutative ring.

\begin{definition}
A \textbf{commutative ring with identity} $ R $ is a set together with two binary operations $ +_R, \cdot_R : R \times R \to R $, addition and multiplication, and two distinguished elements $ 0_R $ and $ 1_R $ such that the following holds.
\begin{enumerate}
\item The operation $ +_R $ makes $ R $ into an abelian group with identity $ 0_R $.
\begin{enumerate}
\item For all $ r \in R $, $ 0_R +_R r = r +_R 0_R = 0_R $ (additive identity).
\item For all $ r, s, t \in R $, $ \rb{r +_R s} +_R t = r +_R \rb{s +_R t} $  (associativity of $ +_R $).
\item For all $ r, s \in R $, $ r +_R s = s +_R r $ (commutativity of $ +_R $).
\item For all $ r \in R $, there exists $ -r \in R $ such that $ r +_R \rb{-r} = \rb{-r} +_R r = 0_R $ (additive inverses).
\end{enumerate}
\item The operation $ \cdot_R $ is associative and commutative with identity $ 1_R $.
\begin{enumerate}
\item For all $ r \in R $, $ 1_R \cdot_R r = r \cdot_R 1_R = 1_R $ (multiplicative identity).
\item For all $ r, s, t \in R $, $ \rb{r \cdot_R s} \cdot_R t = r \cdot_R \rb{s \cdot_R t} $ (associativity of $ \cdot_R $).
\item For all $ r, s \in R $, $ r \cdot_R s = s \cdot_R r $ (commutativity of $ \cdot_R $).
\end{enumerate}
\item Multiplication distributes over addition.
\begin{enumerate}
\item For all $ r, s, t \in R $, $ r \cdot_R \rb{s +_R t} = r \cdot_R s +_R r \cdot_R t $ and $ \rb{s +_R t} \cdot_R r = s \cdot_R r +_R t \cdot_R r $ (distributivity of $ \cdot $ over $ + $).
\end{enumerate}
\end{enumerate}
\end{definition}

There is some redundancy here, of course. I have written things this way so that one obtains the definition of a noncommutative ring simply by removing the condition that multiplication is commutative. In this course, however, all rings will be commutative.

\begin{proposition}
Let $ R $ be a ring. Then for all $ r \in R $, $ r \cdot_R 0_R = 0_R $.
\end{proposition}

\begin{proof}
$ r \cdot_R 0_R = r \cdot_R \rb{0_R +_R 0_R} = r \cdot_R 0_R +_R r \cdot_R 0_R $. Thus $ 0_R = -\rb{r \cdot_R 0_R} +_R \rb{r \cdot_R 0_R} = -\rb{r \cdot_R 0_R} +_R \rb{r \cdot_R 0_R +_R r \cdot_R 0_R} = r \cdot_R 0_R $.
\end{proof}

Some people require $ 0_R \ne 1_R $ in $ R $.

\begin{proposition}
If $ 0_R = 1_R $, then $ R = \cb{0_R} $.
\end{proposition}

\begin{proof}
$ 0_R = r \cdot_R 0_R = r \cdot_R 1_R = r $.
\end{proof}

When it is clear from the context what ring we are working with, we will write $ 0_R $ and $ 1_R $ as $ 0 $ and $ 1 $, $ a +_R b $ as $ a + b $ and $ a \cdot_R b $ as $ ab $.

\begin{definition}
A ring $ R $ is a \textbf{field} if $ R \ne \cb{0_R} $ and every nonzero element of $ R $ has a multiplicative inverse, that is for every $ r \in R \setminus \cb{0_R} $ there exists $ r^{-1} \in R $ such that $ rr^{-1} = r^{-1}r = 1_R $.
\end{definition}

We do not consider the zero ring $ \cb{0_R} $ to be a field. We have seen many examples of rings at this point. The sets $ \Z $, $ \Q $, $ \R $, $ \C $ are all rings with their usual notion of addition and multiplication. All of them but $ \Z $ are in fact fields. As another example, we have the ring $ \Z / n\Z $ of integers modulo $ n $. Let $ n \in \Z_{> 0} $, and recall that $ a $ and $ b $ are said to be congruent modulo $ n $ if $ a - b $ is divisible by $ n $. It is easy to check that this is an equivalence relation on $ \Z $. Moreover, since any $ a \in \Z $ can uniquely be written as $ qn + r $ with $ q, r \in \Z $ and $ 0 \le r < n $, the set $ \cb{\sb{0}_n, \dots, \sb{n - 1}_n} $ is a complete list of the equivalence classes under this relation, where $ \sb{a}_n $ denotes the set of all integers congruent to $ a \mod n $. We denote this $ n $-element set by $ \Z / n\Z $, and we can define addition and multiplication in $ \Z / n\Z $ by setting $ \sb{a}_n + \sb{b}_n = \sb{a + b}_n $ and $ \sb{a}_n\sb{b}_n = \sb{ab}_n $. This defines a ring structure on $ \Z / n\Z $ once one checks that it is well-defined. This is the first example of a general construction of the quotient of a ring by an ideal we will define later.

\marginpar{Lecture 2 \\ Monday \\ 08/10/18}

\subsection{Polynomial rings}

A very important class of rings that we will study are the polynomial rings. Let $ R $ be any ring. Then we can form a new ring $ R\sb{X} $, called the \textbf{ring of polynomials in $ X $ with coefficients in $ R $}. Informally, a polynomial in $ R\sb{X} $ is a finite sum of the form $ r_0 + \dots + r_nX^n $ for some $ n \in \Z_{\ge 0} $ and $ r_i \in R $. If $ n > m $, we consider $ r_0 + \dots + r_nX^n $ to represent the same polynomial of $ R\sb{X} $ as $ s_0 + \dots + s_mX^m $ if $ r_i = s_i $ for $ i \le m $ and $ r_i = 0_R $ for $ i > m $. That is, you can pad out a polynomial with terms of the form $ 0_RX^i $ without changing it. From a formal standpoint, it is better to define a polynomial to be an infinite sum $ \sum_{n = 0}^\infty r_iX^i $ for $ r_i \in R $ in which all but finitely many $ r_i $ are zero. This makes it easier to define addition and multiplication. The \textbf{degree} of such an expression is the largest $ i $ such that $ r_i $ is nonzero. We add and multiply in $ R\sb{X} $ just as we would any other polynomials, by
$$ \rb{\sum_{i = 0}^\infty r_iX^i} +_{R\sb{X}} \rb{\sum_{i = 0}^\infty s_iX^i} = \sum_{i = 0}^\infty \rb{r_i +_R s_i} X^i, $$
$$ \rb{\sum_{i = 0}^\infty r_iX^i} \cdot_{R\sb{X}} \rb{\sum_{i = 0}^\infty s_iX^i} = \sum_{i = 0}^\infty \rb{\sum_{j = 0}^i \rb{r_j \cdot_R s_{i - j}}} X^i. $$
What about polynomial rings in more than one variable? Since the construction of polynomial rings takes an arbitrary ring as input, one can iterate it. Start with a ring $ R $, and consider first the ring $ R\sb{X} $ and then the ring $ \rb{R\sb{X}}\sb{Y} $. An polynomial of this has the form $ \sum_{i = 0}^\infty \rb{\sum_{j = 0}^\infty r_{ij}X^j}Y^i $ for $ r_{ij} \in R $. On the other hand, we can consider the ring $ \rb{R\sb{Y}}\sb{X} $, whose polynomials have the form $ \sum_{i = 0}^\infty \rb{\sum_{j = 0}^\infty s_{ij}Y^j}X^i $ for $ s_{ij} \in R $. Alternatively, we could consider the ring $ R\sb{X, Y} $ whose polynomials are formal expressions of the form $ \sum_{i = 0}^\infty \rb{\sum_{i = 0}^\infty r_{ij}X^i}Y^j $ with only finitely many nonzero coefficients $ r_{ij} $ and define addition and multiplication in the usual way. It is not hard to see that all three approaches yield the same ring. There is a bijection between these expressions. We will therefore primarily use notation like $ R\sb{X, Y} $ for polynomial rings in multiple variables, but we will occasionally need to know that this is the same as $ \rb{R\sb{X}}\sb{Y} $ or $ \rb{R\sb{Y}}\sb{X} $. The identification we have made here is an example of an isomorphism of rings, a notion we will make precise later.

\subsection{Subrings and extensions}

\begin{definition}
Let $ R $ be a ring. A subset $ S $ of $ R $ is a \textbf{subring} of $ R $ if
\begin{enumerate}
\item $ 0_R, 1_R, -1_R \in S $.
\item $ S $ is closed under $ +_R $ and $ \cdot_R $, so if $ r, s \in S $, then so are $ r +_R s $ and $ r \cdot_R s $.
\end{enumerate}
\end{definition}

Subrings inherit the additive and multiplicative structures from the ring that contains them, and are thus themselves rings.

\begin{example}
$ \Z $ is a subring of $ \R $, which is itself a subring of $ \C $.
\end{example}

It is easy to see that the intersection of two subrings of $ R $, or even an arbitrary collection of subrings of $ R $, is also a subring of $ R $.

\begin{definition}
Let $ S \subseteq R $ be a subring of a ring $ R $, and let $ \alpha $ be an element of $ R $. We can then form a subring $ S\sb{\alpha} $ of $ R $, called the \textbf{subring of $ R $ generated by $ \alpha $ over $ S $}, consisting of all elements of $ R $ that can be expressed as $ r_0 + \dots + r_n\alpha^n $ for some $ n \in \Z^* $, and $ r_i \in S $.
\end{definition}

This operation is known as \textbf{adjoining} the element $ \alpha $ to the ring $ S $. An alternative way of defining the ring $ S\sb{\alpha} $ is to note that it is the smallest subring of $ R $ containing $ S $ and $ \alpha $. In one direction, any such subring contains every expression of the form $ r_0 + \dots + r_n\alpha^n $, with $ r_i \in S $, so any subring of $ R $ containing $ S $ and $ \alpha $ contains $ S\sb{\alpha} $. One can thus construct $ S\sb{\alpha} $ as the intersection of every subring of $ R $ containing $ S $ and $ \alpha $. Since the intersection of any collection of subrings of $ R $ is a subring of $ R $ it is clear that this intersection is equal to $ S\sb{\alpha} $ as defined above.

\begin{example}
Let $ i $ denote a square root of $ -1 $ in $ \C $. $ \Z \subseteq \C $ and $ i $ form $ \Z\sb{i} $. Note $ -1 = i^2 = i^6 = i + i^3 + i^{10} $.
\end{example}

\begin{proposition}
Every element of $ \Z\sb{i} $ can be uniquely expressed as $ a + bi $ for $ a, b \in \Z $.
\end{proposition}

\begin{example}
Given $ \sum_{n = 0}^\infty a_ni^n $ with only finitely many $ a_n $ nonzero, set $ a = a_0 - a_2 + \dots $ and $ b = a_1 - a_3 + \dots $. Then $ \sum_{n = 0}^\infty a_ni^n = a + bi $. For uniqueness, if $ a + bi = c + di $ in $ \C $ for $ a, b, c, d \in \Z $, then $ a = c $ or $ b = d $.
\end{example}

If $ \alpha $ is more complicated then the elements of $ R\sb{\alpha} $ may well be harder to describe.

\begin{example}
If $ \alpha $ is the real cube root of $ 2 $, then every element of $ \Z\sb{\alpha} $ can be uniquely expressed as $ a + b\alpha + c\alpha^2 $ for $ a, b, c \in \Z $.
\end{example}

\begin{example}
In $ \Z\sb{\pi} $, any element has a unique expression in the form $ \sum_{n = 0}^\infty a_n\pi^n $ for all but finitely many $ a_n $ are zero. Suppose $ \sum_{n = 0}^\infty a_n\pi^n = \sum_{n = 0}^\infty b_n\pi^n $, then $ 0 = \sum_{n = 0}^\infty \rb{a_n - b_n}\pi^n $. Since $ \pi $ is transcendental, this polynomial must be zero. Thus each $ a_n = b_n $.
\end{example}

\begin{example}
The elements of $ \Z\sb{\tfrac{1}{2}} $ can be expressed uniquely as $ a / b $, where $ b $ is a power of $ 2 $ and $ a $ is odd unless $ b = 1 $.
\end{example}

\begin{example}
Let $ \alpha $ be a root of $ x^2 - \tfrac{1}{2}x + 1 $. Then $ \alpha^2 \in \Z\sb{\alpha} $ and $ \alpha^2 = \alpha / 2 - 1 $. Can show that every element of $ \Z\sb{\alpha} $ can be expressed as $ a + b\alpha $ for $ a, b \in \Z\sb{\tfrac{1}{2}} $, but not every $ a + b\alpha $ arises $ a, b \in \Z\sb{\tfrac{1}{2}} $.
\end{example}

\marginpar{Lecture 3 \\ Wednesday \\ 10/10/18}

\subsection{Integral domains and rings of fractions}

\begin{definition}
A \textbf{zero divisor} in a ring $ R $ is a nonzero element $ r $ of $ R $ such that there exists a nonzero $ s \in R $ with $ rs = 0 $. A ring $ R $ in which there are no zero divisors is called an \textbf{integral domain}.
\end{definition}

\begin{example}
$ \Z $ is an integral domain and any subring of a field is an integral domain, but $ \Z / 6\Z $ is not an integral domain, as $ \sb{2}\sb{3} $ is zero modulo $ 6 $ even though neither $ \sb{2} $ nor $ \sb{3} $ is zero modulo $ 6 $.
\end{example}

If $ R $ is an integral domain, then we can form the field of fractions of $ R $ in analogy to the way we build $ \Q $ from $ \Z $.

\begin{definition}
Let $ R $ be an integral domain. The \textbf{field of fractions} $ K\rb{R} $ is the set of equivalence classes of expressions of the form $ a / b $ for $ a, b \in R $, $ b \ne 0 $, where $ a / b \sim a' / b' $ if and only if $ ab' = a'b $. We add and multiply elements of $ K\rb{R} $ just as we do for fractions, by
$$ \dfrac{a}{b} + \dfrac{a'}{b'} = \dfrac{ab' + a'b}{bb'}, \qquad \dfrac{a}{b} \cdot \dfrac{a'}{b'} = \dfrac{aa'}{bb'}, \qquad 0_{K\rb{R}} = \dfrac{0_R}{1_R}, \qquad 1_{K\rb{R}} = \dfrac{1_R}{1_R}. $$
If $ a \ne 0 $ in $ R $, then $ b / a \in K\rb{R} $, so $ \rb{a / b} \cdot \rb{b / a} = ab / ba \sim 1 / 1 $.
\end{definition}

Then $ K\rb{R} $ is a field, and it contains $ R $ in a natural way as a subring if we identify $ r $ with $ r / 1_R \in K\rb{R} $. The field $ K\rb{R} $ is in some sense the smallest field containing $ R $ as a subring. When we talk about homomorphisms and isomorphisms, we will be able to state this more precisely. More generally, a subset $ S $ of $ R $ is a \textbf{multiplicative system} if $ 1 \in S $ and $ 0 \notin S $, and $ S $ is closed under multiplication, that is if $ a, b $ are in $ S $ then so is $ ab $. For any integral domain $ R $ and any multiplicative system $ S $, we can define $ S^{-1}R \subseteq K\rb{R} $ consisting of all fractions of the form $ a / b $ with $ b \in S $. It is easy to see that his is closed under addition and multiplication, and defines a ring in between $ R $ and $ K\rb{R} $.

\begin{example}
If $ R = \Z $ and $ S $ is the set of powers of $ 2 $, then $ S^{-1}R = \Z\sb{\tfrac{1}{2}} $. On the other hand, if $ S $ is the set of odd integers, then $ S^{-1}R $ is the set of all rational numbers of the form $ a / b $ with $ b $ odd.
\end{example}

In general $ S^{-1}R $ is the smallest subring of $ K\rb{R} $ containing $ R $ in which every element of $ S $ has a multiplicative inverse, that is $ b^{-1} \in S $ for all $ b \in S $. The process of obtaining $ S^{-1}R $ from $ R $ is called \textbf{localisation} and is an extremely powerful tool. One can even make sense of it when $ R $ is not an integral domain, but one has to be more careful. The equivalence relation on fractions is tricker, for example. We will not discuss this in this course but it will be quite useful in future courses.

\section{Homomorphisms, ideals, and quotients}

\subsection{Homomorphisms}

Let $ R $ and $ S $ be rings. A ring homomorphism from $ R $ to $ S $ is, roughly, a way of interpreting elements of $ R $ as elements of $ S $, in a way that is compatible with the addition and multiplication laws on $ R $ and $ S $. More precisely is the following.

\begin{definition}
A function $ f : R \to S $ is a \textbf{ring homomorphism} if
\begin{enumerate}
\item $ f\rb{1_R} = 1_S $,
\item for all $ r, r' \in R $, $ f\rb{r +_R r'} = f\rb{r} +_S f\rb{r'} $, and
\item for all $ r, r' \in R $, $ f\rb{r \cdot_R r'} = f\rb{r} \cdot_S f\rb{r'} $.
\end{enumerate}
\end{definition}

\begin{note}
If $ f $ is a homomorphism then $ f\rb{0_R} = f\rb{0_R + 0_R} = f\rb{0_R} +_S f\rb{0_R} $ gives $ f\rb{0_R} = 0_S $. Thus we do not need to require this as an axiom. On the other hand we do need to require $ f\rb{1_R} = 1_S $. For certain $ R, S $ one can construct examples of maps $ f : R \to S $ that satisfy properties $ 2 $ and $ 3 $ of the definition without satisfying property $ 1 $.
\end{note}

\begin{example}
If $ R $ is a subring of $ S $, then the inclusion of $ R $ into $ S $, such as $ \Z \subset \Q \subset \R \subset \C $, is a homomorphism. This is just a fancy way of saying that the addition and multiplication on $ R $ are induced from the corresponding operations on $ S $.
\end{example}

\begin{example}
The composition of two homomorphisms is a homomorphism, as is easily checked from the definitions.
\end{example}

\begin{example}
The map $ \Z \to \Z / n\Z $ that takes an integer $ m $ into its congruence class modulo $ n $ is also a homomorphism. In fact, this is a special case of the following construction.
\end{example}

\begin{proposition}
Let $ R $ be any ring. Then there is a unique ring homomorphism $ f : \Z \to R $ such that
$$ f\rb{n} = \begin{cases} 1_R + \dots + 1_R & n > 0 \\ -\rb{1_R + \dots + 1_R} & n < 0 \\ 0_R & n = 0 \end{cases}. $$
\end{proposition}

\begin{proof}
Let $ f : \Z \to R $ be a homomorphism. Then, directly from the definition, we have $ f\rb{0} = 0_R $ and $ f\rb{1} = 1_R $. In particular for all $ n > 0 $, $ f\rb{n} = f\rb{1 + \dots + 1} = 1_R +_R \dots +_R 1_R $, where there are $ n $ copies of $ 1_R $ in the sum. Moreover, $ 0_R = f\rb{n + \rb{-n}} = f\rb{n} + f\rb{-n} $, so $ f\rb{-n} = -\rb{1_R +_R \dots +_R 1_R} $. Thus $ f\rb{n} $ is determined, for all $ n $, completely by the fact that $ f $ is a homomorphism. In the converse direction, it is not hard to check that the map defined above is in fact a homomorphism.
\end{proof}

Thus, for any ring $ R $, we can regard an integer as an element of $ R $ via this homomorphism.

\begin{definition}
A bijective homomorphism $ f : R \to S $ is called an \textbf{isomorphism}. Write $ S \cong R $ for $ S $ is isomorphic to $ R $.
\end{definition}

In this case one verifies easily that the inverse map $ f^{-1} : S \to R $ is also a bijective homomorphism.

\subsection{Evaluation homomorphisms}

Let $ R $ be a ring, and consider the ring $ R\sb{X} $ of polynomials in $ X $ with coefficients in $ R $. If $ s $ is an element of $ R $, then we can define a homomorphism $ R\sb{X} \to R $ by \textbf{evaluation at $ s $}. More precisely, given an element of $ R\sb{X} $ of the form $ P\rb{X} = r_0 + \dots + r_nX^n $ for some $ n $ and $ r_i \in R $. Then $ P\rb{s} $ for $ s \in R $ is defined to be $ P\rb{s} = r_0 + \dots + r_ns^n \in R $. Consider the map $ \phi_s : R\sb{X} \to R $ that sends $ \phi_s\rb{P} $ to $ P\rb{s} $. In effect, it substitutes $ s $ for $ X $. It is easy to check that this is in fact a ring homomorphism. More generally, if $ R $ and $ S $ are rings and $ f : R \to S $ is a homomorphism, and $ s $ is an element of $ S $, then we can define a map
$$ \phi_{s, f} : R\sb{X} \to S, $$
by setting
$$ \phi_{s, f}\rb{r_0 + \dots + r_nX^n} = f\rb{r_0} + \dots + f\rb{r_n}s^n. $$
That is, by appling $ f $ to the coefficients and substituting $ s $ for $ X $. Again, this is clearly a homomorphism. The evaluation homomorphisms $ \phi_{s, f} $ are a fundamental property of polynomial rings. In some sense, they are the reason polynomial rings are worth studying. In fact, the ring $ R\sb{X} $ is uniquely characterised by the fact that homomorphisms from $ R\sb{X} $ to $ S $ are in bijection with pairs $ \rb{s, f} $, where $ f : R \to S $ is a homomorphism and $ s $ is an element of $ S $.

\subsection{Images, kernels, and ideals}

\begin{definition}
Let $ f : R \to S $ be a homomorphism. The \textbf{image} of $ f $ is $ Im\rb{f} = \cb{f\rb{r} \mid r \in R} \subseteq S $. The \textbf{kernel} of $ f $ is $ Ker\rb{f} = \cb{r \in R \mid f\rb{r} = 0} \subseteq R $.
\end{definition}

The image of a homomorphism $ f : R \to S $ is easily seen to be a subring of $ S $.

\begin{example}
If $ R $ is a subring of $ S $, $ f : R \to S $ is the inclusion and $ s $ lies in $ S $, then the image of the map $ \phi_{s, f} : R\sb{X} \to S $ is precisely the subring $ R\sb{s} $ of $ S $.
\end{example}

By contrast, the kernel of a homomorphism $ f $ is almost never a subring of $ R $. For instance, subrings contain the identity. However, it is an ideal of $ R $.

\marginpar{Lecture 4 \\ Friday \\ 12/10/18}

\begin{definition}
A nonempty subset $ I $ of $ R $ is an \textbf{ideal} of $ R $ if $ I $ is closed under addition, that is for all $ i, j \in I $, $ i + j \in I $, and for all $ i \in I $, $ r \in R $, $ ri \in I $.
\end{definition}

Then one can verify, directly from the definition, that the kernel of any homomorphism $ f : R \to S $ is an ideal of $ R $.

\begin{note}
Any ideal of $ R $ contains $ 0_R $, and conversely the subset $ \cb{0_R} $ of $ R $ is an ideal, called the \textbf{zero ideal}. A homomorphism $ f : R \to S $ is injective if and only if its kernel is the zero ideal. Forward direction is easy. Conversely, if $ f\rb{x} = f\rb{y} $, $ f\rb{x - y} = 0 $, so $ x - y \in Ker\rb{f} $. If $ Ker\rb{f} = \cb{0} $, $ x = y $.
\end{note}

The kernel of the homomorphism $ \Z \to R $ is either the zero ideal, or the ideal of multiples of $ n $ in $ \Z $ for some positive $ n $. We say that $ R $ has characteristic zero or characteristic $ n $, respectively. If not zero, the \textbf{characteristic} of $ R $ is the smallest $ n $ such that the sum of $ n $ copies of $ 1_R $ is equal to zero.

\subsection{Ideals: examples and basic operations}

If $ r $ is an element of $ R $, then any ideal containing $ R $ contains any multiple $ sr $ of $ R $, for any $ r $ in $ S $. Conversely, one checks easily that the set $ \cb{sr \mid s \in R} $ is an ideal of $ R $. It is known as the \textbf{ideal of $ R $ generated by $ r $}, and denoted $ \ab{r} $. An ideal generated by one element in this way is called a \textbf{principal ideal}.

\begin{note}
The ideal generated by $ 1_R $, or more generally by any element of $ R $ with a multiplicative inverse, is all of $ R $. This ideal is called the \textbf{unit ideal} of $ R $.
\end{note}

\begin{proposition}
$ R $ is a \textbf{field} if and only if the only ideals of $ R $ are the zero ideal $ \cb{0} $ and the unit ideal $ R $.
\end{proposition}

\begin{proof}
If $ R $ is a field, let $ I \subseteq R $ be a nonzero ideal. There exists $ r \in I \ne  0 $. Then for all $ s \in R $, $ \rb{sr^{-1}}\rb{r} \in I $, so $ s \in I $ for all $ s \in R $. Conversely, if $ R $ has only zero ideal, unit ideal, let $ r \in R \ne 0 $, let $ I \cb{sr \mid s \in R} $. This is an ideal not zero ideal, so it is all of $ R $. In particular, $ 1 \in I $, so there exists $ s \in R $ such that $ sr = 1 $.
\end{proof}

More generally is the following.

\begin{definition}
If $ S $ is a subset of elements of $ R $, then any ideal containing $ S $ consists of all elements of $ R $ the form $ r_0s_0 + \dots + r_ns_n $ for some $ n \in \Z_{\ge 0} $, $ r_i \in R $, and $ s_i \in S $. The intersection of all these ideals is an ideal of $ R $, known as the \textbf{ideal of $ R $ generated by $ S $}, and denoted $ \ab{S} $. It is also the smallest ideal of $ R $ containing $ S $.
\end{definition}

If $ S $ has one element, $ \ab{S} $ is a principal ideal. We will show soon that any ideal of $ \Z $ is a principal ideal, as is any ideal of the ring $ k\sb{X} $ for any field $ k $. On the other hand, there are rings in which not every ideal is principal.

\begin{example}
The ideal $ \ab{X, Y} $ of $ k\sb{X, Y} $ is not a principal ideal.
\end{example}

Given ideals $ I $ and $ J $ there are several ways to create new ideals.
\begin{enumerate}
\item If $ I, J $ are ideals, then the intersection $ I \cap J $ is an ideal. If $ I $ and $ J $ are given by generators, it might be hard to find generators for the intersection. Certainly it is not enough to intersect the generating sets.
\item The union of ideals is not usually an ideal. Taking $ R = \Z $, $ \ab{3} \cup \ab{5} $ contains $ 3, 5 $ but not $ 3 + 5 $.
\item If $ I, J $ are ideals, then the sum $ I + J $ is an ideal, which are all expressions of the form $ i + j $ for $ i \in I $, $ j \in J $. It is the smallest ideal containing both $ I $ and $ J $, and also the ideal generated by $ I \cup J $.
\item If $ I, J $ are ideals, the product $ I \cdot J $ or $ IJ $ is the ideal generated by elements of the form $ ij $ for $ i \in I $, $ j \in J $. This may be strictly larger than the set of such products.
\end{enumerate}

\begin{example}
Consider the product of the ideals $ I = \ab{X, Y} $ and $ J = \ab{Z, W} $ in $ R = k\sb{X, Y, Z, W} $ for $ k $ a field. The product $ IJ = \ab{XZ, XW, YZ, YW} $ contains $ XZ + YW $, but the latter is not a product of an element in $ I $ with an element in $ J $.
\end{example}

\begin{note}
Let $ I, J $ be general ideals. The product of $ I $ and $ J $ is always contained in the intersection of $ I $ and $ J $, but the two need not be equal, even in simple rings like $ \Z $. $ \ab{3} \cdot \ab{3} = \ab{9} \subseteq \Z $ and $ \ab{3} \cap \ab{3} = \ab{3} $.
\end{note}

\subsection{Quotients}

Let $ R $ be a ring and let $ I $ be an ideal of $ R $. If $ x, y $ are elements of $ R $, we say that $ x $ is \textbf{congruent to $ y $ modulo $ I $} if $ x - y $ is in $ I $. This is an equivalence relation on $ R $. We denote the equivalence class of $ r $ by $ r + I $, or the alternative notations $ \sb{r}_I $, $ \bar{r} $. It is the set $ \cb{r + s \mid s \in I} $. Let $ R / I $ denote the set of equivalence classes on $ R $ modulo $ I $. This set has the natural structure of a ring. The additive and multiplicative identities are $ 0_R + I $ and $ 1_R + I $, respectively, and addition and multiplication are defined by $ \rb{r + I} + \rb{s + I} = \rb{r + s} + I $ and $ \rb{r + I} \cdot \rb{s + I} = \rb{rs + I} $ respectively. One has to check that these are well-defined, but this is not difficult. The ring $ R / I $ is called the \textbf{quotient of $ R $ by the ideal $ I $}.

\begin{example}
If $ R = \Z $ and $ I $ is the ideal generated by $ n $, then $ R / I $ is the ring $ \Z / n\Z $ that we have already seen.
\end{example}

\begin{note}
There is a \textbf{reduction modulo $ I $} or \textbf{natural quotient} homomorphism $ R \to R / I $ defined by taking $ r $ to $ r + I $. This homomorphism is surjective with kernel $ I $.
\end{note}

We then have the following.

\begin{proposition}[Universal property of the quotient]
Let $ I \subseteq R $ be an ideal and let $ f : R \to S $ be a homomorphism, and suppose that the kernel of $ f $ contains $ I $. Then there is a unique homomorphism $ \bar{f} : R / I \to S $ such that for all $ r \in R $, $ \bar{f}\rb{r + I} = f\rb{r} $.
\end{proposition}

\begin{proof}
$ \bar{f} $ is necessarily unique, as every element of $ R / I $ has the form $ r + I $ for some $ r $. It thus suffices to show that it is well-defined and gives a homomorphism. If $ r + I = r' + I $, then $ r - r' \in I $, so $ f\rb{r - r'} = 0 $ gives $ f\rb{r} = f\rb{r'} $. Thus $ \bar{f} $ is well-defined. Checking that it is a homomorphism follows from $ f $ is a homomorphism.
\end{proof}

\begin{note}
The kernel of $ \bar{f} $ in the above proposition is just the image of the kernel of $ f $ in $ R / I $. If the kernel of $ f $ is equal to $ I $, this image is the zero ideal and $ \bar{f} $ is injective. In particular, any homomorphism of $ R $ to $ S $ can be thought of as an isomorphism of some quotient of $ R $ with a subring of $ S $.
\end{note}

\begin{example}
Let $ R \subseteq S $ be a subring, $ \alpha \in S $, and $ \iota : R \to S $ be the inclusion map. Recall that we have an evaluation at $ \alpha $ by $ \phi_{\iota, \alpha} : R\sb{X} \to S $. Image of this is $ R\sb{\alpha} $. Let $ I = Ker\rb{\phi_{\iota, \alpha}} $. Then $ \phi_{\iota, \alpha} $ descends to a map $ \phi_{\iota, \alpha} : R\sb{\alpha} / I \to S $ that is injective with image $ R\sb{\alpha} $. So $ R\sb{\alpha} $ is isomorphic to a quotient of $ R\sb{X} $.
\end{example}

\marginpar{Lecture 5 \\ Monday \\ 15/10/18}

\subsection{Prime and maximal ideals}

\begin{definition}
An ideal $ I $ of $ R $ is \textbf{prime} if the quotient $ R / I $ is an integral domain. It is \textbf{maximal} if $ R / I $ is a field.
\end{definition}

\begin{note}
As fields are integral domains, every maximal ideal is prime. The converse need not hold, of course. The zero ideal in $ \Z $ is prime but not maximal.
\end{note}

\begin{proposition}
An ideal $ I $ is prime if and only if for every pair of elements $ s, r $ in $ R $ such that $ rs $ is in $ I $, either $ r $ is in $ I $ or $ s $ is in $ I $.
\end{proposition}

\begin{proof}
This is just a restatement of the definition. $ R / I $ integral domain if and only if for all whenever two elements $ r + I $ and $ s + I $ in $ R / I $ satisfy $ \rb{r + I}\rb{s + I} = 0 + I $ in $ R / I $, either $ r + I = 0 + I $ or $ s + I = 0 + I $ in $ R / I $. This is the same as saying $ rs $ lies in $ I $ if and only if either $ r $ or $ s $ lies in $ I $.
\end{proof}

\begin{proposition}
An ideal $ I $ is maximal if and only if the only ideals of $ R $ containing $ I $ are $ I $ and the unit ideal $ R $.
\end{proposition}

This justifies the name maximal for such ideals.

\begin{proof}
First suppose that $ R / I $ is a field. Recall that $ R / I $ is a field if and only if only ideals of $ R / I $ are $ \cb{0} $ and $ R / I $. Given an ideal $ J \subseteq R / I $, let $ \widetilde{J} $ be the preimage of $ J $ under $ R \to R / I $. $ \widetilde{J} $ is an ideal containing $ I $ and contained in $ R $. Then $ J $ is either the zero ideal of $ R / I $, in which case $ \widetilde{J} $ is contained in, and thus equal to, $ I $, or $ J $ is all of $ R / I $, in which case $ \widetilde{J} $ contains $ I $ and an element of $ 1_R + I $, so $ \widetilde{J} $ contains $ 1_R $ and is thus the unit ideal of $ R $. Conversely, if the only ideals of $ R $ containing $ I $ are $ I $ and the unit ideal, then for any $ r $ in $ R \setminus I $, the ideal of $ R $ generated by $ I $ and $ r $ contains $ 1_R $. We can thus write $ 1_R = rs + i $, where $ i \in I $ and $ s \in R $. This means that $ s + I $ and $ r + I $ are multiplicative inverses of each other in $ R / I $, so $ R / I $ is a field.
\end{proof}

\section{Factorisation}

In these notes $ R $ always denotes an integral domain.

\subsection{Divisibility, units, associates, and irreducibles}

\begin{definition}
Let $ r, s $ be elements of $ R $. We say $ r $ \textbf{divides} $ s $, written $ r \mid s $, if there exists $ r' \in R $ with $ rr' = s $, or, equivalently, $ s $ lies in the principal ideal $ \ab{r} $ generated by $ r $. An element $ r $ that divides $ 1_R $ is called a \textbf{unit} of $ R $, or, equivalently, $ \ab{r} = R $.
\end{definition}

The set of units in $ R $ forms a group under multiplication denoted $ R^* $. For any element $ r \in R $ and any unit $ u $ of $ R $, both $ u $ and $ ur $ divide $ r $.

\begin{definition}
The set of elements of $ R $ of the form $ ur $, with $ r \in R^* $ are called \textbf{associates} of $ R $, that is $ r, r' $ are associates if $ r = ur' $ for a unit $ u \in R^* $.
\end{definition}

This implies $ r \mid r' $, that is there exists $ u' $ with $ u'u = 1 $ and $ u'r = r' $.

\begin{note}
The principal ideals $ \ab{r} $ and $ \ab{r'} $ are equal if and only if $ r $ and $ r' $ are associates.
\end{note}

\begin{definition}
A nonzero element $ r $ of $ R $ is called \textbf{irreducible} if $ r $ is not a unit and the only elements of $ R $ that divide $ r $ are the units and the associates of $ r $.
\end{definition}

\subsection{Unique factorisation domains}

An interesting question is when elements of rings admit unique factorisations into irreducibles. To that end we define the following.

\begin{definition}
A \textbf{unique factorisation domain} (UFD) is a ring $ R $ in which
\begin{enumerate}
\item every nonunit, nonzero element $ r \in R $ admits a factorisation as a finite product of irreducibles in $ R $, and
\item if $ r = p_1 \dots p_n = q_1 \dots q_m \in R $ are two factorisations of $ r $ as products of irreducibles $ p_i, q_i $, then $ n = m $ and, up to permuting the $ q_i $, each $ q_i $ is an associate of $ p_i $.
\end{enumerate}
\end{definition}

\begin{example}
Both conditions can fail.
\begin{enumerate}
\item There are certainly domains in which $ 1 $ can fail, although they are somewhat exotic. One example is to take the rational polynomial ring $ R = \C\sb{X^\Q} $ with coefficients in $ \C $, whose entries are finite formal sums $ \sum_{i = 0}^N a_iX^{n_i} $ where the $ a_i $ are in $ \C $ and the $ n_i $ are nonnegative rational numbers $ \Q_{\ge 0} $. Any element of $ R $ is a polynomial in $ X^{1 / n} $ for some $ n $. The element $ X $ of this ring is not a unit, and also not a finite product of irreducibles. In $ \C\sb{X^{1 / n}} $, $ X $ factors as $ \rb{X^{1 / n}}^n $. $ X $ has no factorisation into irreducibles in $ R $. We will show later that a very mild finiteness condition on a domain $ R $, the condition that $ R $ is Noetherian, actually guarantees that $ 1 $ holds.
\item Even if $ 1 $ holds, $ 2 $ often fails. The classic example of this is $ R = \Z\sb{\sqrt{-5}} $, in which $ 2, 3, 1 + \sqrt{-5}, 1 - \sqrt{-5} $ are all irreducibles, none are associates of each other, yet $ \rb{2}\rb{3} = \rb{1 + \sqrt{-5}}\rb{1 - \sqrt{-5}} $.
\end{enumerate}
\end{example}

Another way to interpret condition $ 2 $ is as follows.

\begin{definition}
We say an element $ r $ of $ R $ is \textbf{prime} if the principal ideal $ \ab{r} $ of $ R $ is a prime ideal. In other words, for any $ s, s' $ in $ R $, if $ r $ divides $ ss' $, then $ r \mid s $ or $ r \mid s' $.
\end{definition}

\begin{lemma}
Prime elements are irreducible.
\end{lemma}

\begin{proof}
If $ r $ is prime and $ s $ divides $ r $, we can write $ r = ss' $. Then since $ r $ divides $ ss' $ we have that either $ r $ divides $ s $, in which case $ rs'' = s $, then $ ss's'' = s $ and $ s's'' = 1 $, so $ r $ is an associate of $ s $, or $ r $ divides $ s' $, in which case $ s' = rs'' $, then $ r = srs'' $ and $ ss'' = 1 $, so $ r $ is an associate of $ s' $ and $ s $ is a unit.
\end{proof}

The converse is not necessarily true, but we have the following observation as a criteria for $ R $ to be a UFD.

\begin{proposition}
Let $ R $ be a domain in which condition $ 1 $ holds. Then condition $ 2 $ above holds for $ R $ if and only if every irreducible element of $ R $ is prime.
\end{proposition}

\begin{proof}
First suppose condition $ 2 $ holds, and let $ r $ be an irreducible element of $ R $. If $ r $ divides $ ab $, we can write $ rs = ab $ for some $ s \in R $. Expanding out $ s, a, b $ as products of irreducibles we see that $ r $ is an associate of some irreducible dividing $ a $ or $ b $, so $ r $ is prime. Conversely, if every irreducible element of $ R $ is prime, and we have $ p_1 \dots p_n = q_1 \dots q_m $ products of irreducibles, then, since $ p_1 $ is prime, it divides the product $ q_1 \dots q_m $ and is thus an associate of some $ q_i $. We can thus cancel $ p_1 $ from the left and $ q_i $ from the right after introducing a unit on one side. This is possible because $ R $ is an integral domain. Repeating the process we find that, up to reordering the terms and multiplying by units, the two expressions coincide.
\end{proof}

\subsection{Principal ideal domains}

\begin{definition}
An integral domain $ R $ is a \textbf{principal ideal domain} (PID) if every ideal of $ R $ is a principal ideal.
\end{definition}

\begin{theorem}
\label{thm:3.3.2}
Every PID is a UFD.
\end{theorem}

We first show $ 1 $. It is true for units trivially.

\begin{lemma}
Let $ R $ be a PID. Then every nonzero nonunit $ r \in R $ has a irreducible divisor.
\end{lemma}

\begin{proof}
Fix $ r = r_0 \in R $. We first show $ r $ has an irreducible factor. If $ r_0 $ is irreducible we are done. Otherwise $ r_0 $ is not irreducible, we can choose an $ r_1 $, not a unit nor an associate of $ r_0 $, such that $ r_1 $ divides $ r_0 $, so $ r_0 = r_1s_1 $ with $ r_1, s_1 $ not units. If $ r_1 $ is not irreducible we choose $ r_2 $ similarly, and repeat. If this process ever terminates we have found an irreducible divisor of $ r $. Suffices to show this terminates. Suppose it does not terminate. We obtain an increasing tower of ideals
$$ \ab{r_0} \subsetneq \ab{r_1} \subsetneq \dots. $$
Let $ I $ be the union of all these ideals generated by $ r_0, r_1, \dots $. Then $ I $ is an ideal, so it is generated by some element $ s \in I $. Thus $ s $ divides $ r_i $ for all $ i $. On the other hand, $ s $ lives in some $ \ab{r_j} $, so $ r_j $ divides $ s $. Thus $ s $ is an associate of $ r_j $, and therefore an associate of $ r_i $ for all $ i > j $, that is $ I \subseteq \ab{r_j} $. This contradicts our construction because $ \ab{r_{j + 1}} \subseteq I $ and $ \ab{r_{j + 1}} \ne \ab{r_j} $.
\end{proof}

Thus $ r $ has an irreducible divisor $ s_0 $.

\begin{lemma}
Let $ R $ be a PID. Every nonzero nonunit $ r \in R $ is a finite product of irreducibles.
\end{lemma}

\begin{proof}
Consider $ rs_0^{-1} $. If this is a unit we are done. If not let $ s_1 $ be an irreducible divisor of $ rs_0^{-1} $. If $ r\rb{s_0s_1}^{-1} $ is a unit we are done, otherwise repeat. We obtain a sequence of irreducibles $ s_0, s_1, \dots $ such that $ s_0 \dots s_i $ divides $ r $ for all $ i $, so $ r = r_0s_0 = r_0r_1s_1 = \dots $ with $ r_0, r_1, \dots $ irreducible. If this process ever terminates we are done. Suppose it does not. Then we have a strictly increasing tower of ideals
$$ \ab{r} \subsetneq \ab{s_0} \subsetneq \ab{s_1} \subsetneq \dots. $$
This cannot continue forever. Arguing as above we arrive at a contradiction.
\end{proof}

Now we show $ 2 $.

\begin{proof}[Proof of Theorem \ref{thm:3.3.2}]
It suffices to show that in a PID every irreducible is prime. Let $ r \in R $ be irreducible, and suppose that $ r $ divides $ st $. Want $ r \mid s $ or $ r \mid t $. Let $ q $ be a generator of the ideal $ \ab{r, s} $ of $ R $, so $ \ab{r, s} = \ab{q} $. Then $ q $ divides $ r $, so either $ q $ is a unit or $ q $ is an associate of $ r $. If $ q $ is an associate of $ r $, then since $ q $ divides $ s $, $ r $ divides $ s $. on the other hand, if $ q $ is a unit, then the ideal generated by $ r $ and $ s $ is the unit ideal and $ 1 \in \ab{r, s} $, so we can write $ 1 = xr + ys $ for $ x, y $ elements of $ R $. We then have $ t = xrt + yst $, and since $ r $ divides both $ yst $ and $ xrt $, $ r $ divides $ t $.
\end{proof}

\marginpar{Lecture 6 \\ Wednesday \\ 16/10/18}

\subsection{Euclidean domains}

One technique for proving that rings are PIDs is Euclid's algorithm. We formalise this in an abstract setting as follows.

\begin{definition}
Let $ R $ be an integral domain.
\begin{enumerate}
\item A \textbf{Euclidean norm} on $ R $ is a function $ N : R \to \Z_{\ge 0} $ such that for all $ a, b \in R $, with $ b \ne 0 $, there exists $ q, r \in R $ such that $ a = qb + r $, and either $ r = 0 $ or $ N\rb{r} < N\rb{b} $.
\item An integral domain $ R $ is called a \textbf{Euclidean domain} if there is a Euclidean norm on $ R $.
\end{enumerate}
\end{definition}

\begin{theorem}
Any Euclidean domain is a PID.
\end{theorem}

\begin{proof}
Let $ R $ be a Euclidean domain, $ N $ be a Euclidean norm on $ R $, and $ I \subseteq R $ a nonzero ideal of $ R $. Let $ a \in I $ be a nonzero element such that $ N\rb{a} $ is minimal, that is if $ b \in I $, $ b \ne 0 $, then $ N\rb{b} \ge N\rb{a} $. Claim that $ I = \ab{a} $. Let $ b \in I $. Then there exist $ q, r $ such that $ b = aq + r $, with either $ r = 0 $ or $ N\rb{r} \ge N\rb{a} $. So $ r = 0 $ gives $ b = aq $. Thus $ I = \ab{a} $.
\end{proof}

\begin{proof}
Let $ R $ be a Euclidean domain, $ N $ be a Euclidean norm on $ R $, and $ I \subseteq R $ be a nonzero ideal of $ R $. Let $ n $ be the smallest integer such that there exists a nonzero element $ a \in I $ with $ N\rb{a} = n $ minimal, that is if $ b \in I $ and $ b \ne 0 $, then $ N\rb{b} < N\rb{a} $. Claim that $ I = \ab{a} $. Then for any $ b \in I $, we can write $ b = qa + r $ with $ N\rb{r} < N\rb{a} $ unless $ r = 0 $. But since $ N\rb{a} $ is the smallest possible norm in $ I $, we must have $ r = 0 $, so $ b = qa $. Thus $ I $ is generated by $ a $ and we are done.
\end{proof}

\subsection{Examples}

\begin{example}
\hfill
\begin{enumerate}
\item The classic example of a Euclidean domain is $ \Z $, with $ N\rb{x} = \abs{x} $ for $ x \in \Z $.
\item The ring $ \Z\sb{i} $ is a Euclidean domain, with $ N\rb{z} = z\bar{z} = \abs{z}^2 $, so $ N\rb{x + yi} = \abs{x + yi}^2 = x^2 + y^2 $. To see this, note that given $ a $ and $ b $ in $ \Z\sb{i} $ for $ b \ne 0 $, set $ q' = a / b \in \Q\sb{i} $. Write $ q' = x' + iy' $ with $ x', y' \in \Q $. Let $ x $ and $ y $ be the closest integers to $ x' $ and $ y' $, such that $ \abs{x - x'}, \abs{y - y'} \le 1 / 2 $, and set $ q = x + iy $ in $ \Z\sb{i} $ and $ r = a - bq $. Then
$$ N\rb{r} = \abs{r}^2 = \abs{a - bq}^2 = \abs{a - b\rb{\dfrac{a}{b} + \rb{q - q'}}}^2 = \abs{b\rb{q - q'}}^2 = \abs{b}^2\abs{q - q'}^2 \le \dfrac{N\rb{b}}{2}. $$
Similar arguments can be used to prove that $ \Z\sb{\alpha} $ is a Euclidean domain for
$$ \alpha = \sqrt{-2}, \qquad \alpha = \dfrac{-1 + \sqrt{-3}}{2}, \qquad \alpha = \dfrac{-1 + \sqrt{-7}}{2}. $$
Beyond this one needs other tricks and for most $ \alpha $ unique factorisation fails.
\item A critical example is the polynomial ring $ K\sb{X} $ for $ K $ a field. Here we can take $ N\rb{P\rb{X}} $ to be the degree of $ P\rb{X} $. Then, given polynomials $ P\rb{X}, T\rb{X} \in K\sb{X} $ and $ T\rb{X} \ne 0 $, we can use polynomial long division to write $ P\rb{X} = Q\rb{X}T\rb{X} + R\rb{X} $ for some $ Q\rb{X} $ with the degree of $ R $ strictly less than that of $ T $, unless $ T $ is constant, in which case we can make $ R = 0 $. To prove this, fix $ T\rb{X} $. If $ \deg\rb{T\rb{X}} = 0 $, $ T\rb{X} $ is constant, so $ T\rb{X} = c \ne 0 \in K $. Take $ Q\rb{X} = c^{-1}P\rb{X} $, so $ R\rb{X} = 0 $. Otherwise induct on $ \deg\rb{P\rb{X}} $. If $ \deg\rb{P\rb{X}} < \deg\rb{T\rb{X}} $, set $ R\rb{X} = P\rb{X} $ and $ Q\rb{X} = 0 $. Suppose the claim is true for polynomials of degree $ n $ and $ P\rb{X} $ has degree $ n + 1 $, so
$$ P\rb{X} = \sum_{i = 0}^{n + 1} a_iX^i, \qquad T\rb{X} = \sum_{i = 0}^d b_iX^i, $$
for $ d < n + 1 $. Then $ S\rb{X} = P\rb{X} - \rb{a_{n + 1} / b_d}X^{n + 1 - d}T\rb{X} $ has degree $ n $. By inductive hypothesis there exist $ Q\rb{X}, R\rb{X} $ with $ \deg\rb{R\rb{X}} < \deg\rb{T\rb{X}} $ such that
$$ S\rb{X} = Q\rb{X}T\rb{X} + R\rb{X} \qquad \implies \qquad P\rb{X} = \rb{\dfrac{a_{n + 1}}{b_d}X^{n + 1 - d} + Q\rb{X}}T\rb{X} + R\rb{X}. $$
\end{enumerate}
\end{example}

Later, will show if $ R $ UFD, then $ R\sb{X} $ is also a UFD.

\section{The Chinese remainder theorem}

In elementary number theory, let $ m_1, m_2 \in \Z $ be relatively prime and $ a_1, a_2 \in \Z $. Then there exists $ a \in \Z $ such that
$$ a \equiv a_1 \mod m_1, \qquad a \equiv a_2 \mod m_2. $$
Moreover, $ a $ is unique up to congruence modulo $ m_1m_2 $. Question is given ideals $ I_1, \dots, I_r $ and $ a_1, \dots, a_r \in \R $, when can we find a $ a \in R $ with $ a \in a_1 + I_1, \dots a_r + I_r $?

\subsection{Products}

\begin{definition}
Let $ R_1, \dots, R_n $ be rings. The \textbf{direct product} $ R \times \dots \times R_n $ is a ring whose elements are $ n $-tuples $ \rb{r_1, \dots, r_n} $ with $ r_i \in R_i $ for all $ i $. The addition and multiplication are given componentwise.
$$ \rb{r_1, \dots, r_n} + \rb{r_1', \dots, r_n'} = \rb{r_1 + r_1', \dots, r_n + r_n'}, \qquad \rb{r_1, \dots, r_n}\rb{r_1', \dots, r_n'} = \rb{r_1r_1', \dots, r_nr_n'}. $$
\end{definition}

\begin{note}
The product comes with natural homomorphisms for all $ i $, $ \pi_i $, \textbf{projection} onto the $ i $-th factor, defined by
$$ \pi_i\rb{r_1, \dots, r_n} = r_i : R_1 \times \dots \times R_n \to R_i, $$
and the following universal property.
\end{note}

\begin{theorem}[Universal property of the product]
Let $ S, R_1, \dots, R_n $ be any rings. For any homomorphisms $ f_1 : S \to R_1, \dots, f_n : S \to R_n $, there exists a unique homomorphism $ f : S \to R_1 \times \dots \times R_n $ such that $ \pi_i \circ f = f $ for all $ i $.
\end{theorem}

\begin{proof}
Given $ f_i $, the homomorphism $ f $ is defined by $ f\rb{s} = \rb{f_1\rb{t}, \dots, f_n\rb{t}} $. Then $ \rb{\pi_i \circ f}\rb{s} = f_i\rb{s} $. For uniqueness, if $ \rb{\pi \circ g}\rb{s} = f_i\rb{s} $ for all $ i $, then $ g\rb{s} = \rb{f_1\rb{s}, \dots, f_n\rb{s}} = f\rb{s} $.
\end{proof}

More generally, if $ I $ is any index set, and for each $ i \in I $ we have a ring $ R_i $, we can define the product $ \prod_i R_i $. An element $ r $ of this product is a choice, for each $ i \in I $, of an element of $ R_i $. We write such an element as $ \rb{r_i}_{i \in I} $. For each $ j \in I $ we have a map $ \pi_j : \prod_i R_i \to R_j $ given by $ \pi_j\rb{\rb{r_i}_{i \in I}} = r_j $. Such a product satisfies a very similar universal property. For any collection $ f_i : S \to R_i $ of maps for each $ i \in I $, we get a unique map $ f : S \to \prod_i R_i $ such that $ \pi_j \circ f = f_j $.

\subsection{The Chinese remainder theorem}

Let $ R $ be a ring, and let $ I_1, \dots, I_r $ be a finite collection of ideals of $ R $. We have the natural maps $ R \to R / I_1, \dots, R \to R / I_r $, which are surjective with kernel $ I_j $. Consider the product map
$$ R \to \dfrac{R}{I_1} \times \dots \times \dfrac{R}{I_r}. $$
It is easy to see that the kernel of this map is the set of $ r \in R $ such that $ r $ maps to zero in $ R / I_j $ for all $ j $. That is, the kernel is the intersection $ I_1 \cap \dots \cap I_r $. Call this ideal $ J $. We thus have an injective embedding
$$ \dfrac{R}{J} \hookrightarrow \dfrac{R}{I_1} \times \dots \times \dfrac{R}{I_r}. $$
A natural question to ask is, what can we say about the image? In other words, given congruence classes modulo $ I_1, \dots, I_r $, when is there a single element of $ R $ that lives in all those congruence classes simultaneously?

\begin{note}
Because the above map is injective, if one such element exists, then there is a unique congruence class modulo $ J $ that satisfies all of the required congruences.
\end{note}

Of course, without further hypotheses we cannot expect this map to be surjective. Think about what happens when $ I_1 = I_2 $, for instance. Nonetheless, we have the following.

\begin{definition}
We will say $ I_1, \dots, I_r $ are \textbf{pairwise relatively prime} if for each $ i \ne j $, the sum $ I_i + I_j $ is the unit ideal in $ R $.
\end{definition}

(TODO Exercise: if $ R = \Z $, then $ I_i = \ab{n_i} $, and $ \cb{I_i} $ is pairwise relatively prime if and only if for all $ i \ne j $, $ n_i $ and $ n_j $ are relatively prime)

\begin{theorem}
Let $ R $ be a ring and $ I_1, \dots, I_r $ be pairwise relatively prime ideals. Then the natural map
$$ \dfrac{R}{J} \hookrightarrow \dfrac{R}{I_1} \times \dots \times \dfrac{R}{I_r} $$
is an isomorphism.
\end{theorem}

\begin{proof}
We have to prove it is surjective. Fix any tuple $ \rb{c_1, \dots, c_r} $ of elements of $ R $. We need to find $ c \in R $ such that $ c \in c_i + I_i $ for all $ i $. It suffices to construct, for each $ i $, an element $ e_i $ of $ R $ such that $ e_i \equiv 1 \mod I_i $ and $ e_i \equiv 0 \mod I_j $ for $ i \ne j $. Suppose we have such an element. Then the element $ c = c_1e_1 + \dots + c_re_r $ is such that $ c \equiv c_j \mod I_j $ for all $ j $. Given $ i, j $ with $ i \ne j $, we know that $ I_i + I_j $ is the unit ideal. That is, we can write $ a_{ij} + b_{ij} = 1 $ with $ a_{ij} \in I_i $ and $ b_{ij} \in I_j $. Then $ a_{ij} \equiv 1 \mod I_j $ and $ a_{ij} \equiv 0 \mod I_i $ as an element of $ R / I_1 \times \dots \times R / I_r $, so $ a_{ij} $ has zero in the $ i $-th place and one in the $ j $-th place. Then for any $ j $ we can take $ e_j = \prod_{i \ne j} a_{ij} $ and $ e_j \equiv 1 \mod I_j $ and $ e_j \equiv 0 \mod I_i $ for all $ i \ne j $, so $ e_j $ has one only in the $ j $-th place. So $ R \to R / I_1 \times \dots \times R / I_r $ is surjective. The result follows.
\end{proof}

\subsection{Examples}

When $ R = \Z $, then every ideal is principal, so we can write $ I_j = \ab{n_j} $ for all $ j $. The condition that $ I_i + I_j $ is the unit ideal becomes the condition that $ n_i \in \Z $ are pairwise relatively prime. In this case the ideal $ J $ is generated by the product $ n $ of the $ n_i $. Specialising, we find the version of the Chinese remainder theorem from elementary number theory.

\begin{theorem}
If $ \cb{n_j \in \Z} $ is a finite collection of pairwise relatively prime integers, and $ n $ is their product, then for any $ c_1, \dots, c_r \in \Z $, there exists $ c \in \Z $ unique up to congruence modulo $ n $ such that $ c $ is congruent to $ c_i \mod n_i $ for all $ i $.
\end{theorem}

Now let $ K $ be a field and take $ R = K\sb{X} $. If $ c_1, \dots, c_r \in K $ are distinct elements of $ K $, the ideals $ I_i = \ab{X - c_i} \subseteq R $ are such that $ I_i + I_j = \ab{X - c_i} + \ab{X - c_j} $ contains $ c_i - c_j \in K^* $, so contains $ 1 $. That is, $ I_i + I_j $ is the unit ideal in $ R $ and the ideals $ I_i $ are pairwise relatively prime. Moreover, for each $ i $, $ I_i $ is the kernel of the evaluation map $ f_i : R \to K $ by that takes $ P\rb{X} $ to $ P\rb{c_i} $. Let $ f : R \to K \times \dots \times K $ by $ P\rb{X} \mapsto \rb{P\rb{c_1}, \dots, P\rb{c_r}} $. Then the following diagram commutes.
$$
\begin{tikzcd}[column sep=1in]
R \arrow{r}{f} \arrow[two heads]{d} & K \times \dots \times K \\
\dfrac{R}{J} \arrow[swap]{r}{\sim} & \dfrac{R}{I_1} \times \dots \times \dfrac{R}{I_r} \arrow[swap]{u}{\sim}
\end{tikzcd}
$$
Chinese remainder theorem gives that $ f $ is surjective. We thus have an isomorphism of $ R / I_i $ with $ K $ that takes $ P\rb{X} $ to $ P\rb{c_i} $ for all polynomials $ P $. We thus obtain the following.

\begin{theorem}
For any $ c_1, \dots, c_n \in K $, there is a polynomial $ P\rb{X} $ in $ R $, unique up to congruence modulo $ \rb{X - a_1} \dots \rb{X - a_n} $ such that $ P\rb{a_i} = c_i $ for all $ i $.
\end{theorem}

\marginpar{Lecture 7 \\ Friday \\ 19/10/18}

\section{Fields and field extensions}

Next we will use $ K\sb{X} $ is a PID for $ K $ a field to study fields systematically.

\subsection{Prime fields}

Let $ K $ be a field. We have a unique ring homomorphism $ \iota : \Z \to K $ by $ n \ge 0 \mapsto n_K = 1_K + \dots + 1_K $. Let $ I $ be the kernel. Then $ \Z / I \hookrightarrow K $ so $ \Z / I $ is an integral domain, so $ I $ is a prime ideal. Thus $ I $ is either the zero ideal $ \cb{0} $, if $ K $ has characteristic zero, or the ideal $ \ab{p} $ for some prime $ p $ of $ \Z $. In the former case $ I = \cb{0} $, the injection $ \Z \hookrightarrow K $ extends to an inclusion $ \Q \hookrightarrow K $ sending $ a / b \mapsto \rb{\iota a}\rb{\iota b^{-1}} = a_K / b_K $. In the latter case $ I = \ab{p} $, we get an injection $ \Z / p\Z \hookrightarrow K $, which we often denote $ \F_p $ when we think of it as a field. Upshot is that every field $ K $ contains exactly one of $ \Q $, $ \F_p $, for $ p $ prime, in exactly one way depending on its characteristic. This field is called the \textbf{prime field} of $ K $, and it is contained in $ K $ in a unique way.

\subsection{Field extensions}

The prime fields are in some sense the smallest possible fields. Once we know they exist, it makes sense to study fields by studying pairs $ K, L $ of fields such that $ K \subseteq L $ of fields, trying to relate $ L $ to $ K $.

\begin{definition}
A \textbf{field extension} is a pair of fields $ K, L $ with $ K \subseteq L $, and is often denoted $ L / K $.
\end{definition}

\begin{note}
Such an inclusion of fields $ L / K $ makes $ L $ into a $ K $-vector space, that is a vector space over $ K $.
\end{note}

\begin{definition}
We say that a field extension $ L / K $ is \textbf{finite} if $ L $ is finite-dimensional as a $ K $-vector space. If this is the case, the \textbf{degree} of such an extension is the dimension of $ L $ as a $ K $-vector space $ \dim_KL $, and is denoted $ \sb{L : K} $.
\end{definition}

\begin{proposition}
Let $ K \subseteq L \subseteq M $ be fields. Then $ M / K $ is finite if and only if $ M / L $ and $ L / K $ are both finite. If this is the case then $ \sb{M : K} = \sb{M : L}\sb{L : K} $.
\end{proposition}

\begin{proof}
First suppose that $ M / K $ is finite. Then $ L $ is a $ K $-subspace of $ M $, so finite dimensional as a $ K $-vector space. Moreover, there exists a $ K $-basis $ m_1, \dots, m_r $, and this basis spans $ M $ over $ K $ and thus also over $ L $. Thus $ M $ is finite-dimensional as an $ L $-vector space, so $ M / L $ is finite. Conversely, suppose $ L / K $, $ M / L $ are finite. Let $ e_1, \dots, e_n $ be a $ K $-basis for $ L $, and let $ f_1, \dots, f_n $ be an $ L $-basis for $ M $. Then claim that
$$ e_1f_1, \dots, e_1f_m, \dots, e_nf_1, \dots, e_nf_m $$
is a $ K $-basis for $ M $. Every element $ x $ of $ M $ can be expressed uniquely as $ c_1f_1 + \dots + c_mf_m $ with $ c_i \in L $. Each $ c_i $ in turn can be expressed as $ d_{1, i}e_1 + \dots + d_{n, i}e_n $ with $ d_{j, i} \in K $. Thus we can express $ x $ as
$$ d_{1, 1}e_1f_1 + \dots + d_{n, 1}e_nf_1 + \dots + d_{1, m}e_1f_m + \dots + d_{n, m}e_nf_m. $$
In particular the set $ \cb{e_if_j} $ for $ 1 \le i \le n $ and $ 1 \le j \le m $ spans $ M $ over $ K $. In this case the degree of $ L $ over $ K $ is $ n $ and the degree of $ M $ over $ L $ is $ m $, so it remains to show that $ \cb{e_if_j} $ is linearly independent over $ K $. Suppose we have elements $ d_{i, j} $ of $ K $ such that $ \sum_{i, j} d_{i, j}e_if_j = 0 $. Then, regrouping, we find that $ \sum_j \rb{\sum_i d_{i, j}e_i}f_j = 0 $ is an $ L $-linear combination of the $ f_j $ that is zero. Since the $ f_j $ are linearly independent over $ L $ we must have $ \sum_i d_{i, j}e_i = 0 $ for all $ j $. Since the $ e_i $ are linearly independent over $ K $ we must have $ d_{i, j} = 0 $ for all $ i, j $.
\end{proof}

\marginpar{Lecture 8 \\ Monday \\ 22/10/18}

\subsection{Extensions generated by one element}

Let $ L / K $ be a field extension, and let $ \alpha $ be an element of $ L $.

\begin{definition}
We let $ K\rb{\alpha} $ denote the subfield of $ L $ consisting of all elements of $ L $ that can be expressed in the form $ P\rb{\alpha} / Q\rb{\alpha} $, where $ P $ and $ Q $ are polynomials with coefficients in $ K $ and $ Q\rb{\alpha} $ is not zero. This is the smallest subfield of $ L $ containing $ K $ and $ \alpha $.
\end{definition}

Recall that if $ R, S $ are rings, $ f : R \to S $ is a homomorphism, and $ \alpha \in S $, then have $ \phi_{f, a} : R\sb{X} \to S $ by $ \phi_{f, a}\rb{\sum_{i = 1}^n r_iX^i} = \sum_{i = 1}^n f\rb{r_i}\alpha^i $. We have a natural map $ K\sb{X} \to K\rb{\alpha} \subseteq L. $, inclusion on $ K $, that takes a polynomial $ P\rb{X} $ to $ P\rb{\alpha} $. It is a ring homomorphism. Let $ I $ be the kernel of this homomorphism. We then get an injection of $ K\sb{X} / I $ into the field $ K\rb{\alpha} $. Thus $ K\sb{X} / I $ is an integral domain, so $ I $ is a prime ideal of $ K\sb{X} $. Since $ K\sb{X} $ is a PID, every nonzero prime ideal is maximal. (TODO Exercise) There are thus two cases. In the first $ I $ is the zero ideal that is not maximal. That is, there is no nonzero polynomial $ Q $ in $ K\sb{X} $ such that $ Q\rb{\alpha} $ is zero in $ L $. We say that $ \alpha $ is \textbf{transcendental} over $ K $ in this case. In the second $ I $ is an ideal $ \ab{Q} $ for $ Q \in K\sb{X} $ a nonzero irreducible polynomial that is a maximal ideal of $ K\sb{X} $. In this case we say $ \alpha $ is \textbf{algebraic} over $ K $.

\begin{definition}
$ K\rb{X} $ is the \textbf{field of rational functions} on $ X $,
$$ K\rb{X} = \cb{\dfrac{P\rb{X}}{Q\rb{X}} \ \Bigg| \ P, Q \in K\sb{X}, \ Q \ne 0} / \sim. $$
\end{definition}

Assume first that $ \alpha $ is transcendental over $ K $, that is $ I = \cb{0} $. Recall $ I = \cb{P\rb{X} \in K\sb{X} \mid P\rb{\alpha} = 0} $. So in this case there is no nonzero polynomial $ P \in K\sb{X} $ with $ P\rb{\alpha} = 0 $. In this case the map taking $ P\rb{X} $ to $ P\rb{\alpha} $ is an injection of $ K\sb{X} $ into $ K\rb{\alpha} \subseteq L $. In particular every nonzero element of $ K\sb{X} $ gets sent to a nonzero, hence invertible, element of $ L $. Thus the map from $ K\sb{X} $ to $ L $ extends to an injective map from the field of fractions of $ K\sb{X} $, which we denote $ K\rb{X} $, to $ L $. This map takes $ P\rb{X} / Q\rb{X} $ to $ P\rb{\alpha} / Q\rb{\alpha} $. By definition of $ K\rb{\alpha} $, this map is surjective so the image of this map is $ K\rb{\alpha} $. In particular $ K\rb{X} $ and $ K\rb{\alpha} $ are isomorphic. Thus the following diagram holds.
$$
\begin{tikzcd}[column sep=1in]
& L \\
K\rb{X} \arrow{r}{\sim}[swap]{g} & K\rb{\alpha} \arrow[hookrightarrow, swap]{u}{\subseteq} \\
K\sb{X} \arrow[hookrightarrow]{u}{\subseteq} \arrow[hookrightarrow, swap]{ur}{f}
\end{tikzcd}
\qquad f : P\rb{X} \mapsto P\rb{\alpha} \qquad g : \dfrac{P\rb{X}}{Q\rb{X}} \mapsto \dfrac{P\rb{\alpha}}{Q\rb{\alpha}}
$$

\begin{note}
In this case $ K\rb{\alpha} $ is infinite dimensional as a $ K $-vector space. It contains a subspace isomorphic to $ K\sb{X} $, for instance.
\end{note}

If $ \alpha $ is algebraic over $ K $, then $ I $ is a nonzero maximal ideal of the PID $ K\sb{X} $, so it is generated by a single irreducible polynomial $ Q\rb{X} $ in $ K\sb{X} $. As a consequence, since the units in $ K\sb{X} $ are just the constant polynomials, the polynomial $ Q\rb{X} $ is well-defined up to a constant factor. It is called the \textbf{minimal polynomial} of $ \alpha $. By definition, it divides every polynomial $ P\rb{X} $ such that $ P\rb{\alpha} = 0 $. Since $ \ab{Q\rb{X}} $ is maximal, the ring $ K\sb{X} / \ab{Q\rb{X}} $ is a field. Recall that for any $ P \in K\sb{X} $, can write $ P\rb{X} $ uniquely as $ A\rb{X}Q\rb{X} + R\rb{X} $ with $ \deg\rb{R} < \deg\rb{Q} $. So $ 1, \dots, X^{\deg\rb{Q} - 1} $ are a $ K $-basis of $ K\sb{X} / \ab{Q\rb{X}} $. So its dimension as a $ K $-vector space is equal to the degree of $ Q\rb{X} $. The map $ K\sb{X} \to K\rb{\alpha} \subseteq L $ descends to an injection of $ K\sb{X} / \ab{Q\rb{X}} $ into $ L $. Since its image is a subfield of $ K\rb{\alpha} $ containing $ K $ and $ \alpha $, this map is an isomorphism of $ K\rb{\alpha} $ with $ K\sb{X} / \ab{Q\rb{X}} $. Thus in this case the extension $ K\rb{\alpha} / K $ is a finite extension, of degree equal to the degree of $ Q\rb{X} $. Thus the following diagram holds.
$$
\begin{tikzcd}[column sep=1in]
K\sb{X} \arrow[twoheadrightarrow]{dr}{f} & L \\
\dfrac{K\sb{X}}{\ab{Q\rb{X}}} \arrow[hookrightarrow]{u}{\subseteq} \arrow{r}{g}[swap]{\sim} & K\rb{\alpha} \arrow[hookrightarrow, swap]{u}{\subseteq}
\end{tikzcd}
\qquad f : P\rb{X} \mapsto P\rb{\alpha} \qquad g : \sb{R\rb{X}}_{\ab{Q\rb{X}}} \to R\rb{\alpha}
$$

To summarise, extend $ K $ by a single element by
\begin{enumerate}
\item building $ K\sb{X} $, and
\item either passing to field of fractions $ K\rb{X} $ to form a transcendental extension, or choosing an irreducible polynomial $ Q $ to form an algebraic extension $ K\sb{X} / \ab{Q\rb{X}} $.
\end{enumerate}
Slightly informally, instead of $ K\sb{X} / \ab{Q\rb{X}} $, we sometimes write $ K\rb{\alpha} $, where $ \alpha $ is a root of $ Q\rb{X} $.

\begin{definition}
An extension $ L / K $ is \textbf{algebraic} if every element of $ L $ is algebraic over $ K $.
\end{definition}

An observation is that if $ L / K $ is finite, then $ L / K $ is algebraic. Suppose not. Let $ \alpha \in L $ be transcendental over $ K $. $ K\sb{X} $ is a polynomial ring in $ K\rb{\alpha} $ contained in $ L $, so $ L / K $ is not finite.

\begin{corollary}
Let $ L / K $ be a field extension for $ \alpha, \beta \in L $ algebraic over $ K $. Then $ \alpha + \beta $, $ \alpha\beta $ are algebraic over $ K $.
\end{corollary}

\begin{proof}
$ \sb{K\rb{\alpha} : K} = \deg\rb{\alpha} $ and $ \sb{K\rb{\alpha, \beta} : K\rb{\alpha}} \le \deg\rb{\beta} $, so $ \sb{K\rb{\alpha, \beta} : K} \le \rb{\deg\rb{\alpha}}\rb{\deg\rb{\beta}} $. Now $ K \subseteq K\rb{\alpha + \beta} \subseteq K\rb{\alpha, \beta} $, so $ \deg\rb{\alpha + \beta} $ over $ K $ is at most $ \rb{\deg\rb{\alpha}}\rb{\deg\rb{\beta}} $. Similarly for $ \alpha\beta $.
\end{proof}

\begin{corollary}
If $ L / K $, then the subset $ L^{alg} $ of elements of $ L $ algebraic over $ K $ is a field.
\end{corollary}

\begin{proof}
If $ a_0 + \dots + a_n\alpha^n = 0 $ then $ a_0\rb{\alpha^{-1}}^n + \dots + a_n = 0 $.
\end{proof}

\begin{example}
$ \bar{\Q} \subseteq \C $ is the subfield of elements of $ \C $ that are algebraic over $ \Q $.
\end{example}

\subsection{Example}

\begin{example}
Consider the polynomial $ X^2 + X + 1 $ in $ \F_2\sb{X} $. It has no roots in $ \F2 $, so it is irreducible, as a polynomial of degree 2 any nontrivial factor would be linear. The other polynomials of degree two are $ X^2 $, $ X^2 + X = X\rb{X + 1} $, $ X^2 + 1 = \rb{X + 1}^2 $, so $ X^2 + X + 1 $ is the unique irreducible polynomial of degree two. Let $ \F_4 = \F_2\sb{X} / \ab{X^2 + X + 1} $. Thus the quotient $ \F_2\sb{X} = \ab{X^2 + X + 1} $ is a field extension of degree two of $ \F_2 $, which is denoted $ \F_4 $. Its four elements are $ 0, 1, X, X + 1 $, or more precisely, their classes modulo $ \ab{X^2 + X + 1} $.
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
\hline
$ \cdot $ & $ 0 $ & $ 1 $ & $ X $ & $ X + 1 $ \\
\hline
$ 0 $ & $ 0 $ & $ 0 $ & $ 0 $ & $ 0 $ \\
\hline
$ 1 $ & $ 0 $ & $ 1 $ & $ X $ & $ X + 1 $ \\
\hline
$ X $ & $ 0 $ & $ X $ & $ X + 1 $ & $ 1 $ \\
\hline
$ X + 1 $ & $ 0 $ & $ X + 1 $ & $ 1 $ & $ X $ \\
\hline
\end{tabular}
\end{center}
Note that $ X^2 = -X - 1 = X + 1 $, $ X^2 + X + 1 = 0 $, $ \rb{X + 1}^2 = X $, and $ X^3 = X\rb{X + 1} = 1 $ in $ \F_4 $. In particular the multiplicative group of $ \F_4 $ is cyclic of order three. This is not particularly surprising, as all groups of order three are cyclic. We will see later, though, that the multiplicative group of any finite field is cyclic.
\end{example}

\begin{proposition}
Let $ K $ be a field with four elements. Then $ K \cong \F_4 $.
\end{proposition}

\begin{proof}
Let $ \alpha \in K $ with $ \alpha \ne 0 $ and $ \alpha \ne 1 $. Consider $ 1, \alpha, \alpha^2 $. Since $ K $ has dimension two over $ \F_2 $, there is a linear dependence. So there exists a polynomial $ P $ in $ \F_2\sb{X} $ of degree at most two such that $ P\rb{\alpha} = 0 $. In fact $ P $ must be irreducible of degree two. If it is divisible by something of degree one, then a polynomial of degree one vanishes on $ \alpha $, so $ \alpha = 0 $ or $ \alpha = 1 $. So $ \alpha^2 + \alpha + 1 = 0 $. The map $ \F_2\sb{X} \to K $ sending $ X $ to $ \alpha $ descends to $ \F_2\sb{X} / \ab{X^2 + X + 1} \to K $. So $ \F_4 $ embeds in $ K $. Thus the following diagram holds and $ K \cong \F_4 $.
$$
\begin{tikzcd}[column sep=1in]
\F_2\sb{X} \arrow[twoheadrightarrow]{dr}{P\rb{X} \mapsto P\rb{\alpha}} & \\
\dfrac{\F_2\sb{X}}{\ab{X^2 + X + 1}} \arrow[hookrightarrow]{u}{\subseteq} \arrow[swap]{r}{\sim} & K
\end{tikzcd}
$$
\end{proof}

\marginpar{Lecture 9 \\ Wednesday \\ 24/10/18}

\section{Finite fields}

\subsection{Finite fields}

Let $ K $ be a finite field. That is, a field with only finitely many elements. Then $ K $ has characteristic $ p $ for some prime $ p $, and is in particular a finite dimensional $ \F_p $ vector space. Thus its order is a power $ p^r $ of $ p $ for $ r > 0 \in \Z $. If we fix a particular prime power $ p^r $, then two questions naturally arise. Does there exist a field of order $ p^r $? If so, can we classify fields of order $ p^r $ up to isomorphism? We will see that in fact, up to isomorphism, there is a unique field $ \F_{p^r} $ of order $ p^r $.

\subsection{The Frobenius automorphism}

Let $ p $ be a prime. For any ring $ R $, the map $ x \mapsto x^p $ on $ R $ certainly satisfies $ \rb{xy}^p = x^py^p $ for all $ x, y \in R $. On the other hand,
$$ \rb{x + y}^p = x^p + \two{p}{1}xy^{p - 1} + \dots + \two{p}{p - 1}x^{p - 1}y + y^p. $$
Now the binomial coefficients satisfy
$$ p \ \Bigg| \ \two{p}{i} = \dfrac{p!}{i!\rb{p - i}!}, $$
for $ 1 \le i \le p - 1 $, so if $ R $ has characteristic $ p $, we have $ \rb{x + y}^p = x^p + y^p $. So $ x \mapsto x^p : R \to R $ is a ring homomorphism from $ R $ to $ R $, called the \textbf{Frobenius endomorphism} of $ R $. If $ R $ is a field of characteristic $ p $, then the Frobenius endomorphism is injective. If in addition $ R $ is finite, then any injective map from $ R $ to $ R $ is surjective. In particular the Frobenius endomorphism is a bijective and an isomorphism from $ R $ to $ R $ when $ R $ is a finite field of characteristic $ p $. In this case we call the map $ x \mapsto x^p $ the Frobenius \textbf{automorphism}. Composing the Frobenius endomorphism with itself, we find that for any $ r $, $ x \mapsto x^{p^r} $ is also an endomorphism of any ring $ R $ of characteristic $ p $.

\begin{example}
Let $ R = \F_4 $. $ y \to y^2 $ gives $ 0 \mapsto 0 $, $ 1 \mapsto 1 $, $ X \mapsto X + 1 $, and $ X + 1 \mapsto X $.
\end{example}

\begin{note}
Let $ K $ be a field of $ p^r $ elements. Then $ \alpha^{p^r} = \alpha $ for all $ \alpha \in K $. If $ \alpha = 0 $, clear. Otherwise $ \alpha \in K^* $, $ K^* $ is an abelian group of order $ p^r - 1 $. Lagrange's theorem gives $ \alpha^{p^r - 1} = 1 $, so $ \alpha^{p^r} = \alpha $.
\end{note}

We have the following.

\begin{proposition}
Let $ K $ be a field of characteristic $ p $, such that $ \alpha^{p^r} = \alpha $ for all $ \alpha \in K $. Let $ P\rb{X} \in K\sb{X} $ be an irreducible factor of $ X^{p^r} - X $ over $ K\sb{X} $. Then every element $ \beta $ of $ K\sb{X} / \ab{P\rb{X}} $ satisfies $ \beta^{p^r} = \beta $.
\end{proposition}

\begin{proof}
Let $ d = \deg\rb{P} $. Can write $ \beta = c_0 + \dots + c_{d - 1}X^{d - 1} $. Moreover, since $ P\rb{X} = 0 $ in $ K\sb{X} / \ab{P\rb{X}} $ and $ P\rb{X} $ divides $ X^{p^r} - X $, we have $ X^{p^r} = X $ in $ K\sb{X} / \ab{P\rb{X}} $. Thus
$$ \beta^{p^r} = c_0^{p^r} + \dots + c_{d - 1}^{p^r}\rb{X^{p^r}}^{d - 1} = c_0 + \dots + c_{d - 1}\rb{X^{p^r}}^{d - 1} = c_0 + \dots + c_{d - 1}X^{d - 1} = \beta. $$
\end{proof}

\begin{corollary}
There exists a field $ K $ of characteristic $ p $ such that
\begin{enumerate}
\item $ \alpha^{p^r} = \alpha $ for all $ \alpha \in K $, and
\item the polynomial $ X^{p^r} - X $ of $ K\sb{X} $ factors into linear factors over $ K\sb{X} $.
\end{enumerate}
\end{corollary}

\begin{proof}
Let $ K_0 = \F_p $. $ K_0 $ satisfies $ 1 $. We construct a tower of fields $ K_0 = \F_p \subsetneq K_1 \subsetneq \dots $ all satisfying $ 1 $ as follows. Suppose we have constructed $ K_i $ satisfying $ 1 $. If $ X^{p^r} - X $ factors into linear factors over $ K_i\sb{X} $, we are done. Otherwise, choose a nonlinear irreducible factor $ P_i\rb{X} $ of $ X^{p^r} - X $ in $ K_i\sb{X} $ of degree at least two, and set $ K_{i + 1} = K_i\sb{X} / \ab{P_i\rb{X}} $. Then $ K_{i + 1} $ is strictly larger than $ K_i $ and still satisfies $ 1 $. On the other hand, in any field $ K_i $ satisfying $ 1 $, every element is a root of $ X^{p^r} - X $, so $ \#K_i \le p^r $ for all $ i $. Since this polynomial can have at most $ p^r $ roots, this process must eventually terminate.
\end{proof}

Since $ X^{p^r} - X $ has degree $ p^r $, we expect the field $ K $ constructed above to have $ p^r $ elements. So it suffices to show that over any field $ K $ of characteristic $ p $, $ X^{p^r} - X $ has no repeated roots. To prove this we need an additional tool.

\subsection{Derivatives}

\begin{definition}
Let $ R $ be a ring, and let $ P\rb{X} = r_0 + \dots + r_dX^d $ be an element of $ R\sb{X} $. The \textbf{derivative} $ P'\rb{X} $ of $ P\rb{X} $ is the polynomial $ r_1 + \dots + dr_dX^{d - 1} $.
\end{definition}

\begin{note}
Just as for differentiation in calculus, we have a Leibniz rule. For $ P, Q \in R\sb{X} $, $ \rb{PQ}'\rb{X} = P\rb{X}Q'\rb{X} + P'\rb{X}Q\rb{X} $, by reducing to $ P, Q $ monomials.
\end{note}

From this we deduce the following.

\begin{lemma}
Let $ K $ be a field, and let $ P\rb{X} $ be a polynomial in $ K\sb{X} $ with a multiple root in $ K $. Then $ P\rb{X} $ and $ P'\rb{X} $ have a common factor of degree greater than zero.
\end{lemma}

\begin{proof}
Let $ \alpha \in K $ be the multiple root. Then we can write $ P\rb{X} = \rb{X - \alpha}^2Q\rb{X} $. Applying the Leibniz rule we get $ P'\rb{X} = 2\rb{X - \alpha}Q\rb{X} + \rb{X - \alpha}^2Q'\rb{X} $ and it is clear that $ X - \alpha $ divides both $ P\rb{X} $ and $ P'\rb{X} $.
\end{proof}

\begin{corollary}
Let $ K $ be a field of characteristic $ p $. Then $ X^{p^r} - X $ has no repeated roots in $ K $.
\end{corollary}

\begin{proof}
Let $ P\rb{X} = X^{p^r} - X $. Then $ P'\rb{X} = -1 $, so $ P\rb{X} $ and $ P'\rb{X} $ have no common factor.
\end{proof}

\begin{corollary}
There exists a finite field of $ p^r $ elements.
\end{corollary}

\begin{proof}
The field $ K $ we constructed has $ p^r $ elements.
\end{proof}

\marginpar{Lecture 10 \\ Friday \\ 26/10/18}

\subsection{The multiplicative group}

Rather than show immediately that there is a unique finite field of $ p^r $ elements, we make a detour to study the multiplicative group of a finite field. This is not strictly necessary to prove uniqueness, but will simplify the proof, and is of interest in its own right. Let $ K $ denote a field of $ p^r $ elements. The goal of this section is to show that $ K^* $ is cyclic.

\begin{note}
As a multiplicative group, $ K^* $ is an abelian group of order $ p^r - 1 $, so by Lagrange's theorem, we have $ \alpha^{p^r - 1} = 1 $ for all $ \alpha \in K^* $.
\end{note}

Recall for an abelian group $ A $, operation written additively, that the order of an element $ a $ of $ A $ is the smallest $ d \in \Z_{> 0} $ such that $ da = 0 $.
\begin{enumerate}
\item The order of an element $ a $ of $ A $ divides the order of $ A $.
\item If $ d'a = 0 $ for some $ d' \in \Z $ then the order of $ a $ divides $ d' $.
\end{enumerate}
The order of an element $ a $ of $ K^* $ is the smallest $ d \in \Z_{> 0} $ such that $ a^d = 1 $. Since $ a^{p^r - 1} = 1 $, the order of $ a $ is a divisor of $ p^r - 1 $. On the other hand, if $ d $ is a divisor of $ p^r - 1 $, then any element of order dividing $ d $ is a root of the polynomial $ X^d - 1 $. Since $ K $ is a field, this polynomial has at most $ d $ roots, and we find that there are at most $ d $ elements of $ K^* $ of order dividing $ d $. Order of any element divides $ p^r - 1 $. Know $ X^{p^r - 1} - 1 $ has $ p^r - 1 $ distinct roots in $ K $. For $ d \mid p^r - 1 $, $ X^d - 1 \mid X^{p^r - 1} - 1 $, so $ X^d - 1 $ has exactly $ d $ roots in $ K $. That is, for all $ d \mid p^r - 1 $, $ K^* $ has exactly $ d $ elements of order dividing $ d $. In fact, we have the following.

\begin{proposition}
\label{prop:6.4.1}
Let $ A $ be a finite abelian group of order $ n $, and suppose that $ A $ has exactly $ d $ elements of order dividing $ d $, for all $ d $ dividing $ n $. Then $ A $ is cyclic.
\end{proposition}

In particular $ K^* $ is cyclic. The remainder of this section will be devoted to proving this proposition. As a corollary, we deduce that the multiplicative group of any finite field is cyclic. Consider the cyclic group $ \Z / n\Z $. The order of any element in this group is a divisor of $ n $.

\begin{definition}
For $ n \in \Z $, we let $ \Phi\rb{n} $ denote the number of elements in $ \rb{\Z / n\Z, +} $ of exact order $ n $. This equals to the number of elements $ t \in \Z $ for $ 1 \le t \le n $ such that $ \rb{t, n} = 1 $.
\end{definition}

\begin{note}
Since $ \sb{1} $ in $ \Z / n\Z $ has order $ n $, $ \Phi\rb{n} $ is nonzero for all $ n $.
\end{note}

\begin{lemma}
For any $ d $ dividing $ n $, the cyclic group $ \Z / n\Z $ contains a unique subgroup of order $ d $, and any element of $ \Z / n\Z $ of order dividing $ d $ is contained in this subgroup.
\end{lemma}

\begin{proof}
The cyclic subgroup $ C $ of $ \Z / n\Z $ generated by $ n / d $ is clearly a subgroup of order $ d $. This has $ d $ elements $ \sb{0}, \dots, \rb{d - 1}\sb{n / d} $. Conversely, if $ x $ is an element of a subgroup of $ \Z / n\Z $ of order $ d $, then the order of $ x $ divides $ d $, so $ dx $ is divisible by $ n $, and hence by unique factorisation $ x $ is divisible by $ n / d $. Thus $ x $ is in $ C $ and the claim follows.
\end{proof}

As a consequence, we deduce the following.

\begin{corollary}
For any $ d $ dividing $ n $, $ \Phi\rb{d} $ is the number of elements of $ \Z / n\Z $ of order $ d $.
\end{corollary}

\begin{corollary}
For any $ n \in \Z $, we have
$$ \sum_{d \mid n} \Phi\rb{d} = n. $$
\end{corollary}

\begin{proof}
Since every element of $ \Z / n\Z $ has order $ d $ for some $ d $ dividing $ n $, the sum over all possible $ d $ dividing $ n $ of the number of elements of order $ d $ is just the number of elements of $ \Z / n\Z $, which is $ n $.
\end{proof}

\begin{proof}[Proof of Proposition \ref{prop:6.4.1}]
Let $ A $ be as in the proposition. We must show that $ A $ contains an element of order $ n $. In fact, we will show, by induction on $ d $, that $ A $ contains exactly $ \Phi\rb{d} $ elements of order $ d $ for all $ d \mid n $. In particular, $ A $ has $ \Phi\rb{n} > 0 $ elements of order $ n $, so it is cyclic. If $ d = 1 $, the only element of order one is the identity of $ A $. Since $ \Phi\rb{1} = 1 $ the base case holds. Assume the claim is true for all $ d' < d $. $ A $ has
\begin{enumerate}
\item $ d $ elements of order dividing $ d $, and
\item $ \Phi\rb{d} $ elements of order $ d' $ for $ d' \mid d $ and $ d' < d $,
\end{enumerate}
so the number of elements of exact order $ d $ is $ d - \sum_{d' \mid d, \ d' < d} \Phi\rb{d'} $. By the corollary, this is precisely $ \Phi\rb{d} $.
\end{proof}

\subsection{Uniqueness}

We now turn to the question of showing that any two fields of $ p^r $ elements are isomorphic. Let $ K $ be such a field. The cyclicity of $ K^* $ immediately shows.

\begin{proposition}
Any finite field $ K $ of characteristic $ p $ is generated over $ \F_p $ by a single element $ \alpha \in K $.
\end{proposition}

\begin{proof}
Let $ \alpha $ be an element of $ K $, that generates $ K^* $ as an abelian group. Then $ \F_p\rb{\alpha} $ is contained in $ K $, but contains $ \alpha^n $ for all $ n $ so contains $ K^* $, hence $ K = \F_p\rb{\alpha} $.
\end{proof}

As a corollary, we deduce the following.

\begin{proposition}
For any prime $ p $ and any $ r \in \Z_{> 0} $, there exists an irreducible polynomial $ P\rb{X} \in \F_p\sb{X} $ of degree $ r $ in $ \F_p\sb{X} $.
\end{proposition}

\begin{proof}
Let $ K $ be a finite field of $ p^r $ elements, $ \alpha $ be an element of $ K $ that generates $ K $ over $ \F_p $, and $ P $ the minimal polynomial of $ \alpha $ over $ \F_p $. We then have a surjective map $ \F_p\sb{X} \to K $ taking $ X $ to $ \alpha $. It is kernel is generated by irreducible $ P $ of degree $ \deg\rb{P} = \sb{\F_p\rb{\alpha} : \F_p} = r $. Thus the following diagram holds.
$$
\begin{tikzcd}[column sep=1in]
\F_p\sb{X} \arrow[twoheadrightarrow]{dr}{Q\rb{X} \mapsto Q\rb{\alpha}} & \\
\dfrac{\F_p\sb{X}}{\ab{P\rb{X}}} \arrow[hookrightarrow]{u}{\subseteq} \arrow[swap]{r}{\sim} & K = \F_p\rb{\alpha}
\end{tikzcd}
$$
\end{proof}

We thus have the following.

\begin{lemma}
Every irreducible polynomial $ P\rb{X} $ of degree $ r $ in $ \F_p\sb{X} $ is a divisor of $ X^{p^r - 1} - 1 $.
\end{lemma}

\begin{proof}
Let $ K = \F_p\rb{\alpha} $ where $ \alpha $ is a root of $ P $. $ \#K = p^r $ so $ \alpha^{p^r} - \alpha $ is zero in $ K $. So $ P\rb{X} \mid X^{p^r} - X $.
\end{proof}

\begin{corollary}
Any two finite fields $ K, K' $ of cardinality $ p^r $ are isomorphic.
\end{corollary}

\begin{proof}
Choose $ \alpha \in K $ such that $ \alpha $ generates $ K $ over $ \F_p $. We can then write $ K = \F_p\rb{\alpha} \cong \F_p\sb{X} / \ab{P\rb{X}} $, where $ P\rb{X} $ is the minimal polynomial of $ \alpha $ over $ \F_p $. In particular $ P\rb{X} $ is irreducible of degree $ r $. Since $ P\rb{X} $ divides $ X^{p^r - 1} - 1 $ in $ \F_p\sb{X} $, it also divides $ X^{p^r - 1} - 1 $ in $ K'\sb{X} $. Since in $ K'\sb{X} $, $ X^{p^r - 1} - 1 $ factors into linear factors, $ P\rb{X} $ also factors into linear factors over $ K' $. In particular there exists a root $ \alpha' \in K' $ of $ P\rb{X} $ in $ K'\sb{X} $ such that $ P\rb{\alpha'} = 0 $. Then the map $ \F_p\sb{X} \to K' $ that sends $ X $ to $ \alpha' $ has kernel $ \ab{P\rb{X}} $ and induces a map
$$
\begin{tikzcd}[column sep=1in]
K \arrow{r}{Q\rb{\alpha} \mapsto Q\rb{X}}[swap]{\sim} & \dfrac{\F_p\sb{X}}{\ab{P\rb{X}}} \arrow[hookrightarrow]{r}{Q\rb{X} \mapsto Q\rb{\alpha'}} & K'
\end{tikzcd}
$$
Since this is map of fields from $ K $ to $ K' $ that takes $ \alpha $ to $ \alpha' $ it is injective. Since both fields $ K, K' $ have the same cardinality $ p^r $, it is also surjective and an isomorphism.
\end{proof}

If $ k = \Q $, $ \Q\sb{X} / \ab{X^2 - p} $ are pairwise nonisomorphic extensions of degree $ \alpha $ for every prime $ p $.

\marginpar{Lecture 11 \\ Monday \\ 29/10/18}

Lecture 11 is a problem class.

\marginpar{Lecture 12 \\ Wednesday \\ 31/10/18}

\section{$ R $-modules}

\subsection{Definitions}

\begin{definition}
An $ R $-module $ M $ is a set, together with two operations $ + : M \times M \to M $ and $ \cdot : R \times M \to M $, such that
\begin{enumerate}
\item $ \rb{M, +} $ makes $ M $ into an abelian group with identity $ 0_M $,
\item $ r\rb{m + m'} = rm + rm' $ for all $ r \in R $, $ m, m' \in M $,
\item $ \rb{r + r'} = rm + r'm $ for all $ r, r' \in R $, $ m \in M $,
\item $ \rb{rr'}m = r\rb{r'm} $ for all $ r, r' \in R $, $ m \in M $, and
\item $ 1_R \cdot m = m $ for all $ m \in M $.
\end{enumerate}
\end{definition}

\begin{note}
For an abelian group $ M $, let $ End\rb{M} $ denote the set of homomorphisms $ M \to M $ of abelian groups. $ End\rb{M} $ is a noncommutative ring. $ 2 $ if and only if for all $ r \in R $, $ \cdot r : M \to M $ lives in $ End\rb{M} $. $ 3 $, $ 4 $, and $ 5 $ if and only if the map $ R \to End\rb{M} $ given by $ 2 $ is a homomorphism of rings.
\end{note}

\begin{example}
The usual addition and multiplication on $ R $ naturally makes $ R $ into an $ R $-module. More generally, any ideal $ I $ of $ R $ is an $ R $-module with the usual addition and multiplication.
\end{example}

\begin{example}
If $ f : R \to S $, then $ f $ makes $ S $ into an $ R $-module, where the addition $ + $ is the usual addition in $ S $, and the multiplication law is defined by $ r \cdot s = f\rb{r} \cdot_S s $ for all $ r \in S $, $ s \in S $. In particular any quotient $ R / I $ is an $ R $-module. More generally, if $ f : R \to S $ is a homomorphism, and $ M $ is any $ S $-module, then $ M $ is also an $ R $-module via $ r \cdot m = f\rb{r} \cdot m $. In particular, $ R \to R / I $ lets us treat any $ R / I $-module $ M $ as an $ R $-module. Note that if $ M $ is an $ R / I $-module, then for all $ r \in I $, $ m \in M $, $ r \cdot m = 0 $. We say that $ I $ \textbf{annihilates} $ M $ in this situation. Conversely, if $ M $ is an $ R $-module and $ r \cdot m = 0 $ for all $ r \in I $, $ m \in M $, then $ M $ naturally has the structure of an $ R / I $-module. Given $ r + I \in R / I $, $ m \in M $, we define $ \rb{r + I} \cdot m = rm $. If $ r + I = r' + I $, then $ r - r' \in I $, so $ rm - r'm = \rb{r - r'}m = 0 $ by assumption.
\end{example}

\begin{example}
Let $ R = \Z $, and let $ M $ be an abelian group. Then $ M $ has the unique natural structure of $ \Z $-module, as follows. Property $ 3 $ from the module axioms shows that
$$ n \cdot m = \begin{cases} m + \dots + m & n > 0 \\ 0 & n = 0 \\ \rb{-m} + \dots + \rb{-m} & n < 0 \end{cases}. $$
Thus the multiplication law $ \Z \times M \to M $ is forced on us, and one checks that it does satisfy properties $ 2 $ to $ 5 $ above. Informally, we say that abelian groups are $ \Z $-modules.
\end{example}

\begin{example}
If $ R $ is a field, then $ R $-modules are just $ R $-vector spaces.
\end{example}

\begin{example}
Let $ S $ be a set, and let $ M_S $ be the set of $ R $-valued functions $ f : S \to R $. We add and multiply pointwise. For $ f, g \in M_S $, we can define $ f + g $ as the function that takes $ s \in S $ to $ f\rb{s} + g\rb{s} $, and $ rf $ as the function that takes $ s $ to $ r \cdot f\rb{s} $. $ M_S $ is clearly an $ R $-module. Also of interest is the $ R $-submodule $ F_S $ of $ M_S $ that consists of functions $ f : S \to R $ such that $ f\rb{s} = 0_R $ for all but finitely many $ s $. The $ R $-module $ F_S $ is called the \textbf{free $ R $-module} on the set $ S $ and will be very important for us.
\end{example}

\subsection{Submodules, quotients, and direct sums}

\begin{definition}
Let $ M $ be an $ R $-module. A subset $ N $ of $ M $ is an \textbf{$ R $-submodule} of $ M $ if $ N $ is closed under addition and multiplication by elements of $ R $. That is, $ N $ is an additive subgroup of $ M $, and for all $ n \in N $, $ r \in R $, we have $ rN \subseteq N $. In particular, the ideals of $ R $ are just the $ R $-submodules of $ R $.
\end{definition}

\begin{definition}
If $ S $ is any subset of $ M $, we define the \textbf{$ R $-submodule of $ M $ generated by $ S $} to be the set of all elements of $ M $ of the form $ r_1s_1 + \dots + r_ns_n $, where the $ r_i $ are elements of $ R $ and the $ s_i $ are elements of $ S $. It is the smallest $ R $-submodule of $ M $ containing $ S $.
\end{definition}

\begin{definition}
An $ R $-module $ M $ is a \textbf{finitely generated} $ R $-module if $ M $ admits a finite subset $ S $ of $ M $ such that the $ R $-submodule of $ M $ generated by $ S $ is all of $ M $. We say $ S $ is a \textbf{generating set} for $ M $.
\end{definition}

\begin{definition}
Let $ M $ be an $ R $-module and $ N $ be an $ R $-submodule of $ M $. We say two elements $ m, m' $ of $ M $ are \textbf{congruent modulo $ N $} if their difference $ m - m' $ lies in $ N $. This is easily seen to be an equivalence relation, and the equivalence classes are the cosets of the form $ m + N $, for $ m \in M $. The set of equivalence classes is denoted $ M / N $. It has the natural structure of an $ R $-module, where $ \rb{m + N} + \rb{m' + N} = \rb{m + m'} + N $ and $ r \cdot \rb{m + N} = rm + N $. This $ R $-module is called the \textbf{quotient of $ M $ by $ N $}. If $ m + N = m' + N $, then $ m - m' \in N $, so $ rm - rm' = r\rb{m - m'} \in N $. So well-defined. Have a natural map $ M \to M / N $ taking $ m $ to $ m + N $.
\end{definition}

\begin{definition}
Given two $ R $-modules $ M_1 $ and $ M_2 $, the \textbf{direct sum} $ M_1 \oplus M_2 $ is the set of ordered pairs $ \rb{m_1, m_2} $ with $ \rb{m_1, m_2} + \rb{m_1', m_2'} = \rb{m_1 + m_1', m_2 + m_2'} $ and $ r\rb{m_1, m_2} = \rb{rm_1, rm_2} $ for $ m_1, m_1' \in M_1 $, $ m_2, m_2' \in M_2 $, and $ r \in R $.
\end{definition}

\begin{example}
Let $ M $ be an $ R $-module and $ I $ an ideal of $ R $. Then we can form the $ R $-submodule $ IM $ of $ M $ consisting of all elements of $ M $ of the form $ i_1m_1 + \dots + i_rm_r $ where the $ i_j $ are in $ I $ and the $ m_j $ are in $ M $. This is an $ R $-submodule of $ M $, so we can form the quotient $ M / IM $. Then $ M / IM $ is certainly an $ R $-module, but it is also an $ R / I $-module. One can define multiplication $ R / I \times M / IM \to M / IM $ by $ \rb{r + I}\rb{m + IM} = rm + IM $. As always one has to check that this is well-defined, but this is straightforward. We need that if $ r - r' $ lies in $ I $, and $ m - m' $ lies in $ IM $, then $ rm - r'm' $ lies in $ IM $. But $ rm - r'm' = \rb{r - r'}m + r'\rb{m - m'} $ which is clearly in $ IM $.
\end{example}

\subsection{Module homomorphisms, kernels, and images}

\begin{definition}
A map $ f : M \to N $ of $ R $-modules is called a \textbf{homomorphism of $ R $-modules} if
\begin{enumerate}
\item $ f $ is a homomorphism of the underlying abelian groups, and
\item $ f\rb{rm} = rf\rb{m} $ for all $ r \in R $ and $ m \in M $.
\end{enumerate}
\end{definition}

Warning that a ring homomorphism $ R \to R $ satisfies $ f\rb{rr'} = f\rb{r}f\rb{r'} $, but an $ R $-module homomorphism $ R \to R $ satisfies $ f\rb{rr'} = rf\rb{r'} $.

\begin{definition}
The kernel of $ f : M \to N $ is the set $ \cb{m \in M \mid f\rb{m} = 0} $, an $ R $-submodule of $ M $. The image of $ f : M \to N $ is the set $ \cb{n \in N \mid \exists m \in M, \ f\rb{m} = n} $, an $ R $-submodule of $ N $.
\end{definition}

It is easy to see that the kernel and image of a homomorphism of $ R $-modules $ f : M \to N $ are $ R $-submodules of $ M $ and $ N $, respectively.

\begin{note}
In particular there is a natural homomorphism from $ M $ to $ M / N $, taking $ m $ to $ m + N $. This homomorphism has the following universal property, exactly analogous to the universal property of the quotient construction for rings.
\end{note}

\begin{proposition}[Universal property of the quotient]
Let $ N $ be an $ R $-submodule of $ M $, and let $ f : M \to M' $ be an $ R $-module homomorphism whose kernel contains $ N $. Then there is unique homomorphism $ \bar{f} : M / N \to M' $ such that $ f\rb{m + N} = f\rb{m} $ for all $ m \in M $. In particular the kernel of $ \bar{f} $ is the image of $ Ker\rb{f} $ in $ M / N $.
\end{proposition}

\begin{proof}
The proof is identical to that for quotient rings, and will be omitted.
\end{proof}

\subsection{Free modules}

\begin{definition}
Let $ M $ be an $ R $-module. A subset $ S $ of $ M $ is a \textbf{basis} for $ M $ if the following two conditions hold.
\begin{enumerate}
\item $ S $ \textbf{spans $ M $ over $ R $}. For all $ m \in M $, there exist $ s_1, \dots, s_n \in S $ finite and $ r_1, \dots, r_n \in R $ such that $ m = r_1s_1 + \dots + r_ns_n $, that is the $ R $-submodule of $ M $ generated by $ S $ is all of $ M $.
\item $ S $ is \textbf{$ R $-linearly independent}. For any collection $ s_1, \dots, s_n $ of distinct elements of $ S $, and any $ r_1, \dots, r_n \in R $, $ r_1s_1 + \dots + r_ns_n = 0 $ is nonzero in $ M $ unless all $ r_i $ are zero.
\end{enumerate}
\end{definition}

\begin{definition}
An $ R $-module $ M $ that has a basis $ S $ is called a \textbf{free} $ R $-module. The cardinality $ n $ of the basis $ S $ is called the \textbf{rank} of the free $ R $-module $ M $ over $ R $.
\end{definition}

\marginpar{Lecture 13 \\ Friday \\ 02/11/18}

\begin{remark}
If $ R $ is a field, then the notion of a basis for an $ R $-module coincides with the usual notion for vector spaces. In this case, at least if one assumes the axiom of choice, every $ R $-module has a basis. When $ R $ is not a field only very special modules have bases. For instance any quotient $ R / I $ of $ R $, for $ I $ a nonzero ideal, has no basis.
\end{remark}

\begin{example}
The ring $ R $ is a free module of rank one over $ R $, with basis $ \cb{1_R} $. More generally any unit $ u \in R^* $ gives a basis of $ R $ as an $ R $-module.
\end{example}

Recall that the free module $ F_S $ on a set $ S $ was defined to be the set of functions $ f : S \to R $ such that $ f\rb{s} = 0 $ for all but finitely many $ s \in S $. For each $ s \in S $, we have an element $ e_s $ of $ F_S $ defined by $ e_s\rb{t} = 0 $ for all $ t \in S $ with $ t \ne s $, $ e_s\rb{s} = 1 $. Claim that the $ e_s $ form a basis for $ F_S $. In particular, given $ f : R \to S $ with $ f\rb{s} = 0 $ for all but finitely many $ s $, let $ s_1, \dots, s_n $ be the set of elements in $ S $ on which $ f\rb{s_i} $ is nonzero. Set $ r_i = f\rb{s_i} $. Claim that $ f = r_1e_{s_1} + \dots + r_ne_{s_n} $. If $ f\rb{s} = 0 $, then $ s \notin \cb{s_1, \dots, s_n} $ so $ e_{s_i}\rb{s} = 0 $ for all $ i $. For any $ i $, $ e_{s_i}\rb{s_j} = 0 $ if $ i \ne j $ and $ e_{s_i}\rb{s_i} = 1 $, so $ \rb{\sum_{i = 1}^n r_ie_{s_i}}\rb{s_j} = r_j = f\rb{s_j} $. Then $ f $ can be written as $ r_1e_{s_1} + \dots + r_ne_{s_n} $, so the $ e_s $ span $ F_S $. On the other hand, for all $ s_1, \dots, s_n \in S $ distinct with $ \sum_{i = 1}^n r_ie_{s_i} = 0 $, $ \sum_{i = 1}^n r_ie_{s_i} $ takes the value $ r_i $ by evaluating at $ s_i $ for all $ i $, and thus is only the zero function when all $ r_i $ are zero for all $ i $, so we do have $ R $-linear independence. Thus $ F_S $ is free, justifying its name.

\begin{proposition}
Let $ F_1, F_2 $ be free modules with basis $ S_1, S_2 $. Then $ F_1 \oplus F_2 $ is free with basis
$$ \cb{\rb{s, 0} \mid s \in S_1} \cup \cb{\rb{0, s'} \mid s' \in S_2}. $$ Moreover, if $ F_1 $ and $ F_2 $ are free of finite ranks $ n_1 $ and $ n_2 $ respectively, then $ F_1 \oplus F_2 $ is free of rank $ n_1 + n_2 $.
\end{proposition}

\begin{proof}
For linear independence, let $ s_1, \dots, s_m \in S_1 $ and $ s_1', \dots, s_l' \in S_2 $ be distinct. Suppose we have $ r_1, \dots, r_m, r_1', \dots, r_l' \in R $ such that $ r_1\rb{s_1, 0} + \dots + r_m\rb{s_m, 0} + r_1'\rb{0, s_1'} + \dots + r_l'\rb{0, s_l'} = 0 $. Then $ r_1s_1 + \dots + r_ms_m = 0 $ in $ M_1 $ and $ r_1's_1' + \dots + r_l's_l' = 0 $ in $ M_2 $ gives all $ r_i, r_i' $ are zero. For spanning set, let $ \rb{m, m'} \in M_1 \oplus M_2 $. Write $ m = r_1s_1 + \dots + r_ms_m $ for $ s_i \in S_1 $ and $ m' = r_1's_1' + \dots + r_l's_l' $ for $ s_i' \in S_2 $, then $ \rb{m, m'} = r_1\rb{s_1, 0} + \dots + r_m\rb{s_m, 0} + r_1'\rb{0, s_1'} + \dots + r_l'\rb{0, s_l'} $. Thus $ S_1 \cup S_2 $ is a basis for $ F_1 \oplus F_2 $, which immediately proves the claim.
\end{proof}

Free modules have the following universal property.

\begin{proposition}[Universal property of free modules]
Let $ F_S $ be a free $ R $-module on a set $ S $. Then for any $ R $-module $ M $, and any map of sets $ f : S \to M $, there is a unique homomorphism of $ R $-modules $ \phi_f : F_S \to M $ such that $ \phi_f\rb{e_s} = f\rb{s} $ for all $ s \in S $.
\end{proposition}

\begin{proof}
Define $ \phi_f $ by $ \phi_f\rb{g} = \sum_{s \in S, \ g\rb{s} \ne 0} g\rb{s}f\rb{s} $. Note that this is a finite sum since all but finitely many $ s $ have $ g\rb{s} = 0 $. Then it is clear that this is a homomorphism of $ R $-modules. On the other hand suppose $ \phi $ is any other map $ F_S \to N $ with $ \phi\rb{e_s} = f\rb{s} $ for all $ s $. Then we can write $ g = \sum_{s \in S, \ g\rb{s} \ne 0} g\rb{s}e_s $, again a finite sum, so
$$ \phi\rb{g} = \sum_{s \in S, \ g\rb{s} \ne 0} g\rb{s}\phi\rb{e_s} = \sum_{s \in S, \ g\rb{s} \ne 0} g\rb{s}f\rb{s}, $$
so uniqueness is clear.
\end{proof}

The image of $ \phi_f $ is the submodule of $ N $ generated by the elements $ f\rb{s} $, for $ s \in S $.

\begin{corollary}
Let $ M $ be a free $ R $-module with a basis $ T $ for $ M $. Let $ S $ be any set of the same cardinality as $ T $, and let $ g : T \to S $ be any bijection. Then the map $ \phi_f : F_S \to M $ is an isomorphism. In particular, any two free $ R $-modules of the same rank are isomorphic.
\end{corollary}

\begin{proof}
The map $ \phi_f : F_S \to M $ is such that $ \phi_f\rb{e_s} = f\rb{s} $. Since elements of $ T $ are linearly independent, this map is injective. Suppose $ \phi_f\rb{g} = 0 $. Can write $ g = \sum r_ie_{s_i} $ for $ s_i $ distinct, then $ \phi_f\rb{g} = \sum r_if\rb{s_i} $. Since $ s_i $ are distinct, $ f\rb{s_i} $ are distinct elements of $ T $, so $ \sum r_if\rb{s_i} = 0 $ gives all $ r_i $ are zero, so $ g = 0 $. Since elements of $ T $ span $ M $, this map is surjective. Given $ m \in M $, write $ m = \sum r_it_i $. For all $ i $, find $ s_i $, with $ f\rb{s_i} = t_i $. Then $ \phi_f\rb{\sum r_ie_{s_i}} = \sum r_it_i = m $. Thus $ M $ is isomorphic to $ F_S $. Since $ M $ was arbitrary, any module of rank equal to the cardinality of $ S $ is isomorphic to $ F_S $ and the result follows.
\end{proof}

\begin{note}
It is also true, but harder to prove, that if $ M, N $ are free of different ranks, then $ M \ncong N $.
\end{note}

\subsection{Generators and relations}

Now let $ M $ be any $ R $-module, and let $ S = \cb{m_1, \dots, m_t} $ be a finite subset of $ M $ generating $ M $. Then we have a natural map $ F_S \to M $ taking $ e_i $ to $ m_i $ for all $ m_i \in S $, and this map is surjective. In particular, let $ K $ be the kernel of this map, then $ M \cong F_S / K $. Elements of the kernel $ K $ are called \textbf{relations} among $ S $.

\marginpar{Lecture 14 \\ Monday \\ 05/11/18}

Explicitly, an element of $ K $ is a map $ f : S \to R $ such that $ f\rb{s} = 0 $ for all but finitely many $ s $, and $ \sum_{s \in S} f\rb{s}s = 0 $. In other words, each element of $ K $ encodes a linear relation among the elements of $ S $. It is a measure of how far the elements of $ S $ are from being linearly independent. Let $ T = \cb{k_1, \dots, k_s} $ be a subset of $ K $ that generates $ K $. Then in the same way as above, we get a surjection $ F_T \twoheadrightarrow K $ taking $ e_i $ to $ k_i $, with $ F_T $ a free module of rank $ s $. Composing with the inclusion of $ K $ in $ F_S $ gives us a map $ \phi : F_T \to F_S $ whose image is $ K $. The map $ \phi $ determines $ M $ up to isomorphism with the quotient $ F_S / K $, and hence with $ F_S / \phi\rb{F_T} $. A description of a module as a quotient of a free module by the image of a map of free modules is called a \textbf{presentation} of $ M $. If both modules have finite rank the presentation is called \textbf{finite}. A module that has a finite presentation is called \textbf{finitely presented}. Put another way, a presentation is a description of a module $ M $ in terms of
\begin{enumerate}
\item a generating set $ S $ for $ M $, and
\item a generating set $ T $ for the linear relations satisfied by $ S $.
\end{enumerate}
When $ S $ and $ T $ are finite we can encode a presentation in a matrix, called the \textbf{presentation matrix}. Write $ S = \cb{e_1, \dots, e_t} $ and $ T = \cb{f_1, \dots, f_s} $. Then $ \phi $ is determined by $ \phi\rb{f_1}, \dots, \phi\rb{f_s} $. For each $ i $ we can write $ \phi\rb{f_i} $ as a sum $ \sum_{j = 1}^t r_{ij}e_{s_j} $, and let $ A $ be the $ s $ by $ t $ matrix whose $ i, j $ entry is $ r_{ij} $. Then $ A $ gives a map from $ R^t $ to $ R^s $, and the quotient of $ R^s $ by the submodule $ AR^t $ of $ R^s $ is isomorphic to $ M $.

\begin{example}
Let $ R = \Z $ and $ M = \Z / n\Z $ generated by $ \sb{1}_n $. Map $ \Z \to M $ is the quotient map with kernel $ \ab{n} $. So presentation matrix is just $ \rb{n} $.
\end{example}

\begin{example}
Let $ R = \Z\sb{\sqrt{-5}} $ and $ I = \ab{2, 1 + \sqrt{-5}} $. $ R^2 \twoheadrightarrow I $ by $ e_1 \mapsto 2 $ and $ e_2 \mapsto 1 + \sqrt{-5} $. $ 2e_2 - \rb{1 + \sqrt{-5}}e_1 \mapsto 0 $ in $ I $, and since $ \rb{2}\rb{3} = \rb{1 + \sqrt{-5}}\rb{1 - \sqrt{-5}} $, $ 3e_1 - \rb{1 - \sqrt{-5}}e_2 \mapsto 0 $ in $ I $. Claim that the two relations $ \rb{1 + \sqrt{-5}}e_1 - 2e_2 $ and $ 3e_1 - \rb{1 - \sqrt{-5}}e_2 $ generate $ K $. Let $ ae_1 + be_2 $ be a relation, so $ a, b \in R $ and $ 2a + \rb{1 - \sqrt{-5}}b = 0 $, that is $ a = \rb{\rb{1 + \sqrt{-5}} / 2}b $. Question is for which $ b $ does $ \rb{\rb{1 + \sqrt{-5}} / 2}b $ lie in $ R $. Claim that the set of such $ b $ is an ideal $ J $ of $ R $. $ 2 \in J $ and $ 1 - \sqrt{-5} \in J $ so $ J $ contains $ \ab{2, 1 - \sqrt{-5}} $. $ 1 \notin J $, since $ \ab{2, 1 - \sqrt{-5}} $ is maximal, $ J = \ab{2, 1 - \sqrt{-5}} $. So we have a map $ R^2 \to R^2 $ with matrix
$$ \two{1 + \sqrt{-5} & 3}{-2 & -1 + \sqrt{-5}} $$
presenting $ I $.
\end{example}

General idea is if we have a presentation matrix $ A : R^t \to R^s $ for $ M $, with $ s $ rows and $ t $ columns, then $ BAC $ is also a presentation matrix for $ M $, where $ B $ is $ s \times s $ and $ C $ is $ t \times t $, and $ B $ and $ C $ are invertible matrices with inverse matrix entries in $ R $.

\section{Noetherian rings and modules}

\subsection{Definitions and basic properties}

\begin{definition}
Let $ R $ be a ring and let $ M $ be an $ R $-module. We say $ M $ is \textbf{Noetherian} if every increasing infinite chain
$$ M_1 \subseteq M_2 \subseteq \dots $$
of $ R $-submodules $ M_i $ of $ M $ is \textbf{eventually constant}. That is, for any such chain, there exists $ N $ such that we have $ M_i = M_N $ for all $ i \ge N $. A ring $ R $ is Noetherian if $ R $ is Noetherian as an $ R $-module over itself. Since the $ R $-submodules of $ R $ are just the ideals of $ R $, a ring $ R $ is Noetherian if every increasing infinite chain
$$ I_1 \subseteq I_2 \subseteq \dots $$
of ideals $ I_j $ of $ R $ is eventually constant.
\end{definition}

The following result about Noetherian $ R $-modules is fundamental.

\begin{proposition}
An $ R $-module $ M $ is Noetherian if and only if every $ R $-submodule $ N $ of $ M $ is finitely generated.
\end{proposition}

\begin{proof}
Suppose first that $ M $ is Noetherian, and let $ N $ be an $ R $-submodule of $ M $. Choose an element $ n_0 $ of $ N $, and let $ N_0 $ be the $ R $-submodule of $ N $ generated by $ n_0 $. If $ N_0 $ is all of $ N $, then $ N $ is finitely generated. Otherwise, choose $ n_1 $ in $ N \setminus N_0 $, and let $ N_1 $ be the $ R $-submodule of $ N $ generated by $ n_0 $ and $ n_1 $. If $ N $ is not finitely generated, we may continue this process indefinitely, choosing for each $ i $ an $ n_i $ in $ N \setminus N_{i - 1} $, which is nonempty since $ N $ is not finitely generated, and letting $ N_i $ be generated by $ n_0, \dots, n_i $. In this way we obtain a strictly increasing infinite chain
$$ N_0 \subsetneq N_1 \subsetneq \dots $$
of submodules of $ M $, contradicting the fact that $ M $ is Noetherian. Conversely, suppose that every $ R $-submodule of $ M $ is finitely generated, and let
$$ M_0 \subseteq M_1 \subseteq \dots $$
be an increasing chain. We must show that this chain is eventually constant. Let $ N $ be the union of the submodules $ M_i $. Note that $ N $ is an $ R $-submodule of $ M $. Thus $ N $ is finitely generated, say by $ n_1, \dots, n_s $. If $ n_1, n_2 \in N $, then there exist $ i, j $ with $ n_1 \in M_i $, $ n_2 \in M_j $. If $ d \ge i, j $, $ n_1, n_2 \in M_d $, so $ n_1 + n_2 \in M_d $ gives $ n_1 + n_2 \in N $. Since $ N $ is the union of the $ M_j $, there exist $ i_1, \dots, i_s $ such that $ n_j $ is in $ M_{i_j} $ for all $ j $. Let $ d $ be the largest of the $ i_j $. Then $ M_d $ contains $ n_1, \dots, n_s $ so it contains $ N $. In particular for any $ d' \ge d $ we have $ N \subseteq M_d \subseteq M_{d'} \subseteq N $, so $ N = M_d = M_{d'} $ for all such $ d' $ and the chain is constant after $ M_d $.
\end{proof}

\marginpar{Lecture 15 \\ Wednesday \\ 07/11/18}

\begin{corollary}
Let $ R $ be a PID. Then $ R $ is Noetherian.
\end{corollary}

\begin{proof}
Every ideal of $ R $ is principal, hence finitely generated.
\end{proof}

\begin{example}
Any field is Noetherian.
\end{example}

\begin{example}
The ring $ \C\sb{X^{\Q_{\ge 0}}} $ is not Noetherian. The ideal consisting of all elements with no constant term is not finitely generated.
\end{example}

\subsection{Finitely generated modules over Noetherian rings}

Plan is
\begin{enumerate}
\item show that Noetherianness has strong consequences, and
\item use these properties to show $ R $ is Noetherian gives $ R\sb{X} $ is Noetherian and other consequences.
\end{enumerate}
The goal of this section is to prove the following theorem.

\begin{theorem}
\label{thm:8.2.1}
Any finitely generated $ R $-module $ M $ over a Noetherian ring $ R $ is Noetherian.
\end{theorem}

We proceed in several steps.

\begin{proposition}
Let $ M $ be a Noetherian $ R $-module. Then for any submodule $ N $ of $ M $,
\begin{enumerate}
\item $ N $ is Noetherian, and
\item $ M / N $ is Noetherian.
\end{enumerate}
\end{proposition}

\begin{proof}
\hfill
\begin{enumerate}
\item Since $ M $ is Noetherian, any submodule of $ M $ is finitely generated, and thus any submodule of $ N $ is finitely generated.
\item Given a submodule $ N' $ of $ M / N $, let $ \widetilde{N'} $ be its preimage in $ N $ under the canonical quotient map $ f : M \to M / N $. We have a surjection from $ \widetilde{N'} $ to $ N' $ induced by $ f $. $ \widetilde{N'} \subseteq M $, so $ \widetilde{N'} $ is finitely generated, say by $ n_1, \dots, n_s $. Claim that $ f\rb{n_1}, \dots, f\rb{n_s} $ generate $ N' $. Given $ n \in N' $, there exists $ \widetilde{n} \in \widetilde{N'} $ such that $ f\rb{\widetilde{n}} = n $. Write $ \widetilde{n} = r_1n_1 + \dots + r_sn_s $ for $ r_i \in R $. Then $ n = f\rb{\widetilde{n}} = r_1f\rb{n_1} + \dots + r_sf\rb{n_s} $.
\end{enumerate}
\end{proof}

\begin{proposition}
Let $ M $ be an $ R $-module, let $ N $ be a Noetherian submodule of $ M $, and suppose that $ M / N $ is Noetherian. Then $ M $ is Noetherian.
\end{proposition}

\begin{proof}
Let $ M' $ be a submodule of $ M $. Then $ M' \cap N $ is a submodule of $ M $, hence finitely generated. Let $ a_1, \dots, a_s \in M' \cap N $ generate $ M' \cap N $. Let $ \bar{M'} $ denote the image of $ M' $ in $ M / N $. This is a submodule of $ M / N $ and thus finitely generated. Let $ \bar{b_1}, \dots, \bar{b_t} \in \bar{M'} \subseteq M / N $ generate $ \bar{M'} $, and choose elements $ b_1, \dots, b_t $ of $ M' $ mapping to $ \bar{b_1}, \dots, \bar{b_t} $ in $ M / N $, respectively. We now show that $ a_1, \dots, a_s, b_1, \dots, b_t $ is a generating set for $ M' $, proving the claim. Given any $ m \in M' $, let $ \bar{m} $ be its image in $ M / N $ under $ f : M' \to \bar{M'} $. Then we can write $ \bar{m} $ as a sum $ r_1\bar{b_1} + \dots + r_t\bar{b_t} $ for some $ r_1, \dots, r_t \in R $. Let $ m' = m - r_1b_1 - \dots - r_tb_t $. Then the image of $ m' $ in $ M / N $ is $ f\rb{m'} = \bar{m} - r_1\bar{b_1} - \dots - r_t\bar{b_t} = 0 $. So $ m' $ lies in $ N $. $ m \in M', r_1b_1 \in M', \dots, r_tb_t \in M' $ so $ m' $ also lies in $ M' $. So it lies in $ M' \cap N $. We can thus write $ m' $ as $ q_1a_1 + \dots + q_sa_s $ for some $ q_1, \dots, q_s \in R $. We then have
$$ m = q_1a_1 + \dots + q_sa_s + r_1b_1 + \dots + r_tb_t, $$
proving the claim.
\end{proof}

\begin{corollary}
Let $ M $ and $ N $ are Noetherian $ R $-modules, then so is $ M \oplus N $.
\end{corollary}

\begin{proof}
We have a surjection $ M \oplus N \to M $ taking $ \rb{m, n} $ to $ m $. Its kernel $ K $ is the set of pairs of $ M \oplus N $ of the form $ \rb{0, n} $, which is isomorphic to $ N $ by the map $ N \to K $ taking $ n $ to $ \rb{0, n} $, and hence Noetherian. The surjection $ M \oplus N \to M $ descends to an isomorphism $ \rb{M \oplus N} / K \cong M $, so that $ \rb{M \oplus N} / K $ is Noetherian. Thus $ M \oplus N $ is Noetherian.
\end{proof}

Now assume $ R $ is Noetherian. Then $ R, R \oplus R, \dots $ are all Noetherian $ R $-modules, that is the following.

\begin{corollary}
If $ R $ is Noetherian, then any free $ R $-module of finite rank is Noetherian.
\end{corollary}

\begin{proof}
A free $ R $-module of rank $ s $ is the direct sum of $ s $ copies of $ R $, each of which is Noetherian as an $ R $-module when $ R $ is Noetherian.
\end{proof}

\begin{proof}[Proof of Theorem \ref{thm:8.2.1}]
Let $ M $ be a finitely generated $ R $-module, and let $ m_1, \dots, m_s $ be a set of generators for $ M $. Then if $ R^s $ is a free $ R $-module of rank $ s $, with generators $ e_1, \dots, e_s $, we have a surjection of $ R^s $ onto $ M $ taking $ e_i $ to $ m_i $ for all $ i $. Let $ K $ be the kernel. Then $ M $ is isomorphic to $ R^s / K $, and $ R^s $ is a Noetherian $ R $-module, so $ M $ is Noetherian as well.
\end{proof}

\section{Polynomial rings in several variables}

\subsection{The Hilbert basis theorem}

In this section, we will use the ideas of the previous section to establish the following key result about polynomial rings, known as the Hilbert basis theorem.

\begin{theorem}[Hilbert basis theorem]
\label{thm:9.1.1}
Let $ R $ be a Noetherian ring. Then $ R\sb{X} $ is Noetherian.
\end{theorem}

\marginpar{Lecture 16 \\ Friday \\ 09/11/18}

Over a field, if $ Q\rb{X} = a_nX^n + \dots $ and $ P\rb{X} = b_mX^m + \dots $ for $ m \ge n $ and $ a_n, b_m \ne 0 $, then
$$ \deg\rb{P\rb{X} - \dfrac{b_m}{a_n}X^{m - n}Q\rb{X}} < \deg\rb{P\rb{X}}. $$
Over a ring, this only goes so far. Over $ \Z $, cannot use a multiple of $ 3X + 4 $ to reduce the degree of $ a_nX^n + \dots $ unless $ 3 \mid a_n $. Let $ P\rb{X} = b_0 + \dots + b_nX_n $, with $ b_n \in R $ nonzero. We say that $ b_n $ is the \textbf{leading coefficient} of $ P\rb{X} $. In general, if I have $ Q_1\rb{X}, \dots, Q_r\rb{X} $ with degrees $ d_1, \dots, d_r $ and leading coefficients $ a_1, \dots, a_r $ and $ P\rb{X} $ of degree $ d \ge d_1, \dots, d_r $ then there exist $ n_1, \dots, n_r \in R $ such that
$$ \deg\rb{P\rb{X} - n_1X^{d - d_1}Q_1\rb{X} - \dots - n_rX^{d - d_r}Q_r\rb{X}} < d, $$
if and only if leading coefficient of $ P\rb{X} $ is in the ideal generated by $ a_1, \dots, a_r $.

\begin{lemma}
Let $ R $ be Noetherian and $ I \subseteq R\sb{X} $ be an ideal. Let $ J \subseteq R $ be the set of leading coefficients of polynomials in $ I $. That is, the set of $ a \in R $ such that there exists a polynomial $ P\rb{X} $ in $ I $ with leading coefficient $ a $. Then $ J $ is an ideal of $ R $.
\end{lemma}

\begin{proof}
Certainly if $ a \in J $ is the leading coefficient of $ P\rb{X} \in I $ such that $ P\rb{X} = aX^n + \dots $, then for any $ r \in R $, $ ra $ is the leading coefficient of $ rP\rb{X} = raX^n + \dots $ so $ ra \in J $, so $ J $ is closed under multiplication. On the other hand, if $ a, b \in J $ are the leading coefficients of $ P\rb{X} $ and $ Q\rb{X} $ in $ I $, then let $ n, m $ be the degrees of $ P\rb{X} = aX^n + \dots $ and $ Q\rb{X} = bX^m + \dots $ respectively. Without loss of generality we may assume $ n \ge m $. Then $ a + b $ is the leading coefficient of $ P\rb{X} + X^{n - m}Q\rb{X} = \rb{a + b}X^{n + m} + \dots $, and the latter polynomial is in $ I $ so $ a + b \in J $. Thus $ J $ is closed under addition, and is therefore an ideal.
\end{proof}

Now since $ R $ is Noetherian, $ J $ is finitely generated, say by $ a_1, \dots, a_s \in R $. By definition of $ J $, there are thus polynomials $ P_1, \dots, P_s $ in $ I $, of degrees $ d_1, \dots, d_n $, such that $ P_i = a_iX^{d_i} + \dots $ has leading coefficient $ a_i $ for all $ i $. Let $ N $ be the largest of the $ d_i $.

\begin{lemma}
Given $ Q\rb{X} \in I $ of degree $ d \ge N $. Then there exist $ R_1\rb{X}, \dots, R_s\rb{X} \in R\sb{X} $ such that $ Q\rb{X} - R_1\rb{X}P_1\rb{X} - \dots - R_s\rb{X}P_s\rb{X} $ has degree less than $ N $.
\end{lemma}

\begin{proof}
The proof is by induction on $ d $ and the base case $ d < N $ is clear by setting $ R_i = 0 $ for all $ i $. Suppose the claim is true for polynomials of degree less than or equal to $ d - 1 $, with $ d \ge N $. Let $ a \in J $ be the leading coefficient of $ Q\rb{X} = aX^d + \dots $, so that $ Q\rb{X} - aX^d $ has degree at most $ d - 1 $. Since $ a $ lies in $ J $ we can write $ a = r_1a_1 + \dots + r_sa_s $. Then the leading term of the polynomial
$$ r_1X^{d - d_1}P_1\rb{X} + \dots + r_sX^{d - d_s}P_s\rb{X} $$
is $ aX^d $, so the difference
$$ Q\rb{X} - r_1X^{d - d_1}P_1\rb{X} - \dots - r_sX^{d - d_s}P_s\rb{X} $$
has degree at most $ d - 1 $ and lies in $ I $. By the inductive hypothesis this difference is an $ R\sb{X} $-linear combination of the $ P_i\rb{X} $,
$$ R_1\rb{X}P_1\rb{X} + \dots + R_s\rb{X}P_s\rb{X}. $$
So
$$ Q\rb{X} = \rb{R_1\rb{X} + r_1X^{d - d_1}}P_1\rb{X} + \dots + \rb{R_s\rb{X} + r_sX^{d - d_s}}P_s\rb{X}. $$
\end{proof}

\begin{proof}[Proof of Theorem \ref{thm:9.1.1}]
The following proof is due to Emmy Noether, and is a vast simplification of Hilbert's original proof. Let $ I $ be an ideal of $ R\sb{X} $. We want to show that $ I $ is finitely generated. Let $ I_{\le N} = I \cap R\sb{X}_{\le N} $ be the subset of $ I $ consisting of all polynomials of degree at most $ N $. Then $ I_{\le N} $ is an $ R $-submodule of the $ R $-module $ R\sb{X}_{\le N} $ of all polynomials of degree at most $ N $. The latter is free of rank $ N + 1 $ and generated by $ 1, \dots, X^N $ as an $ R $-module, so it is finitely generated, hence Noetherian. In particular since $ R $ is Noetherian $ I_{\le N} $ is also a finitely generated $ R $-module. Let $ T_1\rb{X}, \dots, T_k\rb{X} $ generate $ I_{\le N} $ as an $ R $-module. We will show that
$$ P_1\rb{X}, \dots, P_s\rb{X}, T_1\rb{X}, \dots, T_k\rb{X} $$
generate $ I $ as an $ R\sb{X} $-module. More precisely, we will show that $ Q\rb{X} $ is an $ R\sb{X} $-linear combination of the $ P_i\rb{X} $ and $ T_j\rb{X} $. Given $ Q\rb{X} \in I $, there exist $ R_1\rb{X}, \dots, R_s\rb{X} \in R\sb{X} $ such that
$$ Q\rb{X} = R_1\rb{X}P_1\rb{X} + \dots + R_s\rb{X}P_s\rb{X} + T\rb{X}, $$
with $ T\rb{X} \in I_{\le N} $. There exist $ r_1, \dots, r_k \in R $ such that
$$ T\rb{X} = r_1T_1\rb{X} + \dots + r_kT_k\rb{X}, $$
so
$$ Q\rb{X} = R_1\rb{X}P_1\rb{X} + \dots + R_s\rb{X}P_s\rb{X} + r_1T_1\rb{X} + \dots + r_kT_k\rb{X}. $$
\end{proof}

As a corollary, we deduce the following.

\begin{corollary}
Let $ R $ be any field or PID, or indeed any Noetherian ring. Then for any $ n $, the ring $ R\sb{X_1, \dots, X_n} $ is Noetherian.
\end{corollary}

An observation is that if $ R $ is Noetherian and $ I \subseteq R $ is an ideal, then $ R / I $ is Noetherian. Let $ J $ be an ideal of $ R / I $ and $ \widetilde{J} $ be preimage of $ J $ in $ R $. There exist $ \widetilde{j_1}, \dots, \widetilde{j_n} $ generating $ \widetilde{J} $ over $ R $. Let $ j_i = \widetilde{j_i} + I \in R / I $. These lie in $ J $ and generate $ J $ over $ R / I $. In particular, any quotient of polynomial ring over a field or PID is Noetherian. Indeed, since any quotient of a Noetherian ring is Noetherian, we can say more.

\begin{definition}
Let $ R $ be a ring. An $ R $-algebra is a ring $ S $ together with a homomorphism $ f : R \to S $. If $ S $ is an $ R $-algebra, we say that $ S $ is finitely generated as an $ R $-algebra over $ R $ if there exists a finite set of elements $ s_1, \dots, s_n \in S $ such that every element of $ S $ can be expressed as a polynomial in the $ s_i $ with coefficients in $ R $. Equivalently, $ S $ is generated over $ R $ by $ s_1, \dots, s_n $ if the homomorphism $ R\sb{X_1, \dots, X_n} \to S $ by $ f : R \mapsto S $ and sending $ X_i $ to $ s_i $ is surjective.
\end{definition}

\begin{note}
Any finitely generated $ R $-algebra $ S $ is isomorphic to a quotient $ R\sb{X_1, \dots, X_n} / I $ for some $ n $ and some ideal $ I $. Thus we can rephrase the Hilbert basis theorem as saying that if $ R $ is Noetherian, then any finitely generated $ R $-algebra is Noetherian.
\end{note}

\marginpar{Lecture 17 \\ Monday \\ 12/11/18}

Lecture 17 is a problem class.

\marginpar{Lecture 18 \\ Wednesday \\ 14/11/18}

\subsection{Polynomial rings over UFDs are UFDs}

Our next goal is to study factorisation in polynomial rings of the form $ R\sb{X} $. $ \Z\sb{X} $ is not a PID nor a UFD. Idea is relate factorisations in $ \Z\sb{X} $ to factorisations in $ \Q\sb{X} $. Warning that irreducibles in $ \Q\sb{X} $ does not give irreducibles in $ \Z\sb{X} $.

\begin{example}
$ 3x + 15 $ irreducible in $ \Q\sb{X} $. In $ \Z\sb{X} $ $ 3x + 15 = 3\rb{x + 15} $.
\end{example}

Certainly if $ R $ is not a UFD then we cannot expect to have unique factorisation in $ R\sb{X} $, since we do not even have it in $ R $. Assume $ R $ is a UFD. Then the ring $ R\sb{X} $ might be quite complicated, but $ R\sb{X} $ is contained in a much simpler ring where we do understand factorisation, the ring $ K\sb{X} $, where $ K $ is the field of fractions of $ R $. Our goal will thus be to compare factorisations in $ K\sb{X} $ with factorisations in $ R\sb{X} $. Fundamental question is can we turn factorisations in $ K\sb{X} $ of $ P\rb{X} \in R\sb{X} $ into factorisations in $ R\sb{X} $? The key to doing this is the following result, often called Gauss' lemma.

\begin{theorem}[Gauss' lemma]
\label{thm:9.2.1}
Let $ R $ be a UFD and let $ K $ be its field of fractions. Let $ P\rb{X} \in R\sb{X} $, and let $ Q\rb{X} $ be a polynomial in $ K\sb{X} $ that divides $ P\rb{X} $ in $ K\sb{X} $. Then there is an element $ \alpha \in K^* $ such that $ \alpha Q\sb{X} $ lies in $ R\sb{X} $, and divides $ P\rb{X} $ in $ R\sb{X} $. In particular, if $ P\rb{X} $ is reducible in $ K\sb{X} $, then $ P\rb{X} $ is also reducible in $ R\sb{X} $.
\end{theorem}

\begin{proof}
Write $ P\rb{X} = Q\rb{X}T\rb{X} \in K\sb{X} $, and choose nonzero elements $ e_1, e_2 \in R $ such that $ e_1Q\rb{X} $ and $ e_2T\rb{X} $ have coefficients in $ R $, and so that the greatest common divisor of the coefficients of $ Q\rb{X} $ is one, as is the greatest common divisor of the coefficients of $ T\rb{X} $. Letting $ d = e_1e_2 $, we have $ dP\rb{X} = Q'\rb{X}T'\rb{X} $ with $ Q'\rb{X} = e_1Q\rb{X} $ and $ T'\rb{X} = e_2T\rb{X} $. Suppose $ d $ is nota  unit in $ R $. Then $ d $ is divisible by an irreducible element $ q $ of $ R $. Since $ R $ is a UFD, irreducibles are prime, so the ideal of $ R $ generated by $ q $ is a prime ideal. Thus $ R / \ab{q} $ is an integral domain, so $ R / \ab{q}\sb{X} $ is as well. Moreover, if $ \bar{Q'}\rb{X} $ and $ \bar{T'}\rb{X} $ are the images of $ Q'\rb{X} $ and $ T'\rb{X} $ modulo $ \ab{q} $ in $ R / \ab{q}\sb{X} $, $ dP\rb{X} = Q'\rb{X}T'\rb{X} $ becomes $ 0 = \bar{Q'}\rb{X}\bar{T'}\rb{X} $ in $ R / \ab{q}\sb{X} $. Since $ R / \ab{q}\sb{X} $ is an integral domain we must have either $ \bar{Q'}\rb{X} = 0 $ or $ \bar{T'}\rb{X} = 0 $ in $ R / \ab{q}\sb{X} $. Without loss of generality assume $ \bar{Q'}\rb{X} = 0 $. Then all the coefficients of $ Q'\rb{X} $ are divisible by $ q $. Thus $ d_1P\rb{X} = Q_1\rb{X}T_1\rb{X} $ for $ Q_1\rb{X}, T_1\rb{X} \in R\sb{X} $ and $ Q_1\rb{X} $ is a multiple of $ Q\rb{X} $ in $ K\sb{X} $. If $ d_1 $ is a unit, done. Otherwise write $ d_1 = d_2q_1 $ for $ q_1 $ irreducible. Same trick gives $ d_2P\rb{X} = Q_2\rb{X}T_2\rb{X} $ for $ Q_2\rb{X}, T_2\rb{X} \in R\sb{X} $ and $ Q_2\rb{X} $ is a multiple of $ Q_1\rb{X} $ in $ K\sb{X} $. Repeat, contradicting our construction of $ Q'\rb{X} $. Thus $ \alpha = d $ is a unit in $ P\rb{X} $, and we have $ P\rb{X} = e_1Q\rb{X}d^{-1}e_2T\rb{X} $, with $ e_1Q\rb{X} $ and $ d^{-1}e_2T\rb{X} $ in $ R\sb{X} $.
\end{proof}

\begin{note}
The converse to the last claim of Theorem \ref{thm:9.2.1} is not true. if $ P\rb{X} $ is reducible in $ R\sb{X} $, it might be irreducible in $ K\sb{X} $.
\begin{example}
The polynomial $ 7x $ factors into irreducibles as $ 7 \cdot x $ in $ \Z\sb{X} $, but since $ 7 $ is a unit in $ \Q\sb{X} $, $ 7x $ is irreducible in $ \Q\sb{X} $.
\end{example}
The following lemma shows that this kind of thing is all that can happen, however.
\end{note}

\begin{proposition}
Let $ P\rb{X} $ in $ R\sb{X} $ be a polynomial and suppose that the greatest common divisor of all of its coefficients is one. Then $ P\rb{X} $ is irreducible in $ K\sb{X} $ if and only if it is also irreducible in $ R\sb{X} $.
\end{proposition}

\begin{proof}
Suppose $ P\rb{X} $ is irreducible in $ R\sb{X} $, and write $ P\rb{X} = Q\rb{X}T\rb{X} $, with $ Q\rb{X} $ and $ T\rb{X} $ nonunits in $ R\sb{X} $. If $ Q\rb{X} $ or $ T\rb{X} $ were constant with degree zero then it would divide every coefficient of $ P\rb{X} $ and thus divide the GCD of those coefficients, making it a unit. Thus $ Q\rb{X} $ and $ T\rb{X} $ are nonconstant with positive degree and the factorisation $ P\rb{X} = Q\rb{X}T\rb{X} $ is also a nontrivial factorisation in $ K\sb{X} $, so $ P\rb{X} $ is reducible in $ K\sb{X} $. Conversely suppose $ P $ is reducible in $ K\sb{X} $. Then there exist $ Q\rb{X} \in K\sb{X} $ with $ 0 < \deg\rb{Q} < \deg\rb{P} $ such that $ Q\rb{X} \mid P\rb{X} $ in $ K\sb{X} $. Gauss' lemma shows that there exist $ \alpha \in K^* $ such that $ \alpha Q\rb{X} \in R\sb{X} $ and $ \alpha Q\rb{X} \mid P\rb{X} $ in $ R\sb{X} $.
\end{proof}

We are now in a position to prove the following.

\begin{theorem}
If $ R $ is a UFD, then $ R\sb{X} $ is a UFD.
\end{theorem}

\begin{proof}
For existence of factorisations, let $ P\rb{X} $ be an element of $ R\sb{X} $. We must show that $ P\rb{X} $ factors into irreducibles. Let $ d $ be the greatest common divisor of the coefficients of $ P\rb{X} $, and write $ P\rb{X} = dQ\rb{X} $ where the greatest common divisor of the coefficients of $ Q\rb{X} $ is one. Since $ R $ is a UFD, $ d $ factors into irreducibles $ q_1, \dots, q_s $ in $ R $, and these remain irreducible in $ R\sb{X} $, so it suffices to show that $ Q\rb{X} $ factors into irreducibles. Factor $ Q\rb{X} $ into irreducibles in $ K\sb{X} $, $ Q\rb{X} = Q_1\rb{X}, \dots Q_r\rb{X} $. By Gauss' lemma, there exist scalars $ \alpha_1, \dots, \alpha_r \in K^* $ such that $ \alpha_1 \dots \alpha_r = 1 $ and $ \alpha_iQ_i\rb{X} \in R\sb{X} $. Let $ Q'_i \rb{X} = \alpha_iQ_i\rb{X} $. GCD of coefficients of $ Q'_1\rb{X}, \dots, Q'_r\rb{X} $ is one gives $ Q'_1\rb{X}, \dots, Q'_r\rb{X} $ are irreducible in $ R\sb{X} $ since they are irreducible in $ K\sb{X} $. For uniqueness of factorisations, it remains to show that if $ P\rb{X} \in R\sb{X} $ is irreducible in $ R\sb{X} $ and divides $ A\rb{X}B\rb{X} $ in $ R\sb{X} $ for $ A\rb{X}, B\rb{X} \in R\sb{X} $, then $ P\rb{X} $ divides either $ A\rb{X} $ or $ B\rb{X} $ in $ R\sb{X} $.
\begin{enumerate}
\item If $ P\rb{X} $ is constant, then $ P\rb{X} = c $ is irreducible in $ R $. In $ R / \ab{c}\sb{X} $ a domain, $ 0 = \bar{A}\rb{X}\bar{B}\rb{X} $ so $ \bar{A}\rb{X} = 0 $ or $ \bar{B}\rb{X} = 0 $ gives $ c \mid A\rb{X} $ or $ c \mid B\rb{X} $.
\item If $ P\rb{X} $ is nonconstant, since $ P\rb{X} $ is irreducible in $ R\sb{X} $ it is irreducible in $ K\sb{X} $ by Gauss' lemma, and hence divides either $ A\rb{X} $ or $ B\rb{X} $ in $ K\sb{X} $. Suppose $ P\rb{X} $ divides $ A\rb{X} $ in $ K\sb{X} $. Then $ A\rb{X} = P\rb{X}Q\rb{X} $ in $ K\sb{X} $. Then there is an element $ \alpha = r / s \in K^* $ for $ r, s \in R $ and $ r \ne 0 $ such that $ \alpha P\rb{X} $ lies in $ R\sb{X} $ and divides $ A\rb{X} $ in $ R\sb{X} $, and $ A\rb{X} = \alpha P\rb{X}\alpha^{-1} Q\rb{X} $ in $ R\sb{X} $ by Gauss' lemma. On the other hand, since $ P\rb{X} $ is irreducible in $ R\sb{X} $ the GCD of its coefficients is one, so the only way $ \alpha P\rb{X} $ lies in $ R\sb{X} $ is if $ s $ is a unit and $ \alpha $ lies in $ R $. Thus $ \alpha^{-1}Q\rb{X} \in R\sb{X} $, $ \alpha \in R $, and $ P\rb{X} \in R\sb{X} $, so $ P\rb{X} $ also divides $ A\rb{X} $.
\end{enumerate}
\end{proof}

\begin{corollary}
If $ K $ is a UFD, a field, or a PID, then $ K\sb{X_1, \dots, X_n} $ is a UFD for any $ n $.
\end{corollary}

Warning that quotients of UFDs are only rarely UFDs themselves.

\begin{example}
$ \Z\sb{X} $ is a UFD. $ \Z\sb{X} / \ab{X^2 + 5} = \Z\sb{\sqrt{-5}} $ is not a UFD.
\end{example}

\end{document}