\documentclass[numbers=enddot,12pt,final,onecolumn,notitlepage]{scrartcl}%
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[all,cmtip]{xy}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{framed}
\usepackage{comment}
\usepackage{color}
\usepackage{hyperref}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{needspace}
\usepackage{tabls}
\usepackage{datetime}
\usepackage{wasysym}
\usepackage[type={CC}, modifier={zero}, version={1.0},]{doclicense}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Saturday, February 13, 2021 01:13:02}
%TCIDATA{SuppressPackageManagement}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{Language=American English}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\usetikzlibrary{arrows}
\newcounter{exer}
\newcounter{exera}
\numberwithin{exer}{subsection}
\theoremstyle{definition}
\newtheorem{theo}{Theorem}[subsection]
\newenvironment{theorem}[1][]
{\begin{theo}[#1]\begin{leftbar}}
{\end{leftbar}\end{theo}}
\newtheorem{lem}[theo]{Lemma}
\newenvironment{lemma}[1][]
{\begin{lem}[#1]\begin{leftbar}}
{\end{leftbar}\end{lem}}
\newtheorem{prop}[theo]{Proposition}
\newenvironment{proposition}[1][]
{\begin{prop}[#1]\begin{leftbar}}
{\end{leftbar}\end{prop}}
\newtheorem{defi}[theo]{Definition}
\newenvironment{definition}[1][]
{\begin{defi}[#1]\begin{leftbar}}
{\end{leftbar}\end{defi}}
\newtheorem{remk}[theo]{Remark}
\newenvironment{remark}[1][]
{\begin{remk}[#1]\begin{leftbar}}
{\end{leftbar}\end{remk}}
\newtheorem{coro}[theo]{Corollary}
\newenvironment{corollary}[1][]
{\begin{coro}[#1]\begin{leftbar}}
{\end{leftbar}\end{coro}}
\newtheorem{conv}[theo]{Convention}
\newenvironment{convention}[1][]
{\begin{conv}[#1]\begin{leftbar}}
{\end{leftbar}\end{conv}}
\newtheorem{quest}[theo]{Question}
\newenvironment{question}[1][]
{\begin{quest}[#1]\begin{leftbar}}
{\end{leftbar}\end{quest}}
\newtheorem{warn}[theo]{Warning}
\newenvironment{conclusion}[1][]
{\begin{warn}[#1]\begin{leftbar}}
{\end{leftbar}\end{warn}}
\newtheorem{conj}[theo]{Conjecture}
\newenvironment{conjecture}[1][]
{\begin{conj}[#1]\begin{leftbar}}
{\end{leftbar}\end{conj}}
\newtheorem{exam}[theo]{Example}
\newenvironment{example}[1][]
{\begin{exam}[#1]\begin{leftbar}}
{\end{leftbar}\end{exam}}
\newtheorem{exmp}[exer]{Exercise}
\newenvironment{exercise}[1][]
{\begin{exmp}[#1]\begin{leftbar}}
{\end{leftbar}\end{exmp}}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{teachingnote}[1][Teaching note]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\voffset=0cm
\hoffset=-0.7cm
\setlength\textheight{22.5cm}
\setlength\textwidth{15.5cm}
\newcommand\arxiv[1]{\href{https://www.arxiv.org/abs/#1}{\texttt{arXiv:#1}}}
\newenvironment{verlong}{}{}
\newenvironment{vershort}{}{}
\newenvironment{noncompile}{}{}
\newenvironment{teachingnote}{}{}
\excludecomment{verlong}
\includecomment{vershort}
\excludecomment{noncompile}
\excludecomment{teachingnote}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\id}{\operatorname{id}}
\newcommand{\lcm}{\operatorname{lcm}}
\newcommand{\rev}{\operatorname{rev}}
\newcommand{\powset}[2][]{\ifthenelse{\equal{#2}{}}{\mathcal{P}\left(#1\right)}{\mathcal{P}_{#1}\left(#2\right)}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tup}[1]{\left( #1 \right)}
\newcommand{\ive}[1]{\left[ #1 \right]}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\lf}[2]{#1^{\underline{#2}}}
\newcommand{\underbrack}[2]{\underbrace{#1}_{\substack{#2}}}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\newcommand{\nnn}{\nonumber\\}
\newcommand{\sslash}{\mathbin{/\mkern-6mu/}}
\newcommand{\relnever}{\mathrel{\fbox{$N$}}}
\newcommand{\relalways}{\mathrel{\fbox{$A$}}}
\iffalse
\NOEXPAND{\relnever}{\mathrel{\fbox{$N$}}}
\NOEXPAND{\relalways}{\mathrel{\fbox{$A$}}}
\fi
\ihead{Math 4281 notes as of \today\ at \currenttime}
\ohead{page \thepage}
\cfoot{}
\begin{document}

\title{Introduction to Modern Algebra (UMN Spring 2019 Math 4281 notes)}
\author{Darij Grinberg}
\date{
%TCIMACRO{\TeXButton{today}{\today}}%
%BeginExpansion
\today
%EndExpansion
\ at \currenttime.\\
Status: finished up to Section 4.2.4.}
\maketitle
\tableofcontents

\doclicenseThis


\section{\label{chp.intro}Introduction}

This file contains notes for the Math 4281 class (\textquotedblleft
Introduction to Modern Algebra\textquotedblright) I have taught at the
University of Minnesota in Spring 2019. Occasionally, it also includes
material that did not appear in the lectures.

The website of the class is
\url{https://www.cip.ifi.lmu.de/~grinberg/t/19s/index.html} ; you will find
homework sets and midterms there.

\subsection{Status}

The first few chapters of these notes are finished. The rest are at various
degrees of completion (mostly readable, but sometimes not completely polished).

\begin{noncompile}
subsection: Organisation

See \href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/syll.pdf}{the syllabus}
for the organization of this class and for the homework.
\end{noncompile}

\subsection{Literature}

Many books have been written about abstract algebra. I have only a passing
familiarity with most of them. Some of the ``bibles'' of the subject (bulky
texts covering lots of material) are Dummit/Foote \cite{Dummit-Foote}, Knapp
\cite{Knapp1} and \cite{Knapp2} (both freely available), van der Waerden
\cite{Waerden1} and \cite{Waerden2} (one of the oldest texts on modern
algebra, thus rather dated, but still as readable as ever).
%Two other textbooks are Bosch \cite{Bosch} and Artin \cite{Artin}.


Of course, any book longer than 200 pages likely goes further than our course
will (unless it is full of details or solved exercises or printed in really
large letters, like this one will be once it is finished). Thus, let me
recommend some more introductory sources. Siksek's lecture notes \cite{Siksek}
are a readable introduction that is a lot more amusing than I had ever
expected an algebra text to be. Goodman's free book \cite{Goodman} combines
introductory material with geometric motivation and applications, such as the
classification of regular polyhedra and 2-dimensional crystals. In a sense, it
is a great complement to our ungeometric course. Pinter's \cite{Pinter} often
gets used in classes like ours. Armstrong's notes \cite{Armstrong} cover a
significant part of what we do. Childs's \cite{Childs00} comes the closest to
what we are setting out to do here, that is, give an example-grounded
introduction to basic abstract algebra.

Keith Conrad's blurbs \cite{Conrad*} are not a book, as they only cover
selected topics. But at pretty much every topic they cover, they are one of
the best sources (clear, full of examples, and often going fairly deep). We
shall follow one of them particularly closely: the one on Gaussian integers
\cite{Conrad-Gauss}.

We will use some basic linear algebra, all of which can be found in Hefferon's
book \cite{Hefferon} (but we won't need all of this book). As far as
determinants are concerned, we will briefly build up their theory; we refer to
\cite[Section 12 \& Appendix B]{Strickland} for proofs (and to \cite[Chapter
6]{detnotes} for a really detailed and formal treatment).

This course will begin (after some motivating questions) with a survey of
elementary number theory. This is in itself a deep subject (despite the name)
with a long history (\href{https://en.wikipedia.org/wiki/Plimpton_322}{perhaps
as old as mathematics}), and of course we will just scratch the surface. Books
like \cite{NiZuMo91}, \cite{Burton} and \cite{Uspensky-Heaslet} cover a lot
more than we can do. The Gallier/Quaintance survey \cite{Gallier-RSA} covers a
good amount of basics and more.

We assume that the reader is familiar with the commonplaces of mathematical
argumentation, such as induction (including strong induction),
\textquotedblleft WLOG\textquotedblright\ arguments, proof by contradiction,
summation signs ($\sum$) and polynomials (a vague notion of polynomials will
suffice; we will give a precise definition when it becomes necessary). If not,
several texts can be helpful in achieving such familiarity: e.g.,
\cite[particularly Chapters 1--5]{LeLeMe}, \cite{Hammack}, \cite{Day}.

I thank the students of the Math 4281 class for discovering and reporting
errors in previous versions of these notes. Some of the discussion of variants
of Gaussian integers (and the occasional correction) is due to Keith Conrad;
the discussion of Gaussian integers itself owes much to his
\cite{Conrad-Gauss}.

These notes include some excerpts from \cite{floor} and slightly rewritten
sections of \cite{detnotes}.

\begin{teachingnote}
\textbf{2019-01-23 lecture}
\end{teachingnote}

\subsection{The plan}

The material I am going to cover is mostly standard. However, the order in
which I will go through it is somewhat unusual: I will spend a lot of time
studying the basic examples before defining abstract notions such as
``group'', ``monoid'', ``ring'' and ``field''. This way, once I come to these
notions, you'll already have many examples to work with. (Don't be fooled by
the word ``example'': We will prove a lot about them, much of which is neither
straightforward nor easy.)

First, I will show some motivating questions that are easy to state yet
require abstract algebra to answer. We will hopefully see their answers by the
end of this class. (Some of them can also be answered elementarily, without
using abstract algebra, but such answers usually take more work and are harder
to find.)

\subsection{\label{sect.intro.sum-of-2sq}Motivation: $n=x^{2}+y^{2}$}

A \textit{perfect square} means the square of an integer. Thus, the perfect
squares are
\[
0^{2} = 0, \qquad1^{2} = 1, \qquad2^{2} = 4, \qquad3^{2} = 9, \qquad4^{2} =
16, \qquad\ldots.
\]


Here is an old problem (first solved by Pierre de Fermat in 1640, but
apparently already studied by Diophantus in the 3rd Century):

\begin{question}
\label{quest.intro.sum-of-2sq.1} What integers can be written as sums of two
perfect squares?
\end{question}

For example, $5$ can be written in this way, since $5=2^{2}+1^{2}$.

So can $4$, since $4=2^{2}+0^{2}$. (Keep in mind that $0$ is a perfect square.)

However, $7$ cannot be written in this way. In fact, if we had $7 = a^{2} +
b^{2}$ for two integers $a$ and $b$, then $a^{2}$ and $b^{2}$ would have to be
$\leq7$ (since $a^{2}$ and $b^{2}$ are always $\geq0$, no matter what sign $a$
and $b$ have); but the only perfect squares that are $\leq7$ are $0,1,4$, and
there is no way to write $7$ as a sum of two of these perfect squares (just
check all the possibilities).

For a similar but simpler reason, no negative number can be written as a sum
of two perfect squares.

We can of course approach Question~\ref{quest.intro.sum-of-2sq.1} using a
computer: It is easy to check, for a given integer $n$, whether $n$ is a sum
of two perfect squares. (Just check all possibilities for $a$ and $b$ for the
validity of the equation $n=a^{2}+b^{2}$. You only need to try $a$ and $b$
belonging to $\left\{  0,1,\ldots,\left\lfloor \sqrt{n}\right\rfloor \right\}
$, where $\left\lfloor y\right\rfloor $ (for a real number $y$) denotes the
largest integer that is less or equal than $y$ (also known as
\textquotedblleft$y$ rounded down\textquotedblright).) If you do this, you
will see that among the first $101$ nonnegative integers, the ones that can be
written as sums of two perfect squares are precisely
\begin{align*}
&  0,1,2,4,5,8,9,10,13,16,17,18,20,25,26,29,\\
&  32,34,36,37,40,41,45,49,50,52,53,58,61,64,\\
&  65,68,72,73,74,80,81,82,85,89,90,97,98,100.
\end{align*}
Having this data, you can look up the sequence in \href{https://oeis.org/}{the
Online Encyclopedia of Integer Sequences (short OEIS)}, and see that the
sequence of these integers is known as \href{https://oeis.org/A001481}{OEIS
Sequence A001481}. In the \textquotedblleft Comments\textquotedblright\ field,
you can read a lot of what is known about it (albeit in telegraphic style).

For example, one of the comments says ``Closed under multiplication''. This is
short for ``if you multiply two entries of the sequence, then the product will
again be an entry of the sequence''. In other words, if you multiply two
integers that are sums of two perfect squares, then you get another sum of two
perfect squares. Why is this so?

It turns out that there is a \textquotedblleft simple\textquotedblright%
\ reason for this: the identity
\begin{equation}
\left(  a^{2}+b^{2}\right)  \left(  c^{2}+d^{2}\right)  =\left(  ad+bc\right)
^{2}+\left(  ac-bd\right)  ^{2}, \label{eq.intro.sum-of-2sq.sum*sum}%
\end{equation}
which holds for arbitrary reals $a,b,c,d$ (and thus, in particular, for
integers). This is known as
\href{https://en.wikipedia.org/wiki/Brahmagupta-Fibonacci_identity}{the
Brahmagupta-Fibonacci identity}, and of course can easily be proven by
expanding both sides. But how would you come up with such an identity?

If you stare at the above sequence long enough, you may also discover another
pattern: An integer of the form $4k+3$ with integer $k$ (that is, an integer
that is larger by $3$ than a multiple of $4$) can never be written as a sum of
two perfect squares. (Thus, $3,7,11,15,19,23,\ldots$ cannot be written in this
way.) This does not account for all integers that cannot be written in this
way, but it does provide some clues to the answer that we will later see. In
order to prove this observation, we shall need basic modular arithmetic (or at
least division with remainder); we will see this proof very soon (see Exercise
\ref{exe.ent.even-odd-sumsq} \textbf{(c)}).

We will resolve Question \ref{quest.intro.sum-of-2sq.1} using the theory of
Gaussian integers in Chapter \ref{chp.CC}. For a survey of different
approaches to Question \ref{quest.intro.sum-of-2sq.1} (including a full answer
using finite fields), see \cite[Chapter 4]{AigZie}.

Further questions can be asked. One of them is: Given an integer $n$, how many
ways are there to represent $n$ as a sum of two perfect squares? This is
actually several questions masquerading as one, since it is not so clear what
a ``way'' is. Do $5 = 1^{2} + 2^{2}$ and $5 = 2^{2} + 1^{2}$ count as two
different ways? What about $5 = 1^{2} + 2^{2}$ versus $5 = \left(  -1 \right)
^{2} + 2^{2}$ (here, the perfect squares are the same, but do we really want
to count the squares or rather the numbers we are squaring?).

Let me formalize the question as follows:

\begin{question}
\label{quest.intro.sum-of-2sq.2} Let $n$ be an integer.

\textbf{(a)} How many pairs $\left(  a, b \right)  \in\mathbb{N}^{2}$ are
there that satisfy $n = a^{2} + b^{2}$ ? Here, and in the following,
$\mathbb{N}$ denotes the set $\left\{  0, 1, 2, \ldots\right\}  $ of all
nonnegative integers.

\textbf{(b)} How many pairs $\left(  a, b \right)  \in\mathbb{Z}^{2}$ are
there that satisfy $n = a^{2} + b^{2}$ ? Here, and in the following,
$\mathbb{Z}$ denotes the set $\left\{  \ldots, -2, -1, 0, 1, 2, \ldots
\right\}  $ of all integers.

\textbf{(c)} How do these counts change if we count \textbf{unordered} pairs
instead (i.e., count $\left(  a, b \right)  $ and $\left(  b, a \right)  $ as
one only)?
\end{question}

Note that when I say ``pair'', I always mean ``ordered pair'' by default,
unless I explicitly say ``unordered pair''.

Again, a little bit of programming easily yields answers to all three parts of
this question for small values of $n$, and the resulting data can be plugged
into the OEIS and yields lots of information.

\begin{proof}
[First steps toward answering Question~\ref{quest.intro.sum-of-2sq.2}%
.]\textbf{(a)} I claim that the number of such pairs is even unless $n$ is
twice a perfect square (i.e., unless $n = 2m^{2}$ for some integer $m$); in
the latter case, this number is odd instead.

Why? Let me define a \textit{solution} to be a pair $\left(  a,b\right)  $
such that $n=a^{2}+b^{2}$. So I want to know whether the number of solutions
is even or odd. But we have $a^{2}+b^{2}=b^{2}+a^{2}$ for all $a$ and $b$.
Thus, if $\left(  a,b\right)  $ is a solution, then so is $\left(  b,a\right)
$. Hence, the solutions themselves \textquotedblleft come in
pairs\textquotedblright, with each solution $\left(  a,b\right)  $ being
matched to the solution $\left(  b,a\right)  $, unless there is a solution
$\left(  a,b\right)  $ with $a=b$ (because such a solution would be matched to
itself, and thus not form an actual pair). But solutions $\left(  a,b\right)
$ with $a=b$ are easy to classify: If $n$ is twice a perfect square, then
there is exactly one such solution (namely, $\left(  \sqrt{n/2},\sqrt
{n/2}\right)  $); otherwise there is none (because $n=a^{2}+b^{2}$ with $a=b$
leads to $n=b^{2}+b^{2}=2b^{2}$, which can only happen when $n$ is twice a
perfect square). Since we know that all the other solutions \textquotedblleft
come in pairs\textquotedblright, we thus conclude that the number of solutions
is odd if $n$ is twice a perfect square and even otherwise. This proves our claim.

Of course, we have not made much headway into
Question~\ref{quest.intro.sum-of-2sq.2}; knowing whether a number is even or
odd is far from knowing the number itself. But I think the argument above was
worth showing; similar reasoning is used a lot in algebra.

\textbf{(b)} By reasoning analogous to the one we used in part \textbf{(a)},
we can see that the number of such pairs will be divisible by $8$ whenever $n$
is neither a perfect square nor twice a perfect square. Indeed, this relies on
the fact that
\begin{align*}
a^{2} + b^{2}  &  = b^{2} + a^{2} = \left(  -a \right)  ^{2} + b^{2} = b^{2} +
\left(  -a \right)  ^{2} = a^{2} + \left(  -b \right)  ^{2} = \left(  -b
\right)  ^{2} + a^{2}\\
&  = \left(  -a \right)  ^{2} + \left(  -b \right)  ^{2} = \left(  -b \right)
^{2} + \left(  -a \right)  ^{2}%
\end{align*}
for all $a$ and $b$. Thus the pairs $\left(  a, b \right)  \in\mathbb{Z}^{2}$
that satisfy $n = a^{2} + b^{2}$ don't just come in pairs; they come in sets
of $8$ (namely, each $\left(  a, b \right)  $ comes in a set with $\left(  b,
a \right)  $, $\left(  -a, b \right)  $, $\left(  b, -a \right)  $, $\left(
a, -b \right)  $, $\left(  -b, a \right)  $, $\left(  -a, -b \right)  $ and
$\left(  -b, -a \right)  $). These sets of $8$ can ``degenerate'' to smaller
sets when some of their elements coincide, but this can only happen when $n$
is a perfect square (in which case we can have $\left(  a, b \right)  =
\left(  -a, b \right)  $ for example) or twice a perfect square (in which case
we can have $\left(  a, b \right)  = \left(  b, a \right)  $ or $\left(  a, b
\right)  = \left(  -b, -a \right)  $ or other such coincidences). (Check this!)

\textbf{(c)} We can reduce this to parts \textbf{(a)} and \textbf{(b)}.
Indeed:\footnote{In the rest of this argument, \textquotedblleft
pair\textquotedblright\ will always mean \textquotedblleft pair $\left(
a,b\right)  $ satisfying $n=a^{2}+b^{2}$\textquotedblright.}

\begin{itemize}
\item When $n$ is not twice a perfect square, the number of unordered pairs
will be half the number of ordered pairs, since each unordered pair $\left(
u,v\right)  _{\text{unordered}}$ corresponds to precisely two ordered pairs
$\left(  u,v\right)  $ and $\left(  v,u\right)  $.

\item When $n$ is twice a perfect square, we have%
\begin{align*}
&  \left(  \text{the number of unordered pairs}\right) \\
&  =\dfrac{\left(  \text{the number of ordered pairs}\right)  +\left(
\text{the number of pairs with }a=b\right)  }{2}.
\end{align*}
Indeed, each unordered pair $\left(  u,v\right)  _{\text{unordered}}$
corresponds to precisely two ordered pairs $\left(  u,v\right)  $ and $\left(
v,u\right)  $ unless $u=v$, in which case it corresponds to only one ordered
pair. Thus, if we multiply the number of unordered pairs by $2$, then we
\textbf{overcount} the number of ordered pairs, because we are counting the
pairs $\left(  u,v\right)  $ with $u=v$ (that is, the pairs with $a=b$) twice.
So we get $\left(  \text{the number of ordered pairs}\right)  +\left(
\text{the number of pairs with }a=b\right)  $. This proves our above formula.

What is the number of pairs with $a=b$ ? If $n=0$, then it is $1$ (and the
only such pair is $\left(  0,0\right)  $). Otherwise, it is $1$ if we are
counting pairs in $\mathbb{N}^{2}$ (and the only such pair is $\left(
\sqrt{n/2},\sqrt{n/2}\right)  $), and is $2$ if we are counting pairs in
$\mathbb{Z}^{2}$ (and the only two such pairs are $\left(  \sqrt{n/2}%
,\sqrt{n/2}\right)  $ and $\left(  -\sqrt{n/2},-\sqrt{n/2}\right)  $).
\qedhere

\end{itemize}
\end{proof}

Note that sums of squares have a geometric meaning (going back to Pythagoras):
Two real numbers $a$ and $b$ satisfy $a^{2}+b^{2}=n$ (for a given integer
$n\geq0$) if and only if the point with Cartesian coordinates $\left(
a,b\right)  $ lies on the circle with center $0$ and radius $\sqrt{n}$. This
will actually prove a valuable insight that will lead us to the answers to the
above questions.

Just as a teaser: There are formulas for all three parts of
Question~\ref{quest.intro.sum-of-2sq.2}, in terms of divisors of $n$ of the
forms $4k+1$ and $4k+3$. We will see these formulas after we have properly
understood the concept of Gaussian integers.

\subsection{\label{sect.intro.algnum}Motivation: Algebraic numbers}

\begin{teachingnote}
This section is fun, but most likely pointless in a 1-semester course: In a
single semester, it is very hard to get to a state where the questions posed
here can be answered well. As for answering them badly (= non-constructively),
basic linear algebra suffices, so again it's unclear why the section should be here.
\end{teachingnote}

\begin{noncompile}
Recall how the number system was constructed. In a way, each extension was
done in order to allow a certain operation to proceed: The natural numbers
were extended to the integers in order to allow subtraction (in all cases, not
just when we are subtracting a smaller number from a larger). Then, the
integers were extended to the rational numbers in order to allow division (in
all reasonable cases\footnote{``Reasonable'' in this case means that division
by $0$ is still forbidden. If we allowed division by $0$ as well, then our
``rational numbers'' would all be equal to each other and therefore a huge
step back from the integers.}, not just when the division works out
remainder-less). Then, the rational numbers were extended to the real numbers
in order to allow limits (in all reasonable cases). Finally, the real numbers
were (or will be -- we will see this in more detail) extended to the complex
numbers in order to allow square roots.

From an algebraic point of view, the step from the rational numbers to the
real numbers is somewhat of an overkill. Algebraists often want to work with
roots, particularly roots of polynomials; ideally, every polynomial of degree
$n$ should have ``all'' $n$ roots (counted with multiplicity), so it can be
factored into linear factors. This does indeed happen once you get to complex
numbers (the so-called ``Fundamental Theorem of Algebra''), but the road there
is bumpy and non-algebraic (at the very least, you need continuity to prove
the ``Fundamental Theorem of Algebra''). So algebraists have wondered whether
there is a cheaper way to buy roots for their polynomials -- without having to
pay the price of analysis. (The question became even more relevant when they
started working over arbitrary fields and even commutative rings -- in a
sense, ``alternative number systems'' in which analysis won't help you.)

The answer is ``yes'', and we will eventually see how. But for now, let me
focus on a simple problem that is already interesting if one works inside the
real numbers.
\end{noncompile}

A real number $z$ is said to be \textit{algebraic} if there exists a nonzero
polynomial $P$ with rational coefficients such that $P\left(  z \right)  = 0$.
In other words, a real number $z$ is algebraic if and only if it is a root of
a nonzero polynomial with rational coefficients.

(If you know the complex numbers, you can replace \textquotedblleft
real\textquotedblright\ by \textquotedblleft complex\textquotedblright\ in
this definition; but we shall only see real numbers in this little
motivational section.)

Here are a few examples:

\begin{itemize}
\item Each rational number $a$ is algebraic (being a root of the nonzero
polynomial $x-a$ with rational coefficients).

\item The number $\sqrt{2}$ is algebraic (being a root of the nonzero
polynomial $x^{2}-2$).

\item The number $\sqrt[3]{5}$ is algebraic (being a root of $x^{3}-5$).

\item All the roots of the polynomial $f\left(  x \right)  := \dfrac{3}%
{2}x^{4}+17x^{3}-12x+\dfrac{9}{4}$ (whatever they are) are algebraic. \newline
Speaking of these roots, what are they? Using a computer, one can show that
this polynomial $f\left(  x \right)  $ has $4$ real roots ($-11.269\ldots,
-0.960\ldots, 0.198\ldots, 0.697\ldots$), which can be written as complicated
expressions with radicals (i.e., $\sqrt[k]{}$ signs), though complex numbers
appear in these expressions (despite the roots being real!). All this does not
matter to the fact that they are algebraic $\overset{\cdot\cdot}{\smile}$

\item All the roots of the polynomial $g\left(  x \right)  := x^{7} - x^{5} +
1$ are algebraic. \newline This polynomial has only one real root. This root
cannot be written as an expression with radicals (as can be proven using
\href{https://en.wikipedia.org/wiki/Galois_theory}{Galois theory} -- indeed,
the discovery of this theory greatly motivated the development of abstract
algebra).
%(Nor can the remaining $6$ complex roots be.)
Nevertheless, it is algebraic, by definition. (The same holds for the
remaining $6$ complex roots of $g$ -- we are working with real numbers here
only for the sake of familiarity.)

\item The most famous number that is not algebraic is $\pi$. This is a famous
result of Lindemann, but it belongs to analysis, not to algebra, because $\pi$
is not defined algebraically in the first place (it is defined as the length
of a curve or as an area of a curved region -- but either of these definitions
boils down to a limit of a sequence).

\item The second most famous number that is not algebraic is
\href{https://en.wikipedia.org/wiki/E_(mathematical_constant)}{Euler's number
$e$} (the basis of the natural logarithm). Again, analysis is needed to define
$e$, and thus also to prove its non-algebraicity.
\end{itemize}

Numbers that are not algebraic are called
\href{https://en.wikipedia.org/wiki/Transcendental_number}{\textit{transcendental}%
}. We shall not study them much, since most of them do not come from algebra.
Instead, we shall try our hands at the following question:

\begin{question}
\label{quest.intro.algnum.1} \textbf{(a)} Is the sum of two (or, more
generally, finitely many) algebraic numbers always algebraic?

\textbf{(b)} What if we replace ``sum'' by ``difference'' or ``product''?
\end{question}

Let me motivate why this is a natural question to ask. The sum of two integers
is still an integer; the sum of two rational numbers is still a rational
number. These facts are fundamental; without them we could hardly work with
integers and rational numbers. If a similar fact would not hold for algebraic
numbers, it would mean that the algebraic numbers are not a good ``number
system'' to work in; on a practical level, it would mean that (e.g.) if we
defined a function on the set of all algebraic numbers, then we could not plug
a sum of algebraic numbers into it.

\begin{proof}
[Attempts at answering Question~\ref{quest.intro.algnum.1} \textbf{(a)}.]Let
us try a particularly simple example of a sum of two algebraic numbers: Let
$w$ be $\sqrt{2} + \sqrt{3}$. Is $w$ algebraic?

To answer this question affirmatively, we need to find a nonzero polynomial
$f\left(  x \right)  $ with rational coefficients that has $w$ as a root.

Just looking at the equality $w = \sqrt{2} + \sqrt{3}$, we cannot directly
eyeball such an $f$. The problem, in a sense, is that there are too many
(namely, two) square roots in this equality.

However, if we square this equality, then we obtain
\[
w^{2}=\left(  \sqrt{2}+\sqrt{3}\right)  ^{2}=2+2\sqrt{2}\cdot\sqrt{3}+3
=5+2\sqrt{6},
\]
which is an equality with only one square root (a sign of progress).
Subtracting $5$ from this equality (in order to ``isolate'' this remaining
square root), we obtain $w^{2}-5=2\sqrt{6}$. If we now square this equality,
then we obtain $\left(  w^{2}-5\right)  ^{2}=\left(  2\sqrt{6}\right)
^{2}=24$. At this point all square roots are gone, and we are left with an
equality that contains rational numbers and $w$ only! We can further rewrite
it as $\left(  w^{2} - 5 \right)  ^{2} - 24 = 0$. Thus, $w$ is a root of the
polynomial $f\left(  x \right)  := \left(  x^{2}-5\right)  ^{2}-24 =
x^{4}-10x^{2}+1$. This means that $w$ is algebraic (since $f$ is nonzero).

Let us try a more complicated example: Let $z$ be the number $\sqrt
{2}+\sqrt[3]{2}$. Is $z$ algebraic? The squaring trick no longer works, since
squaring $\sqrt{2}+\sqrt[3]{2}$ does not reduce the number of radicals (= root
signs). Let's instead try rewriting $z=\sqrt{2}+\sqrt[3]{2}$ as $z-\sqrt
{2}=\sqrt[3]{2}$. Cubing this equality, we obtain $\left(  z-\sqrt{2}\right)
^{3}=2$. In view of
\[
\left(  z-\sqrt{2}\right)  ^{3}=z^{3}-3z^{2}\sqrt{2}+3z\left(  \sqrt
{2}\right)  ^{2}-\left(  \sqrt{2}\right)  ^{3}%
\]
(this is a particular case of the identity $\left(  a-b\right)  ^{3}%
=a^{3}-3a^{2}b+3ab^{2}-b^{3}$, which is one form of the Binomial Theorem for
exponent $3$), this rewrites a
\[
z^{3}-3z^{2}\sqrt{2}+3z\left(  \sqrt{2}\right)  ^{2}-\left(  \sqrt{2}\right)
^{3}=2.
\]
This simplifies to%
\[
z^{3}-3\sqrt{2}z^{2}+6z-2\sqrt{2}=2.
\]
Let us transform this inequality in such a way that all terms with a $\sqrt
{2}$ in them end up on the right hand side while all the remaining terms end
up on the left. We thus obtain
\[
z^{3}+6z-2=\sqrt{2}\left(  3z^{2}+2\right)  .
\]
Now, squaring this equality yields
\[
\left(  z^{3}+6z-2\right)  ^{2}=2\left(  3z^{2}+2\right)  ^{2}.
\]
Hence, $z$ is a root of the polynomial
\[
g\left(  x\right)  :=\left(  x^{3}+6x-2\right)  ^{2}-2\left(  3x^{2}+2\right)
^{2}=x^{6}-6x^{4}-4x^{3}+12x^{2}-24x-4.
\]
This is a nonzero polynomial with rational coefficients; hence, $z$ is algebraic.

We thus have verified that the sum of two algebraic numbers is algebraic in
two cases. What about more complicated cases, such as
\[
\sqrt{2}+\sqrt{3}+\sqrt[7]{11}\text{ ?}%
\]
This is a sum of two algebraic numbers (since we already know that $\sqrt
{2}+\sqrt{3}=w$ is algebraic). Is it algebraic? Neither of our above two
methods properly works here; do we have to come up with new ad-hoc tricks?
\end{proof}

\begin{teachingnote}
\textbf{2019-01-25 lecture}
\end{teachingnote}

\subsection{\label{sect.intro.shamir}Motivation: Shamir's Secret Sharing
Scheme}

\subsubsection{The problem}

\href{https://en.wikipedia.org/wiki/Adi_Shamir}{Adi Shamir} is one of the
founders of modern mathematical cryptography (famous in particular for
\href{https://en.wikipedia.org/wiki/RSA_(cryptosystem)}{the RSA cryptosystem},
which we will discuss in Subsection \ref{subsect.equiv.apps.RSA}).

Shamir's Secret Sharing Scheme is a way in which a secret $\mathbf{a}$ (a
piece of data -- e.g., nuclear launch codes) can be distributed among $n$
people in such a way that

\begin{itemize}
\item any $k$ of them can (if they come together) reconstruct it uniquely, but

\item any $k-1$ of them (if they come together) cannot gain \textbf{any}
insight about it (i.e., not only cannot they reconstruct it, but they cannot
even tell that some values are more likely than others to be $\mathbf{a}$).
\end{itemize}

\noindent Here $n$ and $k$ are fixed positive integers.

Understanding this scheme completely will require some abstract algebra, but
we can already start thinking about the problem and get reasonably far.

So we have $n$ people $1,2,\ldots,n$, a positive integer $k\in\left\{
1,2,\ldots,n\right\}  $ and a secret piece of data $\mathbf{a}$. We assume
that this data $\mathbf{a}$ is encoded as a \textit{bitstring} -- i.e., a
finite sequence of bits. A \textit{bit} is an element of the set $\left\{
0,1\right\}  $. Thus, examples of bitstrings are $\left(  0,1,1,0\right)  $
and $\left(  1,0\right)  $ and $\left(  1,1,0,1,0,0,0\right)  $ as well as the
empty sequence $\left(  {}\right)  $. When writing bitstring, we shall usually
omit both the commas and the parentheses; thus, e.g., the bitstring $\left(
1,1,0,1,0,0,0\right)  $ will become $1101000$. Make sure you don't mistake it
for a number. Our goal is to give each of the $n$ people $1,2,\ldots,n$ some
bitstring in such a way that:

\begin{itemize}
\item \textit{Requirement 1:} Any $k$ of the $n$ people can (if they come
together) reconstruct $\mathbf{a}$ uniquely.

\item \textit{Requirement 2:} Any $k-1$ of the $n$ people are unable to gain
any insight about $\mathbf{a}$ (even if they collaborate).
\end{itemize}

We denote the bitstrings given to the people $1,2,\ldots,n$ by $\mathbf{a}%
_{1},\mathbf{a}_{2},\ldots,\mathbf{a}_{n}$, respectively.

We assume that the length of our secret bitstring $\mathbf{a}$ is known in
advance to all parties; i.e., it is not a secret. Thus, when we say
\textquotedblleft$k-1$ persons cannot gain any insight about $\mathbf{a}%
$\textquotedblright, we do not mean that they don't know the length; and when
we say \textquotedblleft some values are more likely than others to be
$\mathbf{a}$\textquotedblright, we only mean values that fit this length.

\subsubsection{The $k=1$ case}

One simple special case of our problem is when $k=1$. In this case, it
suffices to give each of the $n$ people the full secret $\mathbf{a}$ (that is,
we set $\mathbf{a}_{i}=\mathbf{a}$ for all $i$). Then, Requirement 1 is
satisfied (since any $1$ of the $n$ people already knows $\mathbf{a}$), while
Requirement 2 is satisfied as well ($0$ people know nothing).

\subsubsection{The $k=n$ case: what doesn't work}

Let us now consider the case when $k=n$. This case will not help us solve the
general problem, but it will show some ideas that we will encounter again and
again in abstract algebra.

We want to ensure that all $n$ people needed to reconstruct the secret
$\mathbf{a}$, while any $n-1$ of them will be completely clueless.

It sounds reasonable to split $\mathbf{a}$ into $n$ parts, and give each
person one of these parts\footnote{assuming that $\mathbf{a}$ is long enough
for that} (i.e., we let $\mathbf{a}_{i}$ be the $i$-th part of $\mathbf{a}$
for each $i\in\left\{  1,2,\ldots,n\right\}  $). This method satisfies
Requirement 1 (indeed, all $n$ people together can reconstruct $\mathbf{a}$
simply by fusing the $n$ parts back together), but fails Requirement 2
(indeed, any $n-1$ people know $n-1$ parts of the secret $\mathbf{a}$, which
is a far from being clueless about $\mathbf{a}$). So this method doesn't work.
It is not that easy.

\subsubsection{\label{subsect.intro.XOR}The $\operatorname*{XOR}$ operations}

One way to solve the $k=n$ case is using the $\operatorname*{XOR}$ operation.

Let us first define some basic language. A \textit{binary operation} on a set
$S$ is (informally speaking) a function that takes two elements of $S$ and
assigns a new element of $S$ to them. More formally:

\begin{definition}
\label{def.intro.binop}A \textit{binary operation} on a set $S$ is a map $f$
from $S\times S$ to $S$. When $f$ is a binary operation on $S$ and $a$ and $b$
are two elements of $S$, we shall write $afb$ for the value $f\left(
a,b\right)  $.
\end{definition}

\begin{example}
Addition, subtraction and multiplication of integers are three binary
operations on the set $\mathbb{Q}$ (the set of all rational numbers). For
example, addition is the map from $\mathbb{Q}\times\mathbb{Q}$ to $\mathbb{Q}$
that sends each pair $\left(  a,b\right)  \in\mathbb{Q}\times\mathbb{Q}$ to
$a+b$.

Division is not a binary operation on the set $\mathbb{Q}$. Indeed, if it was,
then it would send the pair $\left(  1,0\right)  $ to some integer called
$1/0$; but there is no such integer.

There are myriad more complicated binary operations around waiting for someone
to name them. For example, you could define a binary operation $\smiley{}$ on
the set $\mathbb{Q}$ by $a\smiley{}b=\dfrac{a-b}{1+a^{2}+b^{2}}$. Indeed, you
can do this because $1+a^{2}+b^{2}$ is always nonzero when $a,b\in\mathbb{Q}$
(after all, squares are nonnegative, so that $1+\underbrace{a^{2}}_{\geq
0}+\underbrace{b^{2}}_{\geq0}\geq1>0$). I am not saying that you should...
\end{example}

Now, we define some specific binary operations on the set $\left\{
0,1\right\}  $ of all bits, and on the set $\left\{  0,1\right\}  ^{n}$ of all
length-$n$ bitstrings (for a given $n$).

\begin{definition}
\label{def.intro.XOR.XOR01}We define a binary operation $\operatorname*{XOR}$
on the set $\left\{  0,1\right\}  $ by setting%
\begin{align*}
0\operatorname*{XOR}0  &  =0,\\
0\operatorname*{XOR}1  &  =1,\\
1\operatorname*{XOR}0  &  =1,\\
1\operatorname*{XOR}1  &  =0.
\end{align*}
This is a valid definition, because there are only four pairs $\left(
a,b\right)  \in\left\{  0,1\right\}  \times\left\{  0,1\right\}  $, and we
have just defined $a\operatorname*{XOR}b$ for each of these four options. We
can also rewrite this definition as follows:%
\[
a\operatorname*{XOR}b=%
\begin{cases}
1, & \text{if }a\neq b;\\
0, & \text{if }a=b
\end{cases}
=%
\begin{cases}
1, & \text{if \textbf{exactly} one of }a\text{ and }b\text{ is }1;\\
0, & \text{otherwise.}%
\end{cases}
\]
For lack of a better name, we refer to $a\operatorname*{XOR}b$ as the
\textquotedblleft XOR of $a$ and $b$\textquotedblright.
\end{definition}

The name \textquotedblleft$\operatorname*{XOR}$\textquotedblright\ is short
for \textquotedblleft exclusive or\textquotedblright. In fact, if you identify
bits with boolean truth values (so the bit $0$ stands for \textquotedblleft
False\textquotedblright\ and the bit $1$ stands for \textquotedblleft
True\textquotedblright), then $a\operatorname*{XOR}b$ is precisely the truth
value for \textquotedblleft exactly one of $a$ and $b$ is
True\textquotedblright, which is also known as \textquotedblleft$a$
exclusive-or $b$\textquotedblright.

\begin{definition}
\label{def.intro.XOR.XOR01m}Let $m$ be a nonnegative integer. We define a
binary operation $\operatorname*{XOR}$ on the set $\left\{  0,1\right\}  ^{m}$
(this is the set of all length-$m$ bitstrings) by%
\[
\left(  a_{1},a_{2},\ldots,a_{m}\right)  \operatorname*{XOR}\left(
b_{1},b_{2},\ldots,b_{m}\right)  =\left(  a_{1}\operatorname*{XOR}b_{1}%
,a_{2}\operatorname*{XOR}b_{2},\ldots,a_{m}\operatorname*{XOR}b_{m}\right)  .
\]
In other words, if $\mathbf{a}$ and $\mathbf{b}$ are two length-$m$
bitstrings, then $\mathbf{a}\operatorname*{XOR}\mathbf{b}$ is obtained by
taking the XOR of each entry of $\mathbf{a}$ with the corresponding entry of
$\mathbf{b}$, and packing these $m$ XORs into a new length-$m$ bitstring.
\end{definition}

For example,%
\begin{align*}
\left(  1001\right)  \operatorname*{XOR}\left(  1100\right)   &  =0101;\\
\left(  11011\right)  \operatorname*{XOR}\left(  10101\right)   &  =01110;\\
\left(  11010\right)  \operatorname*{XOR}\left(  01011\right)   &  =10001;\\
\left(  1\right)  \operatorname*{XOR}\left(  0\right)   &  =1;\\
\left(  {}\right)  \operatorname*{XOR}\left(  {}\right)   &  =\left(
{}\right)  .
\end{align*}


Note that if $\mathbf{a}$ and $\mathbf{b}$ are two length-$m$ bitstrings, then
the $0$'s in the bitstring $\mathbf{a}\operatorname*{XOR}\mathbf{b}$ are at
the positions where $\mathbf{a}$ and $\mathbf{b}$ have equal entries, and the
$1$'s in $\mathbf{a}\operatorname*{XOR}\mathbf{b}$ are at the positions where
$\mathbf{a}$ and $\mathbf{b}$ have different entries. Thus, $\mathbf{a}%
\operatorname*{XOR}\mathbf{b}$ essentially pinpoints the differences between
$\mathbf{a}$ and $\mathbf{b}$.

We observe the following simple properties of these operations
$\operatorname*{XOR}$ on bits and on bitstrings\footnote{As a mnemonic, we
shall try to use boldfaced letters like $\mathbf{a}$ and $\mathbf{b}$ for
bitstrings and regular italic letters like $a$ and $b$ for single bits.}:

\begin{itemize}
\item We have $a\operatorname*{XOR}0=a$ for any bit $a$. (This can be
trivially checked by considering both possibilities for $a$.)

\item Thus, $\mathbf{a}\operatorname*{XOR}\mathbf{0}=\mathbf{a}$ for any
bitstring $\mathbf{a}$, where $\mathbf{0}$ denotes the bitstring
$00\cdots0=\left(  0,0,\ldots,0\right)  $ (of appropriate length -- i.e., of
the same length as $\mathbf{a}$).

\item We have $a\operatorname*{XOR}a=0$ for any bit $a$. (This can be
trivially checked by considering both possibilities for $a$.)

\item Thus, $\mathbf{a}\operatorname*{XOR}\mathbf{a}=\mathbf{0}$ for any
bitstring $\mathbf{a}$. We shall refer to this as the
\textit{self-cancellation law}.

\item We have $a\operatorname*{XOR}b=b\operatorname*{XOR}a$ for any bits
$a,b$. (Again, this is easy to check by going through all four options for $a$
and $b$.)

\item Thus, $\mathbf{a}\operatorname*{XOR}\mathbf{b}=\mathbf{b}%
\operatorname*{XOR}\mathbf{a}$ for any bitstrings $\mathbf{a},\mathbf{b}$.

\item We have $a\operatorname*{XOR}\left(  b\operatorname*{XOR}c\right)
=\left(  a\operatorname*{XOR}b\right)  \operatorname*{XOR}c$ for any bits
$a,b,c$. (Again, this is easy to check by going through all eight options for
$a,b,c$.)

\item Thus, $\mathbf{a}\operatorname*{XOR}\left(  \mathbf{b}%
\operatorname*{XOR}\mathbf{c}\right)  =\left(  \mathbf{a}\operatorname*{XOR}%
\mathbf{b}\right)  \operatorname*{XOR}\mathbf{c}$ for any bitstrings
$\mathbf{a},\mathbf{b},\mathbf{c}$.

\item Thus, for any bitstrings $\mathbf{a}$ and $\mathbf{b}$, we have%
\[
\left(  \mathbf{a}\operatorname*{XOR}\mathbf{b}\right)  \operatorname*{XOR}%
\mathbf{b}=\mathbf{a}\operatorname*{XOR}\underbrace{\left(  \mathbf{b}%
\operatorname*{XOR}\mathbf{b}\right)  }_{\substack{=\mathbf{0}\\\text{(by the
self-cancellation law)}}}=\mathbf{a}\operatorname*{XOR}\mathbf{0}=\mathbf{a}.
\]


This observation gives rise to a primitive cryptosystem (known as a
\textit{\href{https://en.wikipedia.org/wiki/One-time_pad}{\textit{one-time
pad}}}): If you have a secret bitstring $\mathbf{a}$ that you want to encrypt,
and another secret bitstring $\mathbf{b}$ that can be used as a key, then you
can encrypt $\mathbf{a}$ by XORing it with $\mathbf{b}$ (that is, you
transform it into $\mathbf{a}\operatorname*{XOR}\mathbf{b}$). Then, you can
decrypt it again by XORing it with $\mathbf{b}$ again; indeed, if you do this,
you will obtain $\left(  \mathbf{a}\operatorname*{XOR}\mathbf{b}\right)
\operatorname*{XOR}\mathbf{b}=\mathbf{a}$. This is a highly safe cryptosystem
as long as you can safely communicate the key $\mathbf{b}$ to whomever needs
to be able to decrypt (or encrypt) your secrets, and as long as you are able
to generate uniformly random keys $\mathbf{b}$ of sufficient length. Its only
weakness is its impracticality (in many situations): If the secret you want to
encrypt is long (say, a whole book), your key will need to be equally long.
Even storing such keys can become difficult.
\end{itemize}

We shall refer to the properties $a\operatorname*{XOR}b=b\operatorname*{XOR}a$
and $\mathbf{a}\operatorname*{XOR}\mathbf{b}=\mathbf{b}\operatorname*{XOR}%
\mathbf{a}$ as \textit{laws of commutativity}, and we shall refer to the
properties $a\operatorname*{XOR}\left(  b\operatorname*{XOR}c\right)  =\left(
a\operatorname*{XOR}b\right)  \operatorname*{XOR}c$ and $\mathbf{a}%
\operatorname*{XOR}\left(  \mathbf{b}\operatorname*{XOR}\mathbf{c}\right)
=\left(  \mathbf{a}\operatorname*{XOR}\mathbf{b}\right)  \operatorname*{XOR}%
\mathbf{c}$ as \textit{laws of associativity}. These are, of course, similar
to well-known facts like $\alpha+\beta=\beta+\alpha$ and $\alpha+\left(
\beta+\gamma\right)  =\left(  \alpha+\beta\right)  +\gamma$ for numbers
$\alpha,\beta,\gamma$ (which is why we are giving them the same names). This
similarity is not coincidental. Just as for addition or multiplication of
numbers, these laws lead to a notion of \textquotedblleft
XOR-products\textquotedblright:

\begin{proposition}
\label{prop.intro.xor.prodm}Let $m$ be a positive integer. Let $\mathbf{a}%
_{1},\mathbf{a}_{2},\ldots,\mathbf{a}_{m}$ be $m$ bitstrings. Then, the
\textquotedblleft$\operatorname*{XOR}$-product\textquotedblright\ expression%
\[
\mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\operatorname*{XOR}%
\mathbf{a}_{3}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{a}_{m}%
\]
is well-defined, in the sense that it does not depend on the parenthesization.
\end{proposition}

What do we mean by \textquotedblleft parenthesization\textquotedblright? To
clarify things, let us set $m=4$. In this case, we want to make sense of the
expression $\mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\operatorname*{XOR}%
\mathbf{a}_{3}\operatorname*{XOR}\mathbf{a}_{4}$. This expression does not
make sense a priori, since it is a $\operatorname*{XOR}$ of \textbf{four}
bitstrings, whereas we have defined only the $\operatorname*{XOR}$ of
\textbf{two} bitstrings. But there are five ways to put parentheses around
some of its sub-expressions such that the expression becomes meaningful:
\begin{align*}
&  \left(  \mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\right)
\operatorname*{XOR}\left(  \mathbf{a}_{3}\operatorname*{XOR}\mathbf{a}%
_{4}\right)  ,\\
&  \left(  \left(  \mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\right)
\operatorname*{XOR}\mathbf{a}_{3}\right)  \operatorname*{XOR}\mathbf{a}_{4},\\
&  \mathbf{a}_{1}\operatorname*{XOR}\left(  \left(  \mathbf{a}_{2}%
\operatorname*{XOR}\mathbf{a}_{3}\right)  \operatorname*{XOR}\mathbf{a}%
_{4}\right)  ,\\
&  \mathbf{a}_{1}\operatorname*{XOR}\left(  \mathbf{a}_{2}\operatorname*{XOR}%
\left(  \mathbf{a}_{3}\operatorname*{XOR}\mathbf{a}_{4}\right)  \right)  ,\\
&  \left(  \mathbf{a}_{1}\operatorname*{XOR}\left(  \mathbf{a}_{2}%
\operatorname*{XOR}\mathbf{a}_{3}\right)  \right)  \operatorname*{XOR}%
\mathbf{a}_{4}.
\end{align*}
Each of these five parenthesizations (= placements of parentheses) turns our
expression $\mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\operatorname*{XOR}%
\mathbf{a}_{3}\operatorname*{XOR}\mathbf{a}_{4}$ into a combination of
$\operatorname*{XOR}$'s of \textbf{two} bitstrings each, and thus gives it
meaning. The question is: Do these five parenthesizations give it the
\textbf{same} meaning?

Well, let us calculate:%
\begin{align*}
&  \left(  \mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\right)
\operatorname*{XOR}\left(  \mathbf{a}_{3}\operatorname*{XOR}\mathbf{a}%
_{4}\right) \\
&  =\mathbf{a}_{1}\operatorname*{XOR}\underbrace{\left(  \mathbf{a}%
_{2}\operatorname*{XOR}\left(  \mathbf{a}_{3}\operatorname*{XOR}\mathbf{a}%
_{4}\right)  \right)  }_{=\left(  \mathbf{a}_{2}\operatorname*{XOR}%
\mathbf{a}_{3}\right)  \operatorname*{XOR}\mathbf{a}_{4}}\\
&  =\mathbf{a}_{1}\operatorname*{XOR}\left(  \left(  \mathbf{a}_{2}%
\operatorname*{XOR}\mathbf{a}_{3}\right)  \operatorname*{XOR}\mathbf{a}%
_{4}\right) \\
&  =\underbrace{\left(  \mathbf{a}_{1}\operatorname*{XOR}\left(
\mathbf{a}_{2}\operatorname*{XOR}\mathbf{a}_{3}\right)  \right)  }_{=\left(
\mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\right)  \operatorname*{XOR}%
\mathbf{a}_{3}}\operatorname*{XOR}\mathbf{a}_{4}\\
&  =\left(  \left(  \mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\right)
\operatorname*{XOR}\mathbf{a}_{3}\right)  \operatorname*{XOR}\mathbf{a}_{4},
\end{align*}
where we used the law of associativity in each step. This shows that our five
parenthesizations yield the same result. Thus, they all give our
\textquotedblleft$\operatorname*{XOR}$-product\textquotedblright\ expression
$\mathbf{a}_{1}\operatorname*{XOR}\mathbf{a}_{2}\operatorname*{XOR}%
\mathbf{a}_{3}\operatorname*{XOR}\mathbf{a}_{4}$ the same meaning; so we can
say that this expression is well-defined. This confirms Proposition
\ref{prop.intro.xor.prodm} for $m=4$.

Of course, proving Proposition \ref{prop.intro.xor.prodm} is less simple. Such
a proof appears in Exercise 4 on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}
(for more general binary operations than $\operatorname*{XOR}$).

\subsubsection{The $k=n$ case: an answer}

Let us now return to our problem. We have $n$ persons $1,2,\ldots,n$ and a
secret $\mathbf{a}$ (encoded as a bitstring). We want to give each person $i$
some bitstring $\mathbf{a}_{i}$ such that only all $n$ of them can recover
$\mathbf{a}$ but any $n-1$ of them cannot gain any insight about $\mathbf{a}$.

We let $\mathbf{a}_{1},\mathbf{a}_{2},\ldots,\mathbf{a}_{n-1}$ be $n-1$
\textbf{uniformly} random bitstrings of the same length as $\mathbf{a}$.
(Think of them as random gibberish.) Set%
\[
\mathbf{a}_{n}=\mathbf{a}\operatorname*{XOR}\mathbf{a}_{1}\operatorname*{XOR}%
\mathbf{a}_{2}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{a}_{n-1}.
\]
(This expression makes sense because of Proposition \ref{prop.intro.xor.prodm}.)

Then,%
\begin{align*}
&  \mathbf{a}_{n}\operatorname*{XOR}\mathbf{a}_{n-1}\operatorname*{XOR}%
\mathbf{a}_{n-2}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{a}_{1}\\
&  =\left(  \mathbf{a}\operatorname*{XOR}\mathbf{a}_{1}\operatorname*{XOR}%
\mathbf{a}_{2}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{a}%
_{n-1}\right)  \operatorname*{XOR}\mathbf{a}_{n-1}\operatorname*{XOR}%
\mathbf{a}_{n-2}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{a}_{1}\\
&  =\mathbf{a}\operatorname*{XOR}\mathbf{a}_{1}\operatorname*{XOR}%
\mathbf{a}_{2}\operatorname*{XOR}\cdots\operatorname*{XOR}%
\underbrace{\mathbf{a}_{n-1}\operatorname*{XOR}\mathbf{a}_{n-1}}_{=\mathbf{0}%
}\operatorname*{XOR}\mathbf{a}_{n-2}\operatorname*{XOR}\cdots
\operatorname*{XOR}\mathbf{a}_{1}\\
&  =\mathbf{a}\operatorname*{XOR}\mathbf{a}_{1}\operatorname*{XOR}%
\mathbf{a}_{2}\operatorname*{XOR}\cdots\operatorname*{XOR}%
\underbrace{\mathbf{a}_{n-2}\operatorname*{XOR}\mathbf{0}}_{=\mathbf{a}_{n-2}%
}\operatorname*{XOR}\mathbf{a}_{n-2}\operatorname*{XOR}\cdots
\operatorname*{XOR}\mathbf{a}_{1}\\
&  =\mathbf{a}\operatorname*{XOR}\mathbf{a}_{1}\operatorname*{XOR}%
\mathbf{a}_{2}\operatorname*{XOR}\cdots\operatorname*{XOR}%
\underbrace{\mathbf{a}_{n-2}\operatorname*{XOR}\mathbf{a}_{n-2}}_{=\mathbf{0}%
}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{a}_{1}\\
&  =\cdots\\
&  =\mathbf{a}%
\end{align*}
(here, we have been unravelling the big $\operatorname*{XOR}$-product from the
middle on, by cancelling equal bitstrings using the self-cancellation law and
then removing the resulting $\mathbf{0}$ using the $\mathbf{a}%
\operatorname*{XOR}\mathbf{0}=\mathbf{a}$ law). Hence, the $n$ people together
can decrypt the secret $\mathbf{a}$.

Can $n-1$ people gain any insight about it? The $n-1$ people $1,2,\ldots,n-1$
certainly cannot, since all they know are the random bitstrings $\mathbf{a}%
_{1},\mathbf{a}_{2},\ldots,\mathbf{a}_{n-1}$. But the $n-1$ people
$2,3,\ldots,n$ cannot gain any insight about $\mathbf{a}$ either: In fact, all
they know are the random bitstrings $\mathbf{a}_{2},\mathbf{a}_{3}%
,\ldots,\mathbf{a}_{n-1}$ and the bitstring%
\[
\mathbf{a}_{n}=\mathbf{a}\operatorname*{XOR}\mathbf{a}_{1}\operatorname*{XOR}%
\mathbf{a}_{2}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{a}_{n-1};
\]
therefore, all the information they have about $\mathbf{a}$ and $\mathbf{a}%
_{1}$ comes to them through $\mathbf{a}\operatorname*{XOR}\mathbf{a}_{1}$,
which says nothing about $\mathbf{a}$ as long as they know nothing about
$\mathbf{a}_{1}$. (We used a bit of handwaving in this argument, but then
again we never formally defined what it means to \textquotedblleft gain no
insight\textquotedblright; this is done in courses on cryptography and
information theory.) Similar arguments show that any other choice of $n-1$
persons remains equally clueless about $\mathbf{a}$. So we have solved the
problem in the case $k=n$.

\subsubsection{The $k=2$ case}

The next simple case is when $k=2$. So we want to ensure that any $2$ of our
$n$ people can together recover the secret, but no $1$ person can learn
anything about it alone.

A really nice approach was suggested by Nathan (a student in class): We pick
$n$ random bitstrings $\mathbf{x}_{1},\mathbf{x}_{2},\ldots,\mathbf{x}_{n-1}$
of the same length as $\mathbf{a}$. Set
\[
\mathbf{x}_{n}=\mathbf{a}\operatorname*{XOR}\mathbf{x}_{1}\operatorname*{XOR}%
\mathbf{x}_{2}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{x}_{n-1};
\]
thus, as in the $k=n$ case, we have%
\begin{equation}
\mathbf{x}_{n}\operatorname*{XOR}\mathbf{x}_{n-1}\operatorname*{XOR}%
\mathbf{x}_{n-2}\operatorname*{XOR}\cdots\operatorname*{XOR}\mathbf{x}%
_{1}=\mathbf{a}. \label{eq.intro.shamir.k=2.2}%
\end{equation}


Each person $i$ now receives the bitstring%
\[
\mathbf{a}_{i}=\mathbf{x}_{1}\mathbf{x}_{2}\cdots\mathbf{x}_{i-1}%
\mathbf{x}_{i+1}\mathbf{x}_{i+2}\cdots\mathbf{x}_{n},
\]
where the product stands for \textit{concatenation} (i.e., the bitstring
$\mathbf{a}_{i}$ is formed by writing down all of the bitstrings
$\mathbf{x}_{1},\mathbf{x}_{2},\ldots,\mathbf{x}_{n}$ one after the other but
skipping $\mathbf{x}_{i}$). Thus, each person $i$ can recover all the $n-1$
bitstrings $\mathbf{x}_{1},\mathbf{x}_{2},\ldots,\mathbf{x}_{i-1}%
,\mathbf{x}_{i+1},\mathbf{x}_{i+2},\ldots,\mathbf{x}_{n}$ (because their
lengths are the length of $\mathbf{a}$, which is known), but knows nothing
about $\mathbf{x}_{i}$ (his \textquotedblleft blind spot\textquotedblright).
Hence, $2$ people together can recover all the $n$ bitstrings $\mathbf{x}%
_{1},\mathbf{x}_{2},\ldots,\mathbf{x}_{n}$ and therefore recover the secret
$\mathbf{a}$ (by (\ref{eq.intro.shamir.k=2.2})). On the other hand, each
single person has no insight about $\mathbf{a}$ (this is proven similarly to
the $k=n$ case). So again, the problem is solved in this case.

\subsubsection{\label{subsect.intro.shamir.k=3}The $k=3$ case}

Now, let us come to the case when $k=3$. Here, I think, the usefulness of the
$\operatorname*{XOR}$ approach has come to its end: at least, I don't know how
to make it work here. Instead, out of the blue, I will invoke something
completely different: polynomials (let's say with rational coefficients).

Recall a fact you might have heard in high school:

\begin{proposition}
\label{prop.intro.shamir.quadpol}A polynomial $\mathbf{f}\left(  x\right)
=cx^{2}+bx+a$ of degree $\leq2$ is uniquely determined by any three of its
values. More precisely: If $u,v,w$ are three fixed distinct numbers, then a
polynomial $\mathbf{f}\left(  x\right)  =cx^{2}+bx+a$ of degree $\leq2$ is
uniquely determined by the values $\mathbf{f}\left(  u\right)  ,\mathbf{f}%
\left(  v\right)  ,\mathbf{f}\left(  w\right)  $.

More precisely: If $u,v,w$ are three fixed distinct numbers, and if $p,q,r$
are three arbitrary numbers, then there is a unique polynomial $\mathbf{f}%
\left(  x\right)  =cx^{2}+bx+a$ of degree $\leq2$ satisfying%
\[
\mathbf{f}\left(  u\right)  =p,\ \ \ \ \ \ \ \ \ \ \mathbf{f}\left(  v\right)
=q,\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \mathbf{f}\left(
w\right)  =r.
\]

\end{proposition}

\noindent Here, the word \textquotedblleft number\textquotedblright\ is
deliberately left ambiguous, but you can think of rational or real numbers
(Proposition \ref{prop.intro.shamir.quadpol} is definitely true for them).

Also recall that any bitstring of given length $N$ can be encoded as an
integer in $\left\{  0,1,\ldots,2^{N}-1\right\}  $: Just read it as a number
in binary. More precisely, any bitstring $a_{N-1}a_{N-2}\cdots a_{0}$ of
length $N$ becomes the integer $a_{N-1}\cdot2^{N-1}+a_{N-2}\cdot2^{N-2}%
+\cdots+a_{0}\cdot2^{0}\in\left\{  0,1,\ldots,2^{N}-1\right\}  $. For example,
the bitstring $010110$ of length $6$ becomes the integer%
\[
0\cdot2^{5}+1\cdot2^{4}+0\cdot2^{3}+1\cdot2^{2}+1\cdot2^{1}+0\cdot2^{0}%
=22\in\left\{  0,1,\ldots,2^{6}-1\right\}  .
\]


Choose two \textbf{uniformly random} bitstrings $\mathbf{c}$ and $\mathbf{b}$
(of the same length as $\mathbf{a}$) and encode them as numbers $c$ and $b$
(as just explained). Encode the secret $\mathbf{a}$ as a number $a$ as well
(in the same way). Define the polynomial $\mathbf{f}\left(  x\right)
=cx^{2}+bx+a$. Reveal to each person $i\in\left\{  1,2,\ldots,n\right\}  $ the
value $\mathbf{f}\left(  i\right)  $ -- or, rather, a bitstring that encodes
it in binary -- as $\mathbf{a}_{i}$.

Any three of the $n$ values $\mathbf{f}\left(  i\right)  $ uniquely determine
the polynomial $\mathbf{f}$ (because of Proposition
\ref{prop.intro.shamir.quadpol}). Thus, any three people can use their
bitstrings $\mathbf{a}_{i}$ to recover three values $\mathbf{f}\left(
i\right)  $ and therefore $\mathbf{f}$ and therefore $a$ (as the constant term
of $\mathbf{f}$) and therefore $\mathbf{a}$ (by decoding $a$). So our method
satisfies Requirement 1.

Now, let us see whether it satisfies Requirement 2. Any $2$ people can recover
two values $\mathbf{f}\left(  i\right)  $, which generally do not determine
$\mathbf{f}$ uniquely. It is not hard to show that they do not even determine
$a$ uniquely; thus, they do not determine $\mathbf{a}$ uniquely. What's
better: If you know just two values of $\mathbf{f}$, there are infinitely many
possible choices for $\mathbf{f}$, and all of them have distinct constant
terms (unless one of the two values you know is $\mathbf{f}\left(  0\right)
$, which of course pins down the constant term)\footnote{Prove this!
(\textbf{Hint:} The constant term of a polynomial is just its value at $0$.
Thus, if you know two values of $\mathbf{f}$ at points other than $0$ and also
the constant term of $\mathbf{f}$, then you simply know three values of
$\mathbf{f}$.)}. So we get infinitely many possible values for $a$, and thus
infinitely many possible values for $\mathbf{a}$. This means that our $2$
people don't gain any insight about $\mathbf{a}$, right?

Not so fast! We cannot really have \textquotedblleft infinitely many possible
values for $\mathbf{a}$\textquotedblright, since $\mathbf{a}$ is bound to be a
bitstring of a given length -- there are only finitely many of those! You can
only get infinitely many possible values for $\mathbf{f}$ if you forget how
$\mathbf{f}$ was constructed (from $c$, $b$ and $a$) and pretend that
$\mathbf{f}$ is just a \textquotedblleft uniformly random\textquotedblright%
\ polynomial (whatever this means). But no one can force the $2$ people to do
this; it is certainly not in their interest! Here are some things they might
do with this knowledge:

\begin{itemize}
\item Let $N$ be the length of $\mathbf{a}$ (which, as we said, is known).
Thus, $\mathbf{c}$ and $\mathbf{b}$ are bitstrings of length $N$, so that $c$
and $b$ are integers in $\left\{  0,1,\ldots,2^{N}-1\right\}  $. Assume that
one of the $2$ people is person $2$. Now, person $2$ knows $\mathbf{f}\left(
2\right)  =c2^{2}+b2+a=4c+2b+a$, and thus knows whether $a$ is even or odd
(because $a$ is even resp. odd if and only if $4c+2b+a$ is even resp. odd).
This means she knows the last bit of the secret $\mathbf{a}$. This is not
\textquotedblleft clueless\textquotedblright.

\item You might try to fix this by picking $c$ and $b$ to be uniformly random
rational numbers instead (rather than using uniformly random bitstrings
$\mathbf{c}$ and $\mathbf{b}$).

Unfortunately, there is no such thing as a \textquotedblleft uniformly random
rational number\textquotedblright\ (in the sense that, e.g., larger numbers
aren't less likely to be picked than smaller numbers). Any probability
distribution will make some numbers more likely than others, and this will
usually cause information about $\mathbf{a}$ to \textquotedblleft
leak\textquotedblright. For example, if $c$ and $b$ are chosen from the
interval $\left[  0,2^{N}-1\right]  $, then person $1$'s knowledge of
$\mathbf{f}\left(  1\right)  =c1^{2}+b1+a=c+b+a$ will sometimes reveal to
person $1$ that $a\geq0.5\cdot\left(  2^{N}-1\right)  $ (namely, this will
happen when $\mathbf{f}\left(  1\right)  \geq2.5\cdot\left(  2^{N}-1\right)
$, which occasionally happens). This, again, is nontrivial information about
the secret $\mathbf{a}$, which a single person (or even two people) should not
be having.
\end{itemize}

So we cannot make Requirement 2 hold, and the culprit is that there are too
many numbers (namely, infinitely many). What would help is a finite
\textquotedblleft number system\textquotedblright\ in which we can add,
subtract, multiply and divide (so that we can define polynomials over it, and
a polynomial of degree $\leq2$ is still uniquely determined by any $3$
values). Assuming that this \textquotedblleft number system\textquotedblright%
\ is large enough that we can encode bitstrings using \textquotedblleft
numbers\textquotedblright\ of this system (instead of integers), we can then
play the above game using this \textquotedblleft number
system\textquotedblright\ and obtain actually uniformly random numbers.

It turns out that such \textquotedblleft number systems\textquotedblright%
\ exist. They are called \textit{finite fields}, and we will construct them
later in this course.

Assuming that they can be constructed, we thus obtain a method of solving the
problem for $k=3$. A similar method works for arbitrary $k$, using polynomials
of degree $\leq k-1$. This is called \textit{Shamir's Secret Sharing Scheme}.

\begin{teachingnote}
\textbf{2019-01-30 lecture (virtual)}
\end{teachingnote}

\section{Elementary number theory}

Let us now begin a systematic introduction to algebra. We start with studying
integers and their divisibility properties -- the beginnings of number theory.
Part of these will be used directly in what will follow; part of these will
inspire more general results and proofs.

\subsection{Notations}

\begin{definition}
Let $\mathbb{N}=\left\{  0,1,2,\ldots\right\}  $ be the set of
\textbf{nonnegative} integers.

Let $\mathbb{P}=\left\{  1,2,3,\ldots\right\}  $ be the set of
\textbf{positive} integers.

Let $\mathbb{Z}=\left\{  \ldots,-1,0,1,\ldots\right\}  $ be the set of integers.

Let $\mathbb{Q}$ be the set of rational numbers.

Let $\mathbb{R}$ be the set of real numbers.
\end{definition}

Be careful with the notation $\mathbb{N}$: While I use it for $\left\{
0,1,2,\ldots\right\}  $, various other authors use it for $\left\{
1,2,3,\ldots\right\}  $ instead. There is no consensus in sight on what
$\mathbb{N}$ should mean.

Same holds for the word \textquotedblleft natural number\textquotedblright%
\ (which I will avoid): It means \textquotedblleft element of $\mathbb{N}%
$\textquotedblright, so again its ultimate meaning depends on the author.

The word \textquotedblleft list\textquotedblright\ shall always mean
\textquotedblleft ordered finite list\textquotedblright\ unless declared
otherwise. Examples of lists of numbers are $\left(  2,5,2\right)  $, $\left(
1,9\right)  $, the one-entry list $\left(  9\right)  $ (not the same as the
number $9$ itself) and the empty list $\left(  {}\right)  $. The word
\textquotedblleft tuple\textquotedblright\ means the same as \textquotedblleft
list\textquotedblright, but more specifically, the word \textquotedblleft%
$k$-tuple\textquotedblright\ (for some $k\in\mathbb{N}$) means
\textquotedblleft list with exactly $k$ entries\textquotedblright. For
instance, $\left(  5,1,5\right)  $ is a $3$-tuple. The word \textquotedblleft
sequence\textquotedblright\ means an ordered, but not necessarily finite, list.

\subsection{Divisibility}

We now go through the basics of divisibility of integers.

\begin{definition}
\label{def.ent.div.div}Let $a$ and $b$ be two integers. We say that $a\mid b$
(or \textquotedblleft$a$ \textit{divides} $b$\textquotedblright\ or
\textquotedblleft$b$ is \textit{divisible by }$a$\textquotedblright\ or
\textquotedblleft$b$ is a \textit{multiple} of $a$\textquotedblright) if there
exists an integer $c$ such that $b=ac$.

We furthermore say that $a\nmid b$ if $a$ does not divide $b$.
\end{definition}

Some authors define the \textquotedblleft divisibility\textquotedblright%
\ relation a bit differently, in that they forbid $a=0$. From the viewpoint of
abstract algebra, this feels like an unnecessary exception, so we don't follow them.

\begin{example}
\label{exa.ent.div.triv}\textbf{(a)} We have $4\mid12$, since $12=4\cdot3$.

\textbf{(b)} We have $a\mid0$ for any $a\in\mathbb{Z}$, since $0=a\cdot0$.

\textbf{(c)} An integer $b$ satisfies $0\mid b$ only when $b=0$, since $0\mid
b$ implies $b=0c=0$ (for some $c\in\mathbb{Z}$).

\textbf{(d)} We have $a\mid a$ for any $a\in\mathbb{Z}$, since $a=a\cdot1$.

\textbf{(e)} We have $1\mid b$ for each $b\in\mathbb{Z}$, since $b=1\cdot b$.
\end{example}

I apologize in advance for the next proposition, in which vertical bars stand
both for the \textquotedblleft divides\textquotedblright\ relation and for the
absolute value of a number. Unfortunately, both of these uses are standard
notation. Confusion is possible, but hopefully will not happen
often\footnote{Unfortunately, the use of vertical bars for absolute values
alone suffices to generate confusion! Just think of the meaning of
\textquotedblleft$\left\vert a\right\vert b\left\vert c\right\vert
$\textquotedblright\ when $a$, $b$ and $c$ are three numbers. Does it stand
for \textquotedblleft$\left(  \left\vert a\right\vert \right)  \cdot
b\cdot\left(  \left\vert c\right\vert \right)  $\textquotedblright\ (where I
am using parentheses to make the ambiguity disappear) or for \textquotedblleft%
$\left\vert \left(  a\cdot\left\vert b\right\vert \cdot c\right)  \right\vert
$\textquotedblright? If you see any expressions in my notes that allow for
more than one meaningful interpretation, please let me know!}.

\begin{proposition}
\label{prop.ent.div.1}Let $a$ and $b$ be two integers.

\textbf{(a)} We have $a\mid b$ if and only if $\left\vert a\right\vert
\mid\left\vert b\right\vert $. (Here, \textquotedblleft$\left\vert
a\right\vert \mid\left\vert b\right\vert $\textquotedblright\ means
\textquotedblleft$\left\vert a\right\vert $ divides $\left\vert b\right\vert
$\textquotedblright.)

\textbf{(b)} If $a\mid b$ and $b\neq0$, then $\left\vert a\right\vert
\leq\left\vert b\right\vert $.

\textbf{(c)} Assume that $a\neq0$. Then, $a\mid b$ if and only if $\dfrac
{b}{a}\in\mathbb{Z}$.
\end{proposition}

Before we prove this proposition, let us recall a well-known fact: We have
\begin{equation}
\left\vert xy\right\vert =\left\vert x\right\vert \cdot\left\vert y\right\vert
\label{eq.ent.div.abs(xy)}%
\end{equation}
for any two integers\footnote{or real numbers} $x$ and $y$. (This can be
easily proven by case distinction: $x$ is either nonnegative or negative, and
so is $y$.)

\begin{proof}
[Proof of Proposition \ref{prop.ent.div.1}.]\textbf{(a)} $\Longrightarrow
:$\footnote{If you are unfamiliar with the shorthand notation
\textquotedblleft$\Longrightarrow:$\textquotedblright, let me explain it. Our
goal is to prove that $a\mid b$ if and only if $\left\vert a\right\vert
\mid\left\vert b\right\vert $. In other words, we need to prove the
equivalence $\left(  a\mid b\right)  \Longleftrightarrow\left(  \left\vert
a\right\vert \mid\left\vert b\right\vert \right)  $. In order to prove this
equivalence, it suffices to prove the two implications $\left(  a\mid
b\right)  \Longrightarrow\left(  \left\vert a\right\vert \mid\left\vert
b\right\vert \right)  $ (called the \textquotedblleft forward
implication\textquotedblright\ or the \textquotedblleft$\Longrightarrow$
direction\textquotedblright\ of the equivalence) and $\left(  a\mid b\right)
\Longleftarrow\left(  \left\vert a\right\vert \mid\left\vert b\right\vert
\right)  $ (called the \textquotedblleft backward
implication\textquotedblright\ or the \textquotedblleft$\Longleftarrow$
direction\textquotedblright). The shorthand \textquotedblleft$\Longrightarrow
:$\textquotedblright\ simply marks the beginning of the proof of the forward
implication; similarly, the symbol \textquotedblleft$\Longleftarrow
:$\textquotedblright\ heralds in the proof of the backward implication.}
Assume that $a\mid b$. Thus, there exists an integer $d$ such that $b=ad$ (by
Definition \ref{def.ent.div.div}). Consider\footnote{Me saying
\textquotedblleft Consider this $d$\textquotedblright\ means that I am picking
some integer $d$ such that $b=ad$ (this can be done, since we have just proven
that such a $d$ exists), and will be referring to it as $d$ from now on.} this
$d$. We have $b=ad$ and thus $\left\vert b\right\vert =\left\vert
ad\right\vert =\left\vert a\right\vert \cdot\left\vert d\right\vert $ (by
(\ref{eq.ent.div.abs(xy)})). Thus, there exists an integer $c$ such that
$\left\vert b\right\vert =\left\vert a\right\vert \cdot c$ (namely,
$c=\left\vert d\right\vert $). In other words, $\left\vert a\right\vert
\mid\left\vert b\right\vert $. This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Proposition
\ref{prop.ent.div.1} \textbf{(a)}.

$\Longleftarrow:$ Assume that $\left\vert a\right\vert \mid\left\vert
b\right\vert $. Thus, there exists an integer $f$ such that $\left\vert
b\right\vert =\left\vert a\right\vert \cdot f$ (by Definition
\ref{def.ent.div.div}). Consider this $f$.

The definition of $\left\vert b\right\vert $ shows that $\left\vert
b\right\vert $ equals either $b$ or $-b$. In other words, $\left\vert
b\right\vert $ equals either $1b$ or $\left(  -1\right)  b$ (since $b=1b$ and
$-b=\left(  -1\right)  b$). In other words, $\left\vert b\right\vert =qb$ for
some $q\in\left\{  1,-1\right\}  $. Similarly, $\left\vert a\right\vert =ra$
for some $r\in\left\{  1,-1\right\}  $. Consider these $q$ and $r$.

From $q\in\left\{  1,-1\right\}  $, we obtain $q^{2}\in\left\{
\underbrace{1^{2}}_{=1},\underbrace{\left(  -1\right)  ^{2}}_{=1}\right\}
=\left\{  1,1\right\}  =\left\{  1\right\}  $. In other words, $q^{2}=1$.

Now, $q\underbrace{\left\vert b\right\vert }_{=qb}=\underbrace{qq}_{=q^{2}%
=1}b=b$, so that $b=q\underbrace{\left\vert b\right\vert }_{=\left\vert
a\right\vert \cdot f}=q\underbrace{\left\vert a\right\vert }_{=ra}\cdot
f=qra\cdot f=a\cdot qfr$. Hence, there exists an integer $c$ such that $b=ac$
(namely, $c=qfr$). In other words, $a\mid b$ (by Definition
\ref{def.ent.div.div}). This proves the \textquotedblleft$\Longleftarrow
$\textquotedblright\ direction of Proposition \ref{prop.ent.div.1}
\textbf{(a)}.

Thus, the proof of Proposition \ref{prop.ent.div.1} \textbf{(a)} is complete.

\textbf{(b)} Assume that $a\mid b$ and $b\neq0$.

From $a\mid b$, we conclude that there exists an integer $c$ such that $b=ac$.
Consider this $c$. We have $ac=b\neq0$, thus $c\neq0$. Hence, $\left\vert
c\right\vert >0$, and thus $\left\vert c\right\vert \geq1$ (since $\left\vert
c\right\vert $ is an integer). We can multiply this inequality by $\left\vert
a\right\vert $ (since $\left\vert a\right\vert \geq0$), and obtain $\left\vert
a\right\vert \cdot\left\vert c\right\vert \geq\left\vert a\right\vert
\cdot1=\left\vert a\right\vert $.

From $b=ac$, we obtain $\left\vert b\right\vert =\left\vert ac\right\vert
=\left\vert a\right\vert \cdot\left\vert c\right\vert $ (by
(\ref{eq.ent.div.abs(xy)})). Hence, $\left\vert b\right\vert =\left\vert
a\right\vert \cdot\left\vert c\right\vert \geq\left\vert a\right\vert $. This
proves Proposition \ref{prop.ent.div.1} \textbf{(b)}.

\textbf{(c)} $\Longrightarrow:$ Assume that $a\mid b$. We must prove that
$\dfrac{b}{a}\in\mathbb{Z}$.

We have $a\mid b$. In other words, there exists an integer $d$ such that
$b=ad$. Consider this $d$. We can divide the equality $b=ad$ by $a$ (since
$a\neq0$), and thus obtain $\dfrac{b}{a}=d\in\mathbb{Z}$. This proves the
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction of Proposition
\ref{prop.ent.div.1} \textbf{(c)}.

$\Longleftarrow:$ Assume that $\dfrac{b}{a}\in\mathbb{Z}$. We must prove that
$a\mid b$.

We have $\dfrac{b}{a}\in\mathbb{Z}$ and $b=a\cdot\dfrac{b}{a}$. Thus, there
exists an integer $c$ such that $b=ac$ (namely, $c=\dfrac{b}{a}$). In other
words, $a\mid b$. This proves the \textquotedblleft$\Longleftarrow
$\textquotedblright\ direction of Proposition \ref{prop.ent.div.1}
\textbf{(c)}. Hence, the proof of Proposition \ref{prop.ent.div.1}
\textbf{(c)} is complete.
\end{proof}

Proposition \ref{prop.ent.div.1} \textbf{(a)} shows that both $a$ and $b$ in
the statement \textquotedblleft$a\mid b$\textquotedblright\ can be replaced by
their absolute values. Thus, when we talk about divisibility of integers, the
sign of the integers does not really matter -- it usually suffices to work
with nonnegative integers. We will often use this (tacitly, after a while) in proofs.

The next proposition shows some basic properties of the divisibility relation:

\begin{proposition}
\label{prop.ent.div.2}\textbf{(a)} We have $a\mid a$ for every $a\in
\mathbb{Z}$. (This is called the \textit{reflexivity of divisibility}.)

\textbf{(b)} If $a,b,c\in\mathbb{Z}$ satisfy $a\mid b$ and $b\mid c$, then
$a\mid c$. (This is called the \textit{transitivity of divisibility}.)

\textbf{(c)} If $a_{1},a_{2},b_{1},b_{2}\in\mathbb{Z}$ satisfy $a_{1}\mid
b_{1}$ and $a_{2}\mid b_{2}$, then $a_{1}a_{2}\mid b_{1}b_{2}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.div.2}.]\textbf{(a)} Let $a\in\mathbb{Z}$.
Then, $a=a\cdot1$. Hence, there exists an integer $c$ such that $a=ac$
(namely, $c=1$). In other words, $a\mid a$ (by Definition
\ref{def.ent.div.div}). This proves Proposition \ref{prop.ent.div.2}
\textbf{(a)}.

\textbf{(b)} Let $a,b,c\in\mathbb{Z}$ satisfy $a\mid b$ and $b\mid c$.

From $a\mid b$, we conclude that there exists an integer $d$ such that $b=ad$
(by Definition \ref{def.ent.div.div}). Consider this $d$.

From $b\mid c$, we conclude that there exists an integer $e$ such that $c=be$
(by Definition \ref{def.ent.div.div}). Consider this $e$.

We have $c=\underbrace{b}_{=ad}e=ade$. Hence, there exists an integer $f$ such
that $c=af$ (namely, $f=de$). In other words, $a\mid c$ (by Definition
\ref{def.ent.div.div}). This proves Proposition \ref{prop.ent.div.2}
\textbf{(b)}.

\textbf{(c)} Let $a_{1},a_{2},b_{1},b_{2}\in\mathbb{Z}$ satisfy $a_{1}\mid
b_{1}$ and $a_{2}\mid b_{2}$.

From $a_{1}\mid b_{1}$, we conclude that there exists an integer $d$ such that
$b_{1}=a_{1}d$. Consider this $d$.

From $a_{2}\mid b_{2}$, we conclude that there exists an integer $e$ such that
$b_{2}=a_{2}e$. Consider this $e$.

We have $\underbrace{b_{1}}_{=a_{1}d}\underbrace{b_{2}}_{=a_{2}e}=a_{1}%
da_{2}e=a_{1}a_{2}de$. Hence, there exists an integer $f$ such that
$b_{1}b_{2}=a_{1}a_{2}f$ (namely, $f=de$). In other words, $a_{1}a_{2}\mid
b_{1}b_{2}$ (by Definition \ref{def.ent.div.div}). This proves Proposition
\ref{prop.ent.div.2} \textbf{(c)}.
\end{proof}

\begin{exercise}
\label{exe.ent.div.aabs}Let $a\in\mathbb{Z}$.

\textbf{(a)} Prove that $a\mid\left\vert a\right\vert $. (This means
\textquotedblleft$a$ divides $\left\vert a\right\vert $\textquotedblright.)

\textbf{(b)} Prove that $\left\vert a\right\vert \mid a$. (This means
\textquotedblleft$\left\vert a\right\vert $ divides $a$\textquotedblright.)
\end{exercise}

\begin{exercise}
\label{exe.ent.div.abba}Let $a$ and $b$ be two integers such that $a\mid b$
and $b\mid a$. Prove that $\left\vert a\right\vert =\left\vert b\right\vert $.
\end{exercise}

\begin{exercise}
\label{exe.ent.div.acbc}Let $a,b,c$ be three integers such that $c\neq0$.
Prove that $a\mid b$ holds if and only if $ac\mid bc$.
\end{exercise}

\begin{exercise}
\label{exe.ent.div.powers}Let $n\in\mathbb{Z}$. Let $a,b\in\mathbb{N}$ be such
that $a\leq b$. Prove that $n^{a}\mid n^{b}$.
\end{exercise}

\begin{exercise}
\label{exe.ent.div.g|1}Let $g$ be a nonnegative integer such that $g\mid1$.
Prove that $g=1$.
\end{exercise}

\begin{exercise}
\label{exe.ent.div.powers-ab}Let $a,b\in\mathbb{Z}$ be such that $a\mid b$.
Let $k\in\mathbb{N}$. Prove that $a^{k}\mid b^{k}$.
\end{exercise}

\subsection{Congruence modulo $n$}

The next definition is simple but crucial:

\begin{definition}
\label{def.ent.cong}Let $n,a,b\in\mathbb{Z}$. We say that $a$ \textit{is
congruent to }$b$ \textit{modulo }$n$ if and only if $n\mid a-b$. We shall use
the notation \textquotedblleft$a\equiv b\operatorname{mod}n$\textquotedblright%
\ for \textquotedblleft$a$ is congruent to $b$ modulo $n$\textquotedblright.

We furthermore shall use the notation \textquotedblleft$a\not \equiv
b\operatorname{mod}n$\textquotedblright\ for \textquotedblleft$a$ is not
congruent to $b$ modulo $n$\textquotedblright.
\end{definition}

\begin{example}
\label{exa.ent.cong.triv}\textbf{(a)} Is $3\equiv7\operatorname{mod}2$ ? Yes,
since $2\mid3-7=-4$.

\textbf{(b)} Is $3\equiv6\operatorname{mod}2$ ? No, since $2\nmid3-6=-3$. So
we have $3\not \equiv 6\operatorname{mod}2$.

Now, let $a$ and $b$ be two integers.

\textbf{(c)} We have $a\equiv b\operatorname{mod}0$ if and only if $a=b$.
(Indeed, $a\equiv b\operatorname{mod}0$ is defined to mean $0\mid a-b$, but
the latter divisibility happens only when $a-b=0$, which is tantamount to
saying $a=b$.)

\textbf{(d)} We have $a\equiv b\operatorname{mod}1$ always, since $1\mid a-b$
always holds (remember: $1$ divides everything).
\end{example}

Note that being congruent modulo $2$ means having the same parity: i.e., two
even numbers will be congruent modulo $2$, and two odd numbers will be, but an
even number will never be congruent to an odd number modulo $2$. (To be
rigorous: This is not quite obvious at this point yet; but it will be easy
once we have properly introduced division with remainder. See Exercise
\ref{exe.ent.even-odd.1} \textbf{(i)} below for the proof.)

\href{https://en.wikipedia.org/wiki/Modulo_(jargon)}{The word
\textquotedblleft modulo\textquotedblright}\ in the phrase \textquotedblleft%
$a$ is congruent to $b$ modulo $n$\textquotedblright\ originates with Gauss
and means something like \textquotedblleft with respect to\textquotedblright.
You should think of \textquotedblleft$a$ is congruent to $b$ modulo
$n$\textquotedblright\ as a relation between all three of the numbers $a$, $b$
and $n$, but $a$ and $b$ are the \textquotedblleft main
characters\textquotedblright\ and $n$ sets the scene.

\begin{exercise}
\label{exe.ent.mod.a+b=a-b}Let $a,b\in\mathbb{Z}$. Prove that $a+b\equiv
a-b\operatorname{mod}2$.
\end{exercise}

We begin with a proposition so fundamental that we will always use it without saying:

\begin{proposition}
\label{prop.ent.mod.0}Let $n\in\mathbb{Z}$ and $a\in\mathbb{Z}$. Then,
$a\equiv0\operatorname{mod}n$ if and only if $n\mid a$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.mod.0}.]We have the following chain of
equivalences:%
\begin{align*}
\left(  a\equiv0\operatorname{mod}n\right)  \  &  \Longleftrightarrow\ \left(
n\mid a-0\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition
\ref{def.ent.cong}}\right) \\
&  \Longleftrightarrow\ \left(  n\mid a\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }a-0=a\right)  .
\end{align*}
This proves Proposition \ref{prop.ent.mod.0}.
\end{proof}

Next come some staple properties of congruences:

\begin{proposition}
\label{prop.ent.mod.basics}Let $n\in\mathbb{Z}$.

\textbf{(a)} We have $a\equiv a\operatorname{mod}n$ for every $a\in\mathbb{Z}$.

\textbf{(b)} If $a,b,c\in\mathbb{Z}$ satisfy $a\equiv b\operatorname{mod}n$
and $b\equiv c\operatorname{mod}n$, then $a\equiv c\operatorname{mod}n$.

\textbf{(c)} If $a,b\in\mathbb{Z}$ satisfy $a\equiv b\operatorname{mod}n$,
then $b\equiv a\operatorname{mod}n$.

\textbf{(d)} If $a_{1},a_{2},b_{1},b_{2}\in\mathbb{Z}$ satisfy $a_{1}\equiv
b_{1}\operatorname{mod}n$ and $a_{2}\equiv b_{2}\operatorname{mod}n$, then%
\begin{align}
a_{1}+a_{2}  &  \equiv b_{1}+b_{2}\operatorname{mod}%
n;\label{eq.prop.ent.mod.basics.d.1}\\
a_{1}-a_{2}  &  \equiv b_{1}-b_{2}\operatorname{mod}%
n;\label{eq.prop.ent.mod.basics.d.2}\\
a_{1}a_{2}  &  \equiv b_{1}b_{2}\operatorname{mod}n.
\label{eq.prop.ent.mod.basics.d.3}%
\end{align}


\textbf{(e)} Let $m\in\mathbb{Z}$ be such that $m\mid n$. If $a,b\in
\mathbb{Z}$ satisfy $a\equiv b\operatorname{mod}n$, then $a\equiv
b\operatorname{mod}m$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.mod.basics}.]\textbf{(a)} Let
$a\in\mathbb{Z}$. Recall that $a\equiv a\operatorname{mod}n$ is defined to
mean $n\mid a-a$. Since $n\mid a-a$ holds (because $a-a=0=n\cdot0$), we thus
see that $a\equiv a\operatorname{mod}n$ holds. This proves Proposition
\ref{prop.ent.mod.basics} \textbf{(a)}.

\textbf{(b)} Let $a,b,c\in\mathbb{Z}$ satisfy $a\equiv b\operatorname{mod}n$
and $b\equiv c\operatorname{mod}n$.

We have $a\equiv b\operatorname{mod}n$. In other words, $n\mid a-b$ (by
Definition \ref{def.ent.cong}). In other words, there exists an integer $p$
such that $a-b=np$ (by Definition \ref{def.ent.div.div}). Consider this $p$.

We have $b\equiv c\operatorname{mod}n$. In other words, $n\mid b-c$ (by
Definition \ref{def.ent.cong}). In other words, there exists an integer $q$
such that $b-c=nq$ (by Definition \ref{def.ent.div.div}). Consider this $q$.

Now,
\[
a-c=\underbrace{\left(  a-b\right)  }_{=np}+\underbrace{\left(  b-c\right)
}_{=nq}=np+nq=n\left(  p+q\right)  .
\]
Hence, there exists an integer $r$ such that $a-c=nr$ (namely, $r=p+q$). In
other words, $n\mid a-c$ (by Definition \ref{def.ent.div.div}). In other
words, $a\equiv c\operatorname{mod}n$ (by Definition \ref{def.ent.cong}). This
proves Proposition \ref{prop.ent.mod.basics} \textbf{(b)}.

\textbf{(c)} Let $a,b\in\mathbb{Z}$ satisfy $a\equiv b\operatorname{mod}n$.

We have $a\equiv b\operatorname{mod}n$. In other words, $n\mid a-b$ (by
Definition \ref{def.ent.cong}). In other words, there exists an integer $p$
such that $a-b=np$ (by Definition \ref{def.ent.div.div}). Consider this $p$.
Now,%
\[
b-a=-\underbrace{\left(  a-b\right)  }_{=np}=-np=n\left(  -p\right)  .
\]
Hence, there exists an integer $c$ such that $b-a=nc$ (namely, $c=-p$). In
other words, $n\mid b-a$ (by Definition \ref{def.ent.div.div}). In other
words, $b\equiv a\operatorname{mod}n$ (by Definition \ref{def.ent.cong}). This
proves Proposition \ref{prop.ent.mod.basics} \textbf{(c)}.

\textbf{(d)} Let $a_{1},a_{2},b_{1},b_{2}\in\mathbb{Z}$ satisfy $a_{1}\equiv
b_{1}\operatorname{mod}n$ and $a_{2}\equiv b_{2}\operatorname{mod}n$.

We have $a_{1}\equiv b_{1}\operatorname{mod}n$. In other words, $n\mid
a_{1}-b_{1}$ (by Definition \ref{def.ent.cong}). In other words, there exists
an integer $p$ such that $a_{1}-b_{1}=np$ (by Definition \ref{def.ent.div.div}%
). Consider this $p$.

We have $a_{2}\equiv b_{2}\operatorname{mod}n$. In other words, $n\mid
a_{2}-b_{2}$ (by Definition \ref{def.ent.cong}). In other words, there exists
an integer $q$ such that $a_{2}-b_{2}=nq$ (by Definition \ref{def.ent.div.div}%
). Consider this $q$.

We have%
\[
\left(  a_{1}+a_{2}\right)  -\left(  b_{1}+b_{2}\right)  =\underbrace{\left(
a_{1}-b_{1}\right)  }_{=np}+\underbrace{\left(  a_{2}-b_{2}\right)  }%
_{=nq}=np+nq=n\left(  p+q\right)  .
\]
Hence, there exists an integer $c$ such that $\left(  a_{1}+a_{2}\right)
-\left(  b_{1}+b_{2}\right)  =nc$ (namely, $c=p+q$). In other words,
$n\mid\left(  a_{1}+a_{2}\right)  -\left(  b_{1}+b_{2}\right)  $ (by
Definition \ref{def.ent.div.div}). In other words, $a_{1}+a_{2}\equiv
b_{1}+b_{2}\operatorname{mod}n$ (by Definition \ref{def.ent.cong}). A similar
argument (using $p-q$ instead of $p+q$) shows that $a_{1}-a_{2}\equiv
b_{1}-b_{2}\operatorname{mod}n$. It thus remains to show that $a_{1}%
a_{2}\equiv b_{1}b_{2}\operatorname{mod}n$.

Let us first show that $a_{1}a_{2}\equiv a_{1}b_{2}\operatorname{mod}n$.
Indeed, $a_{1}a_{2}-a_{1}b_{2}=a_{1}\underbrace{\left(  a_{2}-b_{2}\right)
}_{=nq}=a_{1}nq=n\left(  a_{1}q\right)  $. Hence, there exists an integer $c$
such that $a_{1}a_{2}-a_{1}b_{2}=nc$ (namely, $c=a_{1}q$). In other words,
$n\mid a_{1}a_{2}-a_{1}b_{2}$ (by Definition \ref{def.ent.div.div}). In other
words, $a_{1}a_{2}\equiv a_{1}b_{2}\operatorname{mod}n$ (by Definition
\ref{def.ent.cong}).

Next, let us show that $a_{1}b_{2}\equiv b_{1}b_{2}\operatorname{mod}n$.
Indeed, $a_{1}b_{2}-b_{1}b_{2}=b_{2}\underbrace{\left(  a_{1}-b_{1}\right)
}_{=np}=b_{2}np=n\left(  b_{2}p\right)  $. Hence, there exists an integer $c$
such that $a_{1}b_{2}-b_{1}b_{2}=nc$ (namely, $c=b_{2}p$). In other words,
$n\mid a_{1}b_{2}-b_{1}b_{2}$ (by Definition \ref{def.ent.div.div}). In other
words, $a_{1}b_{2}\equiv b_{1}b_{2}\operatorname{mod}n$ (by Definition
\ref{def.ent.cong}).

From $a_{1}a_{2}\equiv a_{1}b_{2}\operatorname{mod}n$ and $a_{1}b_{2}\equiv
b_{1}b_{2}\operatorname{mod}n$, we now conclude that $a_{1}a_{2}\equiv
b_{1}b_{2}\operatorname{mod}n$ (by Proposition \ref{prop.ent.mod.basics}
\textbf{(b)}, applied to $a=a_{1}a_{2}$, $b=a_{1}b_{2}$ and $c=b_{1}b_{2}$).
This completes the proof of Proposition \ref{prop.ent.mod.basics} \textbf{(d)}.

\textbf{(e)} Let $a,b\in\mathbb{Z}$ satisfy $a\equiv b\operatorname{mod}n$.

We have $a\equiv b\operatorname{mod}n$. In other words, $n\mid a-b$ (by
Definition \ref{def.ent.cong}). From $m\mid n$ and $n\mid a-b$, we obtain
$m\mid a-b$ (by Proposition \ref{prop.ent.div.2} \textbf{(b)}, applied to $m$,
$n$ and $a-b$ instead of $a$, $b$ and $c$). In other words, $a\equiv
b\operatorname{mod}m$ (by Definition \ref{def.ent.cong}). This proves
Proposition \ref{prop.ent.mod.basics} \textbf{(e)}.
\end{proof}

In the above proof, we took care to explicitly cite Definition
\ref{def.ent.div.div} and Definition \ref{def.ent.cong} whenever we used them;
in the following, we will omit references like this.

Proposition \ref{prop.ent.mod.basics} \textbf{(d)} is saying that congruences
modulo $n$ (for a fixed integer $n$) can be added, subtracted and multiplied
together. This does not mean that you can do everything with them that you can
do with equalities. The next exercise shows that dividing congruences and
taking a congruence to the power of another does not generally work:

\begin{exercise}
\label{exe.ent.mod.basics-nope}Let $n,a_{1},a_{2},b_{1},b_{2}\in\mathbb{Z}$
satisfy $a_{1}\equiv b_{1}\operatorname{mod}n$ and $a_{2}\equiv b_{2}%
\operatorname{mod}n$. Then, \textbf{in general}, neither $a_{1}/a_{2}\equiv
b_{1}/b_{2}\operatorname{mod}n$ nor $a_{1}^{a_{2}}\equiv b_{1}^{b_{2}%
}\operatorname{mod}n$ is necessarily true. Of course, this is partly due to
the fact that $a_{1}/a_{2}$, $b_{1}/b_{2}$ and $a_{1}^{a_{2}}$ and
$b_{1}^{b_{2}}$ are not always integers in the first place (and being
congruent modulo $n$ only makes sense for integers, at least for now). But
even when $a_{1}/a_{2}$, $b_{1}/b_{2}$ and $a_{1}^{a_{2}}$ and $b_{1}^{b_{2}}$
are integers, the congruences $a_{1}/a_{2}\equiv b_{1}/b_{2}\operatorname{mod}%
n$ and $a_{1}^{a_{2}}\equiv b_{1}^{b_{2}}\operatorname{mod}n$ are often false.
Find examples of $n,a_{1},a_{2},b_{1},b_{2}$ such that $a_{1}/a_{2}$,
$b_{1}/b_{2}$ and $a_{1}^{a_{2}}$ and $b_{1}^{b_{2}}$ are integers but the
congruences $a_{1}/a_{2}\equiv b_{1}/b_{2}\operatorname{mod}n$ and
$a_{1}^{a_{2}}\equiv b_{1}^{b_{2}}\operatorname{mod}n$ are false.
\end{exercise}

However, we can divide a congruence $a\equiv b\operatorname{mod}n$ by a
nonzero integer $d$ when all of $a,b,n$ are divisible by $d$:

\begin{exercise}
\label{exe.ent.mod.basics.2}Let $n,d,a,b\in\mathbb{Z}$, and assume that
$d\neq0$. Assume that $d$ divides each of $a,b,n$, and assume that $a\equiv
b\operatorname{mod}n$. Prove that $a/d\equiv b/d\operatorname{mod}n/d$.
\end{exercise}

We can also take a congruence to the $k$-th power when $k\in\mathbb{N}$:

\begin{exercise}
\label{exe.ent.mod.basics.k-power}Let $n,a,b\in\mathbb{Z}$ be such that
$a\equiv b\operatorname{mod}n$. Prove that $a^{k}\equiv b^{k}%
\operatorname{mod}n$ for each $k\in\mathbb{N}$.
\end{exercise}

(Note that the \textquotedblleft$n$\textquotedblright\ is not being taken to
the $k$-th power here.)

We can add not just two, but any finite number of congruences:

\begin{exercise}
\label{exe.ent.mod.k-sum}Let $n$ be an integer. Let $S$ be a finite set. For
each $s\in S$, let $a_{s}$ and $b_{s}$ be two integers. Assume that%
\begin{equation}
a_{s}\equiv b_{s}\operatorname{mod}n\ \ \ \ \ \ \ \ \ \ \text{for each }s\in
S. \label{eq.exe.ent.mod.k-sum.ass}%
\end{equation}


\textbf{(a)} Prove that%
\begin{equation}
\sum_{s\in S}a_{s}\equiv\sum_{s\in S}b_{s}\operatorname{mod}n.
\label{eq.exe.ent.mod.k-sum.a}%
\end{equation}


\textbf{(b)} Prove that
\begin{equation}
\prod_{s\in S}a_{s}\equiv\prod_{s\in S}b_{s}\operatorname{mod}n.
\label{eq.exe.ent.mod.k-sum.b}%
\end{equation}


(Keep in mind that if the set $S$ is empty, then $\sum_{s\in S}a_{s}%
=\sum_{s\in S}b_{s}=0$ and $\prod_{s\in S}a_{s}=\prod_{s\in S}b_{s}=1$; this
holds by the definition of empty sums and of empty products.)
\end{exercise}

\begin{exercise}
\label{exe.ent.mod.prod-wrong}Is it true that if $a_{1},a_{2},b_{1}%
,b_{2},n_{1},n_{2}\in\mathbb{Z}$ satisfy $a_{1}\equiv b_{1}\operatorname{mod}%
n_{1}$ and $a_{2}\equiv b_{2}\operatorname{mod}n_{2}$, then $a_{1}a_{2}\equiv
b_{1}b_{2}\operatorname{mod}n_{1}n_{2}$ ?
\end{exercise}

\begin{exercise}
\label{exe.ent.mod.a+nd}Let $a,b,n\in\mathbb{Z}$. Prove that $a\equiv
b\operatorname{mod}n$ if and only if there exists some $d\in\mathbb{Z}$ such
that $b=a+nd$.
\end{exercise}

\begin{exercise}
\label{exe.ent.mod.diff}Let $a,b,c,n\in\mathbb{Z}$. Prove that we have
$a-b\equiv c\operatorname{mod}n$ if and only if $a\equiv b+c\operatorname{mod}%
n$.
\end{exercise}

\begin{exercise}
\label{exe.ent.mod.-}Let $a,b,n\in\mathbb{Z}$. Prove that $a\equiv
b\operatorname{mod}n$ if and only if $a\equiv b\operatorname{mod}-n$.
\end{exercise}

\subsection{\label{sect.ent.subst-chain}Chains of congruences}

\begin{convention}
For this whole Section \ref{sect.ent.subst-chain}, we fix an integer $n$.
\end{convention}

Chains of equalities are a fundamental piece of notation used throughout
mathematics. For example, here is a chain of equalities:%
\begin{align*}
&  \left(  ad+bc\right)  ^{2}+\left(  ac-bd\right)  ^{2}\\
&  =\left(  ad\right)  ^{2}+2ad\cdot bc+\left(  bc\right)  ^{2}+\left(
ac\right)  ^{2}-2ac\cdot bd+\left(  bd\right)  ^{2}\\
&  =a^{2}d^{2}+2abcd+b^{2}c^{2}+a^{2}c^{2}-2abcd+b^{2}d^{2}\\
&  =a^{2}c^{2}+a^{2}d^{2}+b^{2}c^{2}+b^{2}d^{2}\\
&  =\left(  a^{2}+b^{2}\right)  \left(  c^{2}+d^{2}\right)
\end{align*}
(where $a,b,c,d$ are arbitrary numbers). This chain proves the equality
(\ref{eq.intro.sum-of-2sq.sum*sum}). But why does it really? If we look
closely at this chain of equalities, we see that it has the form
\textquotedblleft$A=B=C=D=E$\textquotedblright, where $A,B,C,D,E$ are five
numbers (namely, $A=\left(  ad+bc\right)  ^{2}+\left(  ac-bd\right)  ^{2}$ and
$B=\left(  ad\right)  ^{2}+2ad\cdot bc+\left(  bc\right)  ^{2}+\left(
ac\right)  ^{2}-2ac\cdot bd+\left(  bd\right)  ^{2}$ and so on). This kind of
statement is called a \textquotedblleft chain of equalities\textquotedblright,
and, a priori, it simply means that any two \textbf{adjacent} numbers in this
chain are equal: $A=B$ and $B=C$ and $C=D$ and $D=E$. Without as much as
noticing it, we have concluded that \textbf{any} two numbers in this chain are
equal; thus, in particular, $A=E$, which is precisely the equality
(\ref{eq.intro.sum-of-2sq.sum*sum}) we wanted to prove.

That this kind of \textquotedblleft chaining\textquotedblright\ is possible is
one of the most basic facts in mathematics. Let us define a chain of
equalities formally:

\begin{definition}
If $a_{1},a_{2},\ldots,a_{k}$ are $k$ objects\footnotemark, then the statement
\textquotedblleft$a_{1}=a_{2}=\cdots=a_{k}$\textquotedblright\ shall mean
that
\[
a_{i}=a_{i+1}\text{ holds for each }i\in\left\{  1,2,\ldots,k-1\right\}  .
\]
(In other words, it shall mean that $a_{1}=a_{2}$ and $a_{2}=a_{3}$ and
$a_{3}=a_{4}$ and $\cdots$ and $a_{k-1}=a_{k}$. This is vacuously true when
$k\leq1$. If $k=2$, then it simply means that $a_{1}=a_{2}$.)

Such a statement will be called a \textit{chain of equalities}.
\end{definition}

\footnotetext{\textquotedblleft Objects\textquotedblright\ can be numbers,
sets, tuples or any other well-defined things in mathematics.}

\begin{proposition}
\label{prop.mod.chain-eq}Let $a_{1},a_{2},\ldots,a_{k}$ be $k$ objects such
that $a_{1}=a_{2}=\cdots=a_{k}$. Let $u$ and $v$ be two elements of $\left\{
1,2,\ldots,k\right\}  $. Then, $a_{u}=a_{v}$.
\end{proposition}

So we have defined a chain of equalities to be true if and only if any two
adjacent terms in this chain are equal (i.e., if \textquotedblleft each
equality sign in the chain is satisfied\textquotedblright). Proposition
\ref{prop.mod.chain-eq} shows that in such a chain, \textbf{any two} terms are
equal. This is intuitively rather clear, but can also be formally proven by
induction using the basic properties of equality
(transitivity\footnote{\textit{Transitivity of equality} says that if $a,b,c$
are three objects satisfying $a=b$ and $b=c$, then $a=c$.},
reflexivity\footnote{\textit{Reflexivity of equality} says that every object
$a$ satisfies $a=a$.} and symmetry\footnote{\textit{Symmetry of equality} says
that if $a,b$ are two objects satisfying $a=b$, then $b=a$.}).

But our goal is to understand basic number theory, not to scrutinize the
foundations of mathematics. So let us recall that we have fixed an integer
$n$, and consider congruences modulo $n$. We claim that these can be chained
just as equalities:

\begin{definition}
\label{def.mod.chain}If $a_{1},a_{2},\ldots,a_{k}$ are $k$ integers, then the
statement \textquotedblleft$a_{1}\equiv a_{2}\equiv\cdots\equiv a_{k}%
\operatorname{mod}n$\textquotedblright\ shall mean that
\[
a_{i}\equiv a_{i+1}\operatorname{mod}n\text{ holds for each }i\in\left\{
1,2,\ldots,k-1\right\}  .
\]
(In other words, it shall mean that $a_{1}\equiv a_{2}\operatorname{mod}n$ and
$a_{2}\equiv a_{3}\operatorname{mod}n$ and $a_{3}\equiv a_{4}%
\operatorname{mod}n$ and $\cdots$ and $a_{k-1}\equiv a_{k}\operatorname{mod}%
n$. This is vacuously true when $k\leq1$. If $k=2$, then it simply means that
$a_{1}\equiv a_{2}\operatorname{mod}n$.)

Such a statement will be called a \textit{chain of congruences modulo }$n$.
\end{definition}

\begin{proposition}
\label{prop.mod.chain}Let $a_{1},a_{2},\ldots,a_{k}$ be $k$ integers such that
$a_{1}\equiv a_{2}\equiv\cdots\equiv a_{k}\operatorname{mod}n$. Let $u$ and
$v$ be two elements of $\left\{  1,2,\ldots,k\right\}  $. Then, $a_{u}\equiv
a_{v}\operatorname{mod}n$.
\end{proposition}

Proposition \ref{prop.mod.chain} shows that any two terms in a chain of
congruences modulo $n$ must be congruent to each other modulo $n$. Again, this
can be formally proven by induction; see \cite[proof of Proposition
2.16]{detnotes}. The ingredients of the proof are basic properties of
congruence modulo $n$: transitivity, reflexivity and symmetry. These are fancy
names for parts \textbf{(b)}, \textbf{(a)} and \textbf{(c)} of Proposition
\ref{prop.ent.mod.basics}.

We will use Proposition \ref{prop.mod.chain} tacitly (just as you would use
Proposition \ref{prop.mod.chain-eq}): i.e., every time we prove a chain of
congruences like $a_{1}\equiv a_{2}\equiv\cdots\equiv a_{k}\operatorname{mod}%
n$, we assume that the reader will automatically conclude that any two of its
terms are congruent to each other modulo $n$ (and will remember this
conclusion). For instance, if we show that $1\equiv4\equiv34\equiv
334\equiv304\operatorname{mod}3$, then we automatically get the congruences
$1\equiv304\operatorname{mod}3$ and $334\equiv1\operatorname{mod}3$ and
$4\equiv334\operatorname{mod}3$ and several others out of this chain.

Chains of congruences can also include equality signs. For example, if
$a,b,c,d$ are integers, then \textquotedblleft$a\equiv b=c\equiv
d\operatorname{mod}n$\textquotedblright\ means that $a\equiv
b\operatorname{mod}n$ and $b=c$ and $c\equiv d\operatorname{mod}n$. Such a
chain is still a chain of congruences, because $b=c$ implies $b\equiv
c\operatorname{mod}n$ (by Proposition \ref{prop.ent.mod.basics} \textbf{(a)}).

Just as there are chains of equalities and chains of congruences, there are
chains of divisibilities:

\begin{definition}
If $a_{1},a_{2},\ldots,a_{k}$ are $k$ integers, then the statement
\textquotedblleft$a_{1}\mid a_{2}\mid\cdots\mid a_{k}$\textquotedblright%
\ shall mean that
\[
a_{i}\mid a_{i+1}\text{ holds for each }i\in\left\{  1,2,\ldots,k-1\right\}
.
\]
(In other words, it shall mean that $a_{1}\mid a_{2}$ and $a_{2}\mid a_{3}$
and $a_{3}\mid a_{4}$ and $\cdots$ and $a_{k-1}\mid a_{k}$. This is vacuously
true when $k\leq1$. If $k=2$, then it simply means that $a_{1}\mid a_{2}$.)

Such a statement will be called a \textit{chain of divisibilities}.
\end{definition}

\begin{proposition}
\label{prop.ent.div.chain}Let $a_{1},a_{2},\ldots,a_{k}$ be $k$ integers such
that $a_{1}\mid a_{2}\mid\cdots\mid a_{k}$. Let $u$ and $v$ be two elements of
$\left\{  1,2,\ldots,k\right\}  $ such that $u\leq v$. Then, $a_{u}\mid a_{v}$.
\end{proposition}

Note that we had to require $u\leq v$ in this proposition, unlike the
analogous propositions for chains of equalities and chains of congruences,
because there is no \textquotedblleft symmetry of
divisibility\textquotedblright\ (i.e., if $a\mid b$, then we don't generally
have $b\mid a$). The proof of Proposition \ref{prop.ent.div.chain} relies on
the reflexivity of divisibility (Proposition \ref{prop.ent.div.2}
\textbf{(a)}) and on the transitivity of divisibility (Proposition
\ref{prop.ent.div.2} \textbf{(b)}).

Again, chains of divisibilities can include equality signs. For example,
$4\mid3\cdot4=12=2\cdot6\mid4\cdot6=24$.

\subsection{\label{sect.ent.subst-mod}Substitutivity for congruences}

In\ Section \ref{sect.ent.subst-chain}, we have learnt that congruences modulo
an integer $n$ can be chained together like equalities. A further important
feature of congruences is the principle of \textit{substitutivity for
congruences}. This is yet another way in which congruences behave like
equalities. We are not going to state it fully formally (as it is a
meta-mathematical principle), but will merely explain its meaning. Later on,
once we understand what the rings $\mathbb{Z}/n$ (for integer $n$) are, we
will no longer need this principle, since it will just boil down to
\textquotedblleft equal things can be substituted for one
another\textquotedblright\ (the whole point of $\mathbb{Z}/n$ is to
\textquotedblleft make congruent numbers equal\textquotedblright); but for
now, we cannot treat \textquotedblleft congruent modulo $n$\textquotedblright%
\ as \textquotedblleft equal\textquotedblright, so we have to state it.

You are probably used to making computations like these:%
\begin{align*}
\underbrace{\left(  a+b\right)  ^{2}}_{=a^{2}+2ab+b^{2}}+\underbrace{\left(
a-b\right)  ^{2}}_{=a^{2}-2ab+b^{2}}  &  =\left(  a^{2}+2ab+b^{2}\right)
+\left(  a^{2}-2ab+b^{2}\right) \\
&  =\underbrace{a^{2}+a^{2}}_{=2a^{2}}+\underbrace{b^{2}+b^{2}}_{=2b^{2}%
}=2a^{2}+2b^{2}%
\end{align*}
(for any two numbers $a$ and $b$). What is going on in these underbraces (like
\textquotedblleft$\underbrace{\left(  a+b\right)  ^{2}}_{=a^{2}+2ab+b^{2}}%
$\textquotedblright)? Something pretty simple is going on: You are replacing a
number (in this case, $\left(  a+b\right)  ^{2}$) by an equal number (in this
case, $a^{2}+2ab+b^{2}$). This relies on a fundamental principle of
mathematics (called the \textit{principle of substitutivity for equalities}),
which says that an object in an expression can indeed be replaced by any
object equal to it (without changing the value of the expression). (This is
also known as \textit{Leibniz's equality law}.) To be precise, we are using
this principle twice in some of our equality signs above, since we are making
several replacements at the same time; but this is fine (we can just do the
replacement one by one instead).

We would like to have a similar principle for congruences modulo $n$: We would
like to be able to replace any integer by an integer congruent to it modulo
$n$. For example, we would like to be able to say that if seven integers
$a,a^{\prime},b,b^{\prime},c,c^{\prime},n$ satisfy $a\equiv a^{\prime
}\operatorname{mod}n$ and $b\equiv b^{\prime}\operatorname{mod}n$ and $c\equiv
c^{\prime}\operatorname{mod}n$, then%
\[
\underbrace{b}_{\equiv b^{\prime}\operatorname{mod}n}\ \ \underbrace{c}%
_{\equiv c^{\prime}\operatorname{mod}n}+\underbrace{c}_{\equiv c^{\prime
}\operatorname{mod}n}\ \ \underbrace{a}_{\equiv a^{\prime}\operatorname{mod}%
n}+\underbrace{a}_{\equiv a^{\prime}\operatorname{mod}n}\ \ \underbrace{b}%
_{\equiv b^{\prime}\operatorname{mod}n}\equiv b^{\prime}c^{\prime}+c^{\prime
}a^{\prime}+a^{\prime}b^{\prime}\operatorname{mod}n.
\]


We have to be careful with this: For example, we run into troubles if division
is involved in our expressions. For example, we have $6\equiv
9\operatorname{mod}3$, but we do not have $\underbrace{6}_{\equiv
9\operatorname{mod}3}/3\equiv9/3\operatorname{mod}3$. Similarly,
exponentiation can be problematic. So we need to state the principle we are
using here in clearer terms, so that we know what we can do.

\begin{convention}
For this whole Section \ref{sect.ent.subst-mod}, we fix an integer $n$.
\end{convention}

The \textit{principle of substitutivity for equalities} says the following:

\begin{statement}
\textit{Principle of substitutivity for equalities (PSE):} If two objects $x$
and $x^{\prime}$ are equal, and if we have any expression $A$ that involves
the object $x$, then we can replace this $x$ (or, more precisely, any
arbitrary appearance of $x$ in $A$) in $A$ by $x^{\prime}$; the value of the
resulting expression $A^{\prime}$ will equal the value of $A$.
\end{statement}

Here are two examples of how this principle can be used:

\begin{itemize}
\item If $a,b,c,d,e,c^{\prime}$ are numbers such that $c=c^{\prime}$, then the
PSE says that we can replace $c$ by $c^{\prime}$ in the expression $a\left(
b-\left(  c+d\right)  e\right)  $, and the value of the resulting expression
$a\left(  b-\left(  c^{\prime}+d\right)  e\right)  $ will equal the value of
$a\left(  b-\left(  c+d\right)  e\right)  $; that is, we have%
\begin{equation}
a\left(  b-\left(  c+d\right)  e\right)  =a\left(  b-\left(  c^{\prime
}+d\right)  e\right)  . \label{eq.mod.substitutivity-nums.1}%
\end{equation}


\item If $a,b,c,a^{\prime}$ are numbers such that $a=a^{\prime}$, then
\begin{equation}
\left(  a-b\right)  \left(  a+b\right)  =\left(  a^{\prime}-b\right)  \left(
a+b\right)  , \label{eq.mod.substitutivity-nums.2}%
\end{equation}
because the PSE allows us to replace the first $a$ appearing in the expression
$\left(  a-b\right)  \left(  a+b\right)  $ by an $a^{\prime}$. (We can also
replace the second $a$ by $a^{\prime}$, of course.)
\end{itemize}

More generally, we can make several such replacements at the same time.

The PSE is one of the headstones of mathematical logic; it is the essence of
what it means for two objects to be equal.

The \textit{principle of substitutivity for congruences} is similar, but far
less fundamental; it says the following:

\begin{statement}
\textit{Principle of substitutivity for congruences (PSC):} If two numbers $x$
and $x^{\prime}$ are congruent to each other modulo $n$ (that is, $x\equiv
x^{\prime}\operatorname{mod}n$), and if we have any expression $A$ that
involves only integers, addition, subtraction and multiplication, and involves
the object $x$, then we can replace this $x$ (or, more precisely, any
arbitrary appearance of $x$ in $A$) in $A$ by $x^{\prime}$; the value of the
resulting expression $A^{\prime}$ will be congruent to the value of $A$ modulo
$n$.
\end{statement}

This principle is less general than the PSE, since it only applies to
expressions that are built from integers and certain operations (note that
division is not one of these operations). But it still lets us prove analogues
of our above examples (\ref{eq.mod.substitutivity-nums.1}) and
(\ref{eq.mod.substitutivity-nums.2}):

\begin{itemize}
\item If $a,b,c,d,e,c^{\prime}$ are integers such that $c\equiv c^{\prime
}\operatorname{mod}n$, then the PSC says that we can replace $c$ by
$c^{\prime}$ in the expression $a\left(  b-\left(  c+d\right)  e\right)  $,
and the value of the resulting expression $a\left(  b-\left(  c^{\prime
}+d\right)  e\right)  $ will be congruent to the value of $a\left(  b-\left(
c+d\right)  e\right)  $ modulo $n$; that is, we have%
\begin{equation}
a\left(  b-\left(  c+d\right)  e\right)  \equiv a\left(  b-\left(  c^{\prime
}+d\right)  e\right)  \operatorname{mod}n.
\label{eq.mod.substitutivity-congs.1}%
\end{equation}


\item If $a,b,c,a^{\prime}$ are integers such that $a\equiv a^{\prime
}\operatorname{mod}n$, then
\begin{equation}
\left(  a-b\right)  \left(  a+b\right)  \equiv\left(  a^{\prime}-b\right)
\left(  a+b\right)  \operatorname{mod}n, \label{eq.mod.substitutivity-congs.2}%
\end{equation}
because the PSC allows us to replace the first $a$ appearing in the expression
$\left(  a-b\right)  \left(  a+b\right)  $ by an $a^{\prime}$. (We can also
replace the second $a$ by $a^{\prime}$, of course.)
\end{itemize}

We shall not prove the PSC, since we have not formalized it (after all, we
have not defined what an \textquotedblleft expression\textquotedblright\ is).
But we shall prove the specific congruences
(\ref{eq.mod.substitutivity-congs.1}) and (\ref{eq.mod.substitutivity-congs.2}%
) using Proposition \ref{prop.ent.mod.basics}; the way in which we prove these
congruences is symptomatic: Every congruence obtained from the PSC can be
proven in a manner like these. Thus, the proofs of
(\ref{eq.mod.substitutivity-congs.1}) and (\ref{eq.mod.substitutivity-congs.2}%
) given below can serve as templates which can easily be adapted to any other
situation in which an application of the PSC needs to be justified.

\begin{proof}
[Proof of (\ref{eq.mod.substitutivity-congs.1}).]Let $a,b,c,d,e,c^{\prime}$ be
integers such that $c\equiv c^{\prime}\operatorname{mod}n$.

Adding the congruence\footnote{Proposition \ref{prop.ent.mod.basics}
\textbf{(d)} shows that we can add, subtract and multiply congruences modulo
$n$ at will. We are using this freedom here and will use it many times below.}
$c\equiv c^{\prime}\operatorname{mod}n$ with the congruence $d\equiv
d\operatorname{mod}n$ (which follows from Proposition
\ref{prop.ent.mod.basics} \textbf{(a)}), we obtain $c+d\equiv c^{\prime
}+d\operatorname{mod}n$. Multiplying this congruence with the congruence
$e\equiv e\operatorname{mod}n$ (which follows from Proposition
\ref{prop.ent.mod.basics} \textbf{(a)}), we obtain $\left(  c+d\right)
e\equiv\left(  c^{\prime}+d\right)  e\operatorname{mod}n$. Subtracting this
congruence from the congruence $b\equiv b\operatorname{mod}n$ (which, again,
follows from Proposition \ref{prop.ent.mod.basics} \textbf{(a)}), we obtain
$b-\left(  c+d\right)  e\equiv b-\left(  c^{\prime}+d\right)
e\operatorname{mod}n$. Multiplying the congruence $a\equiv a\operatorname{mod}%
n$ (which follows from Proposition \ref{prop.ent.mod.basics} \textbf{(a)})
with this congruence, we obtain $a\left(  b-\left(  c+d\right)  e\right)
\equiv a\left(  b-\left(  c^{\prime}+d\right)  e\right)  \operatorname{mod}n$.
This proves (\ref{eq.mod.substitutivity-congs.1}).
\end{proof}

\begin{proof}
[Proof of (\ref{eq.mod.substitutivity-congs.2}).]Let $a,b,c,a^{\prime}$ be
integers such that $a\equiv a^{\prime}\operatorname{mod}n$.

Subtracting the congruence $b\equiv b\operatorname{mod}n$ (which follows from
Proposition \ref{prop.ent.mod.basics} \textbf{(a)}) from the congruence
$a\equiv a^{\prime}\operatorname{mod}n$, we obtain $a-b\equiv a^{\prime
}-b\operatorname{mod}n$. Multiplying this congruence with the congruence
$a+b\equiv a+b\operatorname{mod}n$ (which follows from Proposition
\ref{prop.ent.mod.basics} \textbf{(a)}), we obtain $\left(  a-b\right)
\left(  a+b\right)  \equiv\left(  a^{\prime}-b\right)  \left(  a+b\right)
\operatorname{mod}n$. This proves (\ref{eq.mod.substitutivity-congs.2}).
\end{proof}

As we said, these two proofs are exemplary: Any congruence obtained from the
PSC can be proven in such a way (starting with the congruence $x\equiv
x^{\prime}\operatorname{mod}n$, and then \textquotedblleft
wrapping\textquotedblright\ it up in the expression $A$ by repeatedly adding,
multiplying and subtracting congruences that follow from Proposition
\ref{prop.ent.mod.basics} \textbf{(a)}).

When we apply the PSC, we shall use underbraces to point out which integers we
are replacing. For example, when deriving (\ref{eq.mod.substitutivity-congs.1}%
) from this principle, we shall write%
\[
a\left(  b-\left(  \underbrace{c}_{\equiv c^{\prime}\operatorname{mod}%
n}+d\right)  e\right)  \equiv a\left(  b-\left(  c^{\prime}+d\right)
e\right)  \operatorname{mod}n,
\]
in order to stress that we are replacing $c$ by $c^{\prime}$. Likewise, when
deriving (\ref{eq.mod.substitutivity-congs.2}) from the PSC, we shall write%
\[
\left(  \underbrace{a}_{\equiv a^{\prime}\operatorname{mod}n}-b\right)
\left(  a+b\right)  \equiv\left(  a^{\prime}-b\right)  \left(  a+b\right)
\operatorname{mod}n,
\]
in order to stress that we are replacing the first $a$ (but not the second
$a$) by $a^{\prime}$.

The PSC allows us to replace a \textbf{single} integer $x$ appearing in an
expression by another integer $x^{\prime}$ that is congruent to $x$ modulo
$n$. Applying this principle many times, we thus conclude that we can also
replace \textbf{several} integers at the same time (because we can get to the
same result by performing these replacements one at a time, and Proposition
\ref{prop.mod.chain} shows that the value of the final result will be
congruent to the value of the original result). For example, if seven integers
$a,a^{\prime},b,b^{\prime},c,c^{\prime},n$ satisfy $a\equiv a^{\prime
}\operatorname{mod}n$ and $b\equiv b^{\prime}\operatorname{mod}n$ and $c\equiv
c^{\prime}\operatorname{mod}n$, then%
\begin{equation}
bc+ca+ab\equiv b^{\prime}c^{\prime}+c^{\prime}a^{\prime}+a^{\prime}b^{\prime
}\operatorname{mod}n, \label{eq.mod.substitutivity-congs.3}%
\end{equation}
because we can replace all the six integers $b,c,c,a,a,b$ in the expression
$bc+ca+ab$ (listed in the order of their appearance in this expression) by
$b^{\prime},c^{\prime},c^{\prime},a^{\prime},a^{\prime},b^{\prime}$,
respectively. If we want to derive this from the PSC, then we must perform the
replacements one at a time, e.g., as follows:%
\begin{align*}
\underbrace{b}_{\equiv b^{\prime}\operatorname{mod}n}c+ca+ab  &  \equiv
b^{\prime}\underbrace{c}_{\equiv c^{\prime}\operatorname{mod}n}+ca+ab\equiv
b^{\prime}c^{\prime}+\underbrace{c}_{\equiv c^{\prime}\operatorname{mod}%
n}a+ab\\
&  \equiv b^{\prime}c^{\prime}+c^{\prime}\underbrace{a}_{\equiv a^{\prime
}\operatorname{mod}n}+ab\equiv b^{\prime}c^{\prime}+c^{\prime}a^{\prime
}+\underbrace{a}_{\equiv a^{\prime}\operatorname{mod}n}b\\
&  \equiv b^{\prime}c^{\prime}+c^{\prime}a^{\prime}+a^{\prime}\underbrace{b}%
_{\equiv b^{\prime}\operatorname{mod}n}\equiv b^{\prime}c^{\prime}+c^{\prime
}a^{\prime}+a^{\prime}b^{\prime}\operatorname{mod}n.
\end{align*}
Of course, we shall always just show the replacements as a single step:%
\[
\underbrace{b}_{\equiv b^{\prime}\operatorname{mod}n}\ \ \underbrace{c}%
_{\equiv c^{\prime}\operatorname{mod}n}+\underbrace{c}_{\equiv c^{\prime
}\operatorname{mod}n}\ \ \underbrace{a}_{\equiv a^{\prime}\operatorname{mod}%
n}+\underbrace{a}_{\equiv a^{\prime}\operatorname{mod}n}\ \ \underbrace{b}%
_{\equiv b^{\prime}\operatorname{mod}n}\equiv b^{\prime}c^{\prime}+c^{\prime
}a^{\prime}+a^{\prime}b^{\prime}\operatorname{mod}n.
\]


The PSC can be extended: The expression $A$ can be allowed to involve not only
integers, addition, subtraction, multiplication and $x$, but also $k$-th
powers for $k\in\mathbb{N}$ (as long as $k$ remains unchanged in our
replacement) as well as finite sums and products (as long as the bounds of the
sums and products are unchanged). This follows from Exercise
\ref{exe.ent.mod.basics.k-power} and Exercise \ref{exe.ent.mod.k-sum}.

\begin{exercise}
\label{exe.ent.mod.substitutivity.7div}Let $n\in\mathbb{N}$. Show that
$7\mid3^{2n+1}+2^{n+2}$.
\end{exercise}

\begin{teachingnote}
\textbf{2019-02-01 lecture}
\end{teachingnote}

\subsection{\label{sect.ent.quorem}Division with remainder}

The following fact you likely remember from high school:

\begin{theorem}
\label{thm.ent.quorem.full}Let $n$ be a positive integer. Let $u\in\mathbb{Z}%
$. Then, there exists a unique pair $\left(  q,r\right)  \in\mathbb{Z}%
\times\left\{  0,1,\ldots,n-1\right\}  $ such that $u=qn+r$.
\end{theorem}

We shall refer to this as the \textquotedblleft\textit{division-with-remainder
theorem for integers}\textquotedblright. Before we prove this theorem, let us
introduce the notations that it justifies:

\begin{definition}
\label{def.ent.quorem}Let $n$ be a positive integer. Let $u\in\mathbb{Z}$.
Theorem \ref{thm.ent.quorem.full} shows that there exists a unique pair
$\left(  q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $
such that $u=qn+r$. Consider this pair.

\textbf{(a)} We denote the integer $q$ by $u//n$, and refer to it as the
\textit{quotient of the division of }$u$ \textit{by }$n$.

\textbf{(b)} We denote the integer $r$ by $u\%n$, and refer to it as the
\textit{remainder of the division of }$u$ \textit{by }$n$.
\end{definition}

The words \textquotedblleft quotient\textquotedblright\ and \textquotedblleft
remainder\textquotedblright\ are standard, but the notations \textquotedblleft%
$u//n$\textquotedblright\ and \textquotedblleft$u\%n$\textquotedblright\ are
not (I have taken them from the Python programming language); be prepared to
see other notations in the literature (e.g., the notations \textquotedblleft%
$\operatorname*{quo}\left(  u,n\right)  $\textquotedblright\ and
\textquotedblleft$\operatorname*{rem}\left(  u,n\right)  $\textquotedblright%
\ for $u//n$ and $u\%n$, respectively).

\begin{example}
\textbf{(a)} We have $14//3=4$ and $14\%3=2$, because $\left(  4,2\right)  $
is the unique pair $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,2\right\}  $ satisfying $14=q\cdot3+r$.

\textbf{(b)} We have $18//3=6$ and $18\%3=0$, because $\left(  6,0\right)  $
is the unique pair $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,2\right\}  $ satisfying $18=q\cdot3+r$.

\textbf{(c)} We have $\left(  -2\right)  //3=-1$ and $\left(  -2\right)
\%3=1$, because $\left(  -1,1\right)  $ is the unique pair $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,2\right\}  $ satisfying
$-2=q\cdot3+r$.

\textbf{(d)} For each $u\in\mathbb{Z}$, we have $u//1=u$ and $u\%1=0$, because
$\left(  u,0\right)  $ is the unique pair $\left(  q,r\right)  \in
\mathbb{Z}\times\left\{  0\right\}  $ satisfying $u=q\cdot1+r$.
\end{example}

But we have gotten ahead of ourselves: We need to prove Theorem
\ref{thm.ent.quorem.full} before we can use the notations \textquotedblleft%
$u//n$\textquotedblright\ and \textquotedblleft$u\%n$\textquotedblright.

Let us split Theorem \ref{thm.ent.quorem.full} into two parts: existence and uniqueness:

\begin{lemma}
\label{lem.ent.quorem.exist}Let $n$ be a positive integer. Let $u\in
\mathbb{Z}$. Then, there exists \textbf{at least one} pair $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that
$u=qn+r$.
\end{lemma}

\begin{lemma}
\label{lem.ent.quorem.unique}Let $n$ be a positive integer. Let $u\in
\mathbb{Z}$. Then, there exists \textbf{at most one} pair $\left(  q,r\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that $u=qn+r$.
\end{lemma}

We begin by proving Lemma \ref{lem.ent.quorem.unique} (which is the easier one):

\begin{proof}
[Proof of Lemma \ref{lem.ent.quorem.unique}.]Let $\left(  q_{1},r_{1}\right)
$ and $\left(  q_{2},r_{2}\right)  $ be two pairs $\left(  q,r\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that $u=qn+r$. We
shall show that $\left(  q_{1},r_{1}\right)  =\left(  q_{2},r_{2}\right)  $.

We know that $\left(  q_{1},r_{1}\right)  $ is a pair $\left(  q,r\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that $u=qn+r$. In
other words, $\left(  q_{1},r_{1}\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $ and $u=q_{1}n+r_{1}$. Similarly, $\left(
q_{2},r_{2}\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ and
$u=q_{2}n+r_{2}$.

From $\left(  q_{1},r_{1}\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots
,n-1\right\}  $, we obtain $q_{1}\in\mathbb{Z}$ and $r_{1}\in\left\{
0,1,\ldots,n-1\right\}  $. Similarly, $q_{2}\in\mathbb{Z}$ and $r_{2}%
\in\left\{  0,1,\ldots,n-1\right\}  $. Thus, in particular, $q_{1},q_{2}%
,r_{1},r_{2}$ are integers.

From $r_{1}\in\left\{  0,1,\ldots,n-1\right\}  $ and $r_{2}\in\left\{
0,1,\ldots,n-1\right\}  $, we can easily derive%
\begin{equation}
\left\vert r_{2}-r_{1}\right\vert \leq n-1.
\label{pf.lem.ent.quorem.unique.ineq}%
\end{equation}


\begin{fineprint}
[\textit{Proof of (\ref{pf.lem.ent.quorem.unique.ineq}):} Intuitively, this
should be clear: Both $r_{1}$ and $r_{2}$ belong to the integer interval
$\left\{  0,1,\ldots,n-1\right\}  $, and thus the unsigned distance between
$r_{1}$ and $r_{2}$ is at most $n-1$ (with the worst case being when $r_{1}$
and $r_{2}$ are at opposite ends of this interval).

Here is a formal restatement of this argument: We have $r_{1}\in\left\{
0,1,\ldots,n-1\right\}  $, thus $r_{1}\geq0$. Also, $r_{2}\in\left\{
0,1,\ldots,n-1\right\}  $, hence $r_{2}\leq n-1$. Hence, $\underbrace{r_{2}%
}_{\leq n-1}-\underbrace{r_{1}}_{\geq0}\leq\left(  n-1\right)  -0=n-1$.
Similarly, $r_{1}-r_{2}\leq n-1$. But recall that $\left\vert x\right\vert
\in\left\{  x,-x\right\}  $ for each $x\in\mathbb{Z}$. Applying this to
$x=r_{2}-r_{1}$, we obtain
\[
\left\vert r_{2}-r_{1}\right\vert \in\left\{  r_{2}-r_{1},\underbrace{-\left(
r_{2}-r_{1}\right)  }_{=r_{1}-r_{2}}\right\}  =\left\{  r_{2}-r_{1}%
,r_{1}-r_{2}\right\}  .
\]
In other words, $\left\vert r_{2}-r_{1}\right\vert $ is one of the two numbers
$r_{2}-r_{1}$ and $r_{1}-r_{2}$. Since both of these numbers $r_{2}-r_{1}$ and
$r_{1}-r_{2}$ are $\leq n-1$ (as we have just shown), we thus conclude that
$\left\vert r_{2}-r_{1}\right\vert \leq n-1$. This proves
(\ref{pf.lem.ent.quorem.unique.ineq}).]
\end{fineprint}

We have $q_{1}n+r_{1}=u=q_{2}n+r_{2}$, thus $q_{1}n-q_{2}n=r_{2}-r_{1}$.
Hence,%
\begin{equation}
r_{2}-r_{1}=q_{1}n-q_{2}n=\left(  q_{1}-q_{2}\right)  n.
\label{pf.lem.ent.quorem.unique.1}%
\end{equation}


Assume (for the sake of contradiction) that $q_{1}\neq q_{2}$. Thus,
$q_{1}-q_{2}\neq0$, so that $\left\vert q_{1}-q_{2}\right\vert >0$ and
therefore $\left\vert q_{1}-q_{2}\right\vert \geq1$ (since $\left\vert
q_{1}-q_{2}\right\vert $ is an integer). We can multiply this inequality by
$n$ (since $n$ is positive) and thus obtain $\left\vert q_{1}-q_{2}\right\vert
n\geq1n=n$. But from (\ref{pf.lem.ent.quorem.unique.1}), we obtain%
\begin{align*}
\left\vert r_{2}-r_{1}\right\vert  &  =\left\vert \left(  q_{1}-q_{2}\right)
n\right\vert =\left\vert q_{1}-q_{2}\right\vert \cdot\underbrace{\left\vert
n\right\vert }_{\substack{=n\\\text{(since }n\text{ is positive)}%
}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.ent.div.abs(xy)})}\right) \\
&  =\left\vert q_{1}-q_{2}\right\vert n\geq n>n-1.
\end{align*}
This contradicts (\ref{pf.lem.ent.quorem.unique.ineq}). This contradiction
shows that our assumption (that $q_{1}\neq q_{2}$) was false. Hence, we have
$q_{1}=q_{2}$. Thus, $q_{1}-q_{2}=0$, so that
(\ref{pf.lem.ent.quorem.unique.1}) becomes $r_{2}-r_{1}=\underbrace{\left(
q_{1}-q_{2}\right)  }_{=0}n=0$ and thus $r_{2}=r_{1}$, so that $r_{1}=r_{2}$.
Combining this with $q_{1}=q_{2}$, we obtain $\left(  q_{1},r_{1}\right)
=\left(  q_{2},r_{2}\right)  $.

Now, forget that we have fixed $\left(  q_{1},r_{1}\right)  $ and $\left(
q_{2},r_{2}\right)  $. We thus have proven that if $\left(  q_{1}%
,r_{1}\right)  $ and $\left(  q_{2},r_{2}\right)  $ are two pairs $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that
$u=qn+r$, then $\left(  q_{1},r_{1}\right)  =\left(  q_{2},r_{2}\right)  $. In
other words, any two pairs $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $ such that $u=qn+r$ must be equal. In other words,
there exists at most one such pair. This proves Lemma
\ref{lem.ent.quorem.unique}.
\end{proof}

But we also need to prove Lemma \ref{lem.ent.quorem.exist}. This lemma can be
proven by induction on $u$, but not without some complications: Since it is
stated for all integers $u$ (rather than just for nonnegative or positive
integers), the classical induction principle (with an induction base and a
\textquotedblleft$u$ to $u+1$\textquotedblright\ step) cannot prove it
directly. Instead, we have to either add a \textquotedblleft$u$ to
$u-1$\textquotedblright\ step to our induction (resulting in a
\textquotedblleft two-sided induction\textquotedblright\ or \textquotedblleft
up- and down-induction\textquotedblright\ argument), or to treat the case of
negative $u$ separately. A proof using the first of these two methods can be
found in \cite[proof of Proposition 2.150]{detnotes} (where $n$ and $u$ are
denoted by $N$ and $n$). We shall instead give a proof using the second
method; thus, we first state the particular case of Lemma
\ref{lem.ent.quorem.exist} when $u$ is nonnegative:

\begin{lemma}
\label{lem.ent.quorem.existN}Let $n$ be a positive integer. Let $u\in
\mathbb{N}$. Then, there exists \textbf{at least one} pair $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that
$u=qn+r$.
\end{lemma}

This lemma can be proven by induction on $u$ as in \cite[proof of Proposition
2.150]{detnotes}. Let us instead prove it by \textbf{strong} induction on $u$.
See \cite[\S 2.8]{detnotes} for an introduction to strong induction; in
particular, recall that a strong induction needs no induction base (but often
contains a case distinction in its \textquotedblleft induction
step\textquotedblright\ that, in some way, does give the first few values a
special treatment). The proof of Lemma \ref{lem.ent.quorem.existN} that we
give below follows a stupid but valid method of finding the pair $\left(
q,r\right)  $: Keep subtracting $n$ from $u$ until $u$ becomes $<n$; then $r$
will be the resulting number, whereas $q$ will be the number of times you have
subtracted $n$.

\begin{proof}
[Proof of Lemma \ref{lem.ent.quorem.existN}.]We proceed by strong induction on
$u$.

Let $U\in\mathbb{N}$. Assume (as the induction hypothesis) that Lemma
\ref{lem.ent.quorem.existN} holds for every $u\in\mathbb{N}$ satisfying $u<U$.
We must prove that Lemma \ref{lem.ent.quorem.existN} also holds for $u=U$. In
other words, we must prove that there exists \textbf{at least one} pair
$\left(  q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $
such that $U=qn+r$.

We are in one of the following two cases:

\textit{Case 1:} We have $U<n$.

\textit{Case 2:} We have $U\geq n$.

Let us first consider Case 1. In this case, we have $U<n$. Thus, $U\leq n-1$
(since $U$ and $n$ are integers), so that $U\in\left\{  0,1,\ldots
,n-1\right\}  $ (since $U\in\mathbb{N}$). Combining this with $0\in\mathbb{Z}%
$, we obtain $\left(  0,U\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots
,n-1\right\}  $. Hence, $\left(  0,U\right)  $ is a pair $\left(  q,r\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that $U=qn+r$
(since $U=0n+U$). Thus, there exists \textbf{at least one} pair $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that
$U=qn+r$ (namely, $\left(  q,r\right)  =\left(  0,U\right)  $).

Let us now consider Case 2. In this case, we have $U\geq n$. Hence, $U-n\geq
0$, so that $U-n\in\mathbb{N}$ (remember that $\mathbb{N}=\left\{
0,1,2,\ldots\right\}  $). Also, $U-n<U$ (since $n$ is positive). But our
induction hypothesis said that Lemma \ref{lem.ent.quorem.existN} holds for
every $u\in\mathbb{N}$ satisfying $u<U$. Hence, in particular, Lemma
\ref{lem.ent.quorem.existN} holds for $u=U-n$ (since $U-n\in\mathbb{N}$ and
$U-n<U$). In other words, there exists \textbf{at least one} pair $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that
$U-n=qn+r$. Fix such a pair and denote it by $\left(  q_{0},r_{0}\right)  $.
Thus, $\left(  q_{0},r_{0}\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots
,n-1\right\}  $ and $U-n=q_{0}n+r_{0}$.

From $U-n=q_{0}n+r_{0}$, we obtain $U=n+\left(  q_{0}n+r_{0}\right)  =\left(
q_{0}+1\right)  n+r_{0}$. Also, from $\left(  q_{0},r_{0}\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $, we obtain $q_{0}%
\in\mathbb{Z}$ and $r_{0}\in\left\{  0,1,\ldots,n-1\right\}  $, and thus
$\left(  q_{0}+1,r_{0}\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots
,n-1\right\}  $. Thus, the pair $\left(  q_{0}+1,r_{0}\right)  $ is a pair
$\left(  q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $
such that $U=qn+r$ (since $U=\left(  q_{0}+1\right)  n+r_{0}$). Therefore,
there exists \textbf{at least one} pair $\left(  q,r\right)  \in
\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that $U=qn+r$ (namely,
$\left(  q,r\right)  =\left(  q_{0}+1,r_{0}\right)  $).

Now, in each of the two Cases 1 and 2, we have shown that there exists
\textbf{at least one} pair $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $ such that $U=qn+r$. Hence, this holds always. In
other words, Lemma \ref{lem.ent.quorem.existN} holds for $u=U$. This completes
the induction step; thus, Lemma \ref{lem.ent.quorem.existN} is proven by
strong induction.
\end{proof}

In order to derive Lemma \ref{lem.ent.quorem.exist} from Lemma
\ref{lem.ent.quorem.existN} (that is, to extend Lemma
\ref{lem.ent.quorem.existN} to the case of negative $u$), we shall need a
simple but important trick: By adding a sufficiently high multiple of the
positive integer $n$ to $u$, we eventually obtain a nonnegative integer $v$
(to which we can then apply Lemma \ref{lem.ent.quorem.existN}). This trick can
be crystallized in the following lemma:

\begin{lemma}
\label{lem.ent.cong-to-nonneg}Let $n$ be a positive integer. Let
$u\in\mathbb{Z}$. Then, there exists a $v\in\mathbb{N}$ such that $u\equiv
v\operatorname{mod}n$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.cong-to-nonneg}.]We are in one of the following
two cases:

\textit{Case 1:} We have $u\geq0$.

\textit{Case 2:} We have $u<0$.

Let us first consider Case 1. In this case, we have $u\geq0$. Thus,
$u\in\mathbb{N}$. Also, $u\equiv u\operatorname{mod}n$ (by Proposition
\ref{prop.ent.mod.basics} \textbf{(a)}). Thus, there exists a $v\in\mathbb{N}$
such that $u\equiv v\operatorname{mod}n$ (namely, $v=u$). This proves Lemma
\ref{lem.ent.cong-to-nonneg} in Case 1.

Let us now consider Case 2. In this case, we have $u<0$. Hence, $-u>0$. Now,
$u-\left(  n-1\right)  \left(  -u\right)  =nu$ is divisible by $n$ (since
$u\in\mathbb{Z}$). In other words, $n\mid u-\left(  n-1\right)  \left(
-u\right)  $. In other words, $u\equiv\left(  n-1\right)  \left(  -u\right)
\operatorname{mod}n$. Moreover, $n\geq1$ (since $n$ is a positive integer), so
that $n-1\geq0$. We can multiply this inequality with $-u$ (since $-u>0$), and
thus obtain $\left(  n-1\right)  \left(  -u\right)  \geq0\left(  -u\right)
=0$. In other words, $\left(  n-1\right)  \left(  -u\right)  \in\mathbb{N}$.
Thus, there exists a $v\in\mathbb{N}$ such that $u\equiv v\operatorname{mod}n$
(namely, $v=\left(  n-1\right)  \left(  -u\right)  $). This proves Lemma
\ref{lem.ent.cong-to-nonneg} in Case 2.

We have now proven Lemma \ref{lem.ent.cong-to-nonneg} in both Cases 1 and 2;
hence, Lemma \ref{lem.ent.cong-to-nonneg} always holds.
\end{proof}

\begin{proof}
[Proof of Lemma \ref{lem.ent.quorem.exist}.]Lemma \ref{lem.ent.cong-to-nonneg}
shows that there exists a $v\in\mathbb{N}$ such that $u\equiv
v\operatorname{mod}n$. Consider this $v$.

Note that $n\mid u-v$ (since $u\equiv v\operatorname{mod}n$). In other words,
there exists an integer $c$ such that $u-v=nc$. Consider this $c$. From
$u-v=nc$, we obtain $u=v+nc$.

Lemma \ref{lem.ent.quorem.existN} (applied to $v$ instead of $u$) yields that
there exists \textbf{at least one} pair $\left(  q,r\right)  \in
\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that $v=qn+r$. Fix
such a pair, and denote it by $\left(  q_{0},r_{0}\right)  $. Thus, $\left(
q_{0},r_{0}\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ and
$v=q_{0}n+r_{0}$. Now,%
\[
u=\underbrace{v}_{=q_{0}n+r_{0}}+nc=\left(  q_{0}n+r_{0}\right)  +nc=\left(
q_{0}+c\right)  n+r_{0}.
\]
Also, from $\left(  q_{0},r_{0}\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $, we obtain $q_{0}\in\mathbb{Z}$ and $r_{0}%
\in\left\{  0,1,\ldots,n-1\right\}  $, and thus $\left(  q_{0}+c,r_{0}\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $. Thus, the pair $\left(
q_{0}+c,r_{0}\right)  $ is a pair $\left(  q,r\right)  \in\mathbb{Z}%
\times\left\{  0,1,\ldots,n-1\right\}  $ such that $u=qn+r$ (since $u=\left(
q_{0}+c\right)  n+r_{0}$). Therefore, there exists \textbf{at least one} pair
$\left(  q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $
such that $u=qn+r$ (namely, $\left(  q,r\right)  =\left(  q_{0}+c,r_{0}%
\right)  $). This proves Lemma \ref{lem.ent.quorem.exist}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.ent.quorem.full}.]Theorem \ref{thm.ent.quorem.full}
follows by combining Lemma \ref{lem.ent.quorem.exist} with Lemma
\ref{lem.ent.quorem.unique}.
\end{proof}

\begin{remark}
\label{rmk.ent.quo-rem.full.geo}We can visualize Theorem
\ref{thm.ent.quorem.full} as follows: Mark all the multiples of $n$ on the
real line. These multiples are evenly spaced points, with a distance of $n$
between any two neighboring multiples. Thus, they subdivide the real line into
infinitely many intervals of length $n$. More precisely, for each
$a\in\mathbb{Z}$, let $I_{a}$ be the interval $\left[  an,\left(  a+1\right)
n\right)  =\left\{  x\in\mathbb{R}\ \mid\ an\leq x<\left(  a+1\right)
n\right\}  $; then, every real belongs to exactly one of these intervals
$I_{a}$. (This is intuitively clear -- I am not saying this is a rigorous
proof.) Thus, in particular, $u$ belongs to $I_{q}$ for some $q\in\mathbb{Z}$.
This $q$ is precisely the $q$ in the unique pair $\left(  q,r\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ satisfying $u=qn+r$.
Moreover, the $r$ from this pair specifies the relative position of $u$ in the
interval $I_{q}$.

(Unfortunately, it is not clear to me whether this intuition can be turned
into a proper proof of Theorem \ref{thm.ent.quorem.full}, since it relies on
the fact that every real number belongs to exactly one of the intervals
$I_{a}$, which fact may well require Theorem \ref{thm.ent.quorem.full} for its proof.)
\end{remark}

The following properties of the quotient and the remainder are simple but will
be used all the time:

\begin{corollary}
\label{cor.ent.quo-rem.remmod}Let $n$ be a positive integer. Let
$u\in\mathbb{Z}$.

\textbf{(a)} Then, $u\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and $u\%n\equiv
u\operatorname{mod}n$.

\textbf{(b)} We have $n\mid u$ if and only if $u\%n=0$.

\textbf{(c)} If $c\in\left\{  0,1,\ldots,n-1\right\}  $ is such that $c\equiv
u\operatorname{mod}n$, then $c=u\%n$.

\textbf{(d)} We have $u=\left(  u//n\right)  n+\left(  u\%n\right)  $.
\end{corollary}

Before we prove this corollary, let us explain its purpose. Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(a)} says that $u\%n$ is a number in the
set $\left\{  0,1,\ldots,n-1\right\}  $ that is congruent to $u$ modulo $n$.
Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(c)} says that $u\%n$ is the
\textbf{only} such number (as it says that any further such number $c$ must be
equal to $u\%n$). Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(b)} gives an
algorithm to check whether $n\mid u$ holds (namely, compute $u\%n$ and check
whether $u\%n=0$). Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(d)} is a
trivial consequence of the definition of quotient and remainder.

\begin{proof}
[Proof of Corollary \ref{cor.ent.quo-rem.remmod}.]Theorem
\ref{thm.ent.quorem.full} says that there is a unique pair $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that
$u=qn+r$. Consider this pair $\left(  q,r\right)  $. The uniqueness of this
pair can be restated as follows: If $\left(  q^{\prime},r^{\prime}\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ is any further pair such
that $u=q^{\prime}n+r^{\prime}$, then%
\begin{equation}
\left(  q^{\prime},r^{\prime}\right)  =\left(  q,r\right)  .
\label{pf.cor.ent.quo-rem.remmod.uni}%
\end{equation}


Recall that $u\%n$ was defined to be $r$ (in Definition \ref{def.ent.quorem}
\textbf{(b)}). Thus, $u\%n=r$. Now, $n\mid qn=u-r$ (since $u=qn+r$). In other
words, $u\equiv r\operatorname{mod}n$. Hence, $r\equiv u\operatorname{mod}n$
(by Proposition \ref{prop.ent.mod.basics} \textbf{(c)}). This rewrites as
$u\%n\equiv u\operatorname{mod}n$ (since $r=u\%n$).

Furthermore, $u\%n=r\in\left\{  0,1,\ldots,n-1\right\}  $ (since $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $). This
completes the proof of Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)}.

Also, $u//n$ was defined to be $q$ (in Definition \ref{def.ent.quorem}
\textbf{(a)}). Hence, $u//n=q$. Now,%
\[
u=\underbrace{q}_{=u//n}n+\underbrace{r}_{=u\%n}=\left(  u//n\right)
n+\left(  u\%n\right)  .
\]
This proves Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(d)}.

\textbf{(b)} $\Longrightarrow:$ Assume that $n\mid u$. We must prove that
$u\%n=0$.

We have $n\mid u$. In other words, there exists some integer $w$ such that
$u=nw$. Consider this $w$.

We have $n-1\in\mathbb{N}$ (since $n$ is a positive integer), thus
$0\in\left\{  0,1,\ldots,n-1\right\}  $. Hence, $\left(  w,0\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ (since $w\in\mathbb{Z}%
$). Also, $u=nw=wn=wn+0$. Hence, (\ref{pf.cor.ent.quo-rem.remmod.uni})
(applied to $\left(  q^{\prime},r^{\prime}\right)  =\left(  w,0\right)  $)
yields $\left(  w,0\right)  =\left(  q,r\right)  $. In other words, $w=q$ and
$0=r$. Hence, $r=0$, so that $u\%n=r=0$. This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ implication of Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(b)}.

$\Longleftarrow:$ Assume that $u\%n=0$. We must prove that $n\mid u$.

We have $u=qn+\underbrace{r}_{=u\%n=0}=qn=nq$. Thus, $n\mid u$. This proves
the \textquotedblleft$\Longleftarrow$\textquotedblright\ implication of
Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(b)}.

\textbf{(c)} Let $c\in\left\{  0,1,\ldots,n-1\right\}  $ be such that $c\equiv
u\operatorname{mod}n$.

We have $c\equiv u\operatorname{mod}n$. In other words, $n\mid c-u$. In other
words, there exists some integer $w$ such that $c-u=nw$. Consider this $w$.

From $-w\in\mathbb{Z}$ and $c\in\left\{  0,1,\ldots,n-1\right\}  $, we obtain
$\left(  -w,c\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $.
Also, from $c-u=nw$, we obtain $u=c-nw=\left(  -w\right)  n+c$. Hence,
(\ref{pf.cor.ent.quo-rem.remmod.uni}) (applied to $\left(  q^{\prime
},r^{\prime}\right)  =\left(  -w,c\right)  $) yields $\left(  -w,c\right)
=\left(  q,r\right)  $. In other words, $-w=q$ and $c=r$. Hence, $c=r=u\%n$.
This proves Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(c)}.
\end{proof}

\begin{exercise}
\label{exe.ent.quo-rem.mod=rem}Let $n$ be a positive integer. Let $u$ and $v$
be integers. Prove that $u\equiv v\operatorname{mod}n$ if and only if
$u\%n=v\%n$.
\end{exercise}

The following exercise provides an analogue of Theorem
\ref{thm.ent.quorem.full}, in which $r$ is required to be an integer
satisfying $\left\vert r\right\vert \leq n/2$ rather than an element of
$\left\{  0,1,\ldots,n-1\right\}  $. Note, however, that $r$ is not always
unique in this case.

\begin{exercise}
\label{exe.ent.quo-rem.minrem}Let $n$ be a positive integer. Let
$u\in\mathbb{Z}$.

\textbf{(a)} Prove that there exists a pair $\left(  q,r\right)  \in
\mathbb{Z}\times\mathbb{Z}$ such that $u=qn+r$ and $\left\vert r\right\vert
\leq n/2$.

\textbf{(b)} Prove that this pair is not unique in general (i.e., find $n$ and
$u$ for which it is not unique).
\end{exercise}

\begin{remark}
\label{rmk.ent.quo-rem.minrem.geo}There is a simple visualization that makes
Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)} intuitively obvious: Mark
all the multiples of $n$ on the real line. These multiples are evenly spaced
points, with a distance of $n$ between any two neighboring multiples. Hence,
every point on the real line is at most a distance of $n/2$ away from the
closest multiple of $n$. Applying this to the point $u$, we conclude that $u$
is at most a distance of $n/2$ away from the closest multiple of $n$. In other
words, if $qn$ is the closest multiple of $n$ to $u$ (or one of the two
closest multiples of $n$, if $u$ is in the middle between two multiples), then
$\left\vert u-qn\right\vert \leq n/2$. Thus, if we set $r=u-qn$, then $u=qn+r$
and $\left\vert r\right\vert \leq n/2$. This proves Exercise
\ref{exe.ent.quo-rem.minrem} \textbf{(a)} intuitively.

This point of view also makes Exercise \ref{exe.ent.quo-rem.minrem}
\textbf{(b)} evident: When the point $u$ is exactly in the middle of one of
the length-$n$ intervals between multiples of $n$, then there are two
multiples of $n$ equally close to $u$, and we can pick either of them; hence,
the pair $\left(  q,r\right)  $ is not unique.
\end{remark}

\begin{convention}
\label{conv.ent.quo-rem.prec}The symbols $//$ and $\%$ will be granted higher
precedence (in the sense of
\href{https://en.wikipedia.org/wiki/Order_of_operations}{operator precedence})
than addition. This means that an expression of the form \textquotedblleft%
$c+a//n+b$\textquotedblright\ will always be interpreted as \textquotedblleft%
$c+\left(  a//n\right)  +b$\textquotedblright, rather than as
\textquotedblleft$\left(  c+a\right)  //\left(  n+b\right)  $%
\textquotedblright\ (or in any other way). Likewise, an expression of the form
\textquotedblleft$c+a\%n+b$\textquotedblright\ will always be interpreted as
\textquotedblleft$c+\left(  a\%n\right)  +b$\textquotedblright, rather than as
\textquotedblleft$\left(  c+a\right)  \%\left(  n+b\right)  $%
\textquotedblright.
\end{convention}

\begin{exercise}
\label{exe.ent.quo-rem.u+v}Let $u$ and $v$ be two integers. Let $n$ be a
positive integer.

\textbf{(a)} Prove that $u\%n+v\%n-\left(  u+v\right)  \%n\in\left\{
0,n\right\}  $.

\textbf{(b)} Prove that $\left(  u+v\right)  //n-u//n-v//n\in\left\{
0,1\right\}  $.
\end{exercise}

\begin{exercise}
\label{exe.ent.quo-rem.bijs}Let $n$ be a positive integer. Prove the following:

\textbf{(a)} The map%
\begin{align*}
\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}   &  \rightarrow\mathbb{Z},\\
\left(  q,r\right)   &  \mapsto qn+r
\end{align*}
is a bijection.

\textbf{(b)} The map%
\begin{align*}
\mathbb{N}\times\left\{  0,1,\ldots,n-1\right\}   &  \rightarrow\mathbb{N},\\
\left(  q,r\right)   &  \mapsto qn+r
\end{align*}
is a bijection.

\textbf{(c)} Any $q\in\mathbb{Z}$ and $r\in\left\{  0,1,\ldots,n-1\right\}  $
satisfy $\left(  qn+r\right)  //n=q$.

\textbf{(d)} Any $q\in\mathbb{Z}$ and $r\in\left\{  0,1,\ldots,n-1\right\}  $
satisfy $\left(  qn+r\right)  \%n=r$.
\end{exercise}

\subsection{Even and odd numbers}

Recall the following:

\begin{definition}
\label{def.ent.even-odd}Let $u$ be an integer.

\textbf{(a)} We say that $u$ is \textit{even} if $u$ is divisible by $2$.

\textbf{(b)} We say that $u$ is \textit{odd }if $u$ is not divisible by $2$.
\end{definition}

So an integer is either even or odd (but not both at the same time). The
following exercise collects various properties of even and odd integers:

\begin{exercise}
\label{exe.ent.even-odd.1}Let $u$ be an integer.

\textbf{(a)} Prove that $u$ is even if and only if $u\%2=0$.

\textbf{(b)} Prove that $u$ is odd if and only if $u\%2=1$.

\textbf{(c)} Prove that $u$ is even if and only if $u\equiv0\operatorname{mod}%
2$.

\textbf{(d)} Prove that $u$ is odd if and only if $u\equiv1\operatorname{mod}%
2$.

\textbf{(e)} Prove that $u$ is odd if and only if $u+1$ is even.

\textbf{(f)} Prove that exactly one of the two numbers $u$ and $u+1$ is even.

\textbf{(g)} Prove that $u\left(  u+1\right)  \equiv0\operatorname{mod}2$.

\textbf{(h)} Prove that $u^{2}\equiv-u\equiv u\operatorname{mod}2$.

\textbf{(i)} Let $v$ be a further integer. Prove that $u\equiv
v\operatorname{mod}2$ holds if and only if $u$ and $v$ are either both odd or
both even.
\end{exercise}

\begin{exercise}
\label{exe.ent.even-odd-sumsq}\textbf{(a)} Prove that each even integer $u$
satisfies $u^{2}\equiv0\operatorname{mod}4$.

\textbf{(b)} Prove that each odd integer $u$ satisfies $u^{2}\equiv
1\operatorname{mod}4$.

\textbf{(c)} Prove that no two integers $x$ and $y$ satisfy $x^{2}+y^{2}%
\equiv3\operatorname{mod}4$.

\textbf{(d)} Prove that if $x$ and $y$ are two integers satisfying
$x^{2}+y^{2}\equiv2\operatorname{mod}4$, then $x$ and $y$ are both odd.
\end{exercise}

Exercise \ref{exe.ent.even-odd-sumsq} \textbf{(c)} establishes our previous
experimental observation that an integer of the form $4k+3$ with integer $k$
(that is, an integer that is larger by $3$ than a multiple of $4$) can never
be written as a sum of two perfect squares.

\begin{exercise}
\label{exe.ent.13mod4}\textbf{(a)} Prove that the map%
\begin{align*}
\left\{  i\in\mathbb{N}\ \mid\ i\text{ is even}\right\}   &  \rightarrow
\left\{  d\in\mathbb{N}\ \mid\ d\equiv1\operatorname{mod}4\right\}  ,\\
i  &  \mapsto2i+1
\end{align*}
is well-defined and is a bijection.

\textbf{(b)} Prove that the map%
\begin{align*}
\left\{  i\in\mathbb{N}\ \mid\ i\text{ is odd}\right\}   &  \rightarrow
\left\{  d\in\mathbb{N}\ \mid\ d\equiv3\operatorname{mod}4\right\}  ,\\
i  &  \mapsto2i+1
\end{align*}
is well-defined and is a bijection.
\end{exercise}

Note that the map defined in Exercise \ref{exe.ent.13mod4} \textbf{(a)} sends
$0,2,4,6,8,\ldots$ to $1,5,9,13,17,\ldots$, while the map defined in Exercise
\ref{exe.ent.13mod4} \textbf{(b)} sends $1,3,5,7,9,\ldots$ to
$3,7,11,15,19,\ldots$.

\begin{teachingnote}
At this point, as an application of division with remainder, it would be
helpful to explain how nonnegative integers can be written in base $n>1$. Make
sure to stress that the last digit of $u$ is $u//n$.

Decimal fractions can then be handled later using Euler's totient function.
Exercises can be added about mixed-radix number systems as well as
alternating-sign ternary.

\textquotedblleft Base $n$\textquotedblright\ works with polynomials as well,
as long as $n$ is a monic polynomial of degree $>0$. This can be restated as:
If $\mathbf{b}\in\mathbb{K}\left[  x\right]  $ has leading term $ux^{m}$ with
$u$ invertible and $m>0$, then $\mathbb{K}\left[  x\right]  $ is a finite free
$\mathbb{K}\left[  y\right]  $-module with $y$ acting as $\mathbf{b}$. Not
sure how useful it is.
\end{teachingnote}

\begin{teachingnote}
\textbf{2019-02-04 lecture}
\end{teachingnote}

\subsection{The floor function}

We shall now briefly introduce the floor function (following \cite{floor}), as
it is closely connected to division with remainder.

\begin{definition}
\label{def.ent.floor}Let $x$ be a real number. Then, $\left\lfloor
x\right\rfloor $ is defined to be the unique integer $n$ satisfying $n\leq
x<n+1$. This integer $\left\lfloor x\right\rfloor $ is called the
\textit{floor} of $x$, or the \textit{integer part} of $x$.
\end{definition}

\begin{remark}
\label{rmk.ent.floor}\textbf{(a)} Why is $\left\lfloor x\right\rfloor $
well-defined? I mean, why does the unique integer $n$ in Definition
\ref{def.ent.floor} exist, and why is it unique? This question is trickier
than it sounds and relies on the construction of real numbers. However, in the
case when $x$ is rational, the well-definedness of $\left\lfloor
x\right\rfloor $ follows from Proposition \ref{prop.ent.floor.quorem} below.

\textbf{(b)} What we call $\left\lfloor x\right\rfloor $ is typically called
$\left[  x\right]  $ in older books (such as \cite{NiZuMo91}). I suggest
avoiding the notation $\left[  x\right]  $ wherever possible; it has too many
different meanings (whereas $\left\lfloor x\right\rfloor $ almost always means
the floor of $x$).

\textbf{(c)} The map $\mathbb{R}\rightarrow\mathbb{Z},\ x\mapsto\left\lfloor
x\right\rfloor $ is called the \textit{floor function} or the \textit{greatest
integer function}.

There is also a \textit{ceiling function}, which sends each $x\in\mathbb{R}$
to the unique integer $n$ satisfying $n-1<x\leq n$; this latter integer is
called $\left\lceil x\right\rceil $. The two functions are connected by the
rule $\left\lceil x\right\rceil =-\left\lfloor -x\right\rfloor $ (for all
$x\in\mathbb{R}$).

The floor and the ceiling functions are some of the simplest examples of
discontinuous functions.

\textbf{(d)} Here are some examples of floors:%
\begin{align*}
\left\lfloor n\right\rfloor  &  =n\ \ \ \ \ \ \ \ \ \ \text{for every }%
n\in\mathbb{Z};\\
\left\lfloor 1.32\right\rfloor  &  =1;\ \ \ \ \ \ \ \ \ \ \left\lfloor
\pi\right\rfloor =3;\ \ \ \ \ \ \ \ \ \ \left\lfloor 0.98\right\rfloor =0;\\
\left\lfloor -2.3\right\rfloor  &  =-3;\ \ \ \ \ \ \ \ \ \ \left\lfloor
-0.4\right\rfloor =-1.
\end{align*}


\textbf{(e)} You might have the impression that $\left\lfloor x\right\rfloor $
is \textquotedblleft what remains from $x$ if the digits behind the comma are
removed\textquotedblright. This impression is highly imprecise. For one, it is
completely broken for negative $x$ (for example, $\left\lfloor
-2.3\right\rfloor $ is $-3$, not $-2$). But more importantly, the operation of
\textquotedblleft removing the digits behind the comma\textquotedblright\ from
a number is not well-defined; in fact, the periodic decimal representations
$0.999\ldots$ and $1.000\ldots$ belong to the same real number ($1$), but
removing their digits behind the comma leaves us with different integers.

\textbf{(f)} A related map is the map $\mathbb{R}\rightarrow\mathbb{Z}%
,\ x\mapsto\left\lfloor x+\dfrac{1}{2}\right\rfloor $. It sends each real $x$
to the integer that is closest to $x$, choosing the larger one in the case of
a tie. This is one of the many things that are commonly known as
\textquotedblleft rounding\textquotedblright\ a number.
\end{remark}

\begin{proposition}
\label{prop.ent.floor.quorem}Let $a$ and $b$ be integers such that $b>0$.
Then, $\left\lfloor \dfrac{a}{b}\right\rfloor $ is well-defined and equals
$a//b$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.floor.quorem}.]This is a rather easy and
neat exercise. A full proof can be found in \cite[proof of Proposition
1.1.3]{floor}.
\end{proof}

See \cite{floor} and \cite[\S 4.1]{NiZuMo91} for further properties of the
floor function.

\subsection{Common divisors, the Euclidean algorithm and the Bezout theorem}

We are next going to define and study the divisors of an integer, as well as
the common divisors of several integers. These concepts form the backbone of
most of number theory, and will later be extended to some more complicated
notions than integers (e.g., Gaussian integers and polynomials).

\subsubsection{Divisors}

\begin{definition}
\label{def.ent.divisors.divisors}Let $b\in\mathbb{Z}$. The \textit{divisors}
of $b$ are defined as the integers that divide $b$.
\end{definition}

Be aware that some authors use a mildly different definition of
\textquotedblleft divisors\textquotedblright; namely, they additionally
require them to be positive. We don't make such a requirement.

For example, the divisors of $6$ are $-6,-3,-2,-1,1,2,3,6$. Of course, the
negative divisors of an integer $b$ are merely the reflections of the positive
divisors through the origin\footnote{\textquotedblleft Reflection through the
origin\textquotedblright\ is just a poetic way to say \textquotedblleft
negative\textquotedblright; i.e., the reflection of a number $a$ through the
origin is $-a$.} (this follows easily from Proposition \ref{prop.ent.div.1}
\textbf{(a)}); thus, the positive divisors are usually the only ones of interest.

Here are some basic properties of divisors:

\begin{proposition}
\label{prop.ent.divisors.find}\textbf{(a)} If $b\in\mathbb{Z}$, then $1$ and
$b$ are divisors of $b$.

\textbf{(b)} The divisors of $0$ are all the integers.

\textbf{(c)} Let $b\in\mathbb{Z}$ be nonzero. Then, all divisors of $b$ belong
to the set $\left\{  -\left\vert b\right\vert ,-\left\vert b\right\vert
+1,\ldots,\left\vert b\right\vert \right\}  \setminus\left\{  0\right\}  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.divisors.find}.]\textbf{(a)} Clearly,
$1\mid b$ (since $b=1b$), so that $1$ is a divisor of $b$. Also, $b\mid b$
(since $b=b\cdot1$), so that $b$ is a divisor of $b$.

\textbf{(b)} Each integer $a$ divides $0$ (since $0=a\cdot0$) and thus is a
divisor of $0$. This proves Proposition \ref{prop.ent.divisors.find}
\textbf{(b)}.

\textbf{(c)} Let $a$ be a divisor of $b$. Then, $a$ divides $b$. In other
words, $a\mid b$. Hence, Proposition \ref{prop.ent.div.1} \textbf{(b)} yields
$\left\vert a\right\vert \leq\left\vert b\right\vert $ (since $b\neq0$). But
$\left\vert a\right\vert \geq a$ (since $\left\vert x\right\vert \geq x$ for
each $x\in\mathbb{R}$), so that $a\leq\left\vert a\right\vert \leq\left\vert
b\right\vert $. Also, $\left\vert a\right\vert \geq-a$ (since $\left\vert
x\right\vert \geq-x$ for each $x\in\mathbb{R}$) and thus $-a\leq\left\vert
a\right\vert \leq\left\vert b\right\vert $, so that $a\geq-\left\vert
b\right\vert $. Combining this with $a\leq\left\vert b\right\vert $, we obtain
$-\left\vert b\right\vert \leq a\leq\left\vert b\right\vert $ and thus
$a\in\left\{  -\left\vert b\right\vert ,-\left\vert b\right\vert
+1,\ldots,\left\vert b\right\vert \right\}  $ (since $a$ is an integer).

From Example \ref{exa.ent.div.triv} \textbf{(c)}, we know that $0\mid b$ only
when $b=0$. Thus, we don't have $0\mid b$ (since $b\neq0$).

If we had $a=0$, then we would have $0=a\mid b$, which would contradict the
fact that we don't have $0\mid b$. Thus, we cannot have $a=0$. Hence, $a\neq
0$. Combining $a\in\left\{  -\left\vert b\right\vert ,-\left\vert b\right\vert
+1,\ldots,\left\vert b\right\vert \right\}  $ with $a\neq0$, we obtain
$a\in\left\{  -\left\vert b\right\vert ,-\left\vert b\right\vert
+1,\ldots,\left\vert b\right\vert \right\}  \setminus\left\{  0\right\}  $.

We have proven this for each divisor $a$ of $b$. Thus, we conclude that all
divisors of $b$ belong to the set $\left\{  -\left\vert b\right\vert
,-\left\vert b\right\vert +1,\ldots,\left\vert b\right\vert \right\}
\setminus\left\{  0\right\}  $. This proves Proposition
\ref{prop.ent.divisors.find} \textbf{(c)}.
\end{proof}

Thanks to Proposition \ref{prop.ent.divisors.find}, we have a method to find
all divisors of an integer $b$: If $b=0$, then Proposition
\ref{prop.ent.divisors.find} \textbf{(b)} directly yields the result;
otherwise, Proposition \ref{prop.ent.divisors.find} \textbf{(c)} shows that
there is only a finite set of numbers we have to check. When $b$ is large,
this is slow, but to some extent that is because the problem is
computationally hard (or at least suspected to be hard).

\subsubsection{Common divisors}

It is somewhat more interesting to consider the common divisors of two or more integers:

\begin{definition}
\label{def.ent.Div}Let $b_{1},b_{2},\ldots,b_{k}$ be integers. Then, the
\textit{common divisors} of $b_{1},b_{2},\ldots,b_{k}$ are defined to be the
integers $a$ that satisfy%
\begin{equation}
\left(  a\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,k\right\}  \right)
\label{eq.def.ent.Div.cond}%
\end{equation}
(in other words, that divide all of the integers $b_{1},b_{2},\ldots,b_{k}$).
We let $\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ denote
the set of these common divisors.
\end{definition}

Note that the concept of common divisors encompasses the concept of divisors:
The common divisors of a single integer $b$ are merely the divisors of $b$.
Thus, $\operatorname*{Div}\left(  b\right)  $ is the set of all divisors of
$b$ whenever $b\in\mathbb{Z}$. (Of course, speaking of \textquotedblleft
common divisors\textquotedblright\ of just one integer is like speaking of a
conspiracy of just one person. But the definition fits, and we algebraists
don't exclude cases just because they are ridiculous.)

(Also, the common divisors of an empty list of integers are all the integers,
because the requirement (\ref{eq.def.ent.Div.cond}) is vacuously true for
$k=0$. In other words, $\operatorname*{Div}\left(  {}\right)  =\mathbb{Z}$.)

Here are some more interesting examples of common divisors:

\begin{example}
\textbf{(a)} The common divisors of $6$ and $8$ are $-2,-1,1,2$. (In order to
see this, just observe that the divisors of $6$ are $-6,-3,-2,-1,1,2,3,6$,
whereas the divisors of $8$ are $-8,-4,-2,-1,1,2,4,8$; now you can find the
common divisors of $6$ and $8$ by taking the numbers common to these two
lists.) Thus,%
\[
\operatorname*{Div}\left(  6,8\right)  =\left\{  -2,-1,1,2\right\}  .
\]


\textbf{(b)} The common divisors of $6$ and $14$ are $-2,-1,1,2$ again. (In
order to see this, just observe that the divisors of $6$ are
$-6,-3,-2,-1,1,2,3,6$, whereas the divisors of $14$ are
$-14,-7,-2,-1,1,2,7,14$.)

\textbf{(c)} The common divisors of $6$, $10$ and $15$ are $-1$ and $1$. (In
order to see this, note that:

\begin{itemize}
\item The divisors of $6$ are $-6,-3,-2,-1,1,2,3,6$.

\item The divisors of $10$ are $-10,-5,-2,-1,1,2,5,10$.

\item The divisors of $15$ are $-15,-5,-3,-1,1,3,5,15$.
\end{itemize}

\noindent The only numbers common to these three lists are $-1$ and $1$.) However:

\begin{itemize}
\item The common divisors of $6$ and $10$ are $-2,-1,1,2$.

\item The common divisors of $6$ and $15$ are $-3,-1,1,3$.

\item The common divisors of $10$ and $15$ are $-5,-1,1,5$.
\end{itemize}

\noindent This illustrates the fact that three numbers can have pairwise
nontrivial common divisors (where \textquotedblleft
nontrivial\textquotedblright\ means \textquotedblleft distinct from $1$ and
$-1$\textquotedblright), but the only common divisors of all three of them may
still be just $1$ and $-1$.
\end{example}

\begin{proposition}
\label{prop.ent.Div.fin}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely many
integers that are not all $0$. Then, the set $\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{k}\right)  $ has a largest element, and this largest
element is a positive integer.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.Div.fin}.]The integer $1$ satisfies
$\left(  1\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,k\right\}
\right)  $. Thus, $1$ is a common divisor of $b_{1},b_{2},\ldots,b_{k}$ (by
the definition of a \textquotedblleft common divisor\textquotedblright). In
other words, $1\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
$ (by the definition of $\operatorname*{Div}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $). Hence, the set $\operatorname*{Div}\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $ is nonempty.

Moreover, it is easy to see that the set $\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{k}\right)  $ is finite.

\begin{fineprint}
[\textit{Proof:} We have assumed that $b_{1},b_{2},\ldots,b_{k}$ are not all
$0$. In other words, there exists a $j\in\left\{  1,2,\ldots,k\right\}  $ such
that $b_{j}$ is nonzero. Consider such a $j$.

Let $d\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $. Thus,
$d$ is a common divisor of $b_{1},b_{2},\ldots,b_{k}$ (by the definition of
$\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $). In other
words, $d\mid b_{i}$ for all $i\in\left\{  1,2,\ldots,k\right\}  $ (by the
definition of \textquotedblleft common divisor\textquotedblright). Applying
this to $i=j$, we obtain $d\mid b_{j}$. Hence, $d$ is a divisor of $b_{j}$.
But Proposition \ref{prop.ent.divisors.find} \textbf{(c)} (applied to
$b=b_{j}$) shows that all divisors of $b_{j}$ belong to the set $\left\{
-\left\vert b_{j}\right\vert ,-\left\vert b_{j}\right\vert +1,\ldots
,\left\vert b_{j}\right\vert \right\}  \setminus\left\{  0\right\}  $. Hence,
$d$ must belong to this set (since $d$ is a divisor of $b_{j}$). In other
words, $d\in\left\{  -\left\vert b_{j}\right\vert ,-\left\vert b_{j}%
\right\vert +1,\ldots,\left\vert b_{j}\right\vert \right\}  \setminus\left\{
0\right\}  $.

Now, forget that we fixed $d$. We thus have shown that $d\in\left\{
-\left\vert b_{j}\right\vert ,-\left\vert b_{j}\right\vert +1,\ldots
,\left\vert b_{j}\right\vert \right\}  \setminus\left\{  0\right\}  $ for each
$d\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $. In other
words,
\[
\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  \subseteq\left\{
-\left\vert b_{j}\right\vert ,-\left\vert b_{j}\right\vert +1,\ldots
,\left\vert b_{j}\right\vert \right\}  \setminus\left\{  0\right\}  .
\]
Thus, the set $\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $
is finite (since the set $\left\{  -\left\vert b_{j}\right\vert ,-\left\vert
b_{j}\right\vert +1,\ldots,\left\vert b_{j}\right\vert \right\}
\setminus\left\{  0\right\}  $ is finite).]
\end{fineprint}

Now we know that the set $\operatorname*{Div}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $ is a nonempty finite set of integers. Thus, this set
$\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ has a largest
element (since every nonempty finite set of integers has a largest element).
It remains to prove that this largest element is a positive integer.

Let $g$ be this largest element. Thus, we must prove that $g$ is a positive
integer. Clearly, $g$ is an integer (since all elements of
$\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ are integers);
it thus remains to show that $g$ is positive.

The element $g$ is the largest element of the set $\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{k}\right)  $, and thus is $\geq$ to every element of
this set. In other words, $g\geq x$ for each $x\in\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{k}\right)  $. Applying this to $x=1$, we obtain $g\geq1$
(since $1\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $).
Hence, $g$ is positive. This completes the proof of Proposition
\ref{prop.ent.Div.fin}.
\end{proof}

The following exercise shows that the set $\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{k}\right)  $ depends only on the \textbf{set} $\left\{
b_{1},b_{2},\ldots,b_{k}\right\}  $, but not on the numbers $b_{1}%
,b_{2},\ldots,b_{k}$ themselves. Thus, for example, any integers $a$, $b$ and
$c$ satisfy $\operatorname*{Div}\left(  a,b,c,a\right)  =\operatorname*{Div}%
\left(  c,a,b\right)  $ (since $\left\{  a,b,c,a\right\}  =\left\{
c,a,b\right\}  $) and $\operatorname*{Div}\left(  a,a,b,a\right)
=\operatorname*{Div}\left(  a,b,b\right)  $ (since $\left\{  a,a,b,a\right\}
=\left\{  a,b,b\right\}  $).

\begin{exercise}
\label{exe.ent.Div.set}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely many
integers. Let $c_{1},c_{2},\ldots,c_{\ell}$ be finitely many integers. Prove
that if%
\[
\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  =\left\{  c_{1},c_{2}%
,\ldots,c_{\ell}\right\}  ,
\]
then%
\[
\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
=\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  .
\]

\end{exercise}

\subsubsection{Greatest common divisors}

Proposition \ref{prop.ent.Div.fin} allows us to make a crucial definition:

\begin{definition}
\label{def.ent.gcd.gcd}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely many
integers. The \textit{greatest common divisor} of $b_{1},b_{2},\ldots,b_{k}$
is defined as follows:

\begin{itemize}
\item If $b_{1},b_{2},\ldots,b_{k}$ are not all $0$, then it is defined as the
largest element of the set $\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $. This largest element is well-defined (by Proposition
\ref{prop.ent.Div.fin}), and is a positive integer (by Proposition
\ref{prop.ent.Div.fin} again).

\item If $b_{1},b_{2},\ldots,b_{k}$ are all $0$, then it is defined to be $0$.
(This is a slight abuse of the word \textquotedblleft greatest common
divisor\textquotedblright, because $0$ is not actually the greatest among the
common divisors of $b_{1},b_{2},\ldots,b_{k}$ in this case. In fact, when
$b_{1},b_{2},\ldots,b_{k}$ are all $0$, \textbf{every} integer is a common
divisor of $b_{1},b_{2},\ldots,b_{k}$, so that there is no greatest among
these common divisors, because there is no \textquotedblleft greatest
integer\textquotedblright. Nevertheless, defining the greatest common divisor
of $b_{1},b_{2},\ldots,b_{k}$ to be $0$ in this case will prove to be a good
decision, as it will greatly reduce the number of exceptions in our results.)
\end{itemize}

Thus, in either case, this greatest common divisor is a nonnegative integer.
We denote it by $\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  $. (Some authors
also call it $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $, which is rather
dangerous as the same notation stands for a $k$-tuple. We shall avoid this
notation at all cost, but you should be aware of it when reading
number-theoretical literature.)

We shall also use the word \textquotedblleft\textit{gcd}\textquotedblright\ as
shorthand for \textquotedblleft greatest common divisor\textquotedblright.
\end{definition}

The greatest common divisors you will most commonly see are those of two
integers. Indeed, any other gcd can be rewritten in terms of these: for
example,%
\[
\gcd\left(  a,b,c,d,e\right)  =\gcd\left(  a,\gcd\left(  b,\gcd\left(
c,\gcd\left(  d,e\right)  \right)  \right)  \right)
\]
for all $a,b,c,d,e\in\mathbb{Z}$. This is, in fact, a consequence of
Proposition \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} (which we will prove
later), applied several times.

First, let us observe several properties of greatest common divisors:

\begin{proposition}
\label{prop.ent.gcd.props1}\textbf{(a)} We have $\gcd\left(  a,0\right)
=\gcd\left(  a\right)  =\left\vert a\right\vert $ for all $a\in\mathbb{Z}$.

\textbf{(b)} We have $\gcd\left(  a,b\right)  =\gcd\left(  b,a\right)  $ for
all $a,b\in\mathbb{Z}$.

\textbf{(c)} We have $\gcd\left(  a,ua+b\right)  =\gcd\left(  a,b\right)  $
for all $a,b,u\in\mathbb{Z}$.

\textbf{(d)} If $a,b,c\in\mathbb{Z}$ satisfy $b\equiv c\operatorname{mod}a$,
then $\gcd\left(  a,b\right)  =\gcd\left(  a,c\right)  $.

\textbf{(e)} If $a,b\in\mathbb{Z}$ are such that $a$ is positive, then
$\gcd\left(  a,b\right)  =\gcd\left(  a,b\%a\right)  $.

\textbf{(f)} We have $\gcd\left(  a,b\right)  \mid a$ and $\gcd\left(
a,b\right)  \mid b$ for all $a,b\in\mathbb{Z}$.

\textbf{(g)} We have $\gcd\left(  -a,b\right)  =\gcd\left(  a,b\right)  $ for
all $a,b\in\mathbb{Z}$.

\textbf{(h)} We have $\gcd\left(  a,-b\right)  =\gcd\left(  a,b\right)  $ for
all $a,b\in\mathbb{Z}$.

\textbf{(i)} If $a,b\in\mathbb{Z}$ satisfy $a\mid b$, then $\gcd\left(
a,b\right)  =\left\vert a\right\vert $.

\textbf{(j)} The greatest common divisor of the empty list of integers is
$\gcd\left(  {}\right)  =0$.
\end{proposition}

Proposition \ref{prop.ent.gcd.props1} is not difficult and we could start
proving it right away. However, such a proof would require some annoying case
distinctions due to the special treatment that the \textquotedblleft%
$b_{1},b_{2},\ldots,b_{k}$ are all $0$\textquotedblright\ case required in
Definition \ref{def.ent.gcd.gcd}. Fortunately, we can circumnavigate these
annoyances by stating a simple rule for how the gcd of $k$ integers
$b_{1},b_{2},\ldots,b_{k}$ can be computed from their set of common divisors
(including the case when $b_{1},b_{2},\ldots,b_{k}$ are all $0$):

\begin{lemma}
\label{lem.ent.gcd.through-Div}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely many
integers. Then,%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =%
\begin{cases}
\max\left(  \operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right)  , & \text{if }0\notin\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  ;\\
0, & \text{if }0\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
.
\end{cases}
\]
(Here, $\max S$ denotes the largest element of a set $S$ of integers, whenever
this largest element exists.)
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.gcd.through-Div}.]We are in one of the following
two cases:

\textit{Case 1:} The integers $b_{1},b_{2},\ldots,b_{k}$ are not all $0$.

\textit{Case 2:} The integers $b_{1},b_{2},\ldots,b_{k}$ are all $0$.

Let us consider Case 1 first. In this case, the integers $b_{1},b_{2}%
,\ldots,b_{k}$ are not all $0$. Hence, $\gcd\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $ is defined as the largest element of the set
$\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ (by Definition
\ref{def.ent.gcd.gcd}). In other words,
\begin{equation}
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\max\left(  \operatorname*{Div}%
\left(  b_{1},b_{2},\ldots,b_{k}\right)  \right)  .
\label{pf.lem.ent.gcd.through-Div.c1.1}%
\end{equation}


On the other hand, $0\notin\operatorname*{Div}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $\ \ \ \ \footnote{\textit{Proof.} Assume the contrary. Thus,
$0\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $. In other
words, $0$ is a common divisor of $b_{1},b_{2},\ldots,b_{k}$ (by the
definition of $\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $).
In other words, $0\mid b_{i}$ for all $i\in\left\{  1,2,\ldots,k\right\}  $
(by the definition of \textquotedblleft common divisor\textquotedblright).
Thus, for all $i\in\left\{  1,2,\ldots,k\right\}  $, we have $b_{i}=0$ (since
$0\mid b_{i}$, so that $b_{i}=0c$ for some integer $c$; but this yields
$b_{i}=0c=0$). In other words, $b_{1},b_{2},\ldots,b_{k}$ are all $0$. But
this contradicts the fact that $b_{1},b_{2},\ldots,b_{k}$ are not all $0$.
This contradiction shows that our assumption was false, qed.}. Hence,%
\[%
\begin{cases}
\max\left(  \operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right)  , & \text{if }0\notin\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  ;\\
0, & \text{if }0\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\end{cases}
=\max\left(  \operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right)  .
\]
Comparing this with (\ref{pf.lem.ent.gcd.through-Div.c1.1}), we obtain%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =%
\begin{cases}
\max\left(  \operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right)  , & \text{if }0\notin\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  ;\\
0, & \text{if }0\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
.
\end{cases}
\]
Hence, Lemma \ref{lem.ent.gcd.through-Div} is proven in Case 1.

Let us now consider Case 2. In this case, the integers $b_{1},b_{2}%
,\ldots,b_{k}$ are all $0$. Hence, $\gcd\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $ is defined as $0$ (by Definition \ref{def.ent.gcd.gcd}). In
other words,
\begin{equation}
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =0.
\label{pf.lem.ent.gcd.through-Div.c2.1}%
\end{equation}


On the other hand, $0\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $\ \ \ \ \footnote{\textit{Proof.} The integers $b_{1}%
,b_{2},\ldots,b_{k}$ are all $0$. In other words, $b_{i}=0$ for all
$i\in\left\{  1,2,\ldots,k\right\}  $. Hence, $0\mid b_{i}$ for all
$i\in\left\{  1,2,\ldots,k\right\}  $ (since each $i\in\left\{  1,2,\ldots
,k\right\}  $ satisfies $b_{i}=0=0\cdot0$). In other words, $0$ is a common
divisor of $b_{1},b_{2},\ldots,b_{k}$ (by the definition of \textquotedblleft
common divisor\textquotedblright). In other words, $0\in\operatorname*{Div}%
\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ (by the definition of
$\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $).}. Hence,%
\[%
\begin{cases}
\max\left(  \operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right)  , & \text{if }0\notin\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  ;\\
0, & \text{if }0\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\end{cases}
=0.
\]
Comparing this with (\ref{pf.lem.ent.gcd.through-Div.c2.1}), we obtain%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =%
\begin{cases}
\max\left(  \operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right)  , & \text{if }0\notin\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  ;\\
0, & \text{if }0\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
.
\end{cases}
\]
Hence, Lemma \ref{lem.ent.gcd.through-Div} is proven in Case 2.

We have now proven Lemma \ref{lem.ent.gcd.through-Div} in both Cases 1 and 2.
Thus, Lemma \ref{lem.ent.gcd.through-Div} always holds.
\end{proof}

A corollary of Lemma \ref{lem.ent.gcd.through-Div} is the following:

\begin{lemma}
\label{lem.ent.gcd.through-Divc}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely
many integers. Let $c_{1},c_{2},\ldots,c_{\ell}$ be finitely many integers. If%
\[
\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
=\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  ,
\]
then%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\gcd\left(  c_{1},c_{2}%
,\ldots,c_{\ell}\right)  .
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.gcd.through-Divc}.]Assume that
$\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
=\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $. Lemma
\ref{lem.ent.gcd.through-Div} yields%
\begin{align*}
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)   &  =%
\begin{cases}
\max\left(  \operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right)  , & \text{if }0\notin\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  ;\\
0, & \text{if }0\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\end{cases}
\\
&  =%
\begin{cases}
\max\left(  \operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell}\right)
\right)  , & \text{if }0\notin\operatorname*{Div}\left(  c_{1},c_{2}%
,\ldots,c_{\ell}\right)  ;\\
0, & \text{if }0\in\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell
}\right)
\end{cases}
\end{align*}
(since $\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
=\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $). But Lemma
\ref{lem.ent.gcd.through-Div} (applied to $c_{1},c_{2},\ldots,c_{\ell}$
instead of $b_{1},b_{2},\ldots,b_{k}$) yields%
\[
\gcd\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  =%
\begin{cases}
\max\left(  \operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell}\right)
\right)  , & \text{if }0\notin\operatorname*{Div}\left(  c_{1},c_{2}%
,\ldots,c_{\ell}\right)  ;\\
0, & \text{if }0\in\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell
}\right)  .
\end{cases}
\]
Comparing these two equalities, we obtain $\gcd\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  =\gcd\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $. This
proves Lemma \ref{lem.ent.gcd.through-Divc}.
\end{proof}

Lemma \ref{lem.ent.gcd.through-Divc} tells us that in order to prove that two
lists of integers have the same gcd, it suffices to check that they have the
same set of common divisors. Since many of the claims of Proposition
\ref{prop.ent.gcd.props1} are equalities between gcds, we can thus reduce them
to equalities between sets of common divisors. Let us state these equalities
as a lemma, which we will then use as a stepping stone in our proof of
Proposition \ref{prop.ent.gcd.props1}:

\begin{lemma}
\label{lem.ent.Div.props1}\textbf{(a)} We have $\operatorname*{Div}\left(
a,0\right)  =\operatorname*{Div}\left(  a\right)  $ for all $a\in\mathbb{Z}$.

\textbf{(b)} We have $\operatorname*{Div}\left(  a,b\right)
=\operatorname*{Div}\left(  b,a\right)  $ for all $a,b\in\mathbb{Z}$.

\textbf{(c)} We have $\operatorname*{Div}\left(  a,ua+b\right)
=\operatorname*{Div}\left(  a,b\right)  $ for all $a,b,u\in\mathbb{Z}$.

\textbf{(d)} If $a,b,c\in\mathbb{Z}$ satisfy $b\equiv c\operatorname{mod}a$,
then $\operatorname*{Div}\left(  a,b\right)  =\operatorname*{Div}\left(
a,c\right)  $.

\textbf{(e)} If $a,b\in\mathbb{Z}$ are such that $a$ is positive, then
$\operatorname*{Div}\left(  a,b\right)  =\operatorname*{Div}\left(
a,b\%a\right)  $.

\textbf{(f)} We have $\operatorname*{Div}\left(  a,b\right)  \subseteq
\operatorname*{Div}\left(  a\right)  $ and $\operatorname*{Div}\left(
a,b\right)  \subseteq\operatorname*{Div}\left(  b\right)  $ for all
$a,b\in\mathbb{Z}$.

\textbf{(g)} We have $\operatorname*{Div}\left(  -a,b\right)
=\operatorname*{Div}\left(  a,b\right)  $ for all $a,b\in\mathbb{Z}$.

\textbf{(h)} We have $\operatorname*{Div}\left(  a,-b\right)
=\operatorname*{Div}\left(  a,b\right)  $ for all $a,b\in\mathbb{Z}$.

\textbf{(i)} If $a,b\in\mathbb{Z}$ satisfy $a\mid b$, then
$\operatorname*{Div}\left(  a,b\right)  =\operatorname*{Div}\left(  a\right)
$.

\textbf{(j)} The set of common divisors of the empty list of integers is
$\operatorname*{Div}\left(  {}\right)  =\mathbb{Z}$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.Div.props1}.]\textbf{(a)} Here is a sketch of the
proof: The number $0$ is a \textquotedblleft joker\textquotedblright\ when it
comes to common divisors, in the sense that inserting it into a list of
integers does not change the common divisors of that list. For example, if
$a\in\mathbb{Z}$, then the common divisors of $a$ and $0$ are the same as the
divisors of $a$, because every integer divides $0$. But this is saying
precisely that $\operatorname*{Div}\left(  a,0\right)  =\operatorname*{Div}%
\left(  a\right)  $.

For the sake of completeness, let us give a detailed proof of Lemma
\ref{lem.ent.Div.props1} \textbf{(a)}:

\begin{fineprint}
For any integer $x$, we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  x\in\operatorname*{Div}\left(  a,0\right)  \right) \\
&  \Longleftrightarrow\ \left(  x\text{ is a common divisor of }a\text{ and
}0\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}\operatorname*{Div}\left(  a,0\right)  \right) \\
&  \Longleftrightarrow\ \left(  x\mid a\text{ and }x\mid0\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of a \textquotedblleft
common divisor\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  x\mid a\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }x\mid0\text{ always holds (since }0=x\cdot0\text{)}\right) \\
&  \Longleftrightarrow\ \left(  x\text{ is a common divisor of }a\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of a \textquotedblleft
common divisor\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  x\in\operatorname*{Div}\left(  a\right)
\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }%
\operatorname*{Div}\left(  a\right)  \right)  .
\end{align*}
In other words, an integer belongs to $\operatorname*{Div}\left(  a,0\right)
$ if and only if it belongs to $\operatorname*{Div}\left(  a\right)  $. Thus,
$\operatorname*{Div}\left(  a,0\right)  =\operatorname*{Div}\left(  a\right)
$ (since both $\operatorname*{Div}\left(  a,0\right)  $ and
$\operatorname*{Div}\left(  a\right)  $ are sets of integers). Thus, Lemma
\ref{lem.ent.Div.props1} \textbf{(a)} is finally proven.
\end{fineprint}

\textbf{(b)} Let $a,b\in\mathbb{Z}$. For any integer $x$, we have the
following chain of equivalences:%
\begin{align*}
&  \ \left(  x\in\operatorname*{Div}\left(  a,b\right)  \right) \\
&  \Longleftrightarrow\ \left(  x\text{ is a common divisor of }a\text{ and
}b\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}\operatorname*{Div}\left(  a,b\right)  \right) \\
&  \Longleftrightarrow\ \left(  x\mid a\text{ and }x\mid b\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of a \textquotedblleft
common divisor\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  x\mid b\text{ and }x\mid a\right) \\
&  \Longleftrightarrow\ \left(  x\text{ is a common divisor of }b\text{ and
}a\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of a \textquotedblleft
common divisor\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  x\in\operatorname*{Div}\left(  b,a\right)
\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }%
\operatorname*{Div}\left(  b,a\right)  \right)  .
\end{align*}
In other words, an integer belongs to $\operatorname*{Div}\left(  a,b\right)
$ if and only if it belongs to $\operatorname*{Div}\left(  b,a\right)  $.
Thus, $\operatorname*{Div}\left(  a,b\right)  =\operatorname*{Div}\left(
b,a\right)  $ (since both $\operatorname*{Div}\left(  a,b\right)  $ and
$\operatorname*{Div}\left(  b,a\right)  $ are sets of integers). This proves
Lemma \ref{lem.ent.Div.props1} \textbf{(b)}.

Let us prove part \textbf{(d)} now, and then derive part \textbf{(c)} from it.

\textbf{(d)} Let $a,b,c\in\mathbb{Z}$ satisfy $b\equiv c\operatorname{mod}a$.
We must prove that $\operatorname*{Div}\left(  a,b\right)
=\operatorname*{Div}\left(  a,c\right)  $.

From $b\equiv c\operatorname{mod}a$, we obtain $c\equiv b\operatorname{mod}a$
(by Proposition \ref{prop.ent.mod.basics} \textbf{(c)}). Hence, our situation
is symmetric with respect to $b$ and $c$.

We shall now show that $\operatorname*{Div}\left(  a,b\right)  \subseteq
\operatorname*{Div}\left(  a,c\right)  $. Indeed, let $x\in\operatorname*{Div}%
\left(  a,b\right)  $. Then, $x$ is a common divisor of $a$ and $b$ (by the
definition of $\operatorname*{Div}\left(  a,b\right)  $). In other words,
$x\mid a$ and $x\mid b$ (by the definition of a \textquotedblleft common
divisor\textquotedblright). From $x\mid b$, we obtain $b\equiv
0\operatorname{mod}x$. But from $x\mid a$ and $c\equiv b\operatorname{mod}a$,
we obtain $c\equiv b\operatorname{mod}x$ (by Proposition
\ref{prop.ent.mod.basics} \textbf{(e)}, applied to $a$, $x$, $c$ and $b$
instead of $n$, $m$, $a$ and $b$). Thus, $c\equiv b\equiv0\operatorname{mod}%
x$, so that $x\mid c$. Combining $x\mid a$ and $x\mid c$, we see that $x$ is a
common divisor of $a$ and $c$ (by the definition of a \textquotedblleft common
divisor\textquotedblright). In other words, $x\in\operatorname*{Div}\left(
a,c\right)  $ (by the definition of $\operatorname*{Div}\left(  a,c\right)  $).

Now, forget that we fixed $x$. We thus have proven that $x\in
\operatorname*{Div}\left(  a,c\right)  $ for each $x\in\operatorname*{Div}%
\left(  a,b\right)  $. In other words, $\operatorname*{Div}\left(  a,b\right)
\subseteq\operatorname*{Div}\left(  a,c\right)  $.

The same argument (but with the roles of $b$ and $c$ swapped) shows that
$\operatorname*{Div}\left(  a,c\right)  \subseteq\operatorname*{Div}\left(
a,b\right)  $ (since our situation is symmetric with respect to $b$ and $c$).
Combining this with $\operatorname*{Div}\left(  a,b\right)  \subseteq
\operatorname*{Div}\left(  a,c\right)  $, we obtain $\operatorname*{Div}%
\left(  a,b\right)  =\operatorname*{Div}\left(  a,c\right)  $. This proves
Lemma \ref{lem.ent.Div.props1} \textbf{(d)}.

\textbf{(c)} Let $a,b,u\in\mathbb{Z}$. Then, $ua+b\equiv b\operatorname{mod}a$
(since $\left(  ua+b\right)  -b=ua$ is clearly divisible by $a$). Thus, Lemma
\ref{lem.ent.Div.props1} \textbf{(d)} (applied to $ua+b$ and $b$ instead of
$b$ and $c$) yields $\operatorname*{Div}\left(  a,ua+b\right)
=\operatorname*{Div}\left(  a,b\right)  $. This proves Lemma
\ref{lem.ent.Div.props1} \textbf{(c)}.

\textbf{(e)} Let $a,b\in\mathbb{Z}$ be such that $a$ is positive. Then,
$b\%a\equiv b\operatorname{mod}a$ (by Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(a)}, applied to $a$ and $b$ instead of $n$ and $u$), thus $b\equiv
b\%a\operatorname{mod}a$. Hence, $\operatorname*{Div}\left(  a,b\right)
=\operatorname*{Div}\left(  a,b\%a\right)  $ (by Lemma
\ref{lem.ent.Div.props1} \textbf{(d)}, applied to $c=b\%a$). This proves Lemma
\ref{lem.ent.Div.props1} \textbf{(e)}.

\textbf{(f)} Let $a,b\in\mathbb{Z}$. We must prove that $\operatorname*{Div}%
\left(  a,b\right)  \subseteq\operatorname*{Div}\left(  a\right)  $ and
$\operatorname*{Div}\left(  a,b\right)  \subseteq\operatorname*{Div}\left(
b\right)  $.

Let $x\in\operatorname*{Div}\left(  a,b\right)  $. We shall prove that
$x\in\operatorname*{Div}\left(  b\right)  $.

Indeed, $x\in\operatorname*{Div}\left(  a,b\right)  $; in other words, $x$ is
a common divisor of $a$ and $b$ (by the definition of $\operatorname*{Div}%
\left(  a,b\right)  $). In other words, $\left(  x\mid a\text{ and }x\mid
b\right)  $ (by the definition of a \textquotedblleft common
divisor\textquotedblright). Hence, $x\mid a$. In other words, $x$ is a common
divisor of $a$ (by the definition of a \textquotedblleft common
divisor\textquotedblright). In other words, $x\in\operatorname*{Div}\left(
a\right)  $ (by the definition of $\operatorname*{Div}\left(  a\right)  $).

Now, forget that we fixed $x$. We thus have shown that $x\in
\operatorname*{Div}\left(  a\right)  $ for each $x\in\operatorname*{Div}%
\left(  a,b\right)  $. In other words, $\operatorname*{Div}\left(  a,b\right)
\subseteq\operatorname*{Div}\left(  a\right)  $. A similar argument shows that
$\operatorname*{Div}\left(  a,b\right)  \subseteq\operatorname*{Div}\left(
b\right)  $. This proves Lemma \ref{lem.ent.Div.props1} \textbf{(f)}.

\textbf{(g)} Let $a,b\in\mathbb{Z}$. We must prove that $\operatorname*{Div}%
\left(  -a,b\right)  =\operatorname*{Div}\left(  a,b\right)  $.

First, we will show that $\operatorname*{Div}\left(  a,b\right)
\subseteq\operatorname*{Div}\left(  -a,b\right)  $. Indeed, let $x\in
\operatorname*{Div}\left(  a,b\right)  $. Then, $x$ is a common divisor of $a$
and $b$ (by the definition of $\operatorname*{Div}\left(  a,b\right)  $). In
other words, $x\mid a$ and $x\mid b$ (by the definition of a \textquotedblleft
common divisor\textquotedblright). We have $a\mid-a$ (since $-a=a\cdot\left(
-1\right)  $). Thus, $x\mid a\mid-a$. Combining $x\mid-a$ and $x\mid b$, we
see that $x$ is a common divisor of $-a$ and $b$ (by the definition of a
\textquotedblleft common divisor\textquotedblright). In other words,
$x\in\operatorname*{Div}\left(  -a,b\right)  $ (by the definition of
$\operatorname*{Div}\left(  -a,b\right)  $).

Now, forget that we fixed $x$. We thus have proven that $x\in
\operatorname*{Div}\left(  -a,b\right)  $ for each $x\in\operatorname*{Div}%
\left(  a,b\right)  $. In other words, $\operatorname*{Div}\left(  a,b\right)
\subseteq\operatorname*{Div}\left(  -a,b\right)  $.

The same argument (but applied to $-a$ instead of $a$) shows that
$\operatorname*{Div}\left(  -a,b\right)  \subseteq\operatorname*{Div}\left(
-\left(  -a\right)  ,b\right)  $. Since $-\left(  -a\right)  =a$, this
rewrites as $\operatorname*{Div}\left(  -a,b\right)  \subseteq
\operatorname*{Div}\left(  a,b\right)  $. Combining this with
$\operatorname*{Div}\left(  a,b\right)  \subseteq\operatorname*{Div}\left(
-a,b\right)  $, we obtain $\operatorname*{Div}\left(  -a,b\right)
=\operatorname*{Div}\left(  a,b\right)  $. This proves Lemma
\ref{lem.ent.Div.props1} \textbf{(g)}.

\textbf{(h)} We can prove this similarly to how we just proved Lemma
\ref{lem.ent.Div.props1} \textbf{(g)}, but it is easier to derive it from what
was already shown.

Let $a,b\in\mathbb{Z}$. Lemma \ref{lem.ent.Div.props1} \textbf{(b)} (applied
to $-b$ instead of $b$) yields%
\begin{align*}
\operatorname*{Div}\left(  a,-b\right)   &  =\operatorname*{Div}\left(
-b,a\right)  =\operatorname*{Div}\left(  b,a\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma \ref{lem.ent.Div.props1}
\textbf{(g), }applied to }b\text{ and }a\text{ instead of }a\text{ and
}b\right) \\
&  =\operatorname*{Div}\left(  a,b\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Lemma \ref{lem.ent.Div.props1} \textbf{(b)}}\right)  .
\end{align*}
This proves Lemma \ref{lem.ent.Div.props1} \textbf{(h)}.

\textbf{(i)} Let $a,b\in\mathbb{Z}$ satisfy $a\mid b$. From $a\mid b$, we
obtain $b\equiv0\operatorname{mod}a$. Hence, Lemma \ref{lem.ent.Div.props1}
\textbf{(d)} (applied to $c=0$) yields $\operatorname*{Div}\left(  a,b\right)
=\operatorname*{Div}\left(  a,0\right)  =\operatorname*{Div}\left(  a\right)
$ (by Lemma \ref{lem.ent.Div.props1} \textbf{(a)}). This proves Lemma
\ref{lem.ent.Div.props1} \textbf{(i)}.

\textbf{(j)} The definition of $\operatorname*{Div}$ shows that
$\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  \subseteq
\mathbb{Z}$ for any finitely many integers $b_{1},b_{2},\ldots,b_{k}$. Thus,
in particular, $\operatorname*{Div}\left(  {}\right)  \subseteq\mathbb{Z}$. We
shall next prove that $\mathbb{Z}\subseteq\operatorname*{Div}\left(
{}\right)  $.

Indeed, let $x\in\mathbb{Z}$. Let us denote the empty list $\left(  {}\right)
$ of integers by $\left(  b_{1},b_{2},\ldots,b_{0}\right)  $. Then, $\left(
b_{1},b_{2},\ldots,b_{0}\right)  =\left(  {}\right)  $.

But $x\mid b_{i}$ for all $i\in\left\{  1,2,\ldots,0\right\}  $ (indeed, this
is vacuously true, since there exists no $i\in\left\{  1,2,\ldots,0\right\}
$). In other words, $x$ is a common divisor of $\left(  b_{1},b_{2}%
,\ldots,b_{0}\right)  $ (by the definition of \textquotedblleft common
divisor\textquotedblright). In other words, $x\in\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{0}\right)  $ (by the definition of $\left(  b_{1}%
,b_{2},\ldots,b_{0}\right)  $). In other words, $x\in\operatorname*{Div}%
\left(  {}\right)  $ (since $\left(  b_{1},b_{2},\ldots,b_{0}\right)  =\left(
{}\right)  $).

Now, forget that we fixed $x$. We thus have proven that $x\in
\operatorname*{Div}\left(  {}\right)  $ for each $x\in\mathbb{Z}$. In other
words, $\mathbb{Z}\subseteq\operatorname*{Div}\left(  {}\right)  $. Combining
this with $\operatorname*{Div}\left(  {}\right)  \subseteq\mathbb{Z}$, we
obtain $\operatorname*{Div}\left(  {}\right)  =\mathbb{Z}$. This proves Lemma
\ref{lem.ent.Div.props1} \textbf{(j)}.
\end{proof}

\begin{proof}
[Proof of Proposition \ref{prop.ent.gcd.props1}.]\textbf{(a)} Let
$a\in\mathbb{Z}$. Definition \ref{def.ent.gcd.gcd} (specifically, its case
when $b_{1},b_{2},\ldots,b_{k}$ are all $0$) shows that $\gcd\left(
0,0\right)  =0$ and $\gcd\left(  0\right)  =0$. Combining this with
$\left\vert 0\right\vert =0$, we obtain $\gcd\left(  0,0\right)  =\gcd\left(
0\right)  =\left\vert 0\right\vert $. In other words, Proposition
\ref{prop.ent.gcd.props1} \textbf{(a)} holds if $a=0$. Thus, for the rest of
this proof, we WLOG assume that $a\neq0$. Hence, the two integers $a,0$ are
not all zero. Thus, $\gcd\left(  a,0\right)  $ is defined to be the largest
element of the set $\operatorname*{Div}\left(  a,0\right)  $ (by Definition
\ref{def.ent.gcd.gcd}). Likewise, $\gcd\left(  a\right)  $ is the largest
element of the set $\operatorname*{Div}\left(  a\right)  $.

Lemma \ref{lem.ent.Div.props1} \textbf{(a)} yields $\operatorname*{Div}\left(
a,0\right)  =\operatorname*{Div}\left(  a\right)  $. Thus, Lemma
\ref{lem.ent.gcd.through-Divc} (applied to $\left(  a,0\right)  $ and $\left(
a\right)  $ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ and
$\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields $\gcd\left(
a,0\right)  =\gcd\left(  a\right)  $.

For any integer $x$, we have the following chain of equivalences:
\begin{align*}
&  \ \left(  x\in\operatorname*{Div}\left(  a\right)  \right) \\
&  \Longleftrightarrow\ \left(  x\text{ is a common divisor of }a\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\operatorname*{Div}%
\left(  a\right)  \right) \\
&  \Longleftrightarrow\ \left(  x\mid a\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of a \textquotedblleft common
divisor\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  x\text{ is a divisor of }a\right)  .
\end{align*}
Thus, $\operatorname*{Div}\left(  a\right)  $ is the set of all divisors of
$a$.

Exercise \ref{exe.ent.div.aabs} \textbf{(b)} yields $\left\vert a\right\vert
\mid a$. In other words, $\left\vert a\right\vert $ is a divisor of $a$.

Moreover, $a$ is nonzero (since $a\neq0$). Hence, Proposition
\ref{prop.ent.divisors.find} \textbf{(c)} (applied to $b=a$) shows that all
divisors of $a$ belong to the set $\left\{  -\left\vert a\right\vert
,-\left\vert a\right\vert +1,\ldots,\left\vert a\right\vert \right\}
\setminus\left\{  0\right\}  $. Hence, they belong to the set $\left\{
-\left\vert a\right\vert ,-\left\vert a\right\vert +1,\ldots,\left\vert
a\right\vert \right\}  $, and thus are $\leq\left\vert a\right\vert $.

Recall that $\left\vert a\right\vert $ is a divisor of $a$. Since we also know
that all divisors of $a$ are $\leq\left\vert a\right\vert $, we can thus
conclude that $\left\vert a\right\vert $ is the \textbf{largest} divisor of
$a$. In other words, $\left\vert a\right\vert $ is the largest element of the
set $\operatorname*{Div}\left(  a\right)  $ (since $\operatorname*{Div}\left(
a\right)  $ is the set of all divisors of $a$). In other words, $\left\vert
a\right\vert $ is $\gcd\left(  a\right)  $ (since $\gcd\left(  a\right)  $ is
the largest element of the set $\operatorname*{Div}\left(  a\right)  $). Thus,
$\gcd\left(  a\right)  =\left\vert a\right\vert $. Combining this with
$\gcd\left(  a,0\right)  =\gcd\left(  a\right)  $, this yields $\gcd\left(
a,0\right)  =\gcd\left(  a\right)  =\left\vert a\right\vert $. Thus,
Proposition \ref{prop.ent.gcd.props1} \textbf{(a)} is finally proven.

\textbf{(b)} Let $a,b\in\mathbb{Z}$. Lemma \ref{lem.ent.Div.props1}
\textbf{(b)} yields $\operatorname*{Div}\left(  a,b\right)
=\operatorname*{Div}\left(  b,a\right)  $. Thus, Lemma
\ref{lem.ent.gcd.through-Divc} (applied to $\left(  a,b\right)  $ and $\left(
b,a\right)  $ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ and
$\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields $\gcd\left(
a,b\right)  =\gcd\left(  b,a\right)  $. This proves Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)}.

\textbf{(c)} Let $a,b,u\in\mathbb{Z}$. Then, Lemma \ref{lem.ent.Div.props1}
\textbf{(c)} yields $\operatorname*{Div}\left(  a,ua+b\right)
=\operatorname*{Div}\left(  a,b\right)  $. Thus, Lemma
\ref{lem.ent.gcd.through-Divc} (applied to $\left(  a,ua+b\right)  $ and
$\left(  a,b\right)  $ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $
and $\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields $\gcd\left(
a,ua+b\right)  =\gcd\left(  a,b\right)  $. This proves Proposition
\ref{prop.ent.gcd.props1} \textbf{(c)}.

\textbf{(d)} Let $a,b,c\in\mathbb{Z}$ satisfy $b\equiv c\operatorname{mod}a$.
Then, Lemma \ref{lem.ent.Div.props1} \textbf{(d)} yields $\operatorname*{Div}%
\left(  a,b\right)  =\operatorname*{Div}\left(  a,c\right)  $. Thus, Lemma
\ref{lem.ent.gcd.through-Divc} (applied to $\left(  a,b\right)  $ and $\left(
a,c\right)  $ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ and
$\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields $\gcd\left(
a,b\right)  =\gcd\left(  a,c\right)  $. This proves Proposition
\ref{prop.ent.gcd.props1} \textbf{(d)}.

\textbf{(e)} Let $a,b\in\mathbb{Z}$ be such that $a$ is positive. Then, Lemma
\ref{lem.ent.Div.props1} \textbf{(e)} yields $\operatorname*{Div}\left(
a,b\right)  =\operatorname*{Div}\left(  a,b\%a\right)  $. Thus, Lemma
\ref{lem.ent.gcd.through-Divc} (applied to $\left(  a,b\right)  $ and $\left(
a,b\%a\right)  $ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ and
$\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields $\gcd\left(
a,b\right)  =\gcd\left(  a,b\%a\right)  $. This proves Proposition
\ref{prop.ent.gcd.props1} \textbf{(e)}.

\textbf{(f)} Let $a,b\in\mathbb{Z}$. We must prove that $\gcd\left(
a,b\right)  \mid a$ and $\gcd\left(  a,b\right)  \mid b$.

If the two integers $a,b$ are all $0$, then this is
obvious\footnote{\textit{Proof.} Assume that $a,b$ are all $0$. Then,
$a=0=\gcd\left(  a,b\right)  \cdot0$, so that $\gcd\left(  a,b\right)  \mid
a$; similarly, $\gcd\left(  a,b\right)  \mid b$. Hence, we have proven that
$\gcd\left(  a,b\right)  \mid a$ and $\gcd\left(  a,b\right)  \mid b$ if the
integers $a,b$ are all $0$.}. Hence, for the rest of this proof, we WLOG
assume that $a,b$ are not all $0$. Thus, $\gcd\left(  a,b\right)  $ is defined
to be the largest element of the set $\operatorname*{Div}\left(  a,b\right)  $
(by Definition \ref{def.ent.gcd.gcd}). Hence, $\gcd\left(  a,b\right)  $ is an
element of this set $\operatorname*{Div}\left(  a,b\right)  $. In other words,
$\gcd\left(  a,b\right)  $ is a common divisor of $a$ and $b$ (by the
definition of $\operatorname*{Div}\left(  a,b\right)  $). In other words,
$\gcd\left(  a,b\right)  \mid a$ and $\gcd\left(  a,b\right)  \mid b$. This
proves Proposition \ref{prop.ent.gcd.props1} \textbf{(f)}.

\textbf{(g)} Let $a,b\in\mathbb{Z}$. Then, Lemma \ref{lem.ent.Div.props1}
\textbf{(g)} yields $\operatorname*{Div}\left(  -a,b\right)
=\operatorname*{Div}\left(  a,b\right)  $. Thus, Lemma
\ref{lem.ent.gcd.through-Divc} (applied to $\left(  -a,b\right)  $ and
$\left(  a,b\right)  $ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $
and $\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields $\gcd\left(
-a,b\right)  =\gcd\left(  a,b\right)  $. This proves Proposition
\ref{prop.ent.gcd.props1} \textbf{(g)}.

\textbf{(h)} Let $a,b\in\mathbb{Z}$. Then, Lemma \ref{lem.ent.Div.props1}
\textbf{(h)} yields $\operatorname*{Div}\left(  a,-b\right)
=\operatorname*{Div}\left(  a,b\right)  $. Thus, Lemma
\ref{lem.ent.gcd.through-Divc} (applied to $\left(  a,-b\right)  $ and
$\left(  a,b\right)  $ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $
and $\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields $\gcd\left(
a,-b\right)  =\gcd\left(  a,b\right)  $. This proves Proposition
\ref{prop.ent.gcd.props1} \textbf{(h)}.

\textbf{(i)} Let $a,b\in\mathbb{Z}$ satisfy $a\mid b$. From $a\mid b$, we
obtain $b\equiv0\operatorname{mod}a$. Hence, Proposition
\ref{prop.ent.gcd.props1} \textbf{(d)} (applied to $c=0$) yields $\gcd\left(
a,b\right)  =\gcd\left(  a,0\right)  =\left\vert a\right\vert $ (by
Proposition \ref{prop.ent.gcd.props1} \textbf{(a)}). This proves Proposition
\ref{prop.ent.gcd.props1} \textbf{(i)}.

\textbf{(j)} The empty list of integers $\left(  {}\right)  $ has the property
that all its entries are $0$ (indeed, this is vacuously true because it has no
entries at all). Thus, its greatest common divisor is defined to be $0$ (by
the \textquotedblleft If $b_{1},b_{2},\ldots,b_{k}$ are not all $0$%
\textquotedblright\ case of Definition \ref{def.ent.gcd.gcd}). In other words,
$\gcd\left(  {}\right)  =0$. This proves Proposition \ref{prop.ent.gcd.props1}
\textbf{(j)}.
\end{proof}

\begin{remark}
Proposition \ref{prop.ent.gcd.props1} \textbf{(c)} says that if we add a
multiple of $a$ to $b$, then $\gcd\left(  a,b\right)  $ does not change.
Similarly, if we add a multiple of $b$ to $a$, then $\gcd\left(  a,b\right)  $
does not change (i.e., we have $\gcd\left(  vb+a,b\right)  =\gcd\left(
a,b\right)  $ for all $a,b,v\in\mathbb{Z}$).

However, if we \textbf{simultaneously} add a multiple of $a$ to $b$ and a
multiple of $b$ to $a$, then $\gcd\left(  a,b\right)  $ may well change: i.e.,
we may have $\gcd\left(  vb+a,ua+b\right)  \neq\gcd\left(  a,b\right)  $ for
all $a,b,u,v\in\mathbb{Z}$. Examples are easy to find (just take $v=1$ and
$u=1$).
\end{remark}

Proposition \ref{prop.ent.gcd.props1} gives a quick way to compute
$\gcd\left(  a,b\right)  $ for two nonnegative integers $a$ and $b$, by
repeatedly applying division with remainder. For example, let us compute
$\gcd\left(  210,45\right)  $ as follows:%
\begin{align*}
\gcd\left(  210,45\right)   &  =\gcd\left(  45,210\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.ent.gcd.props1}
\textbf{(b)}}\right) \\
&  =\gcd\left(  45,\underbrace{210\%45}_{=30}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.ent.gcd.props1}
\textbf{(e)}}\right) \\
&  =\gcd\left(  45,30\right) \\
&  =\gcd\left(  30,45\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)}}\right) \\
&  =\gcd\left(  30,\underbrace{45\%30}_{=15}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.ent.gcd.props1}
\textbf{(e)}}\right) \\
&  =\gcd\left(  30,15\right) \\
&  =\gcd\left(  15,30\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)}}\right) \\
&  =\gcd\left(  15,\underbrace{30\%15}_{=0}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.ent.gcd.props1}
\textbf{(e)}}\right) \\
&  =\gcd\left(  15,0\right)  =\left\vert 15\right\vert
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.ent.gcd.props1}
\textbf{(a)}}\right) \\
&  =15.
\end{align*}
This method of computing $\gcd\left(  a,b\right)  $ is called the
\textit{Euclidean algorithm}, and is usually much faster than the divisors of
$a$ or the divisors of $b$ can be found!

The following exercise shows that the number $\gcd\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $ depends only on the \textbf{set} $\left\{  b_{1}%
,b_{2},\ldots,b_{k}\right\}  $, but not on the numbers $b_{1},b_{2}%
,\ldots,b_{k}$ themselves. Thus, for example, any integers $a$, $b$ and $c$
satisfy $\gcd\left(  a,b,c,a\right)  =\gcd\left(  c,a,b\right)  $ (since
$\left\{  a,b,c,a\right\}  =\left\{  c,a,b\right\}  $) and $\gcd\left(
a,a,b,a\right)  =\gcd\left(  a,b,b\right)  $ (since $\left\{  a,a,b,a\right\}
=\left\{  a,b,b\right\}  $).

\begin{exercise}
\label{exe.ent.gcd.set}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely many
integers. Let $c_{1},c_{2},\ldots,c_{\ell}$ be finitely many integers. Prove
that if%
\[
\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  =\left\{  c_{1},c_{2}%
,\ldots,c_{\ell}\right\}  ,
\]
then%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\gcd\left(  c_{1},c_{2}%
,\ldots,c_{\ell}\right)  .
\]

\end{exercise}

\subsubsection{Bezout's theorem}

The following fact about gcds is one of the most important facts in number theory:

\begin{theorem}
\label{thm.ent.gcd.bezout}Let $a$ and $b$ be two integers. Then, there exist
integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that%
\[
\gcd\left(  a,b\right)  =xa+yb.
\]

\end{theorem}

Theorem \ref{thm.ent.gcd.bezout} is often stated as follows: \textquotedblleft
If $a$ and $b$ are two integers, then $\gcd\left(  a,b\right)  $ is a
$\mathbb{Z}$-linear combination of $a$ and $b$\textquotedblright. The notion
\textquotedblleft$\mathbb{Z}$-linear combination of $a$ and $b$%
\textquotedblright\ simply means \textquotedblleft a number of the form
$xa+yb$ with $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$\textquotedblright\ (this is
exactly the notion of a \textquotedblleft linear combination\textquotedblright%
\ in linear algebra, except that now the scalars must come from $\mathbb{Z}$),
so this is just a restatement of Theorem \ref{thm.ent.gcd.bezout}.

\begin{teachingnote}
The following proof of Bezout's theorem is not quite the fastest, nor does it
generalize to polynomial rings over fields. Maybe replace it by another, which
uses division with remainder and induction on $\left\vert a\right\vert
+\left\vert b\right\vert $ (so no need to split into three steps). This is
also needed because I refer to the Extended Euclidean algorithm in the
computational parts, but I never explain how it works.
\end{teachingnote}

Theorem \ref{thm.ent.gcd.bezout} is known as \textit{Bezout's theorem} (or
\textit{Bezout's identity})\footnote{or \textit{Bezout's theorem for integers}
if you want to be more precise (as there are similar theorems for other
objects)}. We shall prove it in several steps. The first step is to show it
when $a$ and $b$ are nonnegative:

\begin{lemma}
\label{lem.ent.gcd.bezout.++}Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$. Then,
there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that%
\[
\gcd\left(  a,b\right)  =xa+yb.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.gcd.bezout.++}.]The following proof uses a
strategy similar to the Euclidean algorithm (making one of $a$ and $b$ smaller
repeatedly until one of $a$ and $b$ becomes $0$), and can in fact be viewed as
a \textquotedblleft protocol\textquotedblright\ of the algorithm\footnote{or,
rather, of a more primitive version of the Euclidean algorithm, in which we
apply not the full power of Proposition \ref{prop.ent.gcd.props1} \textbf{(e)}
but only the identity $\gcd\left(  a,b\right)  =\gcd\left(  a,b-a\right)  $}.

We use strong induction on $a+b$. Thus, we fix an $n\in\mathbb{N}$, and assume
(as induction hypothesis) that Lemma \ref{lem.ent.gcd.bezout.++} holds
whenever $a+b<n$. We must now prove that Lemma \ref{lem.ent.gcd.bezout.++}
holds whenever $a+b=n$.

We have assumed that Lemma \ref{lem.ent.gcd.bezout.++} holds whenever $a+b<n$.
In other words, the following statement holds:

\begin{statement}
\textit{Statement 1:} Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$ be such that
$a+b<n$. Then, there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such
that $\gcd\left(  a,b\right)  =xa+yb$.
\end{statement}

Now, we must prove that Lemma \ref{lem.ent.gcd.bezout.++} holds whenever
$a+b=n$. Let us first prove this in the case when $b\geq a$:

\begin{statement}
\textit{Statement 2:} Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$ be such that
$a+b=n$ and $b\geq a$. Then, there exist integers $x\in\mathbb{Z}$ and
$y\in\mathbb{Z}$ such that $\gcd\left(  a,b\right)  =xa+yb$.
\end{statement}

[\textit{Proof of Statement 2:} We are in one of the following two cases:

\textit{Case 1:} We have $a=0$.

\textit{Case 2:} We have $a\neq0$.

Let us first consider Case 1. In this case, we have $a=0$. Now, Proposition
\ref{prop.ent.gcd.props1} \textbf{(a)} (applied to $b$ instead of $a$) yields
$\gcd\left(  b,0\right)  =\gcd\left(  b\right)  =\left\vert b\right\vert
\in\left\{  b,-b\right\}  $. In other words, $\gcd\left(  b,0\right)  =ub$ for
some $u\in\left\{  1,-1\right\}  $. Consider this $u$. Now, Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)} yields%
\[
\gcd\left(  a,b\right)  =\gcd\left(  b,\underbrace{a}_{=0}\right)
=\gcd\left(  b,0\right)  =ub=0a+ub.
\]
Hence, there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that
$\gcd\left(  a,b\right)  =xa+yb$ (namely, $x=0$ and $y=u$). Thus, Statement 2
is proven in Case 1.

Let us next consider Case 2. In this case, we have $a\neq0$. Hence, $a>0$
(since $a\in\mathbb{N}$), so that $a+b>b$. Hence, $b<a+b=n$.

From $b\geq a$, we obtain $b-a\in\mathbb{N}$. Moreover, $a\in\mathbb{N}$ and
$b-a\in\mathbb{N}$ satisfy $a+\left(  b-a\right)  =b<n$. Therefore, we can
apply Statement 1 \textbf{to }$b-a$ \textbf{instead of }$b$. Thus we obtain
that there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that
$\gcd\left(  a,b-a\right)  =xa+y\left(  b-a\right)  $. Fix two such integers
$x$ and $y$, and denote them by $x_{0}$ and $y_{0}$. Thus, $x_{0}$ and $y_{0}$
are two integers such that $\gcd\left(  a,b-a\right)  =x_{0}a+y_{0}\left(
b-a\right)  $.

Also, Proposition \ref{prop.ent.gcd.props1} \textbf{(c)} (applied to $u=-1$)
yields $\gcd\left(  a,\left(  -1\right)  a+b\right)  =\gcd\left(  a,b\right)
$. Hence,%
\begin{align*}
\gcd\left(  a,b\right)   &  =\gcd\left(  a,\underbrace{\left(  -1\right)
a+b}_{=b-a}\right)  =\gcd\left(  a,b-a\right)  =x_{0}a+y_{0}\left(  b-a\right)
\\
&  =x_{0}a+y_{0}b-y_{0}a=\left(  x_{0}-y_{0}\right)  a+y_{0}b.
\end{align*}
Hence, there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that
$\gcd\left(  a,b\right)  =xa+yb$ (namely, $x=x_{0}-y_{0}$ and $y=y_{0}$).
Thus, Statement 2 is proven in Case 2.

We have now proven Statement 2 in both Cases 1 and 2. Hence, Statement 2 is
always proven.]

Now, we can prove that Lemma \ref{lem.ent.gcd.bezout.++} holds whenever
$a+b=n$:

\begin{statement}
\textit{Statement 3:} Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$ be such that
$a+b=n$. Then, there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such
that $\gcd\left(  a,b\right)  =xa+yb$.
\end{statement}

[\textit{Proof of Statement 3:} We are in one of the following two cases:

\textit{Case 1:} We have $b\geq a$.

\textit{Case 2:} We have $b<a$.

Let us first consider Case 1. In this case, we have $b\geq a$. Hence,
Statement 2 shows that there exist integers $x\in\mathbb{Z}$ and
$y\in\mathbb{Z}$ such that $\gcd\left(  a,b\right)  =xa+yb$. Thus, Statement 3
is proven in Case 1.

Let us next consider Case 2. In this case, we have $b<a$. Hence, $a>b$, so
that $a\geq b$. This shows that we can apply Statement 2 \textbf{to }%
$b$\textbf{ and }$a$ \textbf{instead of }$a$ \textbf{and }$b$. Thus we obtain
that there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that
$\gcd\left(  b,a\right)  =xb+ya$. Fix two such integers $x$ and $y$, and
denote them by $x_{0}$ and $y_{0}$. Thus, $x_{0}$ and $y_{0}$ are two integers
such that $\gcd\left(  b,a\right)  =x_{0}b+y_{0}a$. Now, Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)} yields $\gcd\left(  a,b\right)
=\gcd\left(  b,a\right)  =x_{0}b+y_{0}a=y_{0}a+x_{0}b$. Hence, there exist
integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that $\gcd\left(
a,b\right)  =xa+yb$ (namely, $x=y_{0}$ and $y=x_{0}$). Thus, Statement 3 is
proven in Case 2.

We have now proven Statement 3 in both Cases 1 and 2. Hence, Statement 3 is
always proven.]

By proving Statement 3, we have shown that Lemma \ref{lem.ent.gcd.bezout.++}
holds whenever $a+b=n$. This completes the induction step. Thus, Lemma
\ref{lem.ent.gcd.bezout.++} is proven by strong induction.
\end{proof}

Next, we shall prove Theorem \ref{thm.ent.gcd.bezout} when $a\in\mathbb{N}$
but $b$ may be negative:

\begin{lemma}
\label{lem.ent.gcd.bezout.+}Let $a\in\mathbb{N}$ and $b\in\mathbb{Z}$. Then,
there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that%
\[
\gcd\left(  a,b\right)  =xa+yb.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.gcd.bezout.+}.]We are in one of the following two cases:

\textit{Case 1:} We have $b\geq0$.

\textit{Case 2:} We have $b<0$.

Let us first consider Case 1. In this case, we have $b\geq0$. Thus,
$b\in\mathbb{N}$ (since $b\in\mathbb{Z}$). Therefore, Lemma
\ref{lem.ent.gcd.bezout.++} shows that there exist integers $x\in\mathbb{Z}$
and $y\in\mathbb{Z}$ such that $\gcd\left(  a,b\right)  =xa+yb$. Thus, Lemma
\ref{lem.ent.gcd.bezout.+} is proven in Case 1.

Let us now consider Case 2. In this case, we have $b<0$. Hence, $-b>0$, so
that $-b\in\mathbb{N}$ (since $-b\in\mathbb{Z}$). Therefore, Lemma
\ref{lem.ent.gcd.bezout.++} (applied to $-b$ instead of $b$) shows that there
exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that $\gcd\left(
a,-b\right)  =xa+y\left(  -b\right)  $. Fix such integers, and denote them by
$x_{0}$ and $y_{0}$. Thus, $x_{0}\in\mathbb{Z}$ and $y_{0}\in\mathbb{Z}$ are
integers such that $\gcd\left(  a,-b\right)  =x_{0}a+y_{0}\left(  -b\right)  $.

Now, Proposition \ref{prop.ent.gcd.props1} \textbf{(h)} yields $\gcd\left(
a,-b\right)  =\gcd\left(  a,b\right)  $. Hence,%
\[
\gcd\left(  a,b\right)  =\gcd\left(  a,-b\right)  =x_{0}a+y_{0}\left(
-b\right)  =x_{0}a+\left(  -y_{0}\right)  b.
\]
Hence, there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that
$\gcd\left(  a,b\right)  =xa+yb$ (namely, $x=x_{0}$ and $y=-y_{0}$). Thus,
Lemma \ref{lem.ent.gcd.bezout.+} is proven in Case 2.

We have now proven Lemma \ref{lem.ent.gcd.bezout.+} in both Cases 1 and 2.
Hence, Lemma \ref{lem.ent.gcd.bezout.+} is proven.
\end{proof}

Now, we can prove the whole Theorem \ref{thm.ent.gcd.bezout}:

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.bezout}.]Theorem \ref{thm.ent.gcd.bezout}
can be derived from Lemma \ref{lem.ent.gcd.bezout.+} in the same way as Lemma
\ref{lem.ent.gcd.bezout.+} was derived from Lemma \ref{lem.ent.gcd.bezout.++}
(except that this time, we have to distinguish between the cases $a\geq0$ and
$a<0$, and we have to use Proposition \ref{prop.ent.gcd.props1} \textbf{(g)}
instead of Proposition \ref{prop.ent.gcd.props1} \textbf{(h)}). Again, let us
give the detailed argument for the sake of completeness:

\begin{fineprint}
We are in one of the following two cases:

\textit{Case 1:} We have $a\geq0$.

\textit{Case 2:} We have $a<0$.

Let us first consider Case 1. In this case, we have $a\geq0$. Thus,
$a\in\mathbb{N}$ (since $a\in\mathbb{Z}$). Therefore, Lemma
\ref{lem.ent.gcd.bezout.+} shows that there exist integers $x\in\mathbb{Z}$
and $y\in\mathbb{Z}$ such that $\gcd\left(  a,b\right)  =xa+yb$. Thus, Theorem
\ref{thm.ent.gcd.bezout} is proven in Case 1.

Let us now consider Case 2. In this case, we have $a<0$. Hence, $-a>0$, so
that $-a\in\mathbb{N}$ (since $-a\in\mathbb{Z}$). Therefore, Lemma
\ref{lem.ent.gcd.bezout.+} (applied to $-a$ instead of $a$) shows that there
exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that $\gcd\left(
-a,b\right)  =x\left(  -a\right)  +yb$. Fix such integers, and denote them by
$x_{0}$ and $y_{0}$. Thus, $x_{0}\in\mathbb{Z}$ and $y_{0}\in\mathbb{Z}$ are
integers such that $\gcd\left(  -a,b\right)  =x_{0}\left(  -a\right)  +y_{0}b$.

Now, Proposition \ref{prop.ent.gcd.props1} \textbf{(g)} yields $\gcd\left(
-a,b\right)  =\gcd\left(  a,b\right)  $. Hence,%
\[
\gcd\left(  a,b\right)  =\gcd\left(  -a,b\right)  =x_{0}\left(  -a\right)
+y_{0}b=\left(  -x_{0}\right)  a+y_{0}b.
\]
Hence, there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that
$\gcd\left(  a,b\right)  =xa+yb$ (namely, $x=-x_{0}$ and $y=y_{0}$). Thus,
Theorem \ref{thm.ent.gcd.bezout} is proven in Case 2.

We have now proven Theorem \ref{thm.ent.gcd.bezout} in both Cases 1 and 2.
Hence, Theorem \ref{thm.ent.gcd.bezout} is proven.
\end{fineprint}
\end{proof}

\begin{exercise}
\label{exe.ent.gcd.an-1}Let $u$ be an integer.

\textbf{(a)} Prove that $u^{b}-1\equiv u^{a}-1\operatorname{mod}u^{b-a}-1$ for
any $a\in\mathbb{N}$ and $b\in\mathbb{N}$ satisfying $b\geq a$.

\textbf{(b)} Prove that $\gcd\left(  u^{a}-1,u^{b}-1\right)  =\left\vert
u^{\gcd\left(  a,b\right)  }-1\right\vert $ for all $a\in\mathbb{N}$ and
$b\in\mathbb{N}$.
\end{exercise}

\subsubsection{First applications of Bezout's theorem}

An important corollary of Theorem \ref{thm.ent.gcd.bezout} is the following fact:

\begin{theorem}
\label{thm.ent.gcd.uniprop}Let $a,b\in\mathbb{Z}$. Then:

\textbf{(a)} For each $m\in\mathbb{Z}$, we have the following logical
equivalence:%
\begin{equation}
\left(  m\mid a\ \text{and }m\mid b\right)  \ \Longleftrightarrow\ \left(
m\mid\gcd\left(  a,b\right)  \right)  . \label{eq.thm.ent.gcd.uniprop.equiv}%
\end{equation}


\textbf{(b)} The common divisors of $a$ and $b$ are precisely the divisors of
$\gcd\left(  a,b\right)  $.

\textbf{(c)} We have $\operatorname*{Div}\left(  a,b\right)
=\operatorname*{Div}\left(  \gcd\left(  a,b\right)  \right)  $.
\end{theorem}

The three parts of this theorem are saying the same thing from slightly
different perspectives; the importance of the theorem nevertheless justifies
this repetition. To prove the theorem, we first show the following:

\begin{lemma}
\label{lem.ent.gcd.uniprop}Let $m,a,b\in\mathbb{Z}$ be such that $m\mid a$ and
$m\mid b$. Then, $m\mid\gcd\left(  a,b\right)  $.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.gcd.uniprop}.]Theorem \ref{thm.ent.gcd.bezout}
shows that there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such
that%
\begin{equation}
\gcd\left(  a,b\right)  =xa+yb. \label{pf.lem.ent.gcd.uniprop.1}%
\end{equation}
Consider these $x$ and $y$. Now, $m\mid a\mid xa$, so that $xa\equiv
0\operatorname{mod}m$. Also, $m\mid b\mid yb$, thus $yb\equiv
0\operatorname{mod}m$. Adding the congruences $xa\equiv0\operatorname{mod}m$
and $yb\equiv0\operatorname{mod}m$ together, we find $xa+yb\equiv
0+0=0\operatorname{mod}m$; in other words, $m\mid xa+yb$. In view of
(\ref{pf.lem.ent.gcd.uniprop.1}), this rewrites as $m\mid\gcd\left(
a,b\right)  $. This proves Lemma \ref{lem.ent.gcd.uniprop}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.uniprop}.]\textbf{(a)} Let $m\in\mathbb{Z}%
$. In order to prove (\ref{eq.thm.ent.gcd.uniprop.equiv}), we need to prove
the \textquotedblleft$\Longrightarrow$\textquotedblright\ and
\textquotedblleft$\Longleftarrow$\textquotedblright\ directions of the
equivalence (\ref{eq.thm.ent.gcd.uniprop.equiv}). But this is easy: The
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction is just the
statement of Lemma \ref{lem.ent.gcd.uniprop}, whereas the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction is trivial (to wit: if
$m\mid\gcd\left(  a,b\right)  $, then
\[
m\mid\gcd\left(  a,b\right)  \mid a\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.ent.gcd.props1} \textbf{(f)}}\right)
\]
and%
\[
m\mid\gcd\left(  a,b\right)  \mid b\ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.ent.gcd.props1} \textbf{(f)}}\right)  ,
\]
and thus $\left(  m\mid a\ \text{and }m\mid b\right)  $). Hence, the
equivalence (\ref{eq.thm.ent.gcd.uniprop.equiv}) is proven. This proves
Theorem \ref{thm.ent.gcd.uniprop} \textbf{(a)}.

\textbf{(b)} The common divisors of $a$ and $b$ are precisely the integers $m$
that satisfy $\left(  m\mid a\text{ and }m\mid b\right)  $ (by the definition
of \textquotedblleft common divisor\textquotedblright). In view of the
equivalence (\ref{eq.thm.ent.gcd.uniprop.equiv}), this rewrites as follows:
The common divisors of $a$ and $b$ are precisely the integers $m$ that satisfy
$m\mid\gcd\left(  a,b\right)  $. In other words, the common divisors of $a$
and $b$ are precisely the divisors of $\gcd\left(  a,b\right)  $. This proves
Theorem \ref{thm.ent.gcd.uniprop} \textbf{(b)}.

\textbf{(c)} Recall that each $c\in\mathbb{Z}$ satisfies%
\begin{align*}
\operatorname*{Div}\left(  c\right)   &  =\left\{  \text{the common divisors
of }c\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}\operatorname*{Div}\left(  c\right)  \right) \\
&  =\left\{  \text{the integers }x\text{ such that }x\mid c\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of \textquotedblleft
common divisors\textquotedblright}\right) \\
&  =\left\{  \text{the divisors of }c\right\}  .
\end{align*}
Applying this to $c=\gcd\left(  a,b\right)  $, we obtain%
\begin{equation}
\operatorname*{Div}\left(  \gcd\left(  a,b\right)  \right)  =\left\{
\text{the divisors of }\gcd\left(  a,b\right)  \right\}  .
\label{pf.thm.ent.gcd.uniprop.c.1a}%
\end{equation}


The definition of $\operatorname*{Div}\left(  a,b\right)  $ yields%
\begin{align*}
\operatorname*{Div}\left(  a,b\right)   &  =\left\{  \text{the common divisors
of }a\text{ and }b\right\} \\
&  =\left\{  \text{the divisors of }\gcd\left(  a,b\right)  \right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.ent.gcd.uniprop}
\textbf{(b)}}\right) \\
&  =\operatorname*{Div}\left(  \gcd\left(  a,b\right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.ent.gcd.uniprop.c.1a}%
)}\right)  .
\end{align*}
This proves Theorem \ref{thm.ent.gcd.uniprop} \textbf{(c)}.
\end{proof}

The following corollary of Theorem \ref{thm.ent.gcd.bezout} lets us
\textquotedblleft combine\textquotedblright\ two divisibilities $a\mid c$ and
$b\mid c$. In fact, Proposition \ref{prop.ent.div.2} \textbf{(c)} would
already allow us to \textquotedblleft combine\textquotedblright\ them to form
$ab\mid cc=c^{2}$; but we can also \textquotedblleft combine\textquotedblright%
\ them to $ab\mid\gcd\left(  a,b\right)  \cdot c$ using the following fact:

\begin{theorem}
\label{thm.ent.gcd.combine}Let $a,b,c\in\mathbb{Z}$ satisfy $a\mid c$ and
$b\mid c$. Then, $ab\mid\gcd\left(  a,b\right)  \cdot c$.
\end{theorem}

\begin{example}
Let $a=6$ and $b=10$ and $c=30$. Then, $a=6\mid30=c$ and $b=10\mid30=c$. Thus,
Theorem \ref{thm.ent.gcd.combine} yields $ab\mid\gcd\left(  a,b\right)  \cdot
c$. And indeed, this is true, since $ab=6\cdot10\mid2\cdot30=\gcd\left(
a,b\right)  \cdot c$ (because $\gcd\left(  a,b\right)  =\gcd\left(
6,10\right)  =2$). Note that this latter divisibility is actually an equality:
we have $6\cdot10=2\cdot30$. Note also that we do \textbf{not} obtain $ab\mid
c$ (and indeed, this does not hold).
\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.combine}.]Theorem \ref{thm.ent.gcd.bezout}
yields that there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such
that $\gcd\left(  a,b\right)  =xa+yb$. Consider these $x$ and $y$.

We have $a\mid c$. In other words, there exists an integer $u$ such that
$c=au$. Consider this $u$.

We have $b\mid c$. In other words, there exists an integer $v$ such that
$c=bv$. Consider this $v$.

Now,%
\[
\underbrace{\gcd\left(  a,b\right)  }_{=xa+yb}\cdot c=\left(  xa+yb\right)
c=xa\underbrace{c}_{=bv}+yb\underbrace{c}_{=au}=xabv+ybau=ab\left(
xv+yu\right)  .
\]
Thus, there exists an integer $d$ such that $\gcd\left(  a,b\right)  \cdot
c=abd$ (namely, $d=xv+yu$). In other words, $ab\mid\gcd\left(  a,b\right)
\cdot c$. This proves Theorem \ref{thm.ent.gcd.combine}.
\end{proof}

Here is another corollary of Theorem \ref{thm.ent.gcd.bezout} whose usefulness
will become clearer later on:

\begin{theorem}
\label{thm.ent.gcd.cancel}Let $a,b,c\in\mathbb{Z}$ satisfy $a\mid bc$. Then,
$a\mid\gcd\left(  a,b\right)  \cdot c$.
\end{theorem}

At this point, you should see that Theorem \ref{thm.ent.gcd.cancel} allows
\textquotedblleft strengthening\textquotedblright\ divisibilities: You give it
a \textquotedblleft weak\textquotedblright\ divisibility $a\mid bc$, and
obtain a \textquotedblleft stronger\textquotedblright\ divisibility $a\mid
\gcd\left(  a,b\right)  \cdot c$ from it (stronger because $\gcd\left(
a,b\right)  $ is usually smaller than $b$).

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.cancel}.]Theorem \ref{thm.ent.gcd.bezout}
yields that there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such
that $\gcd\left(  a,b\right)  =xa+yb$. Consider these $x$ and $y$.

We have $a\mid bc\mid ybc$; in other words, $ybc\equiv0\operatorname{mod}a$.
Also, $a\mid axc$, so that $axc\equiv0\operatorname{mod}a$. Adding the two
congruences $axc\equiv0\operatorname{mod}a$ and $ybc\equiv0\operatorname{mod}%
a$ together, we obtain $axc+ybc\equiv0+0=0\operatorname{mod}a$. In view of
$axc+ybc=\underbrace{\left(  xa+yb\right)  }_{=\gcd\left(  a,b\right)  }%
c=\gcd\left(  a,b\right)  \cdot c$, this rewrites as $\gcd\left(  a,b\right)
\cdot c\equiv0\operatorname{mod}a$. In other words, $a\mid\gcd\left(
a,b\right)  \cdot c$. This proves Theorem \ref{thm.ent.gcd.cancel}.
\end{proof}

\begin{theorem}
\label{thm.ent.gcd.sa,sb}Let $s,a,b\in\mathbb{Z}$. Then,
\[
\gcd\left(  sa,sb\right)  =\left\vert s\right\vert \gcd\left(  a,b\right)  .
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.sa,sb}.]We shall prove that the two
integers $\gcd\left(  sa,sb\right)  $ and $s\gcd\left(  a,b\right)  $ mutually
divide each other (i.e., they satisfy $\gcd\left(  sa,sb\right)  \mid
s\gcd\left(  a,b\right)  $ and $s\gcd\left(  a,b\right)  \mid\gcd\left(
sa,sb\right)  $). Then, Exercise \ref{exe.ent.div.abba} will let us conclude
that $\left\vert \gcd\left(  sa,sb\right)  \right\vert =\left\vert
s\gcd\left(  a,b\right)  \right\vert $. This will then rewrite as $\gcd\left(
sa,sb\right)  =\left\vert s\right\vert \gcd\left(  a,b\right)  $, and we will
be done. (This trick is actually a common strategy for proving equalities
between gcds.)

Here is the argument in detail. For the sake of brevity, let us set
$g=\gcd\left(  sa,sb\right)  $ and $h=s\gcd\left(  a,b\right)  $. So our first
goal is to prove that $g\mid h$ and $h\mid g$.

\textit{Proof of }$g\mid h$\textit{:} Theorem \ref{thm.ent.gcd.bezout} yields
that there exist integers $x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that
$\gcd\left(  a,b\right)  =xa+yb$. Consider these $x$ and $y$.

Proposition \ref{prop.ent.gcd.props1} \textbf{(f)} (applied to $sa$ and $sb$
instead of $a$ and $b$) yields that $\gcd\left(  sa,sb\right)  \mid sa$ and
$\gcd\left(  sa,sb\right)  \mid sb$. From $g=\gcd\left(  sa,sb\right)  \mid
sa$, we obtain $g\mid sa\mid xsa$, thus $xsa\equiv0\operatorname{mod}g$.
Similarly, $ysb\equiv0\operatorname{mod}g$. Adding these two congruences
together, we find $xsa+ysb\equiv0\operatorname{mod}g$. Now,%
\[
h=s\underbrace{\gcd\left(  a,b\right)  }_{=xa+yb}=s\left(  xa+yb\right)
=xsa+ysb\equiv0\operatorname{mod}g.
\]
In other words, $g\mid h$. Thus, we have proven $g\mid h$.

\textit{Proof of }$h\mid g$\textit{:} Proposition \ref{prop.ent.gcd.props1}
\textbf{(f)} yields $\gcd\left(  a,b\right)  \mid a$ and $\gcd\left(
a,b\right)  \mid b$. Also, $s\mid s$. Hence, Proposition \ref{prop.ent.div.2}
\textbf{(c)} (applied to $s,\gcd\left(  a,b\right)  ,s,a$ instead of
$a_{1},a_{2},b_{1},b_{2}$) yields $s\gcd\left(  a,b\right)  \mid sa$.
Similarly, $s\gcd\left(  a,b\right)  \mid sb$. Hence, Lemma
\ref{lem.ent.gcd.uniprop} (applied to $s\gcd\left(  a,b\right)  $, $sa$ and
$sb$ instead of $m$, $a$ and $b$) yields $s\gcd\left(  a,b\right)  \mid
\gcd\left(  sa,sb\right)  $. In view of $g=\gcd\left(  sa,sb\right)  $ and
$h=s\gcd\left(  a,b\right)  $, this rewrites as $h\mid g$. So we have proven
$h\mid g$.

Now, Exercise \ref{exe.ent.div.abba} (applied to $g$ and $h$ instead of $a$
and $b$) yields $\left\vert g\right\vert =\left\vert h\right\vert $.

But recall that a gcd of any finitely many integers is nonnegative (by
Definition \ref{def.ent.gcd.gcd}). Hence, in particular, $\gcd\left(
a,b\right)  $ and $\gcd\left(  sa,sb\right)  $ are nonnegative. From
$g=\gcd\left(  sa,sb\right)  $, we obtain%
\[
\left\vert g\right\vert =\left\vert \gcd\left(  sa,sb\right)  \right\vert
=\gcd\left(  sa,sb\right)
\]
(since $\gcd\left(  sa,sb\right)  $ is nonnegative). Also, from $h=s\gcd
\left(  a,b\right)  $, we obtain%
\begin{align*}
\left\vert h\right\vert  &  =\left\vert s\gcd\left(  a,b\right)  \right\vert
=\left\vert s\right\vert \cdot\underbrace{\left\vert \gcd\left(  a,b\right)
\right\vert }_{\substack{=\gcd\left(  a,b\right)  \\\text{(since }\gcd\left(
a,b\right)  \\\text{is nonnegative)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.ent.div.abs(xy)})}\right) \\
&  =\left\vert s\right\vert \gcd\left(  a,b\right)  .
\end{align*}
Hence,
\[
\gcd\left(  sa,sb\right)  =\left\vert g\right\vert =\left\vert h\right\vert
=\left\vert s\right\vert \gcd\left(  a,b\right)  .
\]
This proves Theorem \ref{thm.ent.gcd.sa,sb}.
\end{proof}

\begin{exercise}
\label{exe.ent.gcd.div}Let $a_{1},a_{2},b_{1},b_{2}\in\mathbb{Z}$ satisfy
$a_{1}\mid b_{1}$ and $a_{2}\mid b_{2}$. Prove that%
\[
\gcd\left(  a_{1},a_{2}\right)  \mid\gcd\left(  b_{1},b_{2}\right)  .
\]

\end{exercise}

\begin{exercise}
\label{exe.ent.gcd.abs}Let $a,b\in\mathbb{Z}$.

\textbf{(a)} Prove that $\gcd\left(  a,\left\vert b\right\vert \right)
=\gcd\left(  a,b\right)  $.

\textbf{(b)} Prove that $\gcd\left(  \left\vert a\right\vert ,b\right)
=\gcd\left(  a,b\right)  $.

\textbf{(c)} Prove that $\gcd\left(  \left\vert a\right\vert ,\left\vert
b\right\vert \right)  =\gcd\left(  a,b\right)  $.
\end{exercise}

\subsubsection{gcds of multiple numbers}

\begin{teachingnote}
I am not sure how useful this section is for an algebra class. It probably is
used for the Smith normal form, but before that?
\end{teachingnote}

The following theorem generalizes some of the previous facts to gcds of
multiple integers:

\begin{theorem}
\label{thm.ent.gcd.uniprop-mul}Let $b_{1},b_{2},\ldots,b_{k}$ be integers.

\textbf{(a)} For each $m\in\mathbb{Z}$, we have the following logical
equivalence:%
\[
\left(  m\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,k\right\}  \right)
\ \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots
,b_{k}\right)  \right)  .
\]


\textbf{(b)} The common divisors of $b_{1},b_{2},\ldots,b_{k}$ are precisely
the divisors of $\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  $.

\textbf{(c)} We have $\operatorname*{Div}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  =\operatorname*{Div}\left(  \gcd\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  \right)  $.

\textbf{(d)} If $k>0$, then%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\gcd\left(  \gcd\left(
b_{1},b_{2},\ldots,b_{k-1}\right)  ,b_{k}\right)  .
\]

\end{theorem}

\begin{teachingnote}
The following proof generalizes badly to more general rings (even
$\mathbb{Z}\left[  i\right]  $ maybe?), as it uses inequalities.
\end{teachingnote}

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.uniprop-mul}.]Forget that we fixed
$b_{1},b_{2},\ldots,b_{k}$. Rather than prove the four parts of Theorem
\ref{thm.ent.gcd.uniprop-mul} separately, we shall prove them together as a package.

We shall proceed by induction on $k$:

\textit{Induction base:} Theorem \ref{thm.ent.gcd.uniprop-mul} holds for $k=0$.

\begin{fineprint}
[\textit{Proof:} This is a straightforward exercise in dealing with empty
sets, $0$-tuples and vacuous truths. For the sake of completeness, here is the
full argument:

Assume that $k=0$. We must prove that Theorem \ref{thm.ent.gcd.uniprop-mul} holds.

Let $b_{1},b_{2},\ldots,b_{k}$ be integers. Of course, these are $0$ integers,
since $k=0$.

We don't have $k>0$ (since $k=0$). Hence, Theorem
\ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} is vacuously true.

All of $b_{1},b_{2},\ldots,b_{k}$ are $0$ (indeed, this is vacuously true).
Thus, $\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =0$ (by Definition
\ref{def.ent.gcd.gcd}).

For each $m\in\mathbb{Z}$, we have the logical equivalence%
\begin{align*}
&  \ \left(  m\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,k\right\}
\right) \\
&  \Longleftrightarrow\ \left(  \text{truth}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since there exists no }i\in\left\{
1,2,\ldots,k\right\}  \right) \\
&  \Longleftrightarrow\ \left(  m\mid0\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }m\mid0\text{ is always true}\right) \\
&  \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots
,b_{k}\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }0=\gcd\left(
b_{1},b_{2},\ldots,b_{k}\right)  \right)  .
\end{align*}
This proves Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(a)} (in the case
$k=0$, that is). Parts \textbf{(b)} and \textbf{(c)} of Theorem
\ref{thm.ent.gcd.uniprop-mul} are restatements of Theorem
\ref{thm.ent.gcd.uniprop-mul} \textbf{(a)} and can be derived from it in the
same way as we derived parts \textbf{(b)} and \textbf{(c)} of Theorem
\ref{thm.ent.gcd.uniprop} from Theorem \ref{thm.ent.gcd.uniprop} \textbf{(a)}.

Thus, all four parts of Theorem \ref{thm.ent.gcd.uniprop-mul} are proven for
$k=0$. This completes the induction base.]
\end{fineprint}

\textit{Induction step:} Let $\ell$ be a positive integer. Assume that Theorem
\ref{thm.ent.gcd.uniprop-mul} holds for $k=\ell-1$. We must prove that Theorem
\ref{thm.ent.gcd.uniprop-mul} holds for $k=\ell$.

We have assumed that Theorem \ref{thm.ent.gcd.uniprop-mul} holds for
$k=\ell-1$. In other words, the following statement holds:

\begin{statement}
\textit{Statement 1:} Let $b_{1},b_{2},\ldots,b_{\ell-1}$ be integers.

\textbf{(a)} For each $m\in\mathbb{Z}$, we have the following logical
equivalence:%
\[
\left(  m\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,\ell-1\right\}
\right)  \ \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2}%
,\ldots,b_{\ell-1}\right)  \right)  .
\]


\textbf{(b)} The common divisors of $b_{1},b_{2},\ldots,b_{\ell-1}$ are
precisely the divisors of $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  $.

\textbf{(c)} We have $\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{\ell
-1}\right)  =\operatorname*{Div}\left(  \gcd\left(  b_{1},b_{2},\ldots
,b_{\ell-1}\right)  \right)  $.

\textbf{(d)} If $\ell-1>0$, then%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  =\gcd\left(  \gcd\left(
b_{1},b_{2},\ldots,b_{\left(  \ell-1\right)  -1}\right)  ,b_{\ell-1}\right)
.
\]

\end{statement}

Recall that we must prove that Theorem \ref{thm.ent.gcd.uniprop-mul} holds for
$k=\ell$. In other words, we must prove the following statement:

\begin{statement}
\textit{Statement 2:} Let $b_{1},b_{2},\ldots,b_{\ell}$ be integers.

\textbf{(a)} For each $m\in\mathbb{Z}$, we have the following logical
equivalence:%
\[
\left(  m\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,\ell\right\}
\right)  \ \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2}%
,\ldots,b_{\ell}\right)  \right)  .
\]


\textbf{(b)} The common divisors of $b_{1},b_{2},\ldots,b_{\ell}$ are
precisely the divisors of $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $.

\textbf{(c)} We have $\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{\ell
}\right)  =\operatorname*{Div}\left(  \gcd\left(  b_{1},b_{2},\ldots,b_{\ell
}\right)  \right)  $.

\textbf{(d)} If $\ell>0$, then%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  =\gcd\left(  \gcd\left(
b_{1},b_{2},\ldots,b_{\ell-1}\right)  ,b_{\ell}\right)  .
\]

\end{statement}

[\textit{Proof of Statement 2:} \textbf{(d)} Let us begin with part
\textbf{(d)}. Assume that $\ell>0$ (though we already know that this is true).

Let $c=\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  $.

Let $g=\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $ and $h=\gcd\left(
c,b_{\ell}\right)  $.

If the integers $b_{1},b_{2},\ldots,b_{\ell}$ are all $0$, then Statement 2
\textbf{(d)} holds\footnote{\textit{Proof.} Assume that $b_{1},b_{2}%
,\ldots,b_{\ell}$ are all $0$. Then, $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell
}\right)  =0$ (by Definition \ref{def.ent.gcd.gcd}). Moreover, $b_{1}%
,b_{2},\ldots,b_{\ell-1}$ are all $0$ (since $b_{1},b_{2},\ldots,b_{\ell}$ are
all $0$), and thus $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  =0$.
Finally, $b_{\ell}=0$ (since $b_{1},b_{2},\ldots,b_{\ell}$ are all $0$).
Comparing $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  =0$ with
$\gcd\left(  \underbrace{\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)
}_{=0},\underbrace{b_{\ell}}_{=0}\right)  =\gcd\left(  0,0\right)  =0$, we
obtain $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  =\gcd\left(
\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  ,b_{\ell}\right)  $. In
other words, Statement 2 \textbf{(d)} holds.}. Hence, for the rest of this
proof, we WLOG assume that the integers $b_{1},b_{2},\ldots,b_{\ell}$ are not
all $0$. Therefore, $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $ is the
largest element of the set $\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{\ell}\right)  $ (by Definition \ref{def.ent.gcd.gcd}). In other
words, $g$ is the largest element of the set $\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{\ell}\right)  $ (since $g=\gcd\left(  b_{1},b_{2}%
,\ldots,b_{\ell}\right)  $).

Furthermore, the two integers $c$ and $b_{\ell}$ are not all $0$%
\ \ \ \ \footnote{\textit{Proof.} Assume the contrary. Thus, both $c$ and
$b_{\ell}$ are $0$. Thus, in particular, $b_{\ell}=0$. If the $\ell-1$
integers $b_{1},b_{2},\ldots,b_{\ell-1}$ were all $0$, then the $\ell$
integers $b_{1},b_{2},\ldots,b_{\ell}$ would be all $0$ (since $b_{\ell}=0$),
which would contradict the fact that the integers $b_{1},b_{2},\ldots,b_{\ell
}$ are not all $0$. Hence, the $\ell-1$ integers $b_{1},b_{2},\ldots
,b_{\ell-1}$ are not all $0$. Thus, $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell
-1}\right)  $ is a positive integer (by Definition \ref{def.ent.gcd.gcd}).
Thus, $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  >0$, so that
$c=\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  >0$. But this contradicts
the fact that $c$ is $0$. This contradiction shows that our assumption was
false, qed.}. Hence, $\gcd\left(  c,b_{\ell}\right)  $ is the largest element
of the set $\operatorname*{Div}\left(  c,b_{\ell}\right)  $ (by Definition
\ref{def.ent.gcd.gcd}). In other words, $h$ is the largest element of the set
$\operatorname*{Div}\left(  c,b_{\ell}\right)  $ (since $h=\gcd\left(
c,b_{\ell}\right)  $).

We intend to show that $g=h$. For that, it suffices to prove $g\leq h$ and
$h\leq g$.

\textit{Proof of }$g\leq h$\textit{:} Recall that $g$ is the largest element
of the set $\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $.
Therefore, $g\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{\ell}\right)
$. In other words, $g$ is a common divisor of $b_{1},b_{2},\ldots,b_{\ell}$.
Hence, $g\mid b_{i}$ for each $i\in\left\{  1,2,\ldots,\ell\right\}  $. Thus,
in particular, $g\mid b_{i}$ for each $i\in\left\{  1,2,\ldots,\ell-1\right\}
$. But Statement 1 \textbf{(a)} (applied to $m=g$) shows that we have the
equivalence%
\[
\left(  g\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,\ell-1\right\}
\right)  \ \Longleftrightarrow\ \left(  g\mid\gcd\left(  b_{1},b_{2}%
,\ldots,b_{\ell-1}\right)  \right)  .
\]
Hence, we have $g\mid\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  $
(since we know that $g\mid b_{i}$ for all $i\in\left\{  1,2,\ldots
,\ell-1\right\}  $). In other words, $g\mid c$ (since $c=\gcd\left(
b_{1},b_{2},\ldots,b_{\ell-1}\right)  $). Combining this with $g\mid b_{\ell}%
$, we conclude that $g$ is a common divisor of $c$ and $b_{\ell}$. In other
words, $g\in\operatorname*{Div}\left(  c,b_{\ell}\right)  $. Therefore, $g\leq
h$ (since $h$ is the largest element of the set $\operatorname*{Div}\left(
c,b_{\ell}\right)  $).

\textit{Proof of }$h\leq g$\textit{:} Proposition \ref{prop.ent.gcd.props1}
\textbf{(f)} (applied to $a=c$ and $b=b_{\ell}$) shows that $\gcd\left(
c,b_{\ell}\right)  \mid c$ and $\gcd\left(  c,b_{\ell}\right)  \mid b_{\ell}$.
Thus,%
\begin{align*}
h  &  =\gcd\left(  c,b_{\ell}\right)  \mid c=\gcd\left(  b_{1},b_{2}%
,\ldots,b_{\ell-1}\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\\
h  &  =\gcd\left(  c,b_{\ell}\right)  \mid b_{\ell}.
\end{align*}


But Statement 1 \textbf{(a)} (applied to $m=h$) shows that we have the
equivalence%
\[
\left(  h\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,\ell-1\right\}
\right)  \ \Longleftrightarrow\ \left(  h\mid\gcd\left(  b_{1},b_{2}%
,\ldots,b_{\ell-1}\right)  \right)  .
\]
Thus, we have $\left(  h\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots
,\ell-1\right\}  \right)  $ (since we have \newline$h\mid\gcd\left(
b_{1},b_{2},\ldots,b_{\ell-1}\right)  $).

This divisibility $h\mid b_{i}$ holds not only for all $i\in\left\{
1,2,\ldots,\ell-1\right\}  $, but also for $i=\ell$ (because $h\mid b_{\ell}%
$). Thus, we conclude that $h\mid b_{i}$ for all $i\in\left\{  1,2,\ldots
,\ell\right\}  $. In other words, $h$ is a common divisor of $b_{1}%
,b_{2},\ldots,b_{\ell}$. In other words, $h\in\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{\ell}\right)  $. Thus, $h\leq g$ (since $g$ is the
largest element of the set $\operatorname*{Div}\left(  b_{1},b_{2}%
,\ldots,b_{\ell}\right)  $).

Combining $h\leq g$ with $g\leq h$, we obtain $g=h$. Comparing this with
$g=\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $, we obtain
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  =h=\gcd\left(  c,b_{\ell
}\right)  =\gcd\left(  \gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)
,b_{\ell}\right)
\]
(since $c=\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  $). Hence,
Statement 2 \textbf{(d)} is proven.

\textbf{(a)} Let $m\in\mathbb{Z}$. Then, we have the equivalence%
\begin{align*}
&  \ \left(  m\mid b_{i}\text{ for all }i\in\left\{  1,2,\ldots,\ell\right\}
\right) \\
&  \Longleftrightarrow\ \left(  \underbrace{\left(  m\mid b_{i}\text{ for all
}i\in\left\{  1,2,\ldots,\ell-1\right\}  \right)  }%
_{\substack{\Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2}%
,\ldots,b_{\ell-1}\right)  \right)  \\\text{(by Statement 1 \textbf{(a)})}%
}}\text{ and }m\mid b_{\ell}\right) \\
&  \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots,b_{\ell
-1}\right)  \text{ and }m\mid b_{\ell}\right) \\
&  \Longleftrightarrow\ \left(  m\mid\underbrace{\gcd\left(  \gcd\left(
b_{1},b_{2},\ldots,b_{\ell-1}\right)  ,b_{\ell}\right)  }_{\substack{=\gcd
\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  \\\text{(by Statement 2
\textbf{(d)}, which we have just proved)}}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.ent.gcd.uniprop}
\textbf{(a)}, applied to }a=\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)
\text{ and }b=b_{\ell}\right) \\
&  \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots,b_{\ell
}\right)  \right)  .
\end{align*}
Thus, Statement 2 \textbf{(a)} follows.

Statement 2 \textbf{(b)} is a restatement of Statement 2 \textbf{(a)} (in the
same way that Theorem \ref{thm.ent.gcd.uniprop} \textbf{(b)} is a restatement
of Theorem \ref{thm.ent.gcd.uniprop} \textbf{(a)}).

Statement 2 \textbf{(c)} is a restatement of Statement 2 \textbf{(b)} (in the
same way that Theorem \ref{thm.ent.gcd.uniprop} \textbf{(c)} is a restatement
of Theorem \ref{thm.ent.gcd.uniprop} \textbf{(b)}).]

We are thus done proving Statement 2.

In other words, we have proven that Theorem \ref{thm.ent.gcd.uniprop-mul}
holds for $k=\ell$. This completes the induction step. Thus, Theorem
\ref{thm.ent.gcd.uniprop-mul} is proven by induction.
\end{proof}

Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} is the reason why most
properties of gcds of multiple numbers can be derived from corresponding
properties of gcds of two numbers. For example, we can easily prove the
following analogue of Theorem \ref{thm.ent.gcd.sa,sb} for gcds of three numbers:

\begin{exercise}
\label{exe.ent.gcd.sa,sb,sc}Let $s,a,b,c\in\mathbb{Z}$. Prove that
$\gcd\left(  sa,sb,sc\right)  =\left\vert s\right\vert \gcd\left(
a,b,c\right)  $.
\end{exercise}

More generally, Theorem \ref{thm.ent.gcd.sa,sb} can be generalized to any
finite number of integers:

\begin{exercise}
\label{exe.ent.gcd.sak}Let $s\in\mathbb{Z}$, and let $a_{1},a_{2},\ldots
,a_{k}$ be integers. Prove that $\gcd\left(  sa_{1},sa_{2},\ldots
,sa_{k}\right)  =\left\vert s\right\vert \gcd\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $.
\end{exercise}

Bezout's theorem (Theorem \ref{thm.ent.gcd.bezout}) also holds for any finite
number of integers:

\begin{theorem}
\label{thm.ent.gcd.bezout-mul}Let $b_{1},b_{2},\ldots,b_{k}$ be integers.
Then, there exist integers $x_{1},x_{2},\ldots,x_{k}$ such that%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =x_{1}b_{1}+x_{2}b_{2}%
+\cdots+x_{k}b_{k}.
\]

\end{theorem}

Once again, we can restate Theorem \ref{thm.ent.gcd.bezout-mul} by using the
concept of a $\mathbb{Z}$-linear combination. Let us define this concept finally:

\begin{definition}
Let $b_{1},b_{2},\ldots,b_{k}$ be numbers. A $\mathbb{Z}$\textit{-linear
combination} of $b_{1},b_{2},\ldots,b_{k}$ shall mean a number of the form
$x_{1}b_{1}+x_{2}b_{2}+\cdots+x_{k}b_{k}$, where $x_{1},x_{2},\ldots,x_{k}$
are integers.
\end{definition}

Thus, Theorem \ref{thm.ent.gcd.bezout-mul} can be restated as follows:

\begin{theorem}
\label{thm.ent.gcd.bezout-mul'}Let $b_{1},b_{2},\ldots,b_{k}$ be integers.
Then, $\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ is a $\mathbb{Z}$-linear
combination of $b_{1},b_{2},\ldots,b_{k}$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.bezout-mul'}.]We shall prove this by
induction on $k$:

\textit{Induction base:} The empty list $\left(  {}\right)  $ satisfies
$\gcd\left(  {}\right)  =0$ (by Definition \ref{def.ent.gcd.gcd}, since all
entries of the empty list are $0$). But $0$ is a $\mathbb{Z}$-linear
combination of an empty list of numbers, because $0=\left(  \text{empty
sum}\right)  $. In other words, $\gcd\left(  {}\right)  $ is a $\mathbb{Z}%
$-linear combination of an empty list of numbers (since $\gcd\left(
{}\right)  =0$). But this is precisely the claim of Theorem
\ref{thm.ent.gcd.bezout-mul'} for $k=0$. Thus, Theorem
\ref{thm.ent.gcd.bezout-mul'} holds for $k=0$. This completes the induction base.

\textit{Induction step:} Let $\ell$ be a positive integer. Assume that Theorem
\ref{thm.ent.gcd.bezout-mul'} holds for $k=\ell-1$. We must prove that Theorem
\ref{thm.ent.gcd.bezout-mul'} holds for $k=\ell$.

We have assumed that Theorem \ref{thm.ent.gcd.bezout-mul'} holds for
$k=\ell-1$. In other words, the following statement holds:

\begin{statement}
\textit{Statement 1:} Let $b_{1},b_{2},\ldots,b_{\ell-1}$ be integers. Then,
$\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  $ is a $\mathbb{Z}$-linear
combination of $b_{1},b_{2},\ldots,b_{\ell-1}$.
\end{statement}

Our goal is to prove that Theorem \ref{thm.ent.gcd.bezout-mul'} holds for
$k=\ell$. In other words, we must prove the following statement:

\begin{statement}
\textit{Statement 2:} Let $b_{1},b_{2},\ldots,b_{\ell}$ be integers. Then,
$\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $ is a $\mathbb{Z}$-linear
combination of $b_{1},b_{2},\ldots,b_{\ell}$.
\end{statement}

\textit{Proof of Statement 2:} Statement 1 shows that $\gcd\left(  b_{1}%
,b_{2},\ldots,b_{\ell-1}\right)  $ is a $\mathbb{Z}$-linear combination of
$b_{1},b_{2},\ldots,b_{\ell-1}$. In other words, there exist $\ell-1$ integers
$y_{1},y_{2},\ldots,y_{\ell-1}$ such that%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  =y_{1}b_{1}+y_{2}%
b_{2}+\cdots+y_{\ell-1}b_{\ell-1}.
\]
Consider these $y_{1},y_{2},\ldots,y_{\ell-1}$.

Furthermore, Theorem \ref{thm.ent.gcd.bezout} (applied to $a=\gcd\left(
b_{1},b_{2},\ldots,b_{\ell-1}\right)  $ and $b=b_{\ell}$) yields that there
exist two integers $x$ and $y$ such that%
\[
\gcd\left(  \gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  ,b_{\ell
}\right)  =x\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  +yb_{\ell}.
\]
Consider these $x$ and $y$.

Now, $\ell>0$; thus, Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)}
(applied to $k=\ell$) yields%
\begin{align*}
\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)   &  =\gcd\left(  \gcd\left(
b_{1},b_{2},\ldots,b_{\ell-1}\right)  ,b_{\ell}\right) \\
&  =x\underbrace{\gcd\left(  b_{1},b_{2},\ldots,b_{\ell-1}\right)  }%
_{=y_{1}b_{1}+y_{2}b_{2}+\cdots+y_{\ell-1}b_{\ell-1}}+yb_{\ell}\\
&  =x\left(  y_{1}b_{1}+y_{2}b_{2}+\cdots+y_{\ell-1}b_{\ell-1}\right)
+yb_{\ell}\\
&  =xy_{1}b_{1}+xy_{2}b_{2}+\cdots+xy_{\ell-1}b_{\ell-1}+yb_{\ell}.
\end{align*}
This is clearly a $\mathbb{Z}$-linear combination of the $b_{1},b_{2}%
,\ldots,b_{\ell}$. Thus, $\gcd\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $ is
a $\mathbb{Z}$-linear combination of $b_{1},b_{2},\ldots,b_{\ell}$. So
Statement 2 is proven.

In other words, we have proven that Theorem \ref{thm.ent.gcd.bezout-mul'}
holds for $k=\ell$. This completes the induction step. Thus, Theorem
\ref{thm.ent.gcd.bezout-mul'} is proven by induction.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.bezout-mul}.]We have just proven Theorem
\ref{thm.ent.gcd.bezout-mul'}, which is a restatement of Theorem
\ref{thm.ent.gcd.bezout-mul}. Thus, Theorem \ref{thm.ent.gcd.bezout-mul} is
also proven.
\end{proof}

For future reference, let us restate Theorem \ref{thm.ent.gcd.uniprop-mul}
\textbf{(a)} as follows:

\begin{corollary}
\label{cor.ent.gcd.uniprop-mula}Let $b_{1},b_{2},\ldots,b_{k}$ be integers.
For each $m\in\mathbb{Z}$, we have the following logical equivalence:%
\[
\left(  m\mid b_{1}\text{ and }m\mid b_{2}\text{ and }\cdots\text{ and }m\mid
b_{k}\right)  \ \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  \right)  .
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.ent.gcd.uniprop-mula}.]Let $m\in\mathbb{Z}$.
Then, we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  m\mid b_{1}\text{ and }m\mid b_{2}\text{ and }\cdots\text{ and
}m\mid b_{k}\right) \\
&  \Longleftrightarrow\ \left(  m\mid b_{i}\text{ for all }i\in\left\{
1,2,\ldots,k\right\}  \right) \\
&  \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots
,b_{k}\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.ent.gcd.uniprop-mul} \textbf{(a)}}\right)  .
\end{align*}
This proves Corollary \ref{cor.ent.gcd.uniprop-mula}.
\end{proof}

\begin{theorem}
\label{thm.ent.gcd.split}Let $b_{1},b_{2},\ldots,b_{k}$ be integers, and let
$c_{1},c_{2},\ldots,c_{\ell}$ be integers. Then,%
\begin{align*}
&  \gcd\left(  b_{1},b_{2},\ldots,b_{k},c_{1},c_{2},\ldots,c_{\ell}\right) \\
&  =\gcd\left(  \gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  ,\gcd\left(
c_{1},c_{2},\ldots,c_{\ell}\right)  \right)  .
\end{align*}

\end{theorem}

Our proof of this theorem will rely on a simple trick, which we state as a lemma:

\begin{lemma}
\label{lem.ent.gcd.yoneda}Let $a$ and $b$ be two integers.

\textbf{(a)} If each $m\in\mathbb{Z}$ satisfies the implication $\left(  m\mid
a\right)  \Longrightarrow\left(  m\mid b\right)  $, then $a\mid b$.

\textbf{(b)} If each $m\in\mathbb{Z}$ satisfies the equivalence $\left(  m\mid
a\right)  \Longleftrightarrow\left(  m\mid b\right)  $, then $\left\vert
a\right\vert =\left\vert b\right\vert $.
\end{lemma}

Lemma \ref{lem.ent.gcd.yoneda} \textbf{(b)} says that the divisors of an
integer $a$ uniquely determine $\left\vert a\right\vert $ (that is, they
uniquely determine $a$ up to sign). Thus, when you want to prove that two
integers have the same absolute values, it suffices to prove that they have
the same divisors. If you know that your two integers are nonnegative, then
you can prove this way that they are equal (since their absolute values are
just themselves). This is exactly how we will prove that the left and right
hand sides in Theorem \ref{thm.ent.gcd.split} are equal.

\begin{proof}
[Proof of Lemma \ref{lem.ent.gcd.yoneda}.]\textbf{(a)} Assume that each
$m\in\mathbb{Z}$ satisfies the implication $\left(  m\mid a\right)
\Longrightarrow\left(  m\mid b\right)  $. Then, applying this to $m=a$, we
obtain the implication $\left(  a\mid a\right)  \Longrightarrow\left(  a\mid
b\right)  $. Since $a\mid a$ holds, we thus obtain $a\mid b$. This proves
Lemma \ref{lem.ent.gcd.yoneda} \textbf{(a)}.

\textbf{(b)} Assume that each $m\in\mathbb{Z}$ satisfies the equivalence
$\left(  m\mid a\right)  \Longleftrightarrow\left(  m\mid b\right)  $. Thus,
each $m\in\mathbb{Z}$ satisfies the implication $\left(  m\mid a\right)
\Longrightarrow\left(  m\mid b\right)  $ (since this implication is part of
the equivalence we just assumed). Thus, Lemma \ref{lem.ent.gcd.yoneda}
\textbf{(a)} yields $a\mid b$.

Recall again that each $m\in\mathbb{Z}$ satisfies the equivalence $\left(
m\mid a\right)  \Longleftrightarrow\left(  m\mid b\right)  $. Thus, each
$m\in\mathbb{Z}$ satisfies the implication $\left(  m\mid b\right)
\Longrightarrow\left(  m\mid a\right)  $ (since this implication is also part
of the equivalence). Hence, Lemma \ref{lem.ent.gcd.yoneda} \textbf{(a)}
(applied to $b$ and $a$ instead of $a$ and $b$) yields $b\mid a$.

Hence, Exercise \ref{exe.ent.div.abba} yields $\left\vert a\right\vert
=\left\vert b\right\vert $. This proves Lemma \ref{lem.ent.gcd.yoneda}
\textbf{(b)}.
\end{proof}

Lemma \ref{lem.ent.gcd.yoneda} is a simple case of what is known in category
theory as the \textit{Yoneda lemma}.

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.split}.]Let $m\in\mathbb{Z}$. Corollary
\ref{cor.ent.gcd.uniprop-mula} (applied to $k+\ell$ and \newline$\left(
b_{1},b_{2},\ldots,b_{k},c_{1},c_{2},\ldots,c_{\ell}\right)  $ instead of $k$
and $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $) shows that we have the
following equivalence:%
\begin{align*}
&  \ \left(  m\mid b_{1}\text{ and }m\mid b_{2}\text{ and }\cdots\text{ and
}m\mid b_{k}\text{ and }m\mid c_{1}\text{ and }m\mid c_{2}\text{ and }%
\cdots\text{ and }m\mid c_{\ell}\right) \\
&  \Longleftrightarrow\ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots
,b_{k},c_{1},c_{2},\ldots,c_{\ell}\right)  \right)  .
\end{align*}
Hence, we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots,b_{k},c_{1},c_{2}%
,\ldots,c_{\ell}\right)  \right) \\
\Longleftrightarrow\  &  \left(  m\mid b_{1}\text{ and }m\mid b_{2}\text{ and
}\cdots\text{ and }m\mid b_{k}\text{ and }m\mid c_{1}\text{ and }m\mid
c_{2}\text{ and }\cdots\text{ and }m\mid c_{\ell}\right) \\
\Longleftrightarrow\  &  \left(  \underbrace{\left(  m\mid b_{i}\text{ for all
}i\in\left\{  1,2,\ldots,k\right\}  \right)  }_{\substack{\Longleftrightarrow
\ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  \right)
\\\text{(by Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(a)})}}}\text{ and
}\underbrace{\left(  m\mid c_{i}\text{ for all }i\in\left\{  1,2,\ldots
,\ell\right\}  \right)  }_{\substack{\Longleftrightarrow\ \left(  m\mid
\gcd\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  \right)  \\\text{(by Theorem
\ref{thm.ent.gcd.uniprop-mul} \textbf{(a)},}\\\text{applied to }\ell\text{ and
}\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  \\\text{instead of }k\text{ and
}\left(  b_{1},b_{2},\ldots,b_{k}\right)  \text{)}}}\right) \\
\Longleftrightarrow\  &  \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots
,b_{k}\right)  \text{ and }m\mid\gcd\left(  c_{1},c_{2},\ldots,c_{\ell
}\right)  \right) \\
\Longleftrightarrow\  &  \left(  m\mid\gcd\left(  \gcd\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  ,\gcd\left(  c_{1},c_{2},\ldots,c_{\ell}\right)
\right)  \right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.ent.gcd.uniprop} \textbf{(a)},}\\
\text{applied to }a=\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  \text{ and
}b=\gcd\left(  c_{1},c_{2},\ldots,c_{\ell}\right)
\end{array}
\right)  .
\end{align*}


Now, forget that we fixed $m$. We thus have shown that each $m\in\mathbb{Z}$
satisfies the equivalence%
\begin{align*}
&  \ \left(  m\mid\gcd\left(  b_{1},b_{2},\ldots,b_{k},c_{1},c_{2}%
,\ldots,c_{\ell}\right)  \right) \\
&  \Longleftrightarrow\ \left(  m\mid\gcd\left(  \gcd\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  ,\gcd\left(  c_{1},c_{2},\ldots,c_{\ell}\right)
\right)  \right)  .
\end{align*}
Hence, Lemma \ref{lem.ent.gcd.yoneda} \textbf{(b)} (applied to $a=\gcd\left(
b_{1},b_{2},\ldots,b_{k},c_{1},c_{2},\ldots,c_{\ell}\right)  $ and
\newline$b=\gcd\left(  \gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)
,\gcd\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  \right)  $) yields%
\begin{align}
&  \left\vert \gcd\left(  b_{1},b_{2},\ldots,b_{k},c_{1},c_{2},\ldots,c_{\ell
}\right)  \right\vert \nonumber\\
&  =\left\vert \gcd\left(  \gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)
,\gcd\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  \right)  \right\vert .
\label{pf.thm.ent.gcd.split.abs-equal}%
\end{align}


But a gcd of integers is always nonnegative (by Definition
\ref{def.ent.gcd.gcd}); thus, the absolute value of a gcd is always this gcd
itself. Therefore, we can remove the absolute value signs on both sides of
(\ref{pf.thm.ent.gcd.split.abs-equal}). We thus obtain%
\[
\gcd\left(  b_{1},b_{2},\ldots,b_{k},c_{1},c_{2},\ldots,c_{\ell}\right)
=\gcd\left(  \gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  ,\gcd\left(
c_{1},c_{2},\ldots,c_{\ell}\right)  \right)  .
\]
This proves Theorem \ref{thm.ent.gcd.split}.
\end{proof}

\subsubsection{On converses of Bezout's theorem}

Some words of warning are in order. Theorem \ref{thm.ent.gcd.bezout} says that
if $a$ and $b$ are two integers, then $\gcd\left(  a, b \right)  $ is a
$\mathbb{Z}$-linear combination of $a$ and $b$. Note the indefinite article
``a'' here: There are (usually) many $\mathbb{Z}$-linear combinations of $a$
and $b$, but only one gcd. It is definitely not true that every $\mathbb{Z}%
$-linear combination of $a$ and $b$ must be $\gcd\left(  a, b \right)  $.
However, all these $\mathbb{Z}$-linear combinations are \textbf{multiples} of
the gcd, as the following (simple) proposition says:

\begin{proposition}
\label{prop.ent.gcd.bezout-conv}Let $a$ and $b$ be two integers. Then, any
integers $x$ and $y$ satisfy $\gcd\left(  a, b \right)  \mid xa + yb$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.gcd.bezout-conv}.]Let $x$ and $y$ be
integers. Let $g = \gcd\left(  a, b \right)  $. Thus, $g = \gcd\left(  a, b
\right)  \mid a$ (by Proposition \ref{prop.ent.gcd.props1} \textbf{(f)}).
Hence, $g \mid a \mid xa$ (since $xa = ax$). In other words, $xa \equiv0
\mod g$. Similarly, $yb \equiv0 \mod g$. Adding these two congruences
together, we obtain $xa + yb \equiv0 + 0 = 0 \mod g$. In other words, $g \mid
xa + yb$. In other words, $\gcd\left(  a, b \right)  \mid xa + yb$ (since $g =
\gcd\left(  a, b \right)  $). This proves Proposition
\ref{prop.ent.gcd.bezout-conv}.
\end{proof}

A similar proposition holds for $\mathbb{Z}$-linear combinations of any number
of integers $b_{1},b_{2},\ldots,b_{k}$.

\begin{teachingnote}
\textbf{2019-02-06 lecture}
\end{teachingnote}

\subsection{Coprime integers}

\subsubsection{Definition}

The concept of a gcd leads to one of the most important notions of number theory:

\begin{definition}
\label{def.ent.coprime.coprime}Let $a$ and $b$ be two integers. We say that
$a$ is \textit{coprime} to $b$ if and only if $\gcd\left(  a,b\right)  =1$.
\end{definition}

Instead of \textquotedblleft coprime\textquotedblright, some authors say
\textquotedblleft relatively prime\textquotedblright\ or even
\textquotedblleft prime\textquotedblright\ (but the latter language risks
confusion with a more standard notion of \textquotedblleft
prime\textquotedblright\ that we will see later on).

\begin{example}
\label{exa.ent.coprime.1}\textbf{(a)} The number $2$ is coprime to $3$, since
$\gcd\left(  2,3\right)  =1$.

\textbf{(b)} The number $6$ is not coprime to $15$, since $\gcd\left(
6,15\right)  =3\neq1$.

\textbf{(c)} Let $a$ be an integer. We claim (as a generalization of part
\textbf{(a)}) that the number $a$ is coprime to $a+1$. To prove this, we note
that%
\begin{align*}
\gcd\left(  a,\underbrace{a}_{=1a}+1\right)   &  =\gcd\left(  a,1a+1\right)
=\gcd\left(  a,1\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.ent.gcd.props1}
\textbf{(c)}, applied to }u=1\text{ and }b=1\right) \\
&  \mid1\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.ent.gcd.props1} \textbf{(f)}, applied to }b=1\right)  ,
\end{align*}
and thus $\gcd\left(  a,a+1\right)  =1$ (by Exercise \ref{exe.ent.div.g|1},
since $\gcd\left(  a,a+1\right)  $ is a nonnegative integer), which means that
$a$ is coprime to $a+1$.

\textbf{(d)} Let $a$ be an integer. When is $a$ coprime to $a+2$? If we try to
compute $\gcd\left(  a,a+2\right)  $, we find%
\begin{align*}
\gcd\left(  a,\underbrace{a}_{=1a}+2\right)   &  =\gcd\left(  a,1a+2\right)
=\gcd\left(  a,2\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.ent.gcd.props1}
\textbf{(c)}, applied to }u=1\text{ and }b=2\right)  .
\end{align*}
It remains to find $\gcd\left(  a,2\right)  $. Proposition
\ref{prop.ent.gcd.props1} \textbf{(f)} (applied to $b=2$) yields $\gcd\left(
a,2\right)  \mid a$ and $\gcd\left(  a,2\right)  \mid2$. Since $\gcd\left(
a,2\right)  $ is a nonnegative integer and is a divisor of $2$ (because
$\gcd\left(  a,2\right)  \mid2$), we see that $\gcd\left(  a,2\right)  $ must
be either $1$ or $2$ (since the only nonnegative divisors of $2$ are $1$ and
$2$). If $a$ is even, then $2$ is a common divisor of $a$ and $2$, and thus
must be the greatest common divisor of $a$ and $2$ (because a common divisor
of $a$ and $2$ cannot be greater than $2$); in other words, we have
$\gcd\left(  a,2\right)  =2$ in this case. On the other hand, if $a$ is odd,
then $2$ is not a common divisor of $a$ and $2$ (since $2$ does not divide
$a$), and thus cannot be the greatest common divisor of $a$ and $2$; hence, in
this case, we have $\gcd\left(  a,2\right)  \neq2$ and thus $\gcd\left(
a,2\right)  =1$. Summarizing, we conclude that%
\[
\gcd\left(  a,2\right)  =%
\begin{cases}
2, & \text{if }a\text{ is even};\\
1, & \text{if }a\text{ is odd.}%
\end{cases}
\]
Now, recall that $\gcd\left(  a,a+2\right)  =\gcd\left(  a,2\right)  =%
\begin{cases}
2, & \text{if }a\text{ is even};\\
1, & \text{if }a\text{ is odd.}%
\end{cases}
$ Hence, $a$ is coprime to $a+2$ if and only if $a$ is odd.
\end{example}

Following the book \cite{GKP}, we introduce a slightly quaint notation:

\begin{definition}
\label{def.ent.coprime.perp}Let $a$ and $b$ be two integers. We write
\textquotedblleft$a\perp b$\textquotedblright\ to signify that $a$ is coprime
to $b$.
\end{definition}

Note that the \textquotedblleft$\perp$\textquotedblright\ relation is symmetric:

\begin{proposition}
\label{prop.ent.coprime.perp-symm}Let $a$ and $b$ be two integers. Then,
$a\perp b$ if and only if $b\perp a$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.coprime.perp-symm}.]We have the following
chain of equivalences:%
\begin{align*}
\left(  a\perp b\right)  \  &  \Longleftrightarrow\ \left(  a\text{ is coprime
to }b\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
\textquotedblleft}\perp\text{\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \gcd\left(  a,b\right)  =1\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of \textquotedblleft
coprime\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \gcd\left(  b,a\right)  =1\right)
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since Proposition \ref{prop.ent.gcd.props1} \textbf{(b)}}\\
\text{yields }\gcd\left(  a,b\right)  =\gcd\left(  b,a\right)
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  b\text{ is coprime to }a\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of \textquotedblleft
coprime\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  b\perp a\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of \textquotedblleft}\perp\text{\textquotedblright%
}\right)  .
\end{align*}
This proves Proposition \ref{prop.ent.coprime.perp-symm}.
\end{proof}

\begin{definition}
Let $a$ and $b$ be two integers. Proposition \ref{prop.ent.coprime.perp-symm}
shows that $a$ is coprime to $b$ if and only if $b$ is coprime to $a$. Hence,
we shall sometimes use a more symmetric terminology for this situation: We
shall say that \textquotedblleft$a$ and $b$ \textit{are coprime}%
\textquotedblright\ to mean that $a$ is coprime to $b$ (or, equivalently, that
$b$ is coprime to $a$).
\end{definition}

\begin{exercise}
\label{exe.ent.coprime.01}Let $a\in\mathbb{Z}$. Prove the following:

\textbf{(a)} We have $1\perp a$.

\textbf{(b)} We have $0\perp a$ if and only if $\left\vert a\right\vert =1$.
\end{exercise}

\subsubsection{Properties of coprime integers}

We can now state multiple theorems about coprime numbers. The first one states
that we can \textquotedblleft cancel\textquotedblright\ a factor $b$ from a
divisibility $a\mid bc$ as long as this factor is coprime to $a$:

\begin{theorem}
\label{thm.ent.coprime.cancel}Let $a,b,c\in\mathbb{Z}$ satisfy $a\mid bc$ and
$a\perp b$. Then, $a\mid c$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.coprime.cancel}.]We have $a\perp b$; in other
words, $a$ is coprime to $b$ (by Definition \ref{def.ent.coprime.perp}). In
other words, $\gcd\left(  a,b\right)  =1$ (by the definition of
\textquotedblleft coprime\textquotedblright). Now, Theorem
\ref{thm.ent.gcd.cancel} yields $a\mid\underbrace{\gcd\left(  a,b\right)
}_{=1}\cdot c=c$. This proves Theorem \ref{thm.ent.coprime.cancel}.
\end{proof}

I like to think of Theorem \ref{thm.ent.coprime.combine} as a way of removing
\textquotedblleft unsolicited guests\textquotedblright\ from divisibilities.
Indeed, it says that we can remove the factor $b$ from $a\mid bc$ if we know
that $b$ is \textquotedblleft unrelated\textquotedblright\ (i.e., coprime) to
$a$.

The next theorem lets us \textquotedblleft combine\textquotedblright\ two
divisibilities $a\mid c$ and $b\mid c$ to $ab\mid c$ as long as $a$ and $b$
are coprime:

\begin{theorem}
\label{thm.ent.coprime.combine}Let $a,b,c\in\mathbb{Z}$ satisfy $a\mid c$ and
$b\mid c$ and $a\perp b$. Then, $ab\mid c$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.coprime.combine}.]We have $a\perp b$; in other
words, $a$ is coprime to $b$ (by Definition \ref{def.ent.coprime.perp}). In
other words, $\gcd\left(  a,b\right)  =1$ (by the definition of
\textquotedblleft coprime\textquotedblright). Now, Theorem
\ref{thm.ent.gcd.combine} yields $ab\mid\underbrace{\gcd\left(  a,b\right)
}_{=1}\cdot c=c$. This proves Theorem \ref{thm.ent.coprime.combine}.
\end{proof}

Theorem \ref{thm.ent.coprime.combine} can be restated as follows: If $a$ and
$b$ are two coprime divisors of an integer $c$, then $ab$ is also a divisor of
$c$. This is often helpful when proving divisibilities where the left hand
side (i.e., the number in front of the \textquotedblleft$\mid$%
\textquotedblright\ sign) can be split into a product of two mutually coprime
factors. Similar reasoning works with several coprime factors (see Exercise
\ref{exe.ent.coprime.combinek} below).

The next theorem (still part of the fallout of Bezout's theorem) is important,
but we will not truly appreciate it until later:

\begin{theorem}
\label{thm.ent.coprime.modinv}Let $a,n\in\mathbb{Z}$.

\textbf{(a)} There exists an $a^{\prime}\in\mathbb{Z}$ such that $aa^{\prime
}\equiv\gcd\left(  a,n\right)  \operatorname{mod}n$.

\textbf{(b)} If $a\perp n$, then there exists an $a^{\prime}\in\mathbb{Z}$
such that $aa^{\prime}\equiv1\operatorname{mod}n$.

\textbf{(c)} If there exists an $a^{\prime}\in\mathbb{Z}$ such that
$aa^{\prime}\equiv1\operatorname{mod}n$, then $a\perp n$.
\end{theorem}

If $a,n\in\mathbb{Z}$, then an integer $a^{\prime}\in\mathbb{Z}$ satisfying
$aa^{\prime}\equiv1\operatorname{mod}n$ is called a \textit{modular inverse}
of $a$ modulo $n$. The word \textquotedblleft modular
inverse\textquotedblright\ is chosen in analogy to the usual concept of an
\textquotedblleft inverse\textquotedblright\ in $\mathbb{Z}$ (which stands for
an integer $a^{\prime}\in\mathbb{Z}$ satisfying $aa^{\prime}=1$; this exists
if and only if $a$ equals $1$ or $-1$). Theorem \ref{thm.ent.coprime.modinv}
\textbf{(b)} shows that such a modular inverse always exists when $a\perp n$;
Theorem \ref{thm.ent.coprime.modinv} \textbf{(c)} is the converse of this
statement (i.e., it says that if a modular inverse of $a$ modulo $n$ exists,
then $a\perp n$).

\begin{proof}
[Proof of Theorem \ref{thm.ent.coprime.modinv}.]\textbf{(a)} Theorem
\ref{thm.ent.gcd.bezout} (applied to $b=n$) yields that there exist integers
$x\in\mathbb{Z}$ and $y\in\mathbb{Z}$ such that $\gcd\left(  a,n\right)
=xa+yn$. Consider these $x$ and $y$. We have $ax=xa\equiv
xa+yn\operatorname{mod}n$ (since $xa-\left(  xa+yn\right)  =-yn=n\left(
-y\right)  $ is clearly divisible by $n$). Thus, $ax\equiv xa+yn=\gcd\left(
a,n\right)  \operatorname{mod}n$. Thus, there exists an $a^{\prime}%
\in\mathbb{Z}$ such that $aa^{\prime}\equiv\gcd\left(  a,n\right)
\operatorname{mod}n$ (namely, $a^{\prime}=x$). This proves Theorem
\ref{thm.ent.coprime.modinv} \textbf{(a)}.

\textbf{(b)} Assume that $a\perp n$. In other words, $a$ is coprime to $n$ (by
Definition \ref{def.ent.coprime.perp}). In other words, $\gcd\left(
a,n\right)  =1$ (by the definition of \textquotedblleft
coprime\textquotedblright). Now, Theorem \ref{thm.ent.coprime.modinv}
\textbf{(a)} yields that there exists an $a^{\prime}\in\mathbb{Z}$ such that
$aa^{\prime}\equiv\gcd\left(  a,n\right)  \operatorname{mod}n$. In view of
$\gcd\left(  a,n\right)  =1$, this rewrites as follows: There exists an
$a^{\prime}\in\mathbb{Z}$ such that $aa^{\prime}\equiv1\operatorname{mod}n$.
This proves Theorem \ref{thm.ent.coprime.modinv} \textbf{(b)}.

\textbf{(c)} Assume that there exists an $a^{\prime}\in\mathbb{Z}$ such that
$aa^{\prime}\equiv1\operatorname{mod}n$. Consider this $a^{\prime}$.

Proposition \ref{prop.ent.gcd.props1} \textbf{(f)} yields $\gcd\left(
a,n\right)  \mid a$ and $\gcd\left(  a,n\right)  \mid n$. Set $g=\gcd\left(
a,n\right)  $. Then, $g$ is a nonnegative integer.

Now, $g=\gcd\left(  a,n\right)  \mid a\mid aa^{\prime}$, so that $aa^{\prime
}\equiv0\operatorname{mod}g$. But also $g=\gcd\left(  a,n\right)  \mid n$.
Hence, from $aa^{\prime}\equiv1\operatorname{mod}n$, we obtain $aa^{\prime
}\equiv1\operatorname{mod}g$ (by Proposition \ref{prop.ent.mod.basics}
\textbf{(e)}, applied to $g$, $aa^{\prime}$ and $1$ instead of $m$, $a$ and
$b$). Hence, $1\equiv aa^{\prime}\equiv0\operatorname{mod}g$. Equivalently,
$g\mid1-0=1$. Hence, $g=1$ (by Exercise \ref{exe.ent.div.g|1}, since $g$ is a
nonnegative integer). Thus, $\gcd\left(  a,n\right)  =g=1$. In other words,
$a$ is coprime to $n$. In other words, $a\perp n$. This proves Theorem
\ref{thm.ent.coprime.modinv} \textbf{(c)}.
\end{proof}

\begin{theorem}
\label{thm.ent.coprime.ab-to-c}Let $a,b,c\in\mathbb{Z}$ such that $a\perp c$
and $b\perp c$. Then, $ab\perp c$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.coprime.ab-to-c}.]Theorem
\ref{thm.ent.coprime.modinv} \textbf{(b)} (applied to $n=c$) yields that there
exists an $a^{\prime}\in\mathbb{Z}$ such that $aa^{\prime}\equiv
1\operatorname{mod}c$. Consider this $a^{\prime}$.

Theorem \ref{thm.ent.coprime.modinv} \textbf{(b)} (applied to $b$ and $c$
instead of $a$ and $n$) yields that there exists a $b^{\prime}\in\mathbb{Z}$
such that $bb^{\prime}\equiv1\operatorname{mod}c$. Consider this $b^{\prime}$.

Multiplying the two congruences $aa^{\prime}\equiv1\operatorname{mod}c$ and
$bb^{\prime}\equiv1\operatorname{mod}c$, we obtain $\left(  aa^{\prime
}\right)  \left(  bb^{\prime}\right)  \equiv1\cdot1=1\operatorname{mod}c$.

Now, define the integers $r=ab$ and $s=a^{\prime}b^{\prime}$. Then,
$\underbrace{r}_{=ab}\underbrace{s}_{=a^{\prime}b^{\prime}}=\left(  ab\right)
\left(  a^{\prime}b^{\prime}\right)  =\left(  aa^{\prime}\right)  \left(
bb^{\prime}\right)  \equiv1\operatorname{mod}c$. Hence, there exists an
$r^{\prime}\in\mathbb{Z}$ such that $rr^{\prime}\equiv1\operatorname{mod}c$
(namely, $r^{\prime}=s$). Thus, Theorem \ref{thm.ent.coprime.modinv}
\textbf{(c)} (applied to $r$ and $c$ instead of $a$ and $n$) yields that
$r\perp c$. In view of $r=ab$, this rewrites as $ab\perp c$. This proves
Theorem \ref{thm.ent.coprime.ab-to-c}.
\end{proof}

Let us generalize Theorem \ref{thm.ent.coprime.ab-to-c} to products of several
numbers instead of just the two numbers $a$ and $b$:

\begin{exercise}
\label{exe.ent.coprime.ab-to-ck}Let $c\in\mathbb{Z}$. Let $a_{1},a_{2}%
,\ldots,a_{k}$ be integers such that each $i\in\left\{  1,2,\ldots,k\right\}
$ satisfies $a_{i}\perp c$. Prove that $a_{1}a_{2}\cdots a_{k}\perp c$.
\end{exercise}

We can similarly generalize Theorem \ref{thm.ent.coprime.combine} to show that
the product of several mutually coprime divisors of an integer $c$ must again
be a divisor of $c$:

\begin{exercise}
\label{exe.ent.coprime.combinek}Let $c\in\mathbb{Z}$. Let $b_{1},b_{2}%
,\ldots,b_{k}$ be integers that are mutually coprime (i.e., they satisfy
$b_{i}\perp b_{j}$ for all $i\neq j$). Assume that $b_{i}\mid c$ for each
$i\in\left\{  1,2,\ldots,k\right\}  $. Prove that $b_{1}b_{2}\cdots b_{k}\mid
c$.
\end{exercise}

\begin{exercise}
\label{exe.ent.coprime.powers}Let $a,b\in\mathbb{Z}$ be such that $a\perp b$.
Let $n,m\in\mathbb{N}$. Prove that $a^{n}\perp b^{m}$.
\end{exercise}

The above results have one important application to congruences. Recall that
if $a,b,c$ are integers satisfying $ab=ac$, then we can \textquotedblleft
cancel\textquotedblright\ $a$ from the equality $ab=ac$ to obtain $b=c$ as
long as $a$ is nonzero. Something similar is true for congruences modulo $n$,
but the condition \textquotedblleft$a$ is nonzero\textquotedblright\ has to be
replaced by \textquotedblleft$a$ is coprime to $n$\textquotedblright:

\begin{lemma}
\label{lem.ent.coprime.cancel}Let $a,b,c,n$ be integers such that $a\perp n$
and $ab\equiv ac\operatorname{mod}n$. Then, $b\equiv c\operatorname{mod}n$.
\end{lemma}

Lemma \ref{lem.ent.coprime.cancel} says that we can cancel an integer $a$ from
a congruence $ab\equiv ac\operatorname{mod}n$ as long as $a$ is coprime to
$n$. Let us give two proofs of this lemma, to illustrate the uses of some of
the previous results:

\begin{proof}
[First proof of Lemma \ref{lem.ent.coprime.cancel}.]We have $ab\equiv
ac\operatorname{mod}n$. In other words, $n\mid ab-ac=a\left(  b-c\right)  $.
But Proposition \ref{prop.ent.coprime.perp-symm} (applied to $n$ instead of
$b$) shows that $a\perp n$ if and only if $n\perp a$. Thus, we have $n\perp a$
(since $a\perp n$).

Thus, we know that $n\mid a\left(  b-c\right)  $ and $n\perp a$. Hence,
Theorem \ref{thm.ent.coprime.cancel} (applied to $n$, $a$ and $b-c$ instead of
$a$, $b$ and $c$) yields $n\mid b-c$. In other words, $b\equiv
c\operatorname{mod}n$. This proves Lemma \ref{lem.ent.coprime.cancel}.
\end{proof}

\begin{proof}
[Second proof of Lemma \ref{lem.ent.coprime.cancel}.]Theorem
\ref{thm.ent.coprime.modinv} \textbf{(b)} yields that there exists an
$a^{\prime}\in\mathbb{Z}$ such that $aa^{\prime}\equiv1\operatorname{mod}n$
(since $a\perp n$). Consider this $a^{\prime}$. Then, $a^{\prime}a=aa^{\prime
}\equiv1\operatorname{mod}n$. Now, let us multiply the (trivial) congruence
$a^{\prime}\equiv a^{\prime}\operatorname{mod}n$ with the congruence $ab\equiv
ac\operatorname{mod}n$. We thus find%
\[
a^{\prime}ab\equiv\underbrace{a^{\prime}a}_{\equiv1\operatorname{mod}n}%
c\equiv1c=c\operatorname{mod}n.
\]
Hence,
\[
c\equiv\underbrace{a^{\prime}a}_{\equiv1\operatorname{mod}n}b\equiv
1b=b\operatorname{mod}n.
\]
In other words, $b\equiv c\operatorname{mod}n$. This proves Lemma
\ref{lem.ent.coprime.cancel}.
\end{proof}

For future use, let us restate Exercise \ref{exe.ent.coprime.ab-to-ck} in a
form that uses \textquotedblleft unordered\textquotedblright\ finite products
$\prod_{i\in I}b_{i}$ instead of $a_{1}a_{2}\cdots a_{k}$:

\begin{exercise}
\label{exe.ent.coprime.ab-to-cI}Let $c\in\mathbb{Z}$. Let $I$ be a finite set.
For each $i\in I$, let $b_{i}$ be an integer such that $b_{i}\perp c$. Prove
that $\prod_{i\in I}b_{i}\perp c$.
\end{exercise}

\begin{exercise}
\label{exe.ent.coprime.b==c}Let $a,b,c$ be three integers such that $a\equiv
b\operatorname{mod}c$. Prove that if $a\perp c$, then $b\perp c$.
\end{exercise}

\begin{exercise}
\label{exe.ent.coprime.b-a}Let $a,b\in\mathbb{Z}$. Prove that $b-a\perp b$
holds if and only if $a\perp b$.
\end{exercise}

\subsubsection{An application to sums of powers}

Let us show an application of Theorem \ref{thm.ent.coprime.combine}. First, we
shall prove a simple lemma:

\begin{lemma}
\label{lem.ent.xd-yd}Let $d\in\mathbb{N}$. Let $x$ and $y$ be integers.

\textbf{(a)} We have $x-y\mid x^{d}-y^{d}$.

\textbf{(b)} We have $x+y\mid x^{d}+y^{d}$ if $d$ is odd.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.xd-yd}.]\textbf{(a)} Here are two ways of proving this:

\textit{First proof of Lemma \ref{lem.ent.xd-yd} \textbf{(a)}:} We have
$x\equiv y\operatorname{mod}x-y$ (since $x-y\mid x-y$). Thus, Exercise
\ref{exe.ent.mod.basics.k-power} (applied to $n=x-y$, $a=x$, $b=y$ and $k=d$)
yields $x^{d}\equiv y^{d}\operatorname{mod}x-y$. In other words, $x-y\mid
x^{d}-y^{d}$. This proves Lemma \ref{lem.ent.xd-yd} \textbf{(a)}.

\textit{Second proof of Lemma \ref{lem.ent.xd-yd} \textbf{(a)}:} Recall that%
\begin{equation}
\left(  a-b\right)  \left(  a^{k-1}+a^{k-2}b+a^{k-3}b^{2}+\cdots
+ab^{k-2}+b^{k-1}\right)  =a^{k}-b^{k} \label{pf.lem.ent.xd-yd.1}%
\end{equation}
for every $a,b\in\mathbb{Q}$ and $k\in\mathbb{N}$. (This is a well-known
identity, and it appears (with $k$ renamed as $n$) as the first half of
Exercise 1 on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.)
Applying this identity to $a=x$, $b=y$ and $k=d$, we obtain%
\[
\left(  x-y\right)  \left(  x^{d-1}+x^{d-2}y+x^{d-3}y^{2}+\cdots
+xy^{d-2}+y^{d-1}\right)  =x^{d}-y^{d}.
\]
Thus, $x-y\mid x^{d}-y^{d}$ (since $x^{d-1}+x^{d-2}y+x^{d-3}y^{2}%
+\cdots+xy^{d-2}+y^{d-1}$ is an integer). This proves Lemma
\ref{lem.ent.xd-yd} \textbf{(a)}.

\textbf{(b)} Assume that $d$ is odd. Thus, $\left(  -1\right)  ^{d}=-1$. Now,
Lemma \ref{lem.ent.xd-yd} \textbf{(a)} (applied to $-y$ instead of $y$) yields
$x-\left(  -y\right)  \mid x^{d}-\left(  -y\right)  ^{d}$. Since $x-\left(
-y\right)  =x+y$ and $x^{d}-\underbrace{\left(  -y\right)  ^{d}}_{=\left(
-1\right)  ^{d}y^{d}}=x^{d}-\underbrace{\left(  -1\right)  ^{d}}_{=-1}%
y^{d}=x^{d}-\left(  -1\right)  y^{d}=x^{d}+y^{d}$, this rewrites as $x+y\mid
x^{d}+y^{d}$. This proves Lemma \ref{lem.ent.xd-yd} \textbf{(b)}.
\end{proof}

Next, let us recall a basic fact from combinatorics (the \textquotedblleft
Little Gauss\textquotedblright\ sum):

\begin{proposition}
\label{prop.ent.1+2+...+n}Let $n\in\mathbb{N}$. Then,
\[
1+2+\cdots+n=\dfrac{n\left(  n+1\right)  }{2}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.1+2+...+n}.]Here is one of several equally
valid arguments:%
\begin{align*}
2\cdot\left(  1+2+\cdots+n\right)   &  =\left(  1+2+\cdots+n\right)
+\underbrace{\left(  1+2+\cdots+n\right)  }_{\substack{=n+\left(  n-1\right)
+\cdots+1\\\text{(here, we have reversed}\\\text{the order of the addends)}%
}}\\
&  =\underbrace{\left(  1+2+\cdots+n\right)  }_{=\sum_{k=1}^{n}k}%
+\underbrace{\left(  n+\left(  n-1\right)  +\cdots+1\right)  }_{=\sum
_{k=1}^{n}\left(  n+1-k\right)  }\\
&  =\sum_{k=1}^{n}k+\sum_{k=1}^{n}\left(  n+1-k\right)  =\sum_{k=1}%
^{n}\underbrace{\left(  k+\left(  n+1-k\right)  \right)  }_{=n+1}\\
&  =\sum_{k=1}^{n}\left(  n+1\right)  =n\left(  n+1\right)  .
\end{align*}
Thus, $1+2+\cdots+n=\dfrac{n\left(  n+1\right)  }{2}$, so that Proposition
\ref{prop.ent.1+2+...+n} is proven.
\end{proof}

Proposition \ref{prop.ent.1+2+...+n} tells us what the sum $1+2+\cdots+n$ of
the first $n$ positive integers is. One might also ask what the sum
$1^{2}+2^{2}+\cdots+n^{2}$ of their squares is, and similarly for higher
powers. While this is tangential to our course, let us collect some formulas
for this:

\begin{proposition}
\label{prop.ent.1d+2d+...+nd-for-5}Let $n\in\mathbb{N}$. Then:

\textbf{(a)} We have $1+2+\cdots+n=\dfrac{1}{2}n\left(  n+1\right)  $.

\textbf{(b)} We have $1^{2}+2^{2}+\cdots+n^{2}=\dfrac{1}{6}n\left(
n+1\right)  \left(  2n+1\right)  $.

\textbf{(c)} We have $1^{3}+2^{3}+\cdots+n^{3}=\dfrac{1}{4}n^{2}\left(
n+1\right)  ^{2}$.

\textbf{(d)} We have $1^{4}+2^{4}+\cdots+n^{4}=\dfrac{1}{30}n\left(
2n+1\right)  \left(  n+1\right)  \left(  3n+3n^{2}-1\right)  $.

\textbf{(e)} We have $1^{5}+2^{5}+\cdots+n^{5}=\dfrac{1}{12}n^{2}\left(
n+1\right)  ^{2}\left(  2n+2n^{2}-1\right)  $.
\end{proposition}

Each part of Proposition \ref{prop.ent.1d+2d+...+nd-for-5} can be
straightforwardly proven by induction on $n$; we don't need ingenious
arguments like the one we gave above for Proposition \ref{prop.ent.1+2+...+n}
(and in fact, such arguments cannot always be found).

\begin{fineprint}
You probably see a pattern in Proposition \ref{prop.ent.1d+2d+...+nd-for-5}:
It appears that for each positive integer $d$, there exists some polynomial
$p_{d}\left(  x\right)  $ of degree $d+1$ with rational coefficients such that
each $n\in\mathbb{N}$ satisfies $1^{d}+2^{d}+\cdots+n^{d}=p_{d}\left(
n\right)  $. This is indeed the case. Indeed, this is proven (e.g.) in
\cite[Proposition 23.2]{Galvin} and in \cite[Theorem 3.7]{lucas}. The
polynomial $p_{d}\left(  x\right)  $ is uniquely determined for each $d$, and
can be explicitly computed via the formula%
\[
p_{d}\left(  x\right)  =\sum_{k=1}^{d}k!%
%TCIMACRO{\QDATOPD{\{}{\}}{d}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{d}{k}%
%EndExpansion
\dbinom{x+1}{k+1},
\]
where $\dbinom{x+1}{k+1}=\dfrac{\left(  x+1\right)  x\left(  x-1\right)
\cdots\left(  x-k+1\right)  }{\left(  k+1\right)  !}$ and where $%
%TCIMACRO{\QDATOPD{\{}{\}}{d}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{d}{k}%
%EndExpansion
$ is a \textit{Stirling number of the 2nd kind}. Without going into the
details of what Stirling numbers of the 2nd kind are, let me say that $k!%
%TCIMACRO{\QDATOPD{\{}{\}}{d}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{d}{k}%
%EndExpansion
$ is the number of surjective maps from $\left\{  1,2,\ldots,d\right\}  $ to
$\left\{  1,2,\ldots,k\right\}  $. For example,%
\begin{align*}
p_{2}\left(  x\right)   &  =\sum_{k=1}^{2}k!%
%TCIMACRO{\QDATOPD{\{}{\}}{2}{k}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{2}{k}%
%EndExpansion
\dbinom{x+1}{k+1}=\underbrace{1!%
%TCIMACRO{\QDATOPD{\{}{\}}{2}{1}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{2}{1}%
%EndExpansion
}_{=1}\dbinom{x+1}{2}+\underbrace{2!%
%TCIMACRO{\QDATOPD{\{}{\}}{2}{2}}%
%BeginExpansion
\genfrac{\{}{\}}{0pt}{0}{2}{2}%
%EndExpansion
}_{=2}\dbinom{x+1}{3}\\
&  =\dbinom{x+1}{2}+2\dbinom{x+1}{3}=\dfrac{\left(  x+1\right)  x}{2}%
+2\cdot\dfrac{\left(  x+1\right)  x\left(  x-1\right)  }{6}\\
&  =\dfrac{1}{6}x\left(  x+1\right)  \left(  2x+1\right)  ,
\end{align*}
and thus%
\[
1^{2}+2^{2}+\cdots+n^{2}=p_{2}\left(  n\right)  =\dfrac{1}{6}n\left(
n+1\right)  \left(  2n+1\right)  \ \ \ \ \ \ \ \ \ \ \text{for each }%
n\in\mathbb{N}.
\]
This recovers the claim of Proposition \ref{prop.ent.1d+2d+...+nd-for-5}
\textbf{(b)}. The combinatorial proof presented in \cite[Proposition
23.2]{Galvin} is highly recommended reading for anyone interested in this kind
of formulas.

Let us note that the polynomials $p_{d}\left(  x\right)  $ do \textbf{not}
have integer coefficients, but nevertheless all their values $p_{d}\left(
n\right)  $ for $n\in\mathbb{N}$ are integers.
\end{fineprint}

Let us now show the power of Theorem \ref{thm.ent.coprime.combine} on the
following exercise:

\begin{exercise}
\label{exe.ent.coprime.1+2+...+n}Let $n\in\mathbb{N}$. Let $d$ be an odd
positive integer. Prove that%
\[
1+2+\cdots+n\mid1^{d}+2^{d}+\cdots+n^{d}.
\]


[\textbf{Hint:} Use Proposition \ref{prop.ent.1+2+...+n} to reduce the claim
to proving that $n\left(  n+1\right)  \mid2\left(  1^{d}+2^{d}+\cdots
+n^{d}\right)  $. But Theorem \ref{thm.ent.coprime.combine} shows that in
order to prove this, it suffices to prove $n\mid2\left(  1^{d}+2^{d}%
+\cdots+n^{d}\right)  $ and $n+1\mid2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)
$, because $n\perp n+1$.]
\end{exercise}

\subsubsection{More properties of gcds and coprimality}

The following is a random collection of further exercises on gcds.

\begin{exercise}
\label{exe.ent.coprime.bezout-conv} Let $a,b,x,y$ be integers such that
$xa+yb=1$. Prove that $a\perp b$.
\end{exercise}

\begin{exercise}
\label{exe.ent.coprime.gcdgcd1}Let $u,v,x,y\in\mathbb{Z}$. Prove that
$\gcd\left(  u,v\right)  \cdot\gcd\left(  x,y\right)  =\gcd\left(
ux,uy,vx,vy\right)  $.
\end{exercise}

\begin{exercise}
\label{exe.ent.coprime.gcdgcd2}Let $a,b,c\in\mathbb{Z}$.

\textbf{(a)} Prove that $\gcd\left(  a,b\right)  \cdot\gcd\left(  a,c\right)
=\gcd\left(  ag,bc\right)  $, where $g=\gcd\left(  a,b,c\right)  $.

\textbf{(b)} Prove that $\gcd\left(  a,b\right)  \cdot\gcd\left(  a,c\right)
=\gcd\left(  a,bc\right)  $ if $b\perp c$.
\end{exercise}

\begin{exercise}
\label{exe.ent.coprime.a/g}Let $a$ and $b$ be two integers that are not both
zero. Let $g=\gcd\left(  a,b\right)  $. Prove that $\dfrac{a}{g}$ and
$\dfrac{b}{g}$ are integers satisfying $\dfrac{a}{g}\perp\dfrac{b}{g}$.
\end{exercise}

\begin{exercise}
\label{exe.ent.gcd.akbk}Let $a$ and $b$ be two integers. Let $k\in\mathbb{N}$.
Prove that $\gcd\left(  a^{k},b^{k}\right)  =\left(  \gcd\left(  a,b\right)
\right)  ^{k}$.
\end{exercise}

The next exercise is simply claiming the well-known fact that any rational
number can be written as a reduced fraction:

\begin{exercise}
\label{exe.ent.coprime.frac-red}Let $r\in\mathbb{Q}$. Prove that there exist
two \textbf{coprime} integers $a$ and $b$ satisfying $r=a/b$.
\end{exercise}

As an application of some of the preceding results, we can prove that certain
numbers are irrational:

\begin{exercise}
\label{exe.ent.coprime.sqrtu+sqrtv}Prove the following:

\textbf{(a)} If a positive integer $u$ is not a perfect square\footnotemark,
then $\sqrt{u}$ is irrational.

\textbf{(b)} If $u$ and $v$ are two positive integers, then $\sqrt{u}+\sqrt
{v}$ is irrational unless both $u$ and $v$ are perfect squares.
\end{exercise}

\footnotetext{A \textit{perfect square} means the square of an integer.}%
Exercise \ref{exe.ent.coprime.sqrtu+sqrtv} invites a rather natural
generalization: If $u_{1},u_{2},\ldots,u_{k}$ are several positive integers
that are not all perfect squares, then must $\sqrt{u_{1}}+\sqrt{u_{2}}%
+\cdots+\sqrt{u_{k}}$ always be irrational? It turns out that the answer is
\textquotedblleft yes\textquotedblright, but this is not as easy to prove
anymore as the two cases $k=1$ and $k=2$ that we handled in Exercise
\ref{exe.ent.coprime.sqrtu+sqrtv}. Proofs of the general version can be found
in \cite{Boreic08} (actually, a stronger statement is proven there, although
it takes some work to derive ours from it).

Let us generalize Exercise \ref{exe.ent.coprime.gcdgcd1} a bit:

\begin{exercise}
\label{exe.ent.coprime.gcdgcd1k}Let $x,y\in\mathbb{Z}$, and let $a_{1}%
,a_{2},\ldots,a_{k}$ be finitely many integers. Prove that
\[
\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  \cdot\gcd\left(  x,y\right)
=\gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x,a_{1}y,a_{2}y,\ldots,a_{k}y\right)
.
\]

\end{exercise}

We can extend this exercise further to several integers instead of $x$ and
$y$, but this extension would be notationally awkward, so we only state it for
the case of three integers:

\begin{exercise}
\label{exe.ent.coprime.gcdgcd1k3}Let $x,y,z\in\mathbb{Z}$, and let
$a_{1},a_{2},\ldots,a_{k}$ be finitely many integers. Prove that
\begin{align*}
&  \gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  \cdot\gcd\left(  x,y,z\right)
\\
&  =\gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x,a_{1}y,a_{2}y,\ldots,a_{k}%
y,a_{1}z,a_{2}z,\ldots,a_{k}z\right)  .
\end{align*}

\end{exercise}

We leave it to the reader to state and solve an exercise generalizing Exercise
\ref{exe.ent.coprime.gcdgcd1k} and Exercise \ref{exe.ent.coprime.gcdgcd1k3}.

\begin{exercise}
\label{exe.ent.coprime.gcd-distrib1}Let $a,b,c\in\mathbb{Z}$. Prove that%
\[
\gcd\left(  b,c\right)  \cdot\gcd\left(  c,a\right)  \cdot\gcd\left(
a,b\right)  =\gcd\left(  a,b,c\right)  \cdot\gcd\left(  bc,ca,ab\right)  .
\]

\end{exercise}

\begin{exercise}
\label{exe.ent.sum1xy-eng}Let $n$ be a positive integer. Let $\left[
n\right]  $ denote the set $\left\{  1,2,\ldots,n\right\}  $. Let $Z$ be the
set of all pairs $\left(  x,y\right)  \in\left[  n\right]  ^{2}$ satisfying
$x\perp y$ and $x+y>n$. (For example, if $n=5$, then%
\[
Z=\left\{  \left(  1,5\right)  ,\left(  2,5\right)  ,\left(  3,4\right)
,\left(  3,5\right)  ,\left(  4,3\right)  ,\left(  4,5\right)  ,\left(
5,1\right)  ,\left(  5,2\right)  ,\left(  5,3\right)  ,\left(  5,4\right)
\right\}  \text{. )}%
\]
Prove that%
\[
\sum\limits_{\left(  x,y\right)  \in Z}\ \ \dfrac{1}{xy}=1.
\]

\end{exercise}

\begin{teachingnote}
\textbf{2019-02-08 lecture}
\end{teachingnote}

\subsection{Lowest common multiples}

\begin{teachingnote}
I don't think this section is actually used anywhere later in this course.
\end{teachingnote}

Common multiples are, in a sense, a \textquotedblleft mirror
version\textquotedblright\ of common divisors. Here is their definition:

\begin{definition}
\label{def.ent.Mul}Let $b_{1},b_{2},\ldots,b_{k}$ be integers. Then, the
\textit{common multiples} of $b_{1},b_{2},\ldots,b_{k}$ are defined to be the
integers $a$ that satisfy%
\[
\left(  b_{i}\mid a\text{ for all }i\in\left\{  1,2,\ldots,k\right\}  \right)
.
\]
(In other words, a \textit{common multiple} of $b_{1},b_{2},\ldots,b_{k}$ is
an integer that is a multiple of each of $b_{1},b_{2},\ldots,b_{k}$.) We let
$\operatorname*{Mul}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ denote the set
of these common multiples.
\end{definition}

\begin{example}
The common multiples of $4,6$ are $\ldots,-36,-24,-12,0,12,24,36,\ldots$, that
is, all multiples of $12$.

The common multiples of $1,2,3$ are all multiples of $6$.
\end{example}

Note that the common multiples of a single integer $b$ are simply the
multiples of $b$. (Also, the common multiples of an empty list of integers are
all the integers; in other words, $\operatorname*{Mul}\left(  {}\right)
=\mathbb{Z}$.)

Note that the definition of common multiples of $b_{1},b_{2},\ldots,b_{k}$
(Definition \ref{def.ent.Mul}) is the same as the definition of common
divisors of $b_{1},b_{2},\ldots,b_{k}$ except that the divisibility has been
flipped (i.e., it says \textquotedblleft$b_{i}\mid a$\textquotedblright%
\ instead of \textquotedblleft$a\mid b_{i}$\textquotedblright). This is why
common multiples are a \textquotedblleft mirror version\textquotedblright\ of
common divisors. This analogy is not perfect -- in particular, (for example)
two nonzero integers have infinitely many common multiples but only finitely
many common divisors. We shall now introduce lowest common multiples, which
correspond to greatest common divisors in this analogy. However, we have to
prove a simple proposition first:

\begin{proposition}
\label{prop.ent.Mul.exi}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely many
nonzero integers. Then, the set $\operatorname*{Mul}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $ has a smallest positive element.
\end{proposition}

Proposition \ref{prop.ent.Mul.exi} is similar to Proposition
\ref{prop.ent.Div.fin} (and will play a similar role), but note the
differences: It requires \textbf{all} of $b_{1},b_{2},\ldots,b_{k}$ to be
nonzero (unlike Proposition \ref{prop.ent.Div.fin}, which needed only one of
them to be nonzero), and it does not claim finiteness of any set.

\begin{proof}
[Proof of Proposition \ref{prop.ent.Mul.exi}.]We claim that%
\begin{equation}
\left\vert b_{1}b_{2}\cdots b_{k}\right\vert \in\operatorname*{Mul}\left(
b_{1},b_{2},\ldots,b_{k}\right)  . \label{pf.prop.ent.Mul.exi.1}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.ent.Mul.exi.1}):} Let $i\in\left\{
1,2,\ldots,k\right\}  $. Then, the product $b_{1}b_{2}\cdots b_{k}$ can be
written as%
\[
b_{1}b_{2}\cdots b_{k}=b_{i}\cdot\left(  b_{1}b_{2}\cdots b_{i-1}%
b_{i+1}b_{i+2}\cdots b_{k}\right)  ,
\]
and thus is divisible by $b_{i}$. In other words, $b_{i}\mid b_{1}b_{2}\cdots
b_{k}$. But Exercise \ref{exe.ent.div.aabs} \textbf{(a)} (applied to
$a=b_{1}b_{2}\cdots b_{k}$) yields $b_{1}b_{2}\cdots b_{k}\mid\left\vert
b_{1}b_{2}\cdots b_{k}\right\vert $. Altogether, $b_{i}\mid b_{1}b_{2}\cdots
b_{k}\mid\left\vert b_{1}b_{2}\cdots b_{k}\right\vert $.

Now forget that we fixed $i$. We thus have proven that $b_{i}\mid\left\vert
b_{1}b_{2}\cdots b_{k}\right\vert $ for all $i\in\left\{  1,2,\ldots
,k\right\}  $. In other words, $\left\vert b_{1}b_{2}\cdots b_{k}\right\vert $
is a common multiple of $b_{1},b_{2},\ldots,b_{k}$ (by the definition of a
\textquotedblleft common multiple\textquotedblright). In other words,
\newline$\left\vert b_{1}b_{2}\cdots b_{k}\right\vert \in\operatorname*{Mul}%
\left(  b_{1},b_{2},\ldots,b_{k}\right)  $. This proves
(\ref{pf.prop.ent.Mul.exi.1}).]

We know that $b_{1},b_{2},\ldots,b_{k}$ are nonzero integers. Hence, their
product $b_{1}b_{2}\cdots b_{k}$ is a nonzero integer as well. Thus, its
absolute value $\left\vert b_{1}b_{2}\cdots b_{k}\right\vert $ is a positive
integer. Hence, $\left\vert b_{1}b_{2}\cdots b_{k}\right\vert $ is a positive
element of $\operatorname*{Mul}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $
(since (\ref{pf.prop.ent.Mul.exi.1}) shows that it is an element of
$\operatorname*{Mul}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $). Thus, the set
$\operatorname*{Mul}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ has a positive
element. Therefore, this set $\operatorname*{Mul}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $ has a \textbf{smallest} positive element as
well\footnote{Here we are using the following basic fact: If a set of integers
$S$ has a positive element, then it has a \textbf{smallest} positive element
as well. (To prove this fact, you can fix a positive element $s\in S$, which
exists by assumption; then, the set $\left\{  1,2,\ldots,s\right\}  \cap S$ is
finite and nonempty (since it contains $s$), and thus clearly has a smallest
element; now you can easily check that its smallest element must also be the
smallest positive element of $S$.)}. This proves Proposition
\ref{prop.ent.Mul.exi}.
\end{proof}

\begin{definition}
\label{def.ent.lcm.lcm}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely many
integers. The \textit{lowest common multiple} of $b_{1},b_{2},\ldots,b_{k}$ is
defined as follows:

\begin{itemize}
\item If $b_{1},b_{2},\ldots,b_{k}$ are all nonzero, then it is defined as the
smallest positive element of the set $\operatorname*{Mul}\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $. This smallest positive element is well-defined
(by Proposition \ref{prop.ent.Mul.exi}), and is a positive integer (obviously).

\item If $b_{1},b_{2},\ldots,b_{k}$ are not all nonzero (i.e., at least one of
$b_{1},b_{2},\ldots,b_{k}$ is zero), then it is defined to be $0$.
\end{itemize}

Thus, in either case, this lowest common multiple is a nonnegative integer. We
denote it by $\operatorname{lcm}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $.
(Some authors also call it $\left[  b_{1},b_{2},\ldots,b_{k}\right]  $.)

We shall also use the word \textquotedblleft\textit{lcm}\textquotedblright\ as
shorthand for \textquotedblleft lowest common multiple\textquotedblright.
\end{definition}

Some authors say \textquotedblleft\textit{least common multiple}%
\textquotedblright\ instead of \textquotedblleft lowest common
multiple\textquotedblright.

We are slightly abusing the word \textquotedblleft lowest common
multiple\textquotedblright, of course; it would be more precise to say
\textquotedblleft lowest \textbf{positive} common multiple\textquotedblright,
and even this would only hold for the case when $b_{1},b_{2},\ldots,b_{k}$ are
all nonzero. Taken literally, a \textquotedblleft lowest common
multiple\textquotedblright\ of $2$ and $3$ would not exist, since $2$ and $3$
have infinitely many negative common multiples.

Note that the lcm of a single number is the absolute value of this number:
i.e., we have $\operatorname{lcm}\left(  a\right)  =\left\vert a\right\vert $
for each $a\in\mathbb{Z}$. (This is easy to prove.) Also, the lcm of an empty
list of numbers is $1$: that is, $\operatorname{lcm}\left(  {}\right)  =1$.

We observe a trivial property of lcms, which (for the sake of brevity) we only
state for two integers $a$ and $b$ despite it holding for any number of
integers (with the same proof):

\begin{proposition}
\label{prop.ent.lcm.divides}Let $a,b\in\mathbb{Z}$.

\textbf{(a)} We have $0\in\operatorname*{Mul}\left(  a,b\right)  $.

\textbf{(b)} We have $\operatorname{lcm}\left(  a,b\right)  \in
\operatorname*{Mul}\left(  a,b\right)  $.

\textbf{(c)} We have $a\mid\operatorname{lcm}\left(  a,b\right)  $ and
$b\mid\operatorname{lcm}\left(  a,b\right)  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.lcm.divides}.]\textbf{(a)} The integer $0$
clearly satisfies $\left(  a\mid0\text{ and }b\mid0\right)  $. In other words,
$0$ is a common multiple of $a$ and $b$ (by the definition of a
\textquotedblleft common multiple\textquotedblright). In other words,
$0\in\operatorname*{Mul}\left(  a,b\right)  $ (by the definition of
$\operatorname*{Mul}\left(  a,b\right)  $). This proves Proposition
\ref{prop.ent.lcm.divides} \textbf{(a)}.

\textbf{(b)} If the two integers $a$ and $b$ are not all nonzero, then
Proposition \ref{prop.ent.lcm.divides} \textbf{(b)}
holds\footnote{\textit{Proof.} Assume that the two integers $a$ and $b$ are
not all nonzero. Hence, Definition \ref{def.ent.lcm.lcm} shows that
$\operatorname{lcm}\left(  a,b\right)  =0\in\operatorname*{Mul}\left(
a,b\right)  $ (by Proposition \ref{prop.ent.lcm.divides} \textbf{(a)}). Thus,
Proposition \ref{prop.ent.lcm.divides} \textbf{(b)} holds.}. Hence, for the
rest of this proof, we WLOG assume that the two integers $a$ and $b$ are all
nonzero. Thus, Definition \ref{def.ent.lcm.lcm} yields that
$\operatorname{lcm}\left(  a,b\right)  $ is the smallest positive element of
the set $\operatorname*{Mul}\left(  a,b\right)  $. Hence, $\operatorname{lcm}%
\left(  a,b\right)  \in\operatorname*{Mul}\left(  a,b\right)  $. This proves
Proposition \ref{prop.ent.lcm.divides} \textbf{(b)}.

\textbf{(c)} Proposition \ref{prop.ent.lcm.divides} \textbf{(b)} yields
$\operatorname{lcm}\left(  a,b\right)  \in\operatorname*{Mul}\left(
a,b\right)  $. In other words, $\operatorname{lcm}\left(  a,b\right)  $ is a
common multiple of $a$ and $b$ (by the definition of $\operatorname*{Mul}%
\left(  a,b\right)  $). In other words, we have $\left(  a\mid
\operatorname{lcm}\left(  a,b\right)  \text{ and }b\mid\operatorname{lcm}%
\left(  a,b\right)  \right)  $ (by the definition of \textquotedblleft common
multiple\textquotedblright). This proves Proposition
\ref{prop.ent.lcm.divides} \textbf{(c)}.
\end{proof}

The following theorem yields a good way of computing lcms of two numbers
(since we already know how to compute gcds via the Euclidean algorithm):

\begin{theorem}
\label{thm.ent.lcm.gcd*lcm}Let $a,b\in\mathbb{Z}$. Then, $\gcd\left(
a,b\right)  \cdot\operatorname{lcm}\left(  a,b\right)  =\left\vert
ab\right\vert $.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.lcm.gcd*lcm}.]If at least one of the two
numbers $a$ and $b$ is $0$, then Theorem \ref{thm.ent.lcm.gcd*lcm}
holds\footnote{\textit{Proof.} Assume that at least one of the two numbers $a$
and $b$ is $0$. Thus, the product $ab$ is $0$. Hence, $ab=0$, so that
$\left\vert ab\right\vert =0$.
\par
On the other hand, the two numbers $a,b$ are not all nonzero (since at least
one of the two numbers $a$ and $b$ is $0$). Hence, Definition
\ref{def.ent.lcm.lcm} shows that $\operatorname{lcm}\left(  a,b\right)  =0$.
Comparing $\gcd\left(  a,b\right)  \cdot\underbrace{\operatorname{lcm}\left(
a,b\right)  }_{=0}=0$ with $\left\vert ab\right\vert =0$, we obtain
$\gcd\left(  a,b\right)  \cdot\operatorname{lcm}\left(  a,b\right)
=\left\vert ab\right\vert $. In other words, Theorem \ref{thm.ent.lcm.gcd*lcm}
holds.}. Hence, for the rest of this proof, we WLOG assume that none of the
two numbers $a$ and $b$ is $0$. In other words, $a$ and $b$ are nonzero. Thus,
Definition \ref{def.ent.lcm.lcm} yields that $\operatorname{lcm}\left(
a,b\right)  $ is the smallest positive element of the set $\operatorname*{Mul}%
\left(  a,b\right)  $. Also, $\gcd\left(  a,b\right)  $ is a positive integer
(since $a$ and $b$ are nonzero) and thus nonzero. Hence, we can define
$c\in\mathbb{Q}$ by $c=\dfrac{ab}{\gcd\left(  a,b\right)  }$. Consider this
$c$. From $c=\dfrac{ab}{\gcd\left(  a,b\right)  }$, we obtain $ab=\gcd\left(
a,b\right)  \cdot c$.

Let $d=\left\vert c\right\vert $. The number $c=\dfrac{ab}{\gcd\left(
a,b\right)  }$ is nonzero (since $a$ and $b$ are nonzero). Hence, its absolute
value $\left\vert c\right\vert $ is positive. In other words, $d$ is positive
(since $d=\left\vert c\right\vert $). From $ab=\gcd\left(  a,b\right)  \cdot
c$, we obtain%
\begin{align}
\left\vert ab\right\vert  &  =\left\vert \gcd\left(  a,b\right)  \cdot
c\right\vert =\underbrace{\left\vert \gcd\left(  a,b\right)  \right\vert
}_{\substack{=\gcd\left(  a,b\right)  \\\text{(since }\gcd\left(  a,b\right)
\text{ is positive)}}}\cdot\underbrace{\left\vert c\right\vert }%
_{=d}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.ent.div.abs(xy)}), applied to
}\gcd\left(  a,b\right)  \text{ and }c\text{ instead of }x\text{ and }y\right)
\nonumber\\
&  =\gcd\left(  a,b\right)  \cdot d. \label{pf.thm.ent.lcm.gcd*lcm.1}%
\end{align}
Solving this for $d$, we find $d=\dfrac{\left\vert ab\right\vert }{\gcd\left(
a,b\right)  }$ (since $\gcd\left(  a,b\right)  $ is nonzero).

We have $\gcd\left(  a,b\right)  \mid b$ (by Proposition
\ref{prop.ent.gcd.props1} \textbf{(f)}). Thus, $\dfrac{b}{\gcd\left(
a,b\right)  }$ is an integer. Now, $c=\dfrac{ab}{\gcd\left(  a,b\right)
}=a\cdot\dfrac{b}{\gcd\left(  a,b\right)  }$ is the product of two integers
(since $a$ and $\dfrac{b}{\gcd\left(  a,b\right)  }$ are integers). Therefore,
$c$ itself is an integer. Thus, $d$ is an integer as well (since $d=\left\vert
c\right\vert $). Moreover, $c=a\cdot\dfrac{b}{\gcd\left(  a,b\right)  }$ shows
that $a\mid c$ (since $\dfrac{b}{\gcd\left(  a,b\right)  }$ is an integer).
But Exercise \ref{exe.ent.div.aabs} \textbf{(a)} (applied to $c$ instead of
$a$) yields $c\mid\left\vert c\right\vert $ (this means \textquotedblleft$c$
divides $\left\vert c\right\vert $\textquotedblright). In other words, $c\mid
d$ (since $d=\left\vert c\right\vert $). Hence, $a\mid c\mid d$.

So we have proven that $a\mid d$. Similarly, $b\mid d$. Thus, we know that
$\left(  a\mid d\text{ and }b\mid d\right)  $. In other words, $d$ is a common
multiple of $a$ and $b$ (by the definition of a \textquotedblleft common
multiple\textquotedblright). In other words, $d\in\operatorname*{Mul}\left(
a,b\right)  $ (by the definition of $\operatorname*{Mul}\left(  a,b\right)
$). Thus, $d$ is a positive element of the set $\operatorname*{Mul}\left(
a,b\right)  $ (since $d$ is positive).

We shall now show that $d$ is the smallest positive element of this set.
Indeed, let $x$ be any positive element of $\operatorname*{Mul}\left(
a,b\right)  $. We are going to prove that $x\geq d$.

In fact, $x\in\operatorname*{Mul}\left(  a,b\right)  $. In other words, $x$ is
a common multiple of $a$ and $b$. In other words, we have $\left(  a\mid
x\text{ and }b\mid x\right)  $. Hence, Theorem \ref{thm.ent.gcd.combine}
(applied to $x$ instead of $c$) yields $ab\mid\gcd\left(  a,b\right)  \cdot
x$. Both numbers $\gcd\left(  a,b\right)  $ and $x$ are positive; hence, their
product $\gcd\left(  a,b\right)  \cdot x$ is positive as well, and thus we
have $\gcd\left(  a,b\right)  \cdot x\neq0$. Hence, Proposition
\ref{prop.ent.div.1} \textbf{(b)} (applied to $ab$ and $\gcd\left(
a,b\right)  \cdot x$ instead of $a$ and $b$) yields $\left\vert ab\right\vert
\leq\left\vert \gcd\left(  a,b\right)  \cdot x\right\vert =\gcd\left(
a,b\right)  \cdot x$ (since $\gcd\left(  a,b\right)  \cdot x$ is positive).
Thus,%
\[
\gcd\left(  a,b\right)  \cdot x\geq\left\vert ab\right\vert =\gcd\left(
a,b\right)  \cdot d\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.ent.lcm.gcd*lcm.1})}\right)  .
\]
We can divide this inequality by $\gcd\left(  a,b\right)  $ (since
$\gcd\left(  a,b\right)  $ is positive), and thus obtain $x\geq d$.

Now, forget that we fixed $x$. We thus have proven that each positive element
$x$ of the set $\operatorname*{Mul}\left(  a,b\right)  $ satisfies $x\geq d$.
Hence, $d$ is the \textbf{smallest} positive element of the set
$\operatorname*{Mul}\left(  a,b\right)  $ (since we already know that $d$ is a
positive element of the set $\operatorname*{Mul}\left(  a,b\right)  $). In
other words, $d$ is $\operatorname{lcm}\left(  a,b\right)  $ (since
$\operatorname{lcm}\left(  a,b\right)  $ is the smallest positive element of
the set $\operatorname*{Mul}\left(  a,b\right)  $). In other words,
$d=\operatorname{lcm}\left(  a,b\right)  $. Hence,
(\ref{pf.thm.ent.lcm.gcd*lcm.1}) becomes $\left\vert ab\right\vert
=\gcd\left(  a,b\right)  \cdot\underbrace{d}_{=\operatorname{lcm}\left(
a,b\right)  }=\gcd\left(  a,b\right)  \cdot\operatorname{lcm}\left(
a,b\right)  $. This proves Theorem \ref{thm.ent.lcm.gcd*lcm}.
\end{proof}

Next, we state an analogue of Theorem \ref{thm.ent.gcd.uniprop} (with all
divisibilities flipped):

\begin{theorem}
\label{thm.ent.lcm.uniprop}Let $a,b\in\mathbb{Z}$. Then:

\textbf{(a)} For each $m\in\mathbb{Z}$, we have the following logical
equivalence:%
\begin{equation}
\left(  a\mid m\ \text{and }b\mid m\right)  \ \Longleftrightarrow\ \left(
\operatorname{lcm}\left(  a,b\right)  \mid m\right)  .
\label{eq.thm.ent.lcm.uniprop.equiv}%
\end{equation}


\textbf{(b)} The common multiples of $a$ and $b$ are precisely the multiples
of $\operatorname{lcm}\left(  a,b\right)  $.

\textbf{(c)} We have $\operatorname*{Mul}\left(  a,b\right)
=\operatorname*{Mul}\left(  \operatorname{lcm}\left(  a,b\right)  \right)  $.
\end{theorem}

Again, the three parts of this theorem are saying the same thing from slightly
different perspectives. Our proof of Theorem \ref{thm.ent.lcm.uniprop} will
rely on the following lemma:

\begin{lemma}
\label{lem.ent.lcm.uniprop}Let $m,a,b\in\mathbb{Z}$ be such that $a\mid m$ and
$b\mid m$. Then, $\operatorname{lcm}\left(  a,b\right)  \mid m$.
\end{lemma}

Lemma \ref{lem.ent.lcm.uniprop} is similar to Lemma \ref{lem.ent.gcd.uniprop},
but its proof is not:

\begin{proof}
[Proof of Lemma \ref{lem.ent.lcm.uniprop}.]If at least one of the two numbers
$a$ and $b$ is $0$, then Lemma \ref{lem.ent.lcm.uniprop}
holds\footnote{\textit{Proof.} Assume that at least one of the two numbers $a$
and $b$ is $0$. In other words, $a=0$ or $b=0$. Let us WLOG assume that $a=0$
(since the proof in the case $b=0$ is analogous). We have $a\mid m$, thus
$0=a\mid m$.
\par
On the other hand, the two numbers $a,b$ are not all nonzero (since at least
one of the two numbers $a$ and $b$ is $0$). Hence, Definition
\ref{def.ent.lcm.lcm} shows that $\operatorname{lcm}\left(  a,b\right)
=0=a\mid m$. In other words, Lemma \ref{lem.ent.lcm.uniprop} holds.}. Hence,
for the rest of this proof, we WLOG assume that none of the two numbers $a$
and $b$ is $0$. In other words, $a$ and $b$ are nonzero. Thus, Definition
\ref{def.ent.lcm.lcm} yields that $\operatorname{lcm}\left(  a,b\right)  $ is
the smallest positive element of the set $\operatorname*{Mul}\left(
a,b\right)  $. Set $n=\operatorname{lcm}\left(  a,b\right)  $. Thus, $n$ is
the smallest positive element of the set $\operatorname*{Mul}\left(
a,b\right)  $ (since $\operatorname{lcm}\left(  a,b\right)  $ is the smallest
positive element of the set $\operatorname*{Mul}\left(  a,b\right)  $).
Therefore, $n$ is a positive integer and belongs to $\operatorname*{Mul}%
\left(  a,b\right)  $.

Now, $n$ is a common multiple of $a$ and $b$ (since $n$ belongs to
$\operatorname*{Mul}\left(  a,b\right)  $). In other words, we have $\left(
a\mid n\text{ and }b\mid n\right)  $.

Our goal is to prove that $\operatorname{lcm}\left(  a,b\right)  \mid m$. In
other words, our goal is to prove that $n\mid m$ (since $n=\operatorname{lcm}%
\left(  a,b\right)  $). Assume the contrary. Thus, we don't have $n\mid m$.
Hence, we don't have $m\%n=0$ (because Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(b)} (applied to $u=m$) shows that we have $n\mid m$ if and only if
$m\%n=0$). In other words, we have $m\%n\neq0$.

Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $u=m$) yields
that $m\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and $m\%n\equiv
m\operatorname{mod}n$. Combining $m\%n\in\left\{  0,1,\ldots,n-1\right\}  $
with $m\%n\neq0$, we obtain $m\%n\in\left\{  0,1,\ldots,n-1\right\}
\setminus\left\{  0\right\}  =\left\{  1,2,\ldots,n-1\right\}  $. Hence,
$m\%n$ is a positive integer and satisfies $m\%n\leq n-1<n$.

From $m\%n\equiv m\operatorname{mod}n$ and $a\mid n$, we obtain $m\%n\equiv
m\operatorname{mod}a$ (by Proposition \ref{prop.ent.mod.basics} \textbf{(e)},
applied to $a$, $m\%n$ and $m$ instead of $m$, $a$ and $b$). But
$m\equiv0\operatorname{mod}a$ (since $a\mid m$). Thus, $m\%n\equiv
m\equiv0\operatorname{mod}a$. In other words, $a\mid m\%n$. Similarly, $b\mid
m\%n$.

So we have proven that $\left(  a\mid m\%n\text{ and }b\mid m\%n\right)  $. In
other words, $m\%n$ is a common multiple of $a$ and $b$. In other words,
$m\%n\in\operatorname*{Mul}\left(  a,b\right)  $. Therefore, $m\%n$ is a
positive element of $\operatorname*{Mul}\left(  a,b\right)  $ (since $m\%n$ is
positive). Thus, $m\%n\geq n$ (since $n$ is the \textbf{smallest} positive
element of $\operatorname*{Mul}\left(  a,b\right)  $). This contradicts the
fact that $m\%n<n$. This contradiction shows that our assumption was false.
Hence, Lemma \ref{lem.ent.lcm.uniprop} is proven.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.ent.lcm.uniprop}.]\textbf{(a)} Let $m\in\mathbb{Z}%
$. In order to prove (\ref{eq.thm.ent.lcm.uniprop.equiv}), we need to prove
the \textquotedblleft$\Longrightarrow$\textquotedblright\ and
\textquotedblleft$\Longleftarrow$\textquotedblright\ directions of the
equivalence (\ref{eq.thm.ent.lcm.uniprop.equiv}). But this is easy: The
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction is just the
statement of Lemma \ref{lem.ent.lcm.uniprop}, whereas the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction is trivial (to wit: if
$\operatorname{lcm}\left(  a,b\right)  \mid m$, then%
\begin{align*}
a  &  \mid\operatorname{lcm}\left(  a,b\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.ent.lcm.divides} \textbf{(c)}}\right) \\
&  \mid m
\end{align*}
and%
\begin{align*}
b  &  \mid\operatorname{lcm}\left(  a,b\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.ent.lcm.divides} \textbf{(c)}}\right) \\
&  \mid m
\end{align*}
and thus $\left(  a\mid m\ \text{and }b\mid m\right)  $). Hence, the
equivalence (\ref{eq.thm.ent.lcm.uniprop.equiv}) is proven. This proves
Theorem \ref{thm.ent.lcm.uniprop} \textbf{(a)}.

\textbf{(b)} Theorem \ref{thm.ent.lcm.uniprop} \textbf{(b)} can be derived
from Theorem \ref{thm.ent.lcm.uniprop} \textbf{(a)} in the same way as Theorem
\ref{thm.ent.gcd.uniprop} \textbf{(b)} was derived from Theorem
\ref{thm.ent.gcd.uniprop} \textbf{(a)} (after the necessary changes are made
-- such as flipping all divisibility relations and replacing \textquotedblleft
divisor\textquotedblright\ by \textquotedblleft multiple\textquotedblright).

\textbf{(c)} Theorem \ref{thm.ent.lcm.uniprop} \textbf{(c)} can be derived
from Theorem \ref{thm.ent.lcm.uniprop} \textbf{(b)} in the same way as Theorem
\ref{thm.ent.gcd.uniprop} \textbf{(c)} was derived from Theorem
\ref{thm.ent.gcd.uniprop} \textbf{(b)} (after the necessary changes are made
-- such as flipping all divisibility relations and replacing \textquotedblleft
divisor\textquotedblright\ by \textquotedblleft multiple\textquotedblright).
\end{proof}

Our next claim is an analogue of Theorem \ref{thm.ent.gcd.uniprop-mul}:

\begin{theorem}
\label{thm.ent.lcm.uniprop-mul}Let $b_{1},b_{2},\ldots,b_{k}$ be integers.

\textbf{(a)} For each $m\in\mathbb{Z}$, we have the following logical
equivalence:%
\[
\left(  b_{i}\mid m\text{ for all }i\in\left\{  1,2,\ldots,k\right\}  \right)
\ \Longleftrightarrow\ \left(  \operatorname{lcm}\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  \mid m\right)  .
\]


\textbf{(b)} The common multiples of $b_{1},b_{2},\ldots,b_{k}$ are precisely
the multiples of $\operatorname{lcm}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $.

\textbf{(c)} We have $\operatorname*{Mul}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  =\operatorname*{Mul}\left(  \operatorname{lcm}\left(
b_{1},b_{2},\ldots,b_{k}\right)  \right)  $.

\textbf{(d)} If $k>0$, then%
\[
\operatorname{lcm}\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\operatorname{lcm}%
\left(  \operatorname{lcm}\left(  b_{1},b_{2},\ldots,b_{k-1}\right)
,b_{k}\right)  .
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.lcm.uniprop-mul} (sketched).]It is not hard to
transform our above proof of Theorem \ref{thm.ent.gcd.uniprop-mul} into a
proof of Theorem \ref{thm.ent.lcm.uniprop-mul}. To do so, we need (of course)
to flip the divisibility relations and replace \textquotedblleft
divisor\textquotedblright\ by \textquotedblleft multiple\textquotedblright%
\ and \textquotedblleft$\gcd$\textquotedblright\ by \textquotedblleft%
$\operatorname{lcm}$\textquotedblright. (Some more changes need to be made as
well -- for example, the induction base needs to be handled differently, and
the WLOG assumption that \textquotedblleft the integers $b_{1},b_{2}%
,\ldots,b_{\ell}$ are not all $0$\textquotedblright\ needs to be replaced by a
WLOG assumption that \textquotedblleft the integers $b_{1},b_{2}%
,\ldots,b_{\ell}$ are all nonzero\textquotedblright. Also, \textquotedblleft
largest element\textquotedblright\ needs to be replaced by \textquotedblleft
smallest positive element\textquotedblright. But these are fairly
straightforward changes; the main thrust of the argument remains unchanged.)
\end{proof}

\begin{exercise}
\label{exe.ent.lcm.props1}Let $a,b\in\mathbb{Z}$.

\textbf{(a)} Prove that $\operatorname{lcm}\left(  a,b\right)
=\operatorname{lcm}\left(  b,a\right)  $.

\textbf{(b)} Prove that $\operatorname{lcm}\left(  -a,b\right)
=\operatorname{lcm}\left(  a,b\right)  $.

\textbf{(c)} Prove that $\operatorname{lcm}\left(  a,-b\right)
=\operatorname{lcm}\left(  a,b\right)  $.

\textbf{(d)} Prove the following: If $a\mid b$, then $\operatorname{lcm}%
\left(  a,b\right)  =\left\vert b\right\vert $.

\textbf{(e)} Let $s\in\mathbb{Z}$. Prove that $\operatorname{lcm}\left(
sa,sb\right)  =\left\vert s\right\vert \operatorname{lcm}\left(  a,b\right)  $.
\end{exercise}

\begin{exercise}
\label{exe.ent.lcm.lcmabc}Let $a,b,c$ be three integers.

\textbf{(a)} Prove that $\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}%
\left(  bc,ca,ab\right)  =\left\vert abc\right\vert $.

\textbf{(b)} Prove that $\operatorname{lcm}\left(  a,b,c\right)  \cdot
\gcd\left(  bc,ca,ab\right)  =\left\vert abc\right\vert $.
\end{exercise}

\subsection{The Chinese remainder theorem (elementary form)}

\begin{theorem}
\label{thm.ent.crt1}Let $m$ and $n$ be two coprime integers. Let
$a,b\in\mathbb{Z}$.

\textbf{(a)} There exists an integer $x\in\mathbb{Z}$ such that%
\[
\left(  x\equiv a\operatorname{mod}m\text{ and }x\equiv b\operatorname{mod}%
n\right)  .
\]


\textbf{(b)} If $x_{1}$ and $x_{2}$ are two such integers $x$, then
$x_{1}\equiv x_{2}\operatorname{mod}mn$.
\end{theorem}

Theorem \ref{thm.ent.crt1} is known as the \textit{Chinese remainder theorem}.
More precisely, there is a sizeable cloud of results that share this name;
Theorem \ref{thm.ent.crt1} is one of the most elementary and basic of these
results. A more general result is Theorem \ref{thm.ent.crt1k} further below.
However, the strongest and most general \textquotedblleft Chinese remainder
theorems\textquotedblright\ rely on concepts from abstract algebra such as
rings and ideals; it will take us a while to get to them.

Theorem \ref{thm.ent.crt1} has gotten its name from the fact that
\href{https://en.wikipedia.org/wiki/Chinese_remainder_theorem#History}{a first
glimpse of it appears in \textquotedblleft Master Sun's Mathematical
Manual\textquotedblright\ from the 3rd century AD}; it took centuries until it
become a theorem with proof and precise statement.

The claim of Theorem \ref{thm.ent.crt1} \textbf{(b)} is often restated as
\textquotedblleft This integer $x$ (i.e., the integer $x$ satisfying $\left(
x\equiv a\operatorname{mod}m\text{ and }x\equiv b\operatorname{mod}n\right)
$) is unique modulo $mn$\textquotedblright. The \textquotedblleft modulo
$mn$\textquotedblright\ here signifies that what we are not claiming literal
uniqueness (which would mean that if $x_{1}$ and $x_{2}$ are two such integers
$x$, then $x_{1}=x_{2}$), but merely claiming a weaker form (namely, that if
$x_{1}$ and $x_{2}$ are two such integers $x$, then $x_{1}\equiv
x_{2}\operatorname{mod}mn$).

\begin{example}
Theorem \ref{thm.ent.crt1} \textbf{(a)} (applied to $m=5$, $n=6$ and $a=3$ and
$b=2$) shows that there exists an integer $x\in\mathbb{Z}$ such that%
\[
\left(  x\equiv3\operatorname{mod}5\text{ and }x\equiv2\operatorname{mod}%
6\right)  .
\]
We will soon find such an integer, after we have proved Theorem
\ref{thm.ent.crt1}.
\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.ent.crt1}.]The integers $m$ and $n$ are coprime. In
other words, $m\perp n$, so that $n\perp m$ (by Proposition
\ref{prop.ent.coprime.perp-symm}).

\textbf{(a)} Theorem \ref{thm.ent.coprime.modinv} \textbf{(b)} (applied to $m$
instead of $a$) shows that there exists an $m^{\prime}\in\mathbb{Z}$ such that
$mm^{\prime}\equiv1\operatorname{mod}n$.

Similarly, there exists an $n^{\prime}\in\mathbb{Z}$ such that $nn^{\prime
}\equiv1\operatorname{mod}m$ (since $m$ and $n$ play symmetric roles in
Theorem \ref{thm.ent.crt1}).

Now, set $x_{0}=nn^{\prime}a+mm^{\prime}b$. Then,%
\[
x_{0}=\underbrace{nn^{\prime}}_{\equiv1\operatorname{mod}m}%
a+\underbrace{mm^{\prime}b}_{\equiv0\operatorname{mod}m}\equiv
1a+0=a\operatorname{mod}m
\]
(here, we have used the Principle of substitutivity for congruences, which we
described in Section \ref{sect.ent.subst-mod}) and similarly $x_{0}\equiv
b\operatorname{mod}n$. Thus, there exists an integer $x\in\mathbb{Z}$ such
that $\left(  x\equiv a\operatorname{mod}m\text{ and }x\equiv
b\operatorname{mod}n\right)  $ (namely, $x=x_{0}$). This proves Theorem
\ref{thm.ent.crt1} \textbf{(a)}.

\textbf{(b)} Let $x_{1}$ and $x_{2}$ be two such integers $x$. We want to
prove that $x_{1}\equiv x_{2}\operatorname{mod}mn$.

We know that $x_{1}$ is an integer $x$ such that $\left(  x\equiv
a\operatorname{mod}m\text{ and }x\equiv b\operatorname{mod}n\right)  $. Thus,
$x_{1}\equiv a\operatorname{mod}m$ and $x_{1}\equiv b\operatorname{mod}n$.

In particular, $x_{1}\equiv a\operatorname{mod}m$, and similarly $x_{2}\equiv
a\operatorname{mod}m$. Thus, $x_{1}\equiv a\equiv x_{2}\operatorname{mod}m$,
so that $m\mid x_{1}-x_{2}$. Similarly, $n\mid x_{1}-x_{2}$. Since $m\perp n$,
we thus obtain $mn\mid x_{1}-x_{2}$ (by Theorem \ref{thm.ent.coprime.combine},
applied to $m$, $n$ and $x_{1}-x_{2}$ instead of $a$, $b$ and $c$). In other
words, $x_{1}\equiv x_{2}\operatorname{mod}mn$. This proves Theorem
\ref{thm.ent.crt1}.
\end{proof}

\begin{noncompile}
Theorem \ref{thm.ent.crt1} is (the simplest form of) the \textit{Chinese
Remainder Theorem} (Sunzi, 3rd century AD).
\end{noncompile}

\begin{example}
Assume that we want to find an $x\in\mathbb{Z}$ such that%
\[
\left(  x\equiv3\operatorname{mod}5\text{ and }x\equiv2\operatorname{mod}%
6\right)  .
\]
To compute such an $x$, let us follow the proof of Theorem \ref{thm.ent.crt1}
\textbf{(a)} above.

We need a modular inverse $5^{\prime}$ of $5$ modulo $6$. Such an inverse is
$5$, since $5\cdot5\equiv1\operatorname{mod}6$. (In this particular case,
finding this modular inverse was easy, because all we had to do is to test the
$6$ numbers $0,1,2,3,4,5$; it is clear that a modular inverse of $a$ modulo
$m$, if it exists, can be found within the set $\left\{  0,1,\ldots
,m-1\right\}  $. In general, there is
\href{https://en.wikipedia.org/wiki/Modular_multiplicative_inverse#Computation}{a
quick way to find a modular inverse of an integer $a$ modulo an integer $m$
using the \textquotedblleft Extended Euclidean algorithm\textquotedblright}.)

We need a modular inverse $6^{\prime}$ of $6$ modulo $5$. Such an inverse is
$1$, since $6\cdot1\equiv1\operatorname{mod}5$.

Now, the proof of Theorem \ref{thm.ent.crt1} \textbf{(a)} tells us that
$x_{0}=6\cdot6^{\prime}\cdot3+5\cdot5^{\prime}\cdot2$ is an integer
$x\in\mathbb{Z}$ such that $\left(  x\equiv3\operatorname{mod}5\text{ and
}x\equiv2\operatorname{mod}6\right)  $. This $x_{0}$ is%
\[
6\cdot6^{\prime}\cdot3+5\cdot5^{\prime}\cdot2=6\cdot1\cdot3+5\cdot5\cdot2=68.
\]
So we have found an $x\in\mathbb{Z}$ such that $\left(  x\equiv
3\operatorname{mod}5\text{ and }x\equiv2\operatorname{mod}6\right)  $, namely
$x=68$. (We can easily check this: $68\equiv3\operatorname{mod}5$ since
$68-3=5\cdot13$; and $68\equiv2\operatorname{mod}6$ since $68-2=6\cdot11$.)
\end{example}

There is also a version of Theorem \ref{thm.ent.crt1} for multiple integers:

\begin{theorem}
\label{thm.ent.crt1k}Let $m_{1},m_{2},\ldots,m_{k}$ be $k$ mutually coprime
integers. Let $a_{1},a_{2},\ldots,a_{k}\in\mathbb{Z}$.

\textbf{(a)} There exists an integer $x$ such that
\begin{equation}
\left(  x\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,k\right\}  \right)  . \label{eq.thm.ent.crt1k.1}%
\end{equation}


\textbf{(b)} If $x_{1}$ and $x_{2}$ are two such integers $x$, then
$x_{1}\equiv x_{2}\operatorname{mod}m_{1}m_{2}\cdots m_{k}$.
\end{theorem}

Again, Theorem \ref{thm.ent.crt1k} \textbf{(b)} is often stated in the form
\textquotedblleft This integer $x$ is unique modulo $m_{1}m_{2}\cdots m_{k}%
$\textquotedblright.

Clearly, Theorem \ref{thm.ent.crt1} is the particular case of Theorem
\ref{thm.ent.crt1k} obtained for $k=2$.

\begin{proof}
[Proof of Theorem \ref{thm.ent.crt1k}.]Forget that we fixed $k$ and
$m_{1},m_{2},\ldots,m_{k}$ and $a_{1},a_{2},\ldots,a_{k}$.

\textbf{(a)} We shall prove Theorem \ref{thm.ent.crt1k} \textbf{(a)} by
induction on $k$:

\textit{Induction base:} Let us check that Theorem \ref{thm.ent.crt1k}
\textbf{(a)} holds for $k=0$. Indeed, if $k=0$, then Theorem
\ref{thm.ent.crt1k} \textbf{(a)} states the following:

\begin{statement}
\textit{Claim 0:} Let $m_{1},m_{2},\ldots,m_{0}$ be $0$ mutually coprime
integers. Let $a_{1},a_{2},\ldots,a_{0}\in\mathbb{Z}$. There exists an integer
$x$ such that
\begin{equation}
\left(  x\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,0\right\}  \right)  . \label{pf.thm.ent.crt1k.a.c0.claim}%
\end{equation}

\end{statement}

But Claim 0 is true, because (\ref{pf.thm.ent.crt1k.a.c0.claim}) is vacuously
true\footnote{since there exists no $i\in\left\{  1,2,\ldots,0\right\}  $} for
\textbf{any} integer $x$ (so we can take, for example, $x=0$). In other words,
Theorem \ref{thm.ent.crt1k} \textbf{(a)} holds for $k=0$; thus, the induction
base is complete.

Needless to say, Claim 0 is not an interesting statement, but it is a
perfectly valid induction base! (But you are free to check the case $k=1$ by
hand -- its proof is almost as easy as that for $k=0$.)

\textit{Induction step:} Let $\ell$ be a positive integer. Assume that Theorem
\ref{thm.ent.crt1k} \textbf{(a)} holds for $k=\ell-1$. We must now prove that
Theorem \ref{thm.ent.crt1k} \textbf{(a)} holds for $k=\ell$.

We have assumed that Theorem \ref{thm.ent.crt1k} \textbf{(a)} holds for
$k=\ell-1$. In other words, the following claim holds:

\begin{statement}
\textit{Claim 1:} Let $m_{1},m_{2},\ldots,m_{\ell-1}$ be $\ell-1$ mutually
coprime integers. Let $a_{1},a_{2},\ldots,a_{\ell-1}\in\mathbb{Z}$. There
exists an integer $x$ such that
\begin{equation}
\left(  x\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,\ell-1\right\}  \right)  . \label{pf.thm.ent.crt1k.a.c1.claim}%
\end{equation}

\end{statement}

We must prove that Theorem \ref{thm.ent.crt1k} \textbf{(a)} holds for $k=\ell
$. In other words, we must prove the following claim:

\begin{statement}
\textit{Claim 2:} Let $m_{1},m_{2},\ldots,m_{\ell}$ be $\ell$ mutually coprime
integers. Let $a_{1},a_{2},\ldots,a_{\ell}\in\mathbb{Z}$. There exists an
integer $x$ such that
\begin{equation}
\left(  x\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,\ell\right\}  \right)  . \label{pf.thm.ent.crt1k.a.c2.claim}%
\end{equation}

\end{statement}

[\textit{Proof of Claim 2:} The main idea of this proof is to combine Claim 1
(applied to $m_{1},m_{2},\ldots,m_{\ell-1}$) with Theorem \ref{thm.ent.crt1}
(applied to the coprime integers $m_{1}m_{2}\cdots m_{\ell-1}$ and $m_{\ell}%
$). In details:

The $\ell$ integers $m_{1},m_{2},\ldots,m_{\ell}$ are mutually coprime. Thus,
the $\ell-1$ integers $m_{1},m_{2},\ldots,m_{\ell-1}$ are mutually coprime.
Hence, Claim 1 shows that there exists an integer $x$ such that
\[
\left(  x\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,\ell-1\right\}  \right)  .
\]
Consider this $x$, and denote it by $u$. Thus, $u$ is an integer such that%
\begin{equation}
\left(  u\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,\ell-1\right\}  \right)  . \label{pf.thm.ent.crt1k.a.c2.pf.u}%
\end{equation}


Define an integer $m=m_{1}m_{2}\cdots m_{\ell-1}$.

The integers $m$ and $m_{\ell}$ are coprime\footnote{\textit{Proof.} Recall
that the $\ell$ integers $m_{1},m_{2},\ldots,m_{\ell}$ are mutually coprime.
In other words, $m_{i}\perp m_{j}$ for any $i,j\in\left\{  1,2,\ldots
,\ell\right\}  $ satisfying $i\neq j$. Applying this to $j=\ell$, we conclude
that $m_{i}\perp m_{\ell}$ for any $i\in\left\{  1,2,\ldots,\ell\right\}  $
satisfying $i\neq\ell$. In other words, $m_{i}\perp m_{\ell}$ for any
$i\in\left\{  1,2,\ldots,\ell-1\right\}  $ (since the numbers $i\in\left\{
1,2,\ldots,\ell\right\}  $ satisfying $i\neq\ell$ are precisely the numbers
$i\in\left\{  1,2,\ldots,\ell-1\right\}  $). In other words, each
$i\in\left\{  1,2,\ldots,\ell-1\right\}  $ satisfies $m_{i}\perp m_{\ell}$.
Hence, Exercise \ref{exe.ent.coprime.ab-to-ck} (applied to $c=m_{\ell}$,
$k=\ell-1$ and $a_{i}=m_{i}$) yields that $m_{1}m_{2}\cdots m_{\ell-1}\perp
m_{\ell}$. This rewrites as $m\perp m_{\ell}$ (since $m=m_{1}m_{2}\cdots
m_{\ell-1}$). In other words, the integers $m$ and $m_{\ell}$ are coprime.}.
Hence, Theorem \ref{thm.ent.crt1} \textbf{(a)} (applied to $n=m_{\ell}$, $a=u$
and $b=a_{\ell}$) yields that there exists an integer $x\in\mathbb{Z}$ such
that%
\[
\left(  x\equiv u\operatorname{mod}m\text{ and }x\equiv a_{\ell}%
\operatorname{mod}m_{\ell}\right)  .
\]
Consider this $x$, and denote it by $v$. Thus, $v$ is an integer such that%
\[
\left(  v\equiv u\operatorname{mod}m\text{ and }v\equiv a_{\ell}%
\operatorname{mod}m_{\ell}\right)  .
\]


Now, let $i\in\left\{  1,2,\ldots,\ell-1\right\}  $. Then,
\[
m=m_{1}m_{2}\cdots m_{\ell-1}=m_{i}\cdot\left(  m_{1}m_{2}\cdots
m_{i-1}m_{i+1}m_{i+2}\cdots m_{\ell-1}\right)  ;
\]
thus, $m_{i}\mid m$ (since $m_{1}m_{2}\cdots m_{i-1}m_{i+1}m_{i+2}\cdots
m_{\ell-1}$ is an integer). But as we just have shown, we have $v\equiv
u\operatorname{mod}m$. Hence, Proposition \ref{prop.ent.mod.basics}
\textbf{(e)} (applied to $v$, $u$, $m$ and $m_{i}$ instead of $a$, $b$, $n$
and $m$) yields $v\equiv u\operatorname{mod}m_{i}$ (since $m_{i}\mid m$).
Hence,
\[
v\equiv u\equiv a_{i}\operatorname{mod}m_{i}\ \ \ \ \ \ \ \ \ \ \left(
\text{by (\ref{pf.thm.ent.crt1k.a.c2.pf.u})}\right)  .
\]


Now, forget that we fixed $i$. We thus have proven the congruence $v\equiv
a_{i}\operatorname{mod}m_{i}$ for each $i\in\left\{  1,2,\ldots,\ell
-1\right\}  $. But this congruence also holds for $i=\ell$ (since $v\equiv
a_{\ell}\operatorname{mod}m_{\ell}$). Hence, this congruence holds for all
$i\in\left\{  1,2,\ldots,\ell\right\}  $. In other words, we have%
\[
v\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,\ell\right\}  \text{.}%
\]
Thus, there exists an integer $x$ such that
\[
\left(  x\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,\ell\right\}  \right)
\]
(namely, $x=v$). This proves Claim 2.]

We have now proven Claim 2. In other words, Theorem \ref{thm.ent.crt1k}
\textbf{(a)} is true for $k=\ell$. Thus, the induction step is complete, so we
have proven Theorem \ref{thm.ent.crt1k} \textbf{(a)} by induction.

\textbf{(b)} Let $k$ and $m_{1},m_{2},\ldots,m_{k}$ and $a_{1},a_{2}%
,\ldots,a_{k}$ be as in Theorem \ref{thm.ent.crt1k}. Let $x_{1}$ and $x_{2}$
be two integers $x$ such that (\ref{eq.thm.ent.crt1k.1}). We must prove that
$x_{1}\equiv x_{2}\operatorname{mod}m_{1}m_{2}\cdots m_{k}$.

We know that $x_{1}$ is an integer $x$ such that (\ref{eq.thm.ent.crt1k.1}).
In other words, $x_{1}$ is an integer and has the property that%
\begin{equation}
\left(  x_{1}\equiv a_{i}\operatorname{mod}m_{i}\text{ for all }i\in\left\{
1,2,\ldots,k\right\}  \right)  . \label{pf.thm.ent.crt1k.b.x1}%
\end{equation}
Now, let $i\in\left\{  1,2,\ldots,k\right\}  $. Then,
(\ref{pf.thm.ent.crt1k.b.x1}) yields $x_{1}\equiv a_{i}\operatorname{mod}%
m_{i}$. Similarly, $x_{2}\equiv a_{i}\operatorname{mod}m_{i}$. Hence,
$x_{1}\equiv a_{i}\equiv x_{2}\operatorname{mod}m_{i}$. In other words,
$m_{i}\mid x_{1}-x_{2}$.

Now, forget that we fixed $i$. We thus have shown that $m_{i}\mid x_{1}-x_{2}$
for each $i\in\left\{  1,2,\ldots,k\right\}  $. Hence, Exercise
\ref{exe.ent.coprime.combinek} (applied to $c=x_{1}-x_{2}$ and $b_{i}=m_{i}$)
shows that $m_{1}m_{2}\cdots m_{k}\mid x_{1}-x_{2}$ (since $m_{1},m_{2}%
,\ldots,m_{k}$ are mutually coprime). In other words, $x_{1}\equiv
x_{2}\operatorname{mod}m_{1}m_{2}\cdots m_{k}$. This proves Theorem
\ref{thm.ent.crt1k} \textbf{(b)}.
\end{proof}

\subsection{Primes}

\subsubsection{Definition and the Sieve of Eratosthenes}

\begin{definition}
\label{def.ent.prime}Let $p$ be an integer greater than $1$. We say that $p$
is \textit{prime} if the only positive divisors of $p$ are $1$ and $p$. A
prime integer is often just called \textit{a prime}.
\end{definition}

Note that we required $p$ to be greater than $1$ here. Thus, $1$ does not
count as prime even though its only positive divisor is $1$ itself.

\begin{example}
\label{exa.ent.prime.1}\textbf{(a)} The only positive divisors of $7$ are $1$
and $7$. Thus, $7$ is a prime.

\textbf{(b)} The positive divisors of $14$ are $1$, $2$, $7$ and $14$. These
are more than just $1$ and $14$. Thus, $14$ is not a prime.

\textbf{(c)} None of the numbers $4,6,8,10,12,14,16,\ldots$ (that is, the
multiples of $2$ that are larger than $2$) is a prime. Indeed, if $p$ is any
of these numbers, then $p$ has a positive divisor other than $1$ and $p$
(namely, $2$), and therefore does not meet the definition of \textquotedblleft
prime\textquotedblright.

\textbf{(d)} None of the numbers $6,9,12,15,18,\ldots$ (that is, the multiples
of $3$ that are larger than $3$) is a prime. Indeed, if $p$ is any of these
numbers, then $p$ has a positive divisor other than $1$ and $p$ (namely, $3$),
and therefore does not meet the definition of \textquotedblleft
prime\textquotedblright.
\end{example}

Parts \textbf{(c)} and \textbf{(d)} of Example \ref{exa.ent.prime.1} suggest a
method for finding all primes up to a given integer:

\begin{example}
Let us say we want to find all primes that are $\leq30$.

\textit{Step 1:} All such primes must lie in $\left\{  2,3,\ldots,30\right\}
$ (since a prime is always an integer greater than $1$); thus, let us first
write down all elements of $\left\{  2,3,\ldots,30\right\}  $:%
\[%
\begin{array}
[c]{cccccccccc}
& 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20\\
21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 & 30
\end{array}
.
\]
(We are using a table just in order to fit these elements on a page.)

We now plan to remove non-prime numbers from this table until only primes are left.

\textit{Step 2:} First, let us remove all multiples of $2$ that are larger
than $2$ from our table, because none of them is a prime (see Example
\ref{exa.ent.prime.1} \textbf{(c)}). We thus are left with%
\[%
\begin{array}
[c]{cccccccccc}
& 2 & 3 &  & 5 &  & 7 &  & 9 & \\
11 &  & 13 &  & 15 &  & 17 &  & 19 & \\
21 &  & 23 &  & 25 &  & 27 &  & 29 &
\end{array}
.
\]


\textit{Step 3:} Next, let us remove all multiples of $3$ that are larger than
$3$ from our table, because none of them is a prime (see Example
\ref{exa.ent.prime.1} \textbf{(d)}). We thus are left with%
\[%
\begin{array}
[c]{cccccccccc}
& 2 & 3 &  & 5 &  & 7 &  &  & \\
11 &  & 13 &  &  &  & 17 &  & 19 & \\
&  & 23 &  & 25 &  &  &  & 29 &
\end{array}
.
\]
(Note that some of these multiples have already been removed in Step 2.)

\textit{Step 4:} Next, let us remove all multiples of $4$ that are larger than
$4$ from our table, because none of them is a prime (for similar reasons). It
turns out that this does not change the table at all, because all such
multiples have already been removed in Step 2. This is not a coincidence:
Since $4$ itself has been removed, we know that $4$ was a multiple of some
number $d<4$ (in this case, $d=2$) whose multiples have been removed;
therefore, all multiples of $4$ are also multiples of $d$ and thus have been
removed along with $4$.

\textit{Step 5:} Next, let us remove all multiples of $5$ that are larger than
$5$ from our table, because none of them is a prime (for similar reasons). We
thus are left with%
\[%
\begin{array}
[c]{cccccccccc}
& 2 & 3 &  & 5 &  & 7 &  &  & \\
11 &  & 13 &  &  &  & 17 &  & 19 & \\
&  & 23 &  &  &  &  &  & 29 &
\end{array}
.
\]


\textit{Step 6:} Next, let us remove all multiples of $6$ that are larger than
$6$ from our table, because none of them is a prime. Just as Step 4, this does
not change the table, since all such multiples have already been removed in
Step 2.

\textit{Step 7:} Next, let us remove all multiples of $7$ that are larger than
$7$ from our table, because none of them is a prime. Again, this does not
change the table, since all such multiples have already been removed.

Proceed likewise until Step 30, at which point the table has become%
\[%
\begin{array}
[c]{cccccccccc}
& 2 & 3 &  & 5 &  & 7 &  &  & \\
11 &  & 13 &  &  &  & 17 &  & 19 & \\
&  & 23 &  &  &  &  &  & 29 &
\end{array}
.
\]
(You are reading it right: None of the steps from Step 6 to Step 30 causes any
changes to the table, since all multiples that these steps attempt to remove
have already been removed beforehand.)

The resulting table has the following property: If $p$ is an element of this
table, then $p$ cannot be a multiple of any $d\in\left\{  2,3,\ldots
,p-1\right\}  $ (because if it was such a multiple, then it would have been
removed from the table in Step $d$ or earlier). In other words, if $p$ is an
element of this table, then $p$ cannot have any divisor $d\in\left\{
2,3,\ldots,p-1\right\}  $. In other words, if $p$ is an element of this table,
then the only positive divisors of $p$ are $1$ and $p$. In other words, if $p$
is an element of this table, then $p$ is prime. Conversely, any prime $\leq30$
is in our table, since the only numbers we have removed from the table were
guaranteed to be non-prime. Thus, the table now contains all the primes
$\leq30$ and only them. So we conclude that the primes $\leq30$ are
$2,3,5,7,11,13,17,19,23,29$.

This method of finding primes is known as the \textit{sieve of Eratosthenes}.
We could have made it more efficient using the following two tricks:

\begin{itemize}
\item If a number $d\in\left\{  2,3,\ldots,30\right\}  $ has been removed from
the table before Step $d$, then we know immediately that Step $d$ will not
change the table (because all multiples of $d$ have already been removed
before this step). Thus, we do not need to make this step.

\item If $d\in\left\{  2,3,\ldots,30\right\}  $ satisfies $d^{2}>30$, then
Step $d$ will not change the table\footnotemark. Thus, we only need to take
the Steps $d$ with $d^{2}\leq30$.
\end{itemize}

Together, these tricks tell us that the only steps we need to take are the
Steps 2, 3 and 5.
\end{example}

\footnotetext{\textit{Proof.} Let $d\in\left\{  2,3,\ldots,30\right\}  $ be
such that $d^{2}>30$. We must show that Step $d$ will not change the table.
\par
Indeed, at Step $d$, we remove all multiples of $d$ that are larger than $d$
from our table. But all these multiples (at least the ones that appear in our
table) have already been removed from this table before Step $d$.
\par
Here is why: Let $m\in\left\{  2,3,\ldots,30\right\}  $ be a multiple of $d$
that is larger than $d$. Then, $d\mid m$ (since $m$ is a multiple of $d$) and
thus $m/d\in\mathbb{Z}$. Hence, $m/d$ is a positive integer (since $m/d$ is
clearly positive) and $m/d>1$ (since $m$ is larger than $d$). Furthermore,
$m/d\mid m$ (since $m=\left(  m/d\right)  d$), so that $m$ is a multiple of
$m/d$. But $d>1$ (since $d\in\left\{  2,3,\ldots,30\right\}  $) and thus
$m/d<m$. In other words, $m>m/d$. Hence, $m$ is a multiple of $m/d$ that is
larger than $m/d$.
\par
Furthermore, $d^{2}>30\geq m$ (since $m\in\left\{  2,3,\ldots,30\right\}  $).
Dividing both sides of this inequality by $d$, we obtain $d>m/d$. Hence,
$m/d<d$, so that $m/d\in\left\{  2,3,\ldots,d-1\right\}  $ (since $m/d>1$).
Thus, before Step $d$ begins, Step $m/d$ has already happened. Of course, Step
$m/d$ has removed $m$ from the table (since $m$ is a multiple of $m/d$ that is
larger than $m/d$). Therefore, the number $m$ has already been removed from
the table before Step $d$.
\par
Now, forget that we fixed $m$. We thus have shown that if $m\in\left\{
2,3,\ldots,30\right\}  $ is a multiple of $d$ that is larger than $d$, then
$m$ has already been removed from the table before Step $d$. In other words,
all multiples of $d$ that we try to remove at Step $d$ have already been
removed before Step $d$. Therefore, Step $d$ does not change our table.}

\begin{teachingnote}
\textbf{2019-02-11 lecture}
\end{teachingnote}

\subsubsection{Basic properties of primes}

\begin{proposition}
\label{prop.ent.prime.each-i-coprime}Let $p$ be a prime. Then, each
$i\in\left\{  1,2,\ldots,p-1\right\}  $ is coprime to $p$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.each-i-coprime}.]Let $i\in\left\{
1,2,\ldots,p-1\right\}  $. We must prove that $i$ is coprime to $p$.

From $i\in\left\{  1,2,\ldots,p-1\right\}  $, we obtain $1\leq i\leq p-1$ and
thus $i\geq1>0$, so that $i\neq0$. Hence, $i$ and $p$ are not all zero. Also,
$\left\vert i\right\vert =i$ (since $i>0$).

Also, $\gcd\left(  i,p\right)  $ is a positive integer (since $i$ and $p$ are
not all zero). Thus, $\left\vert \gcd\left(  i,p\right)  \right\vert
=\gcd\left(  i,p\right)  $.

Proposition \ref{prop.ent.gcd.props1} \textbf{(f)} (applied to $a=i$ and
$b=p$) shows that $\gcd\left(  i,p\right)  \mid i$ and $\gcd\left(
i,p\right)  \mid p$. From $\gcd\left(  i,p\right)  \mid i$ and $i\neq0$, we
obtain $\left\vert \gcd\left(  i,p\right)  \right\vert \leq\left\vert
i\right\vert $ (by Exercise \ref{prop.ent.div.1} \textbf{(b)}, applied to
$a=\gcd\left(  i,p\right)  $ and $b=i$). In view of $\left\vert \gcd\left(
i,p\right)  \right\vert =\gcd\left(  i,p\right)  $ and $\left\vert
i\right\vert =i$, this rewrites as $\gcd\left(  i,p\right)  \leq i$. Hence,
$\gcd\left(  i,p\right)  \leq i\leq p-1<p$ and therefore $\gcd\left(
i,p\right)  \neq p$.

We know that $p$ is prime. In other words, the only positive divisors of $p$
are $1$ and $p$ (by the definition of \textquotedblleft
prime\textquotedblright).

The integer $\gcd\left(  i,p\right)  $ is a positive divisor of $p$ (since
$\gcd\left(  i,p\right)  $ is positive and satisfies $\gcd\left(  i,p\right)
\mid p$), and thus must be either $1$ or $p$ (since the only positive divisors
of $p$ are $1$ and $p$). Since we know that $\gcd\left(  i,p\right)  \neq p$,
we thus conclude that $\gcd\left(  i,p\right)  =1$. In other words, $i$ is
coprime to $p$ (by the definition of \textquotedblleft
coprime\textquotedblright). This proves Proposition
\ref{prop.ent.prime.each-i-coprime}.
\end{proof}

Note that this proposition characterizes primes: If $p>1$ is an integer such
that each $i\in\left\{  1,2,\ldots,p-1\right\}  $ is coprime to $p$, then $p$
is prime. (The proof of this is left as an easy exercise.)

\begin{proposition}
\label{prop.ent.prime.div-or-coprime}Let $p$ be a prime. Let $a\in\mathbb{Z}$.
Then, either $p\mid a$ or $p\perp a$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.div-or-coprime}.]Assume the
contrary. Thus, neither $p\mid a$ nor $p\perp a$.

We know that $p$ is prime. In other words, $p$ is an integer greater than $1$
such that the only positive divisors of $p$ are $1$ and $p$ (by the definition
of \textquotedblleft prime\textquotedblright).

In particular, $p$ is greater than $1$. Hence, $p>1>0$, so that $p\neq0$.
Hence, $a$ and $p$ are not all zero. Thus, $\gcd\left(  a,p\right)  $ is a
positive integer.

Proposition \ref{prop.ent.gcd.props1} \textbf{(f)} (applied to $b=p$) shows
that $\gcd\left(  a,p\right)  \mid a$ and $\gcd\left(  a,p\right)  \mid p$. If
we had $\gcd\left(  a,p\right)  =p$, then we would obtain $p=\gcd\left(
a,p\right)  \mid a$, which would contradict the fact that we do not have
$p\mid a$. Hence, we cannot have $\gcd\left(  a,p\right)  =p$. In other words,
we have $\gcd\left(  a,p\right)  \neq p$.

The integer $\gcd\left(  a,p\right)  $ is a positive divisor of $p$ (since
$\gcd\left(  a,p\right)  $ is positive and satisfies $\gcd\left(  a,p\right)
\mid p$), and thus must be either $1$ or $p$ (since the only positive divisors
of $p$ are $1$ and $p$). Since we know that $\gcd\left(  a,p\right)  \neq p$,
we thus conclude that $\gcd\left(  a,p\right)  =1$. But Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)} (applied to $b=p$) yields $\gcd\left(
a,p\right)  =\gcd\left(  p,a\right)  $. Thus, $\gcd\left(  p,a\right)
=\gcd\left(  a,p\right)  =1$. In other words, $p$ is coprime to $a$ (by the
definition of \textquotedblleft coprime\textquotedblright). In other words,
$p\perp a$. This contradicts the fact that we don't have $p\perp a$.

This contradiction shows that our assumption was false. Hence, Proposition
\ref{prop.ent.prime.div-or-coprime} is proven.
\end{proof}

We note that a converse of Proposition \ref{prop.ent.prime.div-or-coprime}
holds as well: If $p>1$ is an integer such that each $a\in\mathbb{Z}$
satisfies either $p\mid a$ or $p\perp a$, then $p$ is a prime. This is easy to
prove and left to the reader.

\begin{exercise}
\label{exe.ent.prime.dist=cop}Let $p$ and $q$ be two distinct primes. Prove
that $p\perp q$.
\end{exercise}

\begin{theorem}
\label{thm.ent.prime.pab}Let $p$ be a prime. Let $a,b\in\mathbb{Z}$ such that
$p\mid ab$. Then, $p\mid a$ or $p\mid b$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.prime.pab}.]Assume the contrary. Thus, neither
$p\mid a$ nor $p\mid b$.

Proposition \ref{prop.ent.prime.div-or-coprime} yields that either $p\mid a$
or $p\perp a$. Hence, $p\perp a$ (since $p\mid a$ does not hold). But $p\mid
ab$. Hence, Theorem \ref{thm.ent.coprime.cancel} (applied to $p$, $a$ and $b$
instead of $a$, $b$ and $c$) yields $p\mid b$. This contradicts the fact that
we don't have $p\mid b$.

This contradiction shows that our assumption was false. Hence, Theorem
\ref{thm.ent.prime.pab} is proven.
\end{proof}

Again, Theorem \ref{thm.ent.prime.pab} has a converse:

\begin{exercise}
\label{exe.ent.prime.pab-conv}Let $p>1$ be an integer. Assume that for every
$a,b\in\mathbb{Z}$ satisfying $p\mid ab$, we must have $p\mid a$ or $p\mid b$.
Prove that $p$ is prime.
\end{exercise}

There is also a version of Theorem \ref{thm.ent.prime.pab} for products of
multiple integers:

\begin{proposition}
\label{prop.ent.prime.pabk}Let $p$ be a prime. Let $a_{1},a_{2},\ldots,a_{k}$
be integers such that $p\mid a_{1}a_{2}\cdots a_{k}$. Then, $p\mid a_{i}$ for
some $i\in\left\{  1,2,\ldots,k\right\}  $.
\end{proposition}

We could prove Proposition \ref{prop.ent.prime.pabk} by induction on $k$. But
here is a more direct argument:

\begin{fineprint}
\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.pabk}.]Assume the contrary. Thus,
there exists no $i\in\left\{  1,2,\ldots,k\right\}  $ such that $p\mid a_{i}$.
In other words, for each $i\in\left\{  1,2,\ldots,k\right\}  $, we have%
\begin{equation}
\left(  \text{not }p\mid a_{i}\right)  . \label{pf.prop.ent.prime.pabk.1}%
\end{equation}


Now, let $i\in\left\{  1,2,\ldots,k\right\}  $. Then, we don't have $p\mid
a_{i}$ (by (\ref{pf.prop.ent.prime.pabk.1})). But Proposition
\ref{prop.ent.prime.div-or-coprime} (applied to $a=a_{i}$) shows that either
$p\mid a_{i}$ or $p\perp a_{i}$. Hence, we have $p\perp a_{i}$ (since we don't
have $p\mid a_{i}$). In other words, $a_{i}\perp p$ (by Proposition
\ref{prop.ent.coprime.perp-symm}).

Now, forget that we fixed $i$. We thus have proven that each $i\in\left\{
1,2,\ldots,k\right\}  $ satisfies $a_{i}\perp p$. Hence, Exercise
\ref{exe.ent.coprime.ab-to-ck} (applied to $c=p$) yields $a_{1}a_{2}\cdots
a_{k}\perp p$. In other words, $a_{1}a_{2}\cdots a_{k}$ is coprime to $p$. In
other words, $\gcd\left(  a_{1}a_{2}\cdots a_{k},p\right)  =1$. Hence,
Proposition \ref{prop.ent.gcd.props1} \textbf{(b)} yields $\gcd\left(
p,a_{1}a_{2}\cdots a_{k}\right)  =\gcd\left(  a_{1}a_{2}\cdots a_{k},p\right)
=1$.

But $p$ is prime; thus, $p>1$. Hence, $p$ is positive. Recall that $p\mid
a_{1}a_{2}\cdots a_{k}$; thus, Proposition \ref{prop.ent.gcd.props1}
\textbf{(i)} (applied to $a=p$ and $b=a_{1}a_{2}\cdots a_{k}$) yields
$\gcd\left(  p,a_{1}a_{2}\cdots a_{k}\right)  =\left\vert p\right\vert =p$
(since $p$ is positive). Comparing this with $\gcd\left(  p,a_{1}a_{2}\cdots
a_{k}\right)  =1$, we obtain $p=1$. This contradicts $p>1$. This contradiction
shows that our assumption was wrong. This proves Proposition
\ref{prop.ent.prime.pabk}.
\end{proof}
\end{fineprint}

\begin{exercise}
\label{exe.ent.prime.coprime-to-pk}Let $p$ be a prime. Let $k$ be a positive
integer. Let $a\in\mathbb{Z}$. Prove that $a\perp p^{k}$ holds if and only if
$p\nmid a$.
\end{exercise}

\subsubsection{Prime factorization I}

The next simple proposition says that every integer $n>1$ is divisible by at
least one prime:

\begin{proposition}
\label{prop.ent.prime.ex-pri-div}Let $n>1$ be an integer. Then, there exists
at least one prime $p$ such that $p\mid n$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.ex-pri-div}.]Clearly, $n$ is a
divisor of $n$ such that $n>1$. Thus, there exists a divisor $q$ of $n$ such
that $q>1$ (namely, $q=n$). Let $d$ be the \textbf{smallest} such
divisor\footnote{This exists, because the set of possible candidates is
nonempty (by the previous sentence) and finite.}. Thus, $d$ is a divisor of
$n$ and satisfies $d>1$. The integer $d$ is positive (since $d>1>0$) and
satisfies $d\mid n$ (since $d$ is a divisor of $n$).

We claim that $d$ is a prime.

\begin{fineprint}
[\textit{Proof:} Let $e$ be any positive divisor of $d$. Assume (for the sake
of contradiction) that $e\notin\left\{  1,d\right\}  $. Thus, $e\neq1$ and
$e\neq d$. Now, $e$ is a divisor of $d$; thus, $e\mid d\mid n$. In other
words, $e$ is a divisor of $n$. Also, $e>1$ (because $e$ is positive and
$e\neq1$). Hence, $e$ is a divisor $q$ of $n$ such that $q>1$.

But $d$ was defined as the \textbf{smallest} divisor $q$ of $n$ such that
$q>1$. Hence, any such divisor is $\geq d$. In other words, any divisor $q$ of
$n$ such that $q>1$ must satisfy $q\geq d$. Applying this to $q=e$, we
conclude that $e\geq d$ (since $e$ is a divisor $q$ of $n$ such that $q>1$).
Combined with $e\neq d$, this yields $e>d$.

But $e\mid d$ and $d\neq0$ (since $d>1>0$). Hence, $\left\vert e\right\vert
\leq\left\vert d\right\vert $ (by Exercise \ref{prop.ent.div.1} \textbf{(b)},
applied to $a=e$ and $b=d$). Since $e$ is positive, we have $\left\vert
e\right\vert =e$, so that $e=\left\vert e\right\vert \leq\left\vert
d\right\vert =d$ (since $d$ is positive). This contradicts $e>d$. This
contradiction shows that our assumption (that $e\notin\left\{  1,d\right\}  $)
was false. Thus, we have proven that $e\in\left\{  1,d\right\}  $. In other
words, $e$ is either $1$ or $d$.

Now, forget that we fixed $e$. We thus have proven that if $e$ is any positive
divisor of $d$, then $e\in\left\{  1,d\right\}  $. In other words, any
positive divisor of $d$ is either $1$ or $d$. Thus, the only positive divisors
of $d$ are $1$ and $d$ (since $1$ and $d$ clearly \textbf{are} positive
divisors of $d$). In other words, $d$ is prime (by the definition of
\textquotedblleft prime\textquotedblright).]
\end{fineprint}

So we know that $d\mid n$, and that $d$ is prime. Hence, there exists at least
one prime $p$ such that $p\mid n$ (namely, $p=d$). This proves Proposition
\ref{prop.ent.prime.ex-pri-div}.
\end{proof}

\begin{definition}
Let $n$ be an integer. A \textit{prime factor} of $n$ means a prime $p$ such
that $p\mid n$. Some say \textquotedblleft prime divisor\textquotedblright%
\ instead of \textquotedblleft prime factor\textquotedblright.
\end{definition}

Thus, Proposition \ref{prop.ent.prime.ex-pri-div} says that each integer $n>1$
has at least one prime divisor.

\begin{proposition}
\label{prop.ent.prime.fac-ex}Let $n$ be a positive integer. Then, $n$ can be
written as a product of finitely many primes.
\end{proposition}

\begin{example}
\label{exa.ent.prime.fac-ex}\textbf{(a)} The integer $60$ can be written as a
product of four primes: namely, $60=2\cdot2\cdot3\cdot5$.

\textbf{(b)} The integer $1$ is the product of $0$ many primes (because a
product of $0$ many primes is the empty product, which is defined to be $1$).
\end{example}

\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.fac-ex}.]We shall prove Proposition
\ref{prop.ent.prime.fac-ex} by strong induction on $n$. Thus, we fix a
positive integer $N$, and we assume (as the induction hypothesis) that
Proposition \ref{prop.ent.prime.fac-ex} holds whenever $n<N$. We must now
prove that Proposition \ref{prop.ent.prime.fac-ex} holds for $n=N$. In other
words, we must prove that $N$ can be written as a product of finitely many primes.

If $N=1$, then this is obvious (because $1$ is a product of $0$ many
primes\footnote{See Example \ref{exa.ent.prime.fac-ex} \textbf{(b)}.}). Thus,
for the rest of this proof, we WLOG assume that $N\neq1$. Hence, $N>1$ (since
$N$ is a positive integer). Therefore, Proposition
\ref{prop.ent.prime.ex-pri-div} (applied to $n=N$) shows that there exists at
least one prime $p$ such that $p\mid N$. Consider this $p$.

We have $p\mid N$. In other words, there exists an integer $c$ such that
$N=pc$. Consider this $c$. We have $p>1$ (since $p$ is prime); thus, $p$ is
positive. Hence, $p\neq0$. Thus, solving the equality $N=pc$ for $c$, we find
$c=N/\underbrace{p}_{>1}<N/1$ (since $N$ is positive), so that $c<N/1=N$. But
our induction hypothesis says that Proposition \ref{prop.ent.prime.fac-ex}
holds whenever $n<N$. Hence, we can apply Proposition
\ref{prop.ent.prime.fac-ex} to $n=c$ (since $c<N$). We thus conclude that $c$
can be written as a product of finitely many primes. In other words, there
exist primes $q_{1},q_{2},\ldots,q_{k}$ such that $c=q_{1}q_{2}\cdots q_{k}$.
Consider these $q_{1},q_{2},\ldots,q_{k}$.

But%
\[
N=p\underbrace{c}_{=q_{1}q_{2}\cdots q_{k}}=pq_{1}q_{2}\cdots q_{k}.
\]
Hence, $N$ can be written as a product of finitely many primes (namely, of the
primes $p,q_{1},q_{2},\ldots,q_{k}$). In other words, Proposition
\ref{prop.ent.prime.fac-ex} holds for $n=N$. This completes the induction
step. Hence, Proposition \ref{prop.ent.prime.fac-ex} is proven by strong induction.
\end{proof}

Proposition \ref{prop.ent.prime.fac-ex} shows that every positive integer $n$
can be represented as a product of finitely many primes. Such a representation
-- or, more precisely, the list of the primes it contains -- will be called
the \textit{prime factorization} of $n$. Rigorously speaking, this means that
we make the following definition:

\begin{definition}
Let $n$ be a positive integer. A \textit{prime factorization} of $n$ means a
tuple $\left(  p_{1},p_{2},\ldots,p_{k}\right)  $ of primes such that
$n=p_{1}p_{2}\cdots p_{k}$.
\end{definition}

Keep in mind that \textquotedblleft tuple\textquotedblright\ always means
\textquotedblleft ordered tuple\textquotedblright\ unless we say otherwise.

\begin{example}
\textbf{(a)} The prime factorizations of $12$ are%
\[
\left(  2,2,3\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  2,3,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  3,2,2\right)  .
\]
Indeed, these three $3$-tuples are prime factorizations of $12$ because
$12=2\cdot2\cdot3=2\cdot3\cdot2=3\cdot2\cdot2$. It is not hard to check that
they are the only prime factorizations of $12$.

\textbf{(b)} If $p$ is a prime, then the only prime factorization of $p$ is
the $1$-tuple $\left(  p\right)  $.

\textbf{(c)} If $p$ is a prime and $i\in\mathbb{N}$, then the only prime
factorization of $p^{i}$ is the $i$-tuple $\left(  \underbrace{p,p,\ldots
,p}_{i\text{ times}}\right)  $. This is not quite obvious at this point
(though it is not hard to derive from Proposition \ref{prop.ent.prime.pabk}).

\textbf{(d)} The only prime factorization of $1$ is the $0$-tuple $\left(
{}\right)  $.
\end{example}

This example suggests that all prime factorizations of a given positive
integer $n$ are equal to each other up to the order of their entries (i.e.,
are permutations of each other). This is indeed true, and we are going to
prove this soon (in Theorem \ref{thm.ent.prime.fac-uni} below).

\subsubsection{Permutations}

First of all: what is a \textquotedblleft permutation\textquotedblright, and
what exactly does \textquotedblleft equal to each other up to the order of
their entries\textquotedblright\ mean?

Informally speaking, a permutation of a tuple\footnote{Recall: a prime
factorization is a tuple.} $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a
tuple obtained from $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ by rearranging
its entries (without inserting new entries, or removing or duplicating
existing entries). To be rigorous, we need to encode this rearrangement via a
bijective map $\sigma:\left\{  1,2,\ldots,k\right\}  \rightarrow\left\{
1,2,\ldots,k\right\}  $ which will tell us which entry of our original tuple
will go to which position in the rearranged tuple. Such bijective maps, too,
are called permutations -- but permutations of sets, not of tuples. So let us
first define permutations of a set, and then use this to define permutations
of a tuple:

\begin{definition}
\label{def.comb.tuples.perm-set}Let $A$ be a set. A \textit{permutation} of
$A$ means a bijective map $A\rightarrow A$.
\end{definition}

\begin{example}
\textbf{(a)} The map $\left\{  1,2,3,4\right\}  \rightarrow\left\{
1,2,3,4\right\}  $ that sends $1,2,3,4$ to $3,1,4,2$ (respectively) is a
permutation of $\left\{  1,2,3,4\right\}  $.

\textbf{(b)} The map $\left\{  1,2,3\right\}  \rightarrow\left\{
1,2,3\right\}  $ that sends $1,2,3$ to $2,3,1$ (respectively) is a permutation
of $\left\{  1,2,3\right\}  $.

\textbf{(c)} For each set $A$, the identity map $\operatorname*{id}%
:A\rightarrow A$ is a permutation of $A$.
\end{example}

Thus, we have defined permutations of a set. We shall later study such
permutations in more detail, at least for finite sets $A$.

Now we can define permutations of a tuple:

\begin{definition}
\label{def.comb.tuples.perm-tup}Let $\left(  p_{1},p_{2},\ldots,p_{k}\right)
$ be a $k$-tuple. A \textit{permutation} of $\left(  p_{1},p_{2},\ldots
,p_{k}\right)  $ means a $k$-tuple of the form $\left(  p_{\sigma\left(
1\right)  },p_{\sigma\left(  2\right)  },\ldots,p_{\sigma\left(  k\right)
}\right)  $ where $\sigma$ is a permutation of the set $\left\{
1,2,\ldots,k\right\}  $. A permutation of $\left(  p_{1},p_{2},\ldots
,p_{k}\right)  $ is also known as a \textit{rearrangement} of $\left(
p_{1},p_{2},\ldots,p_{k}\right)  $.
\end{definition}

\begin{example}
\textbf{(a)} The $4$-tuple $\left(  1,3,1,2\right)  $ is a permutation of the
$4$-tuple $\left(  3,2,1,1\right)  $. In fact, if we denote the $4$-tuple
$\left(  3,2,1,1\right)  $ by $\left(  p_{1},p_{2},p_{3},p_{4}\right)  $, then
there exists a permutation $\sigma$ of the set $\left\{  1,2,3,4\right\}  $
such that $\left(  1,3,1,2\right)  =\left(  p_{\sigma\left(  1\right)
},p_{\sigma\left(  2\right)  },p_{\sigma\left(  3\right)  },p_{\sigma\left(
4\right)  }\right)  $. (Actually, there exist two such permutations $\sigma$:
One of them sends $1,2,3,4$ to $3,1,4,2$, while the other sends $1,2,3,4$ to
$4,1,3,2$.)

\textbf{(b)} Any $k$-tuple is a permutation of itself. Indeed, if $\left(
p_{1},p_{2},\ldots,p_{k}\right)  $ is any $k$-tuple, then $\left(  p_{1}%
,p_{2},\ldots,p_{k}\right)  =\left(  p_{\sigma\left(  1\right)  }%
,p_{\sigma\left(  2\right)  },\ldots,p_{\sigma\left(  k\right)  }\right)  $ if
we let $\sigma$ be the identity map $\operatorname*{id}:\left\{
1,2,\ldots,k\right\}  \rightarrow\left\{  1,2,\ldots,k\right\}  $.
\end{example}

The following fact is easy and fundamental:

\begin{proposition}
\label{prop.comb.tuples.perm.symm}Let $\left(  p_{1},p_{2},\ldots
,p_{k}\right)  $ be a $k$-tuple. If $\left(  q_{1},q_{2},\ldots,q_{k}\right)
$ is a permutation of $\left(  p_{1},p_{2},\ldots,p_{k}\right)  $, then
$\left(  p_{1},p_{2},\ldots,p_{k}\right)  $ is a permutation of $\left(
q_{1},q_{2},\ldots,q_{k}\right)  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.comb.tuples.perm.symm}.]If you don't insist on
formalization, this is obvious: Any rearrangement of the entries of a
$k$-tuple can be undone by another rearrangement (which places the entries
back in their old positions). Thus, $\left(  p_{1},p_{2},\ldots,p_{k}\right)
$ can be obtained from $\left(  q_{1},q_{2},\ldots,q_{k}\right)  $ by
rearranging the entries.

\begin{fineprint}
Here is a formal proof:

Assume that $\left(  q_{1},q_{2},\ldots,q_{k}\right)  $ is a permutation of
$\left(  p_{1},p_{2},\ldots,p_{k}\right)  $. In other words, the $k$-tuple
$\left(  q_{1},q_{2},\ldots,q_{k}\right)  $ has the form $\left(
p_{\sigma\left(  1\right)  },p_{\sigma\left(  2\right)  },\ldots
,p_{\sigma\left(  k\right)  }\right)  $ for some permutation $\sigma$ of the
set $\left\{  1,2,\ldots,k\right\}  $ (by Definition
\ref{def.comb.tuples.perm-tup}). Consider this $\sigma$, and denote it by
$\tau$. Thus, $\tau$ is a permutation of the set $\left\{  1,2,\ldots
,k\right\}  $ and has the property that $\left(  q_{1},q_{2},\ldots
,q_{k}\right)  =\left(  p_{\tau\left(  1\right)  },p_{\tau\left(  2\right)
},\ldots,p_{\tau\left(  k\right)  }\right)  $.

Now, $\tau$ is a permutation of the set $\left\{  1,2,\ldots,k\right\}  $. In
other words, $\tau$ is a bijective map $\left\{  1,2,\ldots,k\right\}
\rightarrow\left\{  1,2,\ldots,k\right\}  $ (by Definition
\ref{def.comb.tuples.perm-set}). So the map $\tau$ is bijective, hence
invertible. Thus, its inverse $\tau^{-1}$ is well-defined and is also
invertible\footnote{And its inverse is $\left(  \tau^{-1}\right)  ^{-1}=\tau
$.}, hence bijective. So we know that $\tau^{-1}$ is a bijective map $\left\{
1,2,\ldots,k\right\}  \rightarrow\left\{  1,2,\ldots,k\right\}  $. In other
words, $\tau^{-1}$ is a permutation of the set $\left\{  1,2,\ldots,k\right\}
$ (by Definition \ref{def.comb.tuples.perm-set}).

We have $\left(  q_{1},q_{2},\ldots,q_{k}\right)  =\left(  p_{\tau\left(
1\right)  },p_{\tau\left(  2\right)  },\ldots,p_{\tau\left(  k\right)
}\right)  $. In other words,
\begin{equation}
q_{i}=p_{\tau\left(  i\right)  }\ \ \ \ \ \ \ \ \ \ \text{for each }%
i\in\left\{  1,2,\ldots,k\right\}  . \label{pf.prop.comb.tuples.perm.symm.1}%
\end{equation}
Hence, for each $j\in\left\{  1,2,\ldots,k\right\}  $, we have%
\begin{align*}
q_{\tau^{-1}\left(  j\right)  }  &  =p_{\tau\left(  \tau^{-1}\left(  j\right)
\right)  }\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.comb.tuples.perm.symm.1}), applied to }i=\tau^{-1}\left(
j\right)  \right) \\
&  =p_{j}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\tau\left(  \tau^{-1}\left(
j\right)  \right)  =j\right)  .
\end{align*}
In other words, $\left(  q_{\tau^{-1}\left(  1\right)  },q_{\tau^{-1}\left(
2\right)  },\ldots,q_{\tau^{-1}\left(  k\right)  }\right)  =\left(
p_{1},p_{2},\ldots,p_{k}\right)  $. Hence, the $k$-tuple $\left(  p_{1}%
,p_{2},\ldots,p_{k}\right)  $ has the form $\left(  q_{\sigma\left(  1\right)
},q_{\sigma\left(  2\right)  },\ldots,q_{\sigma\left(  k\right)  }\right)  $
for some permutation $\sigma$ of the set $\left\{  1,2,\ldots,k\right\}  $
(namely, $\sigma=\tau^{-1}$). In other words, the $k$-tuple $\left(
p_{1},p_{2},\ldots,p_{k}\right)  $ is a permutation of the $k$-tuple $\left(
q_{1},q_{2},\ldots,q_{k}\right)  $ (by Definition
\ref{def.comb.tuples.perm-tup}). This proves Proposition
\ref{prop.comb.tuples.perm.symm}.
\end{fineprint}
\end{proof}

Now, we can say what we mean when we say that two tuples differ only in the
order of their entries:

\begin{definition}
We say that two tuples \textit{differ only in the order of their entries} if
they are permutations of each other.
\end{definition}

The next lemma that we shall use is a basic fact from elementary combinatorics:

\begin{lemma}
\label{lem.comb.tuples.mult=perm}Let $P$ be a set. Let $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $ and $\left(  b_{1},b_{2},\ldots,b_{\ell}\right)
$ be two tuples of elements of $P$. Assume that for each $p\in P$, we have%
\begin{align}
&  \left(  \text{the number of times }p\text{ appears in }\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  \right) \nonumber\\
&  =\left(  \text{the number of times }p\text{ appears in }\left(  b_{1}%
,b_{2},\ldots,b_{\ell}\right)  \right)  .
\label{eq.lem.comb.tuples.mult=perm.ass}%
\end{align}
Then, the two tuples $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and $\left(
b_{1},b_{2},\ldots,b_{\ell}\right)  $ differ only in the order of their
entries (i.e., are permutations of each other). (In other words, we have
$k=\ell$, and there exists a permutation$\ \sigma$ of the set $\left\{
1,2,\ldots,\ell\right\}  $ such that $\left(  a_{1},a_{2},\ldots,a_{k}\right)
=\left(  b_{\sigma\left(  1\right)  },b_{\sigma\left(  2\right)  }%
,\ldots,b_{\sigma\left(  \ell\right)  }\right)  $.)
\end{lemma}

Lemma \ref{lem.comb.tuples.mult=perm} is an intuitively obvious fact: It says
that if two tuples (of any objects -- e.g., numbers) have the property that
any object occurs as often in the first tuple as it does in the second tuple,
then the two tuples differ only in the order of their entries. From the formal
point of view, though, it is a statement that needs proof. Let us merely
sketch how such a proof can be obtained, without going into the details:

\begin{fineprint}
\begin{proof}
[Proof of Lemma \ref{lem.comb.tuples.mult=perm} (sketched).]We can WLOG assume
that the set $P$ is finite (since otherwise, we can replace $P$ by the finite
subset $\left\{  a_{1},a_{2},\ldots,a_{k},b_{1},b_{2},\ldots,b_{\ell}\right\}
$, without breaking the assumption that $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $ and $\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $ are two
tuples of elements of $P$). Assume this (at least if you don't want to use the
Axiom of Choice\footnote{I don't.}).

For each $p\in P$, define two sets%
\begin{align*}
A_{p}  &  =\left\{  i\in\left\{  1,2,\ldots,k\right\}  \ \mid\ a_{i}%
=p\right\}  ;\\
B_{p}  &  =\left\{  j\in\left\{  1,2,\ldots,\ell\right\}  \ \mid
\ b_{j}=p\right\}  .
\end{align*}
The equation (\ref{eq.lem.comb.tuples.mult=perm.ass}) then says that
$\left\vert A_{p}\right\vert =\left\vert B_{p}\right\vert $ for each $p\in P$.
Hence, for each $p\in P$, there exists a bijection $\phi_{p}:A_{p}\rightarrow
B_{p}$ (because if two sets have the same size, then there exists a bijection
between them). Pick such a bijection $\phi_{p}$ for each $p\in P$. (This does
not require the Axiom of Choice, since $P$ is finite.)

Now, define a map $\sigma:\left\{  1,2,\ldots,k\right\}  \rightarrow\left\{
1,2,\ldots,\ell\right\}  $ as follows: For each $i\in\left\{  1,2,\ldots
,k\right\}  $, set $\sigma\left(  i\right)  =\phi_{p}\left(  i\right)  $,
where $p=a_{i}$. Thus, for each $p\in P$, the map $\sigma$ sends each $i\in
A_{p}$ to an element of $B_{p}$ (because if $i\in A_{p}$, then $a_{i}=p$, and
thus the definition of $\sigma$ yields $\sigma\left(  i\right)  =\phi
_{p}\left(  i\right)  \in B_{p}$.)

It is not hard to see that this map $\sigma$ is a bijection. (Its inverse map
sends each $j\in\left\{  1,2,\ldots,\ell\right\}  $ to $\phi_{p}^{-1}\left(
j\right)  $, where $p=b_{j}$.) Thus, we have found a bijection from $\left\{
1,2,\ldots,k\right\}  $ to $\left\{  1,2,\ldots,\ell\right\}  $. This shows
that the sets $\left\{  1,2,\ldots,k\right\}  $ and $\left\{  1,2,\ldots
,\ell\right\}  $ have the same size; in other words, $k=\ell$. Thus, the
bijection $\sigma$ is actually a bijection from $\left\{  1,2,\ldots
,\ell\right\}  $ to $\left\{  1,2,\ldots,\ell\right\}  $. In other words,
$\sigma$ is a permutation of the set $\left\{  1,2,\ldots,\ell\right\}  $.

Finally, it is easy to see that $\left(  a_{1},a_{2},\ldots,a_{k}\right)
=\left(  b_{\sigma\left(  1\right)  },b_{\sigma\left(  2\right)  }%
,\ldots,b_{\sigma\left(  \ell\right)  }\right)  $. (Indeed, let $i\in\left\{
1,2,\ldots,k\right\}  $, and set $p=a_{i}$; then, the definition of $\sigma$
yields $\sigma\left(  i\right)  =\phi_{p}\left(  i\right)  \in B_{p}$ and
therefore $b_{\sigma\left(  i\right)  }=a_{i}$. Since this holds for each $i$,
we thus conclude that $\left(  b_{\sigma\left(  1\right)  },b_{\sigma\left(
2\right)  },\ldots,b_{\sigma\left(  k\right)  }\right)  =\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $. Thus, $\left(  a_{1},a_{2},\ldots,a_{k}\right)
=\left(  b_{\sigma\left(  1\right)  },b_{\sigma\left(  2\right)  }%
,\ldots,b_{\sigma\left(  k\right)  }\right)  =\left(  b_{\sigma\left(
1\right)  },b_{\sigma\left(  2\right)  },\ldots,b_{\sigma\left(  \ell\right)
}\right)  $ (since $k=\ell$).) Thus, we have found a permutation $\sigma$ of
the set $\left\{  1,2,\ldots,\ell\right\}  $ such that $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  =\left(  b_{\sigma\left(  1\right)  }%
,b_{\sigma\left(  2\right)  },\ldots,b_{\sigma\left(  \ell\right)  }\right)
$. In other words, the two tuples $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $
and $\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $ are permutations of each
other. This proves Lemma \ref{lem.comb.tuples.mult=perm}.
\end{proof}
\end{fineprint}

Lemma \ref{lem.comb.tuples.mult=perm} has a converse that is much simpler:

\begin{lemma}
\label{lem.comb.tuples.mult=perm.conv}Let $P$ be a set. Let $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ and $\left(  b_{1},b_{2},\ldots,b_{\ell
}\right)  $ be two tuples of elements of $P$. Assume that these two tuples
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and $\left(  b_{1},b_{2}%
,\ldots,b_{\ell}\right)  $ differ only in the order of their entries (i.e.,
are permutations of each other). Then, for each $p\in P$, we have%
\begin{align*}
&  \left(  \text{the number of times }p\text{ appears in }\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  \right) \\
&  =\left(  \text{the number of times }p\text{ appears in }\left(  b_{1}%
,b_{2},\ldots,b_{\ell}\right)  \right)  .
\end{align*}

\end{lemma}

We leave the proof of this lemma to the reader.

\subsubsection{$p$-valuations}

Now, let us come back to number theory. We first claim that a nonzero integer
$n$ can only be divisible by finitely many powers of a given prime $p$. More precisely:

\begin{lemma}
\label{lem.ent.prime.vp-wd}Let $p$ be a prime. Let $n$ be a nonzero integer.
Then, there exists a largest $m\in\mathbb{N}$ such that $p^{m}\mid n$.
\end{lemma}

The proof of this lemma will rely on a simple inequality, which we leave as an exercise:

\begin{exercise}
\label{exe.ent.prime.vp-lem}Let $p$ be an integer such that $p>1$. Prove that
$p^{k}>k$ for each $k\in\mathbb{N}$.
\end{exercise}

\begin{proof}
[Proof of Lemma \ref{lem.ent.prime.vp-wd}.]We know that $p$ is a prime. Thus,
$p$ is an integer and $p>1$ (by the definition of a \textquotedblleft
prime\textquotedblright). This is all we shall need from our assumption that
$p$ is prime.

Let $W$ be the set of all $m\in\mathbb{N}$ satisfying $p^{m}\mid n$. Then, $W$
is a set of integers. Moreover, $0$ is an $m\in\mathbb{N}$ satisfying
$p^{m}\mid n$ (since $p^{0}=1\mid n$); in other words, $0\in W$ (by the
definition of $W$). Hence, the set $W$ is nonempty.

Let $u=\left\vert n\right\vert $. Thus, $u\in\mathbb{N}$.

Exercise \ref{exe.ent.prime.vp-lem} yields that $p^{k}>k$ for each
$k\in\mathbb{N}$. Thus, each $g\in W$ satisfies $g\in\left\{  0,1,\ldots
,u-1\right\}  $\ \ \ \ \footnote{\textit{Proof.} Let $g\in W$. Thus, $g$ is an
$m\in\mathbb{N}$ satisfying $p^{m}\mid n$ (by the definition of $W$). In other
words, $g\in\mathbb{N}$ and $p^{g}\mid n$. Also, $n\neq0$ (since $n$ is
nonzero). Hence, Proposition \ref{prop.ent.div.1} \textbf{(b)} (applied to
$a=p^{g}$ and $b=n$) yields $\left\vert p^{g}\right\vert \leq\left\vert
n\right\vert =u$. But $p$ is positive (since $p>1>0$); thus, $p^{g}$ is
positive. Hence, $\left\vert p^{g}\right\vert =p^{g}$. Thus, $p^{g}=\left\vert
p^{g}\right\vert \leq u$. But recall that $p^{k}>k$ for each $k\in\mathbb{N}$.
Applying this to $k=g$, we find $p^{g}>g$. Hence, $g<p^{g}\leq u$, so that
$g\in\left\{  0,1,\ldots,u-1\right\}  $ (since $g\in\mathbb{N}$). Qed.}. In
other words, $W\subseteq\left\{  0,1,\ldots,u-1\right\}  $. Hence, the set $W$
is finite (since the set $\left\{  0,1,\ldots,u-1\right\}  $ is finite). Thus,
$W$ is a finite nonempty set of integers. Therefore, the set $W$ has a largest
element. In view of how $W$ was defined, this can be restated as follows:
There exists a largest $m\in\mathbb{N}$ such that $p^{m}\mid n$. This proves
Lemma \ref{lem.ent.prime.vp-wd}.
\end{proof}

\begin{definition}
\label{def.ent.prime.vp}Let $p$ be a prime.

\textbf{(a)} Let $n$ be a nonzero integer. Then, $v_{p}\left(  n\right)  $
shall denote the largest $m\in\mathbb{N}$ such that $p^{m}\mid n$. This is
well-defined (by Lemma \ref{lem.ent.prime.vp-wd}). This nonnegative integer
$v_{p}\left(  n\right)  $ will be called the $p$\textit{-valuation} (or the
$p$\textit{-adic valuation}) of $n$.

\textbf{(b)} We extend this definition of $v_{p}\left(  n\right)  $ to the
case of $n=0$ as follows: Set $v_{p}\left(  0\right)  =\infty$, where $\infty$
is a new symbol. This symbol $\infty$ is supposed to model \textquotedblleft
positive infinity\textquotedblright; in particular, we take it to satisfy the
following rules:

\begin{itemize}
\item We have $k+\infty=\infty+k=\infty$ for all integers $k$.

\item We have $\infty+\infty=\infty$.

\item Each integer $k$ satisfies $k<\infty$ and $\infty>k$ (and thus
$k\leq\infty$ and $\infty\geq k$).

\item No integer $k$ satisfies $k\geq\infty$ or $\infty\leq k$ (or $k>\infty$
or $\infty<k$).

\item If $S$ is a nonempty set of integers, then $\min\left(  S\cup\left\{
\infty\right\}  \right)  =\min S$ (provided that $\min S$ exists).

\item We have $\min\left\{  \infty\right\}  =\infty$.

\item If $S$ is any set of integers, then $\max\left(  S\cup\left\{
\infty\right\}  \right)  =\infty$.
\end{itemize}

(Note, however, that $\infty$ is not supposed to be a \textquotedblleft first
class citizen\textquotedblright\ of the number system. In particular,
$\infty-\infty$ is not defined. More generally, $k-\infty$ is never defined,
whatever $k$ is. Indeed, any definition of $k-\infty$ would break some of the
familiar rules of arithmetic. The only operations that we shall subject
$\infty$ to are addition, minimum and maximum.)
\end{definition}

Note that the rules for the symbol $\infty$ yield that%
\[
k+\infty=\infty+k=\max\left\{  k,\infty\right\}  =\infty
\]
and%
\[
\min\left\{  k,\infty\right\}  =k
\]
for each $k\in\mathbb{Z}\cup\left\{  \infty\right\}  $. It is not hard to see
that basic properties of inequalities (such as \textquotedblleft if $a\leq b$
and $b\leq c$, then $a\leq c$\textquotedblright) and of addition (such as
\textquotedblleft$\left(  a+b\right)  +c=a+\left(  b+c\right)  $%
\textquotedblright) and of the interplay between inequalities and addition
(such as \textquotedblleft if $a\leq b$, then $a+c\leq b+c$\textquotedblright)
are still valid in $\mathbb{Z}\cup\left\{  \infty\right\}  $ (that is, they
still hold if we plug $\infty$ for one or more of the variables). However, of
course, we cannot \textquotedblleft cancel\textquotedblright\ $\infty$ from
equalities (i.e., we cannot cancel $\infty$ from $a+\infty=b+\infty$ to obtain
$a=b$) or inequalities.

\begin{example}
\label{exa.ent.prime.vp}\textbf{(a)} We have $v_{5}\left(  50\right)  =2$.
Indeed, $2$ is the largest $m\in\mathbb{N}$ such that $5^{m}\mid50$ (because
$5^{2}=25\mid50$ but $5^{3}=125\nmid50$).

\textbf{(b)} We have $v_{5}\left(  51\right)  =0$. Indeed, $0$ is the largest
$m\in\mathbb{N}$ such that $5^{m}\mid51$ (because $5^{0}=1\mid51$ but
$5^{1}=5\nmid51$).

\textbf{(c)} We have $v_{5}\left(  55\right)  =1$. Indeed, $1$ is the largest
$m\in\mathbb{N}$ such that $5^{m}\mid55$ (because $5^{1}=5\mid55$ but
$5^{2}=25\nmid55$).

\textbf{(d)} We have $v_{5}\left(  0\right)  =\infty$ (by Definition
\ref{def.ent.prime.vp} \textbf{(b)}).
\end{example}

Definition \ref{def.ent.prime.vp} \textbf{(a)} can be restated in the
following more intuitive way: Given a prime $p$ and a nonzero integer $n$, we
let $v_{p}\left(  n\right)  $ be the number of times we can divide $n$ by $p$
without leaving $\mathbb{Z}$. Definition \ref{def.ent.prime.vp} \textbf{(b)}
is consistent with this picture, because we can clearly divide $0$ by $p$
infinitely often without leaving $\mathbb{Z}$. From this point of view, the
following lemma should be obvious:

\begin{lemma}
\label{lem.ent.prime.vp-def}Let $p$ be a prime. Let $i\in\mathbb{N}$. Let
$n\in\mathbb{Z}$. Then, $p^{i}\mid n$ if and only if $v_{p}\left(  n\right)
\geq i$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.prime.vp-def}.]First, let us notice that
$p^{i}\mid0$. Also, Definition \ref{def.ent.prime.vp} \textbf{(b)} yields
$v_{p}\left(  0\right)  =\infty\geq i$ (according to our rules for the symbol
$\infty$). Hence, both statements $\left(  p^{i}\mid0\right)  $ and $\left(
v_{p}\left(  0\right)  \geq i\right)  $ hold. Thus, $p^{i}\mid0$ if and only
if $v_{p}\left(  0\right)  \geq i$. In other words, Lemma
\ref{lem.ent.prime.vp-def} holds if $n=0$. Thus, for the rest of this proof,
we WLOG assume that $n\neq0$. Hence, $n$ is nonzero. Thus, $v_{p}\left(
n\right)  $ is the largest $m\in\mathbb{N}$ such that $p^{m}\mid n$ (by
Definition \ref{def.ent.prime.vp} \textbf{(a)}). Hence, $v_{p}\left(
n\right)  $ itself is an $m\in\mathbb{N}$ such that $p^{m}\mid n$. In other
words, $v_{p}\left(  n\right)  \in\mathbb{N}$ and $p^{v_{p}\left(  n\right)
}\mid n$.

We must prove that $p^{i}\mid n$ if and only if $v_{p}\left(  n\right)  \geq
i$. Let us prove the \textquotedblleft$\Longrightarrow$\textquotedblright\ and
\textquotedblleft$\Longleftarrow$\textquotedblright\ directions of this
\textquotedblleft if and only if\textquotedblright\ statement separately:

$\Longrightarrow:$ Assume that $p^{i}\mid n$. We must prove that $v_{p}\left(
n\right)  \geq i$.

The integer $i$ is an $m\in\mathbb{N}$ such that $p^{m}\mid n$ (since
$p^{i}\mid n$). But $v_{p}\left(  n\right)  $ is the \textbf{largest} such $m$
(by Definition \ref{def.ent.prime.vp} \textbf{(a)}). Hence, $v_{p}\left(
n\right)  \geq i$. This proves the \textquotedblleft$\Longrightarrow
$\textquotedblright\ direction of Lemma \ref{lem.ent.prime.vp-def}.

$\Longleftarrow:$ Assume that $v_{p}\left(  n\right)  \geq i$. We must prove
that $p^{i}\mid n$.

We have $v_{p}\left(  n\right)  \geq i$, thus $i\leq v_{p}\left(  n\right)  $.
Hence, Exercise \ref{exe.ent.div.powers} (applied to $p$, $i$ and
$v_{p}\left(  n\right)  $ instead of $n$, $a$ and $b$) yields $p^{i}\mid
p^{v_{p}\left(  n\right)  }$. Thus, $p^{i}\mid p^{v_{p}\left(  n\right)  }\mid
n$.

Hence, we have proven $p^{i}\mid n$. This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Lemma
\ref{lem.ent.prime.vp-def}.
\end{proof}

\begin{corollary}
\label{cor.ent.prime.vp-0}Let $p$ be a prime. Let $n\in\mathbb{Z}$. Then,
$v_{p}\left(  n\right)  =0$ if and only if $p\nmid n$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.ent.prime.vp-0}.]$\Longrightarrow:$ Assume that
$v_{p}\left(  n\right)  =0$. We must prove that $p\nmid n$.

We don't have $v_{p}\left(  n\right)  \geq1$ (since $v_{p}\left(  n\right)
=0<1$). But Lemma \ref{lem.ent.prime.vp-def} (applied to $i=1$) shows that
$p^{1}\mid n$ if and only if $v_{p}\left(  n\right)  \geq1$. Hence, we don't
have $p^{1}\mid n$ (since we don't have $v_{p}\left(  n\right)  \geq1$). In
other words, we have $p^{1}\nmid n$. In other words, $p\nmid n$ (since
$p=p^{1}$). This proves the \textquotedblleft$\Longrightarrow$%
\textquotedblright\ direction of Corollary \ref{cor.ent.prime.vp-0}.

$\Longleftarrow:$ Assume that $p\nmid n$. We must prove that $v_{p}\left(
n\right)  =0$.

We don't have $p\mid n$ (since $p\nmid n$). In other words, we don't have
$p^{1}\mid n$ (since $p^{1}=p$). But Lemma \ref{lem.ent.prime.vp-def} (applied
to $i=1$) shows that $p^{1}\mid n$ if and only if $v_{p}\left(  n\right)
\geq1$. Hence, we don't have $v_{p}\left(  n\right)  \geq1$ (since we don't
have $p^{1}\mid n$). In other words, $v_{p}\left(  n\right)  <1$.

If we had $n=0$, then we would have $p\mid0=n$, which would contradict $p\nmid
n$. Hence, we don't have $n=0$. Thus, $n$ is nonzero. Hence, Definition
\ref{def.ent.prime.vp} \textbf{(a)} shows that $v_{p}\left(  n\right)
\in\mathbb{N}$. In light of this, we can conclude $v_{p}\left(  n\right)  =0$
from $v_{p}\left(  n\right)  <1$. This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Corollary
\ref{cor.ent.prime.vp-0}.
\end{proof}

Here is another property of $p$-valuations that is useful in their study:

\begin{lemma}
\label{lem.ent.prime.vp-copr}Let $p$ be a prime. Let $n\in\mathbb{Z}$ be
nonzero. Then:

\textbf{(a)} There exists a nonzero integer $u$ such that $u\perp p$ and
$n=up^{v_{p}\left(  n\right)  }$.

\textbf{(b)} If $i\in\mathbb{N}$ and $w\in\mathbb{Z}$ are such that $w\perp p$
and $n=wp^{i}$, then $v_{p}\left(  n\right)  =i$.
\end{lemma}

Before we prove this formally, let us show the idea behind this lemma. Recall
that, given a prime $p$ and a nonzero integer $n$, the number $v_{p}\left(
n\right)  $ counts how often we can divide $n$ by $p$ without leaving
$\mathbb{Z}$. What happens after we have divided $n$ by $p$ this many times?
We get a number $u$ that is still an integer, but is no longer divisible by
$p$, and thus must be coprime to $p$ (by Proposition
\ref{prop.ent.prime.div-or-coprime}). This is what Lemma
\ref{lem.ent.prime.vp-copr} \textbf{(a)} says. Lemma
\ref{lem.ent.prime.vp-copr} \textbf{(b)} is a converse statement: It says that
if we divide $n$ by $p$ some number of times (say, $i$ times) and obtain an
integer coprime to $p$, then $i$ must be $v_{p}\left(  n\right)  $.

\begin{proof}
[Proof of Lemma \ref{lem.ent.prime.vp-copr}.]Definition \ref{def.ent.prime.vp}
\textbf{(a)} shows that $v_{p}\left(  n\right)  $ is the largest
$m\in\mathbb{N}$ such that $p^{m}\mid n$. Hence, $v_{p}\left(  n\right)  $
itself is an $m\in\mathbb{N}$ such that $p^{m}\mid n$. In other words,
$v_{p}\left(  n\right)  \in\mathbb{N}$ and $p^{v_{p}\left(  n\right)  }\mid n$.

Thus, in particular, $p^{v_{p}\left(  n\right)  }\mid n$. In other words,
there exists an integer $c$ such that $n=p^{v_{p}\left(  n\right)  }c$.
Consider this $c$. We have $n=p^{v_{p}\left(  n\right)  }c=cp^{v_{p}\left(
n\right)  }$.

Assume (for the sake of contradiction) that $p\mid c$. Thus, there exists an
integer $d$ such that $c=pd$. Consider this $d$. Now,%
\[
n=p^{v_{p}\left(  n\right)  }\underbrace{c}_{=pd}=\underbrace{p^{v_{p}\left(
n\right)  }p}_{=p^{v_{p}\left(  n\right)  +1}}d=p^{v_{p}\left(  n\right)
+1}d.
\]
Hence, $p^{v_{p}\left(  n\right)  +1}\mid n$ (since $d$ is an integer). In
other words, $v_{p}\left(  n\right)  +1$ is an $m\in\mathbb{N}$ such that
$p^{m}\mid n$. But we know that $v_{p}\left(  n\right)  $ is the
\textbf{largest} such $m$ (by Definition \ref{def.ent.prime.vp} \textbf{(a)}).
Hence, we conclude that $v_{p}\left(  n\right)  \geq v_{p}\left(  n\right)
+1$. But this is clearly absurd. This contradiction shows that our assumption
(that $p\mid c$) was wrong. Hence, we do not have $p\mid c$.

But Proposition \ref{prop.ent.prime.div-or-coprime} (applied to $a=c$) shows
that either $p\mid c$ or $p\perp c$. Hence, $p\perp c$ (since we do not have
$p\mid c$). In other words, $c\perp p$ (because of Proposition
\ref{prop.ent.coprime.perp-symm}).

If we had $c=0$, then we would have $n=p^{v_{p}\left(  n\right)
}\underbrace{c}_{=0}=0$, which would contradict the fact that $n$ is nonzero.
Hence, we cannot have $c=0$. Thus, $c$ is nonzero.

Now, we know that $c$ is a nonzero integer satisfying $c\perp p$ and
$n=cp^{v_{p}\left(  n\right)  }$. Hence, there exists a nonzero integer $u$
such that $u\perp p$ and $n=up^{v_{p}\left(  n\right)  }$ (namely, $u=c$).
This proves Lemma \ref{lem.ent.prime.vp-copr} \textbf{(a)}.

\textbf{(b)} Let $i\in\mathbb{N}$ and $w\in\mathbb{Z}$ be such that $w\perp p$
and $n=wp^{i}$. We must prove that $v_{p}\left(  n\right)  =i$.

From $w\perp p$, we obtain $p\perp w$ (by Proposition
\ref{prop.ent.coprime.perp-symm}). In other words, $\gcd\left(  p,w\right)
=1$.

We have $n=wp^{i}=p^{i}w$ and thus $p^{i}\mid n$ (since $w$ is an integer).
But Lemma \ref{lem.ent.prime.vp-def} yields that $p^{i}\mid n$ if and only if
$v_{p}\left(  n\right)  \geq i$. Hence, we have $v_{p}\left(  n\right)  \geq
i$ (since we have $p^{i}\mid n$).

Now, we shall prove that $v_{p}\left(  n\right)  \leq i$. Indeed, assume the
contrary. Thus, $v_{p}\left(  n\right)  >i$, so that $v_{p}\left(  n\right)
\geq i+1$ (since $v_{p}\left(  n\right)  $ and $i$ are integers). But Lemma
\ref{lem.ent.prime.vp-def} (applied to $i+1$ instead of $i$) shows that
$p^{i+1}\mid n$ if and only if $v_{p}\left(  n\right)  \geq i+1$. Thus, we
have $p^{i+1}\mid n$ (since we have $v_{p}\left(  n\right)  \geq i+1$). In
other words, $pp^{i}\mid wp^{i}$ (since $p^{i+1}=pp^{i}$ and $n=wp^{i}$). But
$p$ is a prime; thus, $p>1>0$ and therefore $p\neq0$. Hence, $p^{i}\neq0$.
Thus, Exercise \ref{exe.ent.div.acbc} (applied to $p$, $w$ and $p^{i}$ instead
of $a$, $b$ and $c$) shows that $p\mid w$ holds if and only if $pp^{i}\mid
wp^{i}$. Hence, $p\mid w$ holds (since $pp^{i}\mid wp^{i}$ holds). Thus,
Proposition \ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $p$ and $w$
instead of $a$ and $b$) yields $\gcd\left(  p,w\right)  =\left\vert
p\right\vert =p$ (since $p>0$). Comparing this with $\gcd\left(  p,w\right)
=1$, we find $p=1$. This contradicts $p>1$.

This contradiction shows that our assumption was false. Hence, $v_{p}\left(
n\right)  \leq i$ is proven. Combining this with $v_{p}\left(  n\right)  \geq
i$, we obtain $v_{p}\left(  n\right)  =i$. This proves Lemma
\ref{lem.ent.prime.vp-copr} \textbf{(b)}.
\end{proof}

The next property of $p$-adic valuations is crucial, as it reveals how they
can be computed and bounded:

\begin{theorem}
\label{thm.ent.prime.vp-ring}Let $p$ be a prime.

\textbf{(a)} We have $v_{p}\left(  ab\right)  =v_{p}\left(  a\right)
+v_{p}\left(  b\right)  $ for any two integers $a$ and $b$.

\textbf{(b)} We have $v_{p}\left(  a+b\right)  \geq\min\left\{  v_{p}\left(
a\right)  ,v_{p}\left(  b\right)  \right\}  $ for any two integers $a$ and $b$.

\textbf{(c)} We have $v_{p}\left(  1\right)  =0$.

\textbf{(d)} We have $v_{p}\left(  q\right)  =%
\begin{cases}
1, & \text{if }q=p;\\
0, & \text{if }q\neq p
\end{cases}
$ for any prime $q$.
\end{theorem}

Note that Theorem \ref{thm.ent.prime.vp-ring} \textbf{(a)} gives a formula for
$v_{p}\left(  ab\right)  $ in terms of $v_{p}\left(  a\right)  $ and
$v_{p}\left(  b\right)  $, but there is no such formula for $v_{p}\left(
a+b\right)  $ (since $v_{p}\left(  a\right)  $ and $v_{p}\left(  b\right)  $
do not uniquely determine $v_{p}\left(  a+b\right)  $). Thus, Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(b)} only gives a bound.

\begin{proof}
[Proof of Theorem \ref{thm.ent.prime.vp-ring}.]\textbf{(a)} Let $a$ and $b$ be
two integers. We must prove that $v_{p}\left(  ab\right)  =v_{p}\left(
a\right)  +v_{p}\left(  b\right)  $.

If $a=0$, then this is true\footnote{\textit{Proof.} Assume that $a=0$. Then,
$\underbrace{a}_{=0}b=0$ and thus $v_{p}\left(  ab\right)  =v_{p}\left(
0\right)  =\infty$ (by Definition \ref{def.ent.prime.vp} \textbf{(b)}). Also,
from $a=0$, we obtain $v_{p}\left(  a\right)  =v_{p}\left(  0\right)  =\infty
$. Hence, $\underbrace{v_{p}\left(  a\right)  }_{=\infty}+v_{p}\left(
b\right)  =\infty+v_{p}\left(  b\right)  =\infty$ (since $\infty+k=\infty$ for
each $k\in\mathbb{Z}\cup\left\{  \infty\right\}  $). Comparing this with
$v_{p}\left(  ab\right)  =\infty$, we obtain $v_{p}\left(  ab\right)
=v_{p}\left(  a\right)  +v_{p}\left(  b\right)  $. This is exactly what we
wanted to prove.}. Thus, for the rest of the proof of Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(a)}, we WLOG assume that $a\neq0$. For
similar reasons, we WLOG assume that $b\neq0$.

The integer $a$ is nonzero (since $a\neq0$). Thus, Lemma
\ref{lem.ent.prime.vp-copr} \textbf{(a)} (applied to $n=a$) shows that there
exists a nonzero integer $u$ such that $u\perp p$ and $a=up^{v_{p}\left(
a\right)  }$. Consider this $u$, and denote it by $x$. Thus, $x$ is a nonzero
integer such that $x\perp p$ and $a=xp^{v_{p}\left(  a\right)  }$.

The integer $b$ is nonzero (since $b\neq0$). Thus, Lemma
\ref{lem.ent.prime.vp-copr} \textbf{(a)} (applied to $n=b$) shows that there
exists a nonzero integer $u$ such that $u\perp p$ and $b=up^{v_{p}\left(
b\right)  }$. Consider this $u$, and denote it by $y$. Thus, $y$ is a nonzero
integer such that $y\perp p$ and $b=yp^{v_{p}\left(  b\right)  }$.

We have $x\perp p$ and $y\perp p$. Thus, Theorem \ref{thm.ent.coprime.ab-to-c}
(applied to $x$, $y$ and $p$ instead of $a$, $b$ and $c$) shows that $xy\perp
p$.

The integer $ab$ is nonzero (since $a\neq0$ and $b\neq0$).

Furthermore, multiplying the equalities $a=xp^{v_{p}\left(  a\right)  }$ and
$b=yp^{v_{p}\left(  b\right)  }$, we obtain%
\[
ab=\left(  xp^{v_{p}\left(  a\right)  }\right)  \left(  yp^{v_{p}\left(
b\right)  }\right)  =\left(  xy\right)  \underbrace{\left(  p^{v_{p}\left(
a\right)  }p^{v_{p}\left(  b\right)  }\right)  }_{=p^{v_{p}\left(  a\right)
+v_{p}\left(  b\right)  }}=\left(  xy\right)  p^{v_{p}\left(  a\right)
+v_{p}\left(  b\right)  }.
\]
Thus, Lemma \ref{lem.ent.prime.vp-copr} \textbf{(b)} (applied to $n=ab$,
$i=v_{p}\left(  a\right)  +v_{p}\left(  b\right)  $ and $w=xy$) shows that
$v_{p}\left(  ab\right)  =v_{p}\left(  a\right)  +v_{p}\left(  b\right)  $
(since $v_{p}\left(  a\right)  +v_{p}\left(  b\right)  \in\mathbb{N}$ and
$xy\in\mathbb{Z}$ and $xy\perp p$). This proves Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(a)}.

\textbf{(b)} Let $a$ and $b$ be two integers. We must prove that $v_{p}\left(
a+b\right)  \geq\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)
\right\}  $.

If $a=0$, then this is true\footnote{\textit{Proof.} Assume that $a=0$. Then,
$v_{p}\left(  \underbrace{a}_{=0}+b\right)  =v_{p}\left(  b\right)  \geq
\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  \right\}  $ (since
any element of a set is $\geq$ to the minimum of this set). This is exactly
what we wanted to prove.}. Thus, for the rest of the proof of Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(b)}, we WLOG assume that $a\neq0$. For
similar reasons, we WLOG assume that $b\neq0$.

The integer $a$ is nonzero (since $a\neq0$). Thus, $v_{p}\left(  a\right)
\in\mathbb{N}$ (by Definition \ref{def.ent.prime.vp} \textbf{(a)}). Similarly,
$v_{p}\left(  b\right)  \in\mathbb{N}$.

Let $m=\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  \right\}
$. Thus, $m\in\mathbb{N}$ (since $v_{p}\left(  a\right)  \in\mathbb{N}$ and
$v_{p}\left(  b\right)  \in\mathbb{N}$).

We have $m=\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)
\right\}  \leq v_{p}\left(  a\right)  $; in other words, $v_{p}\left(
a\right)  \geq m$. But Lemma \ref{lem.ent.prime.vp-def} (applied to $n=a$ and
$i=m$) shows that $p^{m}\mid a$ if and only if $v_{p}\left(  a\right)  \geq
m$. Hence, we have $p^{m}\mid a$ (since $v_{p}\left(  a\right)  \geq m$). In
other words, $a\equiv0\operatorname{mod}p^{m}$. Similarly, $b\equiv
0\operatorname{mod}p^{m}$. Adding these two congruences together, we obtain
$a+b\equiv0+0=0\operatorname{mod}p^{m}$. In other words, $p^{m}\mid a+b$.

But Lemma \ref{lem.ent.prime.vp-def} (applied to $n=a+b$ and $i=m$) shows that
$p^{m}\mid a+b$ if and only if $v_{p}\left(  a+b\right)  \geq m$. Hence, we
have $v_{p}\left(  a+b\right)  \geq m$ (since $p^{m}\mid a+b$). Thus,
$v_{p}\left(  a+b\right)  \geq m=\min\left\{  v_{p}\left(  a\right)
,v_{p}\left(  b\right)  \right\}  $. This proves Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(b)}.

\textbf{(c)} Exercise \ref{exe.ent.coprime.01} \textbf{(a)} (applied to $a=p$)
yields $1\perp p$. Also, $1=1\cdot p^{0}$. Thus, Lemma
\ref{lem.ent.prime.vp-copr} \textbf{(b)} (applied to $n=1$, $i=0$ and $w=1$)
yields $v_{p}\left(  1\right)  =0$. This proves Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(c)}.

\textbf{(d)} Let $q$ be a prime. We must prove that $v_{p}\left(  q\right)  =%
\begin{cases}
1, & \text{if }q=p;\\
0, & \text{if }q\neq p
\end{cases}
$.

We are in one of the following two cases:

\textit{Case 1:} We have $q=p$.

\textit{Case 2:} We have $q\neq p$.

Let us first consider Case 1. In this case, we have $q=p$. But Exercise
\ref{exe.ent.coprime.01} \textbf{(a)} (applied to $a=p$) yields $1\perp p$.
Also, $p=1\cdot p^{1}$. Thus, Lemma \ref{lem.ent.prime.vp-copr} \textbf{(b)}
(applied to $n=p$, $i=1$ and $w=1$) yields $v_{p}\left(  p\right)  =1$. From
$q=p$, we obtain $v_{p}\left(  q\right)  =v_{p}\left(  p\right)  =1$.
Comparing this with
\[%
\begin{cases}
1, & \text{if }q=p;\\
0, & \text{if }q\neq p
\end{cases}
=1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }q=p\right)  ,
\]
we obtain $v_{p}\left(  q\right)  =%
\begin{cases}
1, & \text{if }q=p;\\
0, & \text{if }q\neq p
\end{cases}
$. Hence, Theorem \ref{thm.ent.prime.vp-ring} \textbf{(d)} is proven in Case 1.

Let us now consider Case 2. In this case, we have $q\neq p$. Thus, the primes
$q$ and $p$ are distinct. Hence, Exercise \ref{exe.ent.prime.dist=cop}
(applied to $q$ and $p$ instead of $p$ and $q$) yields $q\perp p$. Also,
$q=q\cdot p^{0}$ (since $p^{0}=1$). Thus, Lemma \ref{lem.ent.prime.vp-copr}
\textbf{(b)} (applied to $n=q$, $i=0$ and $w=q$) yields $v_{p}\left(
q\right)  =0$. Comparing this with
\[%
\begin{cases}
1, & \text{if }q=p;\\
0, & \text{if }q\neq p
\end{cases}
=0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }q\neq p\right)  ,
\]
we obtain $v_{p}\left(  q\right)  =%
\begin{cases}
1, & \text{if }q=p;\\
0, & \text{if }q\neq p
\end{cases}
$. Hence, Theorem \ref{thm.ent.prime.vp-ring} \textbf{(d)} is proven in Case 2.

We have now proven Theorem \ref{thm.ent.prime.vp-ring} \textbf{(d)} in each of
the two Cases 1 and 2. Thus, Theorem \ref{thm.ent.prime.vp-ring} \textbf{(d)}
is always proven.
\end{proof}

\begin{corollary}
\label{cor.ent.prime.vp-ringk}Let $p$ be a prime. Let $a_{1},a_{2}%
,\ldots,a_{k}$ be $k$ integers. Then, $v_{p}\left(  a_{1}a_{2}\cdots
a_{k}\right)  =v_{p}\left(  a_{1}\right)  +v_{p}\left(  a_{2}\right)
+\cdots+v_{p}\left(  a_{k}\right)  $.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.ent.prime.vp-ringk}.]This follows
straightforwardly by induction on $k$, using Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(a)} (as well as Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(c)} for the induction base). We leave the
details to the reader, who has seen this sort of proof several times already.
\end{proof}

\begin{exercise}
\label{exe.ent.prime.vp-abs}Let $p$ be a prime. Let $n\in\mathbb{Z}$. Prove
that $v_{p}\left(  \left\vert n\right\vert \right)  =v_{p}\left(  n\right)  $.
\end{exercise}

\begin{exercise}
\label{exe.ent.prime.vp-pow}Let $p$ be a prime. Let $a\in\mathbb{Z}$ and
$k\in\mathbb{N}$. Prove that $v_{p}\left(  a^{k}\right)  =kv_{p}\left(
a\right)  $.
\end{exercise}

\begin{exercise}
\label{exe.ent.prime.p1a1puau}Let $p_{1},p_{2},\ldots,p_{u}$ be finitely many
distinct primes. Let $a_{1},a_{2},\ldots,a_{u}$ be nonnegative integers.

\textbf{(a)} Prove that $v_{p_{i}}\left(  p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots
p_{u}^{a_{u}}\right)  =a_{i}$ for each $i\in\left\{  1,2,\ldots,u\right\}  $.

\textbf{(b)} Prove that $v_{p}\left(  p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots
p_{u}^{a_{u}}\right)  =0$ for each prime $p$ satisfying $p\notin\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  $.
\end{exercise}

\subsubsection{Prime factorization II}

\begin{proposition}
\label{prop.ent.prime.mult-in-pf}Let $n$ be a positive integer. Let $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ be a prime factorization of $n$. Let $p$ be
a prime. Then,%
\begin{align*}
&  \left(  \text{the number of times }p\text{ appears in the tuple }\left(
a_{1},a_{2},\ldots,a_{k}\right)  \right) \\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,k\right\}  \text{
such that }a_{i}=p\right) \\
&  =v_{p}\left(  n\right)  .
\end{align*}

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.mult-in-pf}.]We have assumed that
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a prime factorization of $n$.
Thus, $a_{1},a_{2},\ldots,a_{k}$ are primes satisfying $n=a_{1}a_{2}\cdots
a_{k}$. Hence, for each $i\in\left\{  1,2,\ldots,k\right\}  $, the integer
$a_{i}$ is prime and thus satisfies%
\begin{equation}
v_{p}\left(  a_{i}\right)  =%
\begin{cases}
1, & \text{if }a_{i}=p;\\
0, & \text{if }a_{i}\neq p
\end{cases}
\label{pf.prop.ent.prime.mult-in-pf.1}%
\end{equation}
(by Theorem \ref{thm.ent.prime.vp-ring} \textbf{(d)}, applied to $q=a_{i}$).

From $n=a_{1}a_{2}\cdots a_{k}$, we obtain%
\begin{align*}
v_{p}\left(  n\right)   &  =v_{p}\left(  a_{1}a_{2}\cdots a_{k}\right) \\
&  =v_{p}\left(  a_{1}\right)  +v_{p}\left(  a_{2}\right)  +\cdots
+v_{p}\left(  a_{k}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Corollary
\ref{cor.ent.prime.vp-ringk}}\right) \\
&  =\underbrace{\sum_{i=1}^{k}}_{=\sum_{i\in\left\{  1,2,\ldots,k\right\}  }%
}\underbrace{v_{p}\left(  a_{i}\right)  }_{\substack{=%
\begin{cases}
1, & \text{if }a_{i}=p;\\
0, & \text{if }a_{i}\neq p
\end{cases}
\\\text{(by (\ref{pf.prop.ent.prime.mult-in-pf.1}))}}}=\sum_{i\in\left\{
1,2,\ldots,k\right\}  }%
\begin{cases}
1, & \text{if }a_{i}=p;\\
0, & \text{if }a_{i}\neq p
\end{cases}
\\
&  =\sum_{\substack{i\in\left\{  1,2,\ldots,k\right\}  ;\\a_{i}=p}%
}\underbrace{%
\begin{cases}
1, & \text{if }a_{i}=p;\\
0, & \text{if }a_{i}\neq p
\end{cases}
}_{\substack{=1\\\text{(since }a_{i}=p\text{)}}}+\sum_{\substack{i\in\left\{
1,2,\ldots,k\right\}  ;\\a_{i}\neq p}}\underbrace{%
\begin{cases}
1, & \text{if }a_{i}=p;\\
0, & \text{if }a_{i}\neq p
\end{cases}
}_{\substack{=0\\\text{(since }a_{i}\neq p\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }i\in\left\{  1,2,\ldots,k\right\}  \text{ satisfies either
}a_{i}=p\text{ or }a_{i}\neq p\\
\text{(but not both)}%
\end{array}
\right) \\
&  =\sum_{\substack{i\in\left\{  1,2,\ldots,k\right\}  ;\\a_{i}=p}%
}1+\underbrace{\sum_{\substack{i\in\left\{  1,2,\ldots,k\right\}  ;\\a_{i}\neq
p}}0}_{=0}=\sum_{\substack{i\in\left\{  1,2,\ldots,k\right\}  ;\\a_{i}=p}}1\\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,k\right\}  \text{
such that }a_{i}=p\right)  \cdot1\\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,k\right\}  \text{
such that }a_{i}=p\right) \\
&  =\left(  \text{the number of times }p\text{ appears in }\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  \right)  .
\end{align*}
This proves Proposition \ref{prop.ent.prime.mult-in-pf}.
\end{proof}

We are finally ready to prove the so-called \textit{Fundamental Theorem of
Arithmetic}:

\begin{theorem}
\label{thm.ent.prime.fac-uni}Let $n$ be a positive integer.

\textbf{(a)} There exists a prime factorization of $n$.

\textbf{(b)} Any two such factorizations differ only in the order of their
entries (i.e., are permutations of each other).
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.prime.fac-uni}.]\textbf{(a)} Proposition
\ref{prop.ent.prime.fac-ex} shows that $n$ can be written as a product of
finitely many primes. In other words, there exist finitely many primes
$p_{1},p_{2},\ldots,p_{k}$ such that $n=p_{1}p_{2}\cdots p_{k}$. Consider
these primes. Thus, $\left(  p_{1},p_{2},\ldots,p_{k}\right)  $ is a prime
factorization of $n$ (by the definition of \textquotedblleft prime
factorization\textquotedblright). Hence, there exists a prime factorization of
$n$. This proves Theorem \ref{thm.ent.prime.fac-uni} \textbf{(a)}.

\textbf{(b)} Let $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and $\left(
b_{1},b_{2},\ldots,b_{\ell}\right)  $ be two prime factorizations of $n$. We
must prove that $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and $\left(
b_{1},b_{2},\ldots,b_{\ell}\right)  $ differ only in the order of their
entries (i.e., are permutations of each other).

Let $P$ be the set of all primes. Note that $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $ and $\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $ are prime
factorizations of $n$. Hence, $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and
$\left(  b_{1},b_{2},\ldots,b_{\ell}\right)  $ are tuples of primes, i.e.,
tuples of elements of $P$.

Let $p\in P$. Thus, $p$ is a prime (by the definition of $P$). Hence,
Proposition \ref{prop.ent.prime.mult-in-pf} shows that%
\begin{align*}
&  \left(  \text{the number of times }p\text{ appears in the tuple }\left(
a_{1},a_{2},\ldots,a_{k}\right)  \right) \\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,k\right\}  \text{
such that }a_{i}=p\right) \\
&  =v_{p}\left(  n\right)  .
\end{align*}
Similarly,%
\begin{align*}
&  \left(  \text{the number of times }p\text{ appears in the tuple }\left(
b_{1},b_{2},\ldots,b_{\ell}\right)  \right) \\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,\ell\right\}  \text{
such that }b_{i}=p\right) \\
&  =v_{p}\left(  n\right)  .
\end{align*}
Comparing these two equalities, we conclude that
\begin{align}
&  \left(  \text{the number of times }p\text{ appears in }\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  \right) \nonumber\\
&  =\left(  \text{the number of times }p\text{ appears in }\left(  b_{1}%
,b_{2},\ldots,b_{\ell}\right)  \right)  . \label{pf.thm.ent.prime.fac-uni.b.1}%
\end{align}


Now, forget that we fixed $p$. We thus have proven
(\ref{pf.thm.ent.prime.fac-uni.b.1}) for each $p\in P$. Hence, Lemma
\ref{lem.comb.tuples.mult=perm} shows that the tuples $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $ and $\left(  b_{1},b_{2},\ldots,b_{\ell}\right)
$ differ only in the order of their entries (i.e., are permutations of each
other). This completes our proof of Theorem \ref{thm.ent.prime.fac-uni}
\textbf{(b)}.
\end{proof}

\subsubsection{The canonical factorization}

You have seen finite products such as\footnote{Here and in the following, $n!$
denotes the product $1\cdot2\cdot\cdots\cdot n$ whenever $n\in\mathbb{N}$.
Thus, in particular,
\begin{align*}
0!  &  =\left(  \text{empty product}\right)
=1,\ \ \ \ \ \ \ \ \ \ 1!=1,\ \ \ \ \ \ \ \ \ \ 2!=1\cdot2=2,\\
3!  &  =1\cdot2\cdot3=6,\ \ \ \ \ \ \ \ \ \ 4!=1\cdot2\cdot3\cdot
4=24,\ \ \ \ \ \ \ \ \ \ 5!=1\cdot2\cdot3\cdot4\cdot5=120.
\end{align*}
}
\begin{align*}
\prod_{i\in\left\{  1,2,3,4,5\right\}  }i  &  =1\cdot2\cdot3\cdot
4\cdot5=5!=120\ \ \ \ \ \ \ \ \ \ \text{and}\\
\prod_{i\in\left\{  3,5,7\right\}  }\left(  i^{2}+1\right)   &  =\left(
3^{2}+1\right)  \cdot\left(  5^{2}+1\right)  \cdot\left(  7^{2}+1\right)
=13000.
\end{align*}
Sometimes, infinite products (i.e., products ranging over infinite sets) also
make sense. Many examples of well-defined infinite products arise from
analysis and have to do with convergence. Here, we are doing algebra and thus
shall only consider a very elementary, non-analytic meaning of convergence.
Namely, we will consider infinite products that have only finitely many
factors different from $1$. For example, the product $2\cdot7\cdot
4\cdot\underbrace{1\cdot1\cdot1\cdot1\cdot\cdots}_{\text{infinitely many
}1\text{'s}}$ is of such form. It is easy to give a meaning to such products:
Just throw away all the $1$'s (since multiplying by $1$ does not change a
number) and take the product of the remaining (finitely many) numbers. So, for
example, our product $2\cdot7\cdot4\cdot\underbrace{1\cdot1\cdot1\cdot
1\cdot\cdots}_{\text{infinitely many }1\text{'s}}$ should evaluate to
$2\cdot7\cdot4=56$.

This is indeed a meaningful and useful definition. For example, the set of all
prime numbers is infinite (by Theorem \ref{thm.ent.prime.infin} below), but
nevertheless, for each nonzero integer $n$, the product $\prod_{p\text{
prime}}p^{v_{p}\left(  n\right)  }$ (where the \textquotedblleft%
$\prod_{p\text{ prime}}$\textquotedblright\ symbol means a product ranging
over all primes $p$) is well-defined due to having only finitely many factors
different from $1$:

\begin{lemma}
\label{lem.ent.prime.vpn=0}Let $n$ be a nonzero integer.

\textbf{(a)} We have $v_{p}\left(  n\right)  =0$ for every prime $p>\left\vert
n\right\vert $. (Note that \textquotedblleft for every prime $p>\left\vert
n\right\vert $\textquotedblright\ is shorthand for \textquotedblleft for every
prime $p$ satisfying $p>\left\vert n\right\vert $\textquotedblright.)

\textbf{(b)} The product $\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }$
has only finitely many factors different from $1$. (Here and in the following,
the \textquotedblleft$\prod_{p\text{ prime}}$\textquotedblright\ symbol means
a product ranging over all primes $p$.)
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.prime.vpn=0}.]\textbf{(a)} Let $p$ be a prime
such that $p>\left\vert n\right\vert $. We must prove that $v_{p}\left(
n\right)  =0$.

We have $p>1$ (since $p$ is prime); thus, $p>1>0$ and therefore $\left\vert
p\right\vert =p>\left\vert n\right\vert $.

We have $n\neq0$ (since $n$ is nonzero). Thus, if we had $p\mid n$, then we
would have $\left\vert p\right\vert \leq\left\vert n\right\vert $ (by
Proposition \ref{prop.ent.div.1} \textbf{(b)}, applied to $a=p$ and $b=n$),
which would contradict $\left\vert p\right\vert >\left\vert n\right\vert $.
Thus, we cannot have $p\mid n$. In other words, we have $p\nmid n$.

But Corollary \ref{cor.ent.prime.vp-0} yields that $v_{p}\left(  n\right)  =0$
if and only if $p\nmid n$. Hence, $v_{p}\left(  n\right)  =0$ (since $p\nmid
n$). This proves Lemma \ref{lem.ent.prime.vpn=0} \textbf{(a)}.

\textbf{(b)} For every prime $p>\left\vert n\right\vert $, we have
$v_{p}\left(  n\right)  =0$ (by Lemma \ref{lem.ent.prime.vpn=0} \textbf{(a)})
and thus $p^{v_{p}\left(  n\right)  }=p^{0}=1$. Thus, all but finitely many
primes $p$ satisfy $p^{v_{p}\left(  n\right)  }=1$ (since all but finitely
many primes $p$ satisfy $p>\left\vert n\right\vert $). Therefore, all but
finitely many factors of the product $\prod_{p\text{ prime}}p^{v_{p}\left(
n\right)  }$ are $1$. In other words, the product $\prod_{p\text{ prime}%
}p^{v_{p}\left(  n\right)  }$ has only finitely many factors different from
$1$. This proves Lemma \ref{lem.ent.prime.vpn=0} \textbf{(b)}.
\end{proof}

\begin{corollary}
\label{cor.ent.prime.can-fac}Let $n$ be a positive integer. Then,%
\[
n=\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }.
\]


Here, the infinite product $\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }$
is well-defined (according to Lemma \ref{lem.ent.prime.vpn=0} \textbf{(b)}).
\end{corollary}

This expression $n=\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }$ is
called the \textit{canonical factorization} of $n$.

\begin{proof}
[Proof of Corollary \ref{cor.ent.prime.can-fac}.]Theorem
\ref{thm.ent.prime.fac-uni} \textbf{(a)} shows that there exists a prime
factorization of $n$. Consider such a factorization, and denote it by $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $. Thus, $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $ is a prime factorization of $n$; in other words, $a_{1}%
,a_{2},\ldots,a_{k}$ are primes satisfying $n=a_{1}a_{2}\cdots a_{k}$. For
each prime $p$, we have%
\begin{equation}
\left(  \text{the number of }i\in\left\{  1,2,\ldots,k\right\}  \text{ such
that }a_{i}=p\right)  =v_{p}\left(  n\right)
\label{pf.cor.ent.prime.can-fac.1}%
\end{equation}
(by Proposition \ref{prop.ent.prime.mult-in-pf}). Now,%
\begin{align*}
n  &  =a_{1}a_{2}\cdots a_{k}=\prod_{i\in\left\{  1,2,\ldots,k\right\}  }%
a_{i}\\
&  =\prod_{p\text{ prime}}\ \ \prod_{\substack{i\in\left\{  1,2,\ldots
,k\right\}  ;\\a_{i}=p}}\underbrace{a_{i}}_{=p}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split our product into smaller}\\
\text{products, according to the value of }a_{i}\text{;}\\
\text{this is allowed, since each }a_{i}\text{ is a prime}%
\end{array}
\right) \\
&  =\prod_{p\text{ prime}}\underbrace{\prod_{\substack{i\in\left\{
1,2,\ldots,k\right\}  ;\\a_{i}=p}}p}_{=p^{\left(  \text{the number of }%
i\in\left\{  1,2,\ldots,k\right\}  \text{ such that }a_{i}=p\right)  }}\\
&  =\prod_{p\text{ prime}}\underbrace{p^{\left(  \text{the number of }%
i\in\left\{  1,2,\ldots,k\right\}  \text{ such that }a_{i}=p\right)  }%
}_{\substack{=p^{v_{p}\left(  n\right)  }\\\text{(by
(\ref{pf.cor.ent.prime.can-fac.1}))}}}\\
&  =\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }.
\end{align*}
This proves Corollary \ref{cor.ent.prime.can-fac}.
\end{proof}

The next exercise says that a nonnegative integer $n$ is uniquely determined
by the family $\left(  v_{p}\left(  n\right)  \right)  _{p\text{ prime}}$ of
its $p$-valuations for all primes $p$:

\begin{exercise}
\label{exe.ent.prime.vp=vp}Let $n$ and $m$ be two nonnegative integers. Assume
that
\begin{equation}
v_{p}\left(  n\right)  =v_{p}\left(  m\right)  \ \ \ \ \ \ \ \ \ \ \text{for
every prime }p. \label{eq.exe.ent.prime.vp=vp.ass}%
\end{equation}
Prove that $n=m$.
\end{exercise}

\begin{corollary}
\label{cor.ent.prime.can-facZ}Let $n$ be a nonzero integer. Then,%
\[
\left\vert n\right\vert =\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }.
\]


Here, the infinite product $\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }$
is well-defined (according to Lemma \ref{lem.ent.prime.vpn=0} \textbf{(b)}).
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.ent.prime.can-facZ}.]The integer $\left\vert
n\right\vert $ is positive (since $n$ is nonzero). Hence, Corollary
\ref{cor.ent.prime.can-fac} (applied to $\left\vert n\right\vert $ instead of
$n$) yields%
\[
\left\vert n\right\vert =\prod_{p\text{ prime}}\underbrace{p^{v_{p}\left(
\left\vert n\right\vert \right)  }}_{\substack{=p^{v_{p}\left(  n\right)
}\\\text{(since Exercise \ref{exe.ent.prime.vp-abs}}\\\text{yields }%
v_{p}\left(  \left\vert n\right\vert \right)  =v_{p}\left(  n\right)
\text{)}}}=\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }.
\]
This proves Corollary \ref{cor.ent.prime.can-facZ}.
\end{proof}

We can furthermore use $p$-adic valuations to check divisibility of integers:

\begin{proposition}
\label{prop.ent.prime.n|m}Let $n$ and $m$ be integers. Then, $n\mid m$ if and
only if each prime $p$ satisfies $v_{p}\left(  n\right)  \leq v_{p}\left(
m\right)  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.n|m}.]If $m=0$, then Proposition
\ref{prop.ent.prime.n|m} is true\footnote{\textit{Proof.} Assume that $m=0$.
Thus, each prime $p$ satisfies $v_{p}\left(  \underbrace{m}_{=0}\right)
=v_{p}\left(  0\right)  =\infty$ (by Definition \ref{def.ent.prime.vp}
\textbf{(b)}) and thus $v_{p}\left(  m\right)  =\infty\geq v_{p}\left(
n\right)  $, so that $v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $.
Also, $n\mid0=m$. Thus, the statements \textquotedblleft$n\mid m$%
\textquotedblright\ and \textquotedblleft each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $\textquotedblright\ are
both true. Hence, $n\mid m$ if and only if each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $. In other words,
Proposition \ref{prop.ent.prime.n|m} is true. Qed.}. Hence, for the rest of
this proof, we WLOG assume that $m\neq0$. Therefore, $m$ is nonzero. Hence,
each prime $p$ satisfies $v_{p}\left(  m\right)  \in\mathbb{N}$ (by Definition
\ref{def.ent.prime.vp} \textbf{(a)}), so that $v_{p}\left(  m\right)  <\infty$.

If $n=0$, then Proposition \ref{prop.ent.prime.n|m} is
true\footnote{\textit{Proof.} Assume that $n=0$. Thus, each prime $p$
satisfies $v_{p}\left(  \underbrace{n}_{=0}\right)  =v_{p}\left(  0\right)
=\infty$ (by Definition \ref{def.ent.prime.vp} \textbf{(b)}) and thus
$v_{p}\left(  m\right)  <\infty=v_{p}\left(  n\right)  $. Applying this to
$p=2$, we obtain $v_{2}\left(  m\right)  <v_{2}\left(  n\right)  $ (since $2$
is a prime). Hence, we don't have $v_{2}\left(  n\right)  \leq v_{2}\left(
m\right)  $. Thus, the statement \textquotedblleft each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $\textquotedblright\ is
false (since $p=2$ is a counterexample).
\par
If we had $n\mid m$, then there would be an integer $c$ such that $m=nc$. This
would then lead to $m=\underbrace{n}_{=0}c=0$, which would contradict $m\neq
0$. Hence, we cannot have $n\mid m$. Thus, the statements \textquotedblleft%
$n\mid m$\textquotedblright\ and \textquotedblleft each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $\textquotedblright\ are
both false. Hence, $n\mid m$ if and only if each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $. In other words,
Proposition \ref{prop.ent.prime.n|m} is true. Qed.}. Hence, for the rest of
this proof, we WLOG assume that $n\neq0$. Therefore, $n$ is nonzero.

The statement of Proposition \ref{prop.ent.prime.n|m} does not change if we
replace $n$ and $m$ by $\left\vert n\right\vert $ and $\left\vert m\right\vert
$, respectively\footnote{Indeed, the statement \textquotedblleft$n\mid
m$\textquotedblright\ does not change (since Proposition \ref{prop.ent.div.1}
\textbf{(a)} yields that we have $n\mid m$ if and only if $\left\vert
n\right\vert \mid\left\vert m\right\vert $), and the statement
\textquotedblleft each prime $p$ satisfies $v_{p}\left(  n\right)  \leq
v_{p}\left(  m\right)  $\textquotedblright\ does not change either (because
Exercise \ref{exe.ent.prime.vp-abs} shows that $v_{p}\left(  \left\vert
n\right\vert \right)  =v_{p}\left(  n\right)  $ and $v_{p}\left(  \left\vert
m\right\vert \right)  =v_{p}\left(  m\right)  $).}. Hence, we can WLOG assume
that $n$ and $m$ are nonnegative. Assume this. Then, $n\geq0$, so that $n>0$
(since $n$ is nonzero). Hence, $n$ is a positive integer. Thus, Corollary
\ref{cor.ent.prime.can-fac} yields%
\begin{equation}
n=\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }.
\label{pf.prop.ent.prime.n|m.n=}%
\end{equation}
Similarly,%
\begin{equation}
m=\prod_{p\text{ prime}}p^{v_{p}\left(  m\right)  }.
\label{pf.prop.ent.prime.n|m.m=}%
\end{equation}


Our goal is to prove that $n\mid m$ if and only if each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $. We shall now prove the
\textquotedblleft$\Longleftarrow$\textquotedblright\ and \textquotedblleft%
$\Longrightarrow$\textquotedblright\ directions of this \textquotedblleft if
and only if\textquotedblright\ statement separately.

$\Longleftarrow:$ Assume that each prime $p$ satisfies $v_{p}\left(  n\right)
\leq v_{p}\left(  m\right)  $. We must prove that $n\mid m$.

The product $\prod_{p\text{ prime}}p^{v_{p}\left(  m\right)  -v_{p}\left(
n\right)  }$ is well-defined\footnote{\textit{Proof. }Let $p$ be a prime such
that $p>\left\vert m\right\vert $. Then, $v_{p}\left(  m\right)  =0$ (by Lemma
\ref{lem.ent.prime.vpn=0} \textbf{(a)}, applied to $m$ instead of $n$), so
that $v_{p}\left(  m\right)  -\underbrace{v_{p}\left(  n\right)  }_{\geq0}\leq
v_{p}\left(  m\right)  =0$. On the other hand, $v_{p}\left(  n\right)  \leq
v_{p}\left(  m\right)  $ (since we assumed that each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $); thus, $v_{p}\left(
m\right)  -v_{p}\left(  n\right)  \geq0$. Combining this with $v_{p}\left(
m\right)  -v_{p}\left(  n\right)  \leq0$, we obtain $v_{p}\left(  m\right)
-v_{p}\left(  n\right)  =0$. Hence, $p^{v_{p}\left(  m\right)  -v_{p}\left(
n\right)  }=p^{0}=1$.
\par
Now, forget that we fixed $p$. We thus have proven that every prime
$p>\left\vert m\right\vert $ satisfies $p^{v_{p}\left(  m\right)
-v_{p}\left(  n\right)  }=1$. Hence, all but finitely many primes $p$ satisfy
$p^{v_{p}\left(  m\right)  -v_{p}\left(  n\right)  }=1$ (since all but
finitely many primes $p$ satisfy $p>\left\vert m\right\vert $). In other
words, the product $\prod_{p\text{ prime}}p^{v_{p}\left(  m\right)
-v_{p}\left(  n\right)  }$ has only finitely many factors different from $1$.
Hence, this product is well-defined.}.

We have assumed that each prime $p$ satisfies $v_{p}\left(  n\right)  \leq
v_{p}\left(  m\right)  $. In other words, each prime $p$ satisfies
$v_{p}\left(  m\right)  -v_{p}\left(  n\right)  \geq0$ and therefore
$p^{v_{p}\left(  m\right)  -v_{p}\left(  n\right)  }\in\mathbb{Z}$. Hence, the
product $\prod_{p\text{ prime}}p^{v_{p}\left(  m\right)  -v_{p}\left(
n\right)  }$ is a product of integers, and thus itself an integer. Let us
denote this product by $c$. Thus,%
\begin{equation}
c=\prod_{p\text{ prime}}p^{v_{p}\left(  m\right)  -v_{p}\left(  n\right)  }.
\label{pf.prop.ent.prime.n|m.c=}%
\end{equation}
Thus, $c$ is an integer (since we have just shown that $\prod_{p\text{ prime}%
}p^{v_{p}\left(  m\right)  -v_{p}\left(  n\right)  }$ is an integer).
Multiplying the equalities (\ref{pf.prop.ent.prime.n|m.n=}) and
(\ref{pf.prop.ent.prime.n|m.c=}), we obtain%
\begin{align*}
nc  &  =\left(  \prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }\right)
\left(  \prod_{p\text{ prime}}p^{v_{p}\left(  m\right)  -v_{p}\left(
n\right)  }\right)  =\prod_{p\text{ prime}}\underbrace{\left(  p^{v_{p}\left(
n\right)  }p^{v_{p}\left(  m\right)  -v_{p}\left(  n\right)  }\right)
}_{\substack{=p^{v_{p}\left(  n\right)  +\left(  v_{p}\left(  m\right)
-v_{p}\left(  n\right)  \right)  }=p^{v_{p}\left(  m\right)  }\\\text{(since
}v_{p}\left(  n\right)  +\left(  v_{p}\left(  m\right)  -v_{p}\left(
n\right)  \right)  =v_{p}\left(  m\right)  \text{)}}}\\
&  =\prod_{p\text{ prime}}p^{v_{p}\left(  m\right)  }%
=m\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.prop.ent.prime.n|m.m=}%
)}\right)  .
\end{align*}
In other words, $m=nc$. Hence, $n\mid m$ (since $c$ is an integer). This
completes the proof of the \textquotedblleft$\Longleftarrow$\textquotedblright%
\ direction of Proposition \ref{prop.ent.prime.n|m}.

$\Longrightarrow:$ Assume that $n\mid m$. We must prove that each prime $p$
satisfies $v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $.

So let $p$ be a prime. Recall that $n\mid m$. In other words, there exists
some integer $b$ such that $m=nb$. Consider this $b$. Now,%
\begin{align*}
v_{p}\left(  \underbrace{m}_{=nb}\right)   &  =v_{p}\left(  nb\right) \\
&  =v_{p}\left(  n\right)  +\underbrace{v_{p}\left(  b\right)  }_{\geq
0}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.ent.prime.vp-ring}
\textbf{(a)}, applied to }a=n\right) \\
&  \geq v_{p}\left(  n\right)  ,
\end{align*}
so that $v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $. Now, forget
that we fixed $p$. We thus have proven that each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $. This completes the
proof of the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction
of Proposition \ref{prop.ent.prime.n|m}.
\end{proof}

Let us extract one of the steps of our above proof into a separate lemma,
since we shall use the same reasoning later on:

\begin{lemma}
\label{lem.ent.prime.prod|prod}For each prime $p$, let $a_{p}$ and $b_{p}$ be
nonnegative integers such that
\begin{equation}
a_{p}\leq b_{p}. \label{eq.lem.ent.prime.prod|prod.apbp}%
\end{equation}
Assume that all but finitely many primes $p$ satisfy $b_{p}=0$. Then, the
products $\prod_{p\text{ prime}}p^{a_{p}}$ and $\prod_{p\text{ prime}}%
p^{b_{p}}$ are both well-defined and satisfy
\begin{equation}
\prod_{p\text{ prime}}p^{a_{p}}\mid\prod_{p\text{ prime}}p^{b_{p}}.
\label{eq.lem.ent.prime.prod|prod.claim}%
\end{equation}

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.prime.prod|prod}.]This is going to be really
boring: The well-definedness part is all about bookkeeping finiteness
information, whereas the $\prod_{p\text{ prime}}p^{a_{p}}\mid\prod_{p\text{
prime}}p^{b_{p}}$ claim is proven just as we proved the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Proposition
\ref{prop.ent.prime.n|m}. For the sake of completeness, let us nevertheless
give the complete proof:

\begin{fineprint}
All but finitely many primes $p$ satisfy $b_{p}=0$. In other words, there
exists some finite set $S$ of primes such that every prime $p\notin S$
satisfies
\begin{equation}
b_{p}=0. \label{pf.lem.ent.prime.prod|prod.1}%
\end{equation}
Consider this $S$. Clearly, all but finitely many primes $p$ satisfy $p\notin
S$ (since $S$ is finite).

Now, every prime $p\notin S$ satisfies
\begin{equation}
a_{p}=0 \label{pf.lem.ent.prime.prod|prod.2}%
\end{equation}
\ \footnote{\textit{Proof.} Let $p\notin S$ be a prime. Then,
(\ref{eq.lem.ent.prime.prod|prod.apbp}) yields $a_{p}\leq b_{p}=0$ (by
(\ref{pf.lem.ent.prime.prod|prod.1})). Thus, $a_{p}=0$ (since $a_{p}$ is a
nonnegative integer), qed.}. Hence, all but finitely many primes $p$ satisfy
$a_{p}=0$ (since all but finitely many primes $p$ satisfy $p\notin S$). Thus,
all but finitely many primes $p$ satisfy $p^{a_{p}}=p^{0}=1$. In other words,
only finitely many primes $p$ satisfy $p^{a_{p}}\neq1$. In other words, only
finitely many factors of the product $\prod_{p\text{ prime}}p^{a_{p}}$ are
different from $1$. Hence, this product $\prod_{p\text{ prime}}p^{a_{p}}$ is well-defined.

Also, all but finitely many primes $p$ satisfy $b_{p}=0$. Therefore, all but
finitely many primes $p$ satisfy $p^{b_{p}}=p^{0}=1$. In other words, only
finitely many primes $p$ satisfy $p^{b_{p}}\neq1$. In other words, only
finitely many factors of the product $\prod_{p\text{ prime}}p^{b_{p}}$ are
different from $1$. Hence, this product $\prod_{p\text{ prime}}p^{b_{p}}$ is well-defined.

The product $\prod_{p\text{ prime}}p^{b_{p}-a_{p}}$ is
well-defined\footnote{\textit{Proof. }Every prime $p\notin S$ satisfies
$\underbrace{b_{p}}_{\substack{=0\\\text{(by
(\ref{pf.lem.ent.prime.prod|prod.1}))}}}-\underbrace{a_{p}}%
_{\substack{=0\\\text{(by (\ref{pf.lem.ent.prime.prod|prod.2}))}}}=0-0=0$ and
therefore $p^{b_{p}-a_{p}}=p^{0}=1$. Thus, all but finitely many primes $p$
satisfy $p^{b_{p}-a_{p}}=1$ (since all but finitely many primes $p$ satisfy
$p\notin S$). In other words, only finitely many primes $p$ satisfy
$p^{b_{p}-a_{p}}\neq1$. In other words, only finitely many factors of the
product $\prod_{p\text{ prime}}p^{b_{p}-a_{p}}$ are different from $1$. Hence,
this product $\prod_{p\text{ prime}}p^{b_{p}-a_{p}}$ is well-defined.}. Denote
this product by $c$.

For each prime $p$, we have $b_{p}-a_{p}\geq0$ (by
(\ref{eq.lem.ent.prime.prod|prod.apbp})) and thus $b_{p}-a_{p}\in\mathbb{N}$.
Hence, for each prime $p$, the number $p^{b_{p}-a_{p}}$ is an integer.
Therefore, $\prod_{p\text{ prime}}p^{b_{p}-a_{p}}$ is a product of integers,
and thus itself an integer. In other words, $c$ is an integer (since
$c=\prod_{p\text{ prime}}p^{b_{p}-a_{p}}$).

But from $c=\prod_{p\text{ prime}}p^{b_{p}-a_{p}}$, we obtain%
\[
\left(  \prod_{p\text{ prime}}p^{a_{p}}\right)  c=\left(  \prod_{p\text{
prime}}p^{a_{p}}\right)  \left(  \prod_{p\text{ prime}}p^{b_{p}-a_{p}}\right)
=\prod_{p\text{ prime}}\underbrace{\left(  p^{a_{p}}p^{b_{p}-a_{p}}\right)
}_{=p^{a_{p}+\left(  b_{p}-a_{p}\right)  }=p^{b_{p}}}=\prod_{p\text{ prime}%
}p^{b_{p}}.
\]
Thus, $\prod_{p\text{ prime}}p^{a_{p}}\mid\prod_{p\text{ prime}}p^{b_{p}}$
(since $c$ is an integer). This completes the proof of Lemma
\ref{lem.ent.prime.prod|prod}.
\end{fineprint}
\end{proof}

\begin{corollary}
\label{cor.ent.prime.vp-of-can}For each prime $p$, let $b_{p}$ be a
nonnegative integer. Assume that all but finitely many primes $p$ satisfy
$b_{p}=0$. Let $n=\prod_{p\text{ prime}}p^{b_{p}}$. Then,%
\[
v_{q}\left(  n\right)  =b_{q}\ \ \ \ \ \ \ \ \ \ \text{for each prime }q.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.ent.prime.vp-of-can}.]The product $\prod_{p\text{
prime}}p^{b_{p}}$ is well-defined. (This can be shown just as in the proof of
Lemma \ref{lem.ent.prime.prod|prod}.) Now, choose a list $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $ of primes that contains each prime $p$ exactly
$b_{p}$ times. (Such a list clearly exists: For example, we can pick%
\[
\left(  \underbrace{2,2,\ldots,2}_{b_{2}\text{ times}},\underbrace{3,3,\ldots
,3}_{b_{3}\text{ times}},\underbrace{5,5,\ldots,5}_{b_{5}\text{ times}}%
,\ldots\right)  .
\]
This is indeed a finite list, since all but finitely many primes $p$ satisfy
$b_{p}=0$.)

Now, the list $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ contains each prime
$p$ exactly $b_{p}$ times (and no other entries). Hence, the product
$a_{1}a_{2}\cdots a_{k}$ of the entries of this list contains each prime $p$
exactly $b_{p}$ times as a factor (and no other factors). Thus, this product
equals $\prod_{p\text{ prime}}p^{b_{p}}$. In other words, $a_{1}a_{2}\cdots
a_{k}=\prod_{p\text{ prime}}p^{b_{p}}$. Hence,%
\[
n=\prod_{p\text{ prime}}p^{b_{p}}=a_{1}a_{2}\cdots a_{k}.
\]
Thus, $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a prime factorization of
$n$ (since $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a tuple of primes).

Let $q$ be a prime. Proposition \ref{prop.ent.prime.mult-in-pf} (applied to
$p=q$) yields%
\begin{align*}
&  \left(  \text{the number of times }q\text{ appears in the tuple }\left(
a_{1},a_{2},\ldots,a_{k}\right)  \right) \\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,k\right\}  \text{
such that }a_{i}=q\right) \\
&  =v_{q}\left(  n\right)  .
\end{align*}
Thus,%
\[
v_{q}\left(  n\right)  =\left(  \text{the number of times }q\text{ appears in
the tuple }\left(  a_{1},a_{2},\ldots,a_{k}\right)  \right)  =b_{q}%
\]
(since the list $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ contains each
prime $p$ exactly $b_{p}$ times, and thus contains the prime $q$ exactly
$b_{q}$ times). This proves Corollary \ref{cor.ent.prime.vp-of-can}.
\end{proof}

\begin{exercise}
\label{exe.ent.prime.modpvp}Let $n$ be a nonzero integer. Let $a$ and $b$ be
two integers. Assume that%
\begin{equation}
a\equiv b\operatorname{mod}p^{v_{p}\left(  n\right)  }%
\ \ \ \ \ \ \ \ \ \ \text{for every prime }p.
\label{eq.exe.ent.prime.modpvp.ass}%
\end{equation}
Prove that $a\equiv b\operatorname{mod}n$.
\end{exercise}

\begin{teachingnote}
\textbf{2019-02-13 lecture}
\end{teachingnote}

Canonical factorizations can also be used to describe gcds and lcms:

\begin{proposition}
\label{prop.ent.prime.gcd}Let $n$ and $m$ be two nonzero integers. Then,%
\begin{equation}
\gcd\left(  n,m\right)  =\prod_{p\text{ prime}}p^{\min\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  }
\label{eq.prop.ent.prime.gcd.gcd}%
\end{equation}
and%
\begin{equation}
\operatorname{lcm}\left(  n,m\right)  =\prod_{p\text{ prime}}p^{\max\left\{
v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  }.
\label{eq.prop.ent.prime.gcd.lcm}%
\end{equation}

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.gcd}.]If $p$ is any prime, then
$v_{p}\left(  n\right)  $ and $v_{p}\left(  m\right)  $ are nonnegative
integers (since $n$ and $m$ are nonzero), and thus so are $\min\left\{
v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  $ and $\max\left\{
v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  $.

It is easy to see that the infinite products $\prod_{p\text{ prime}}%
p^{\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  }$
and \newline$\prod_{p\text{ prime}}p^{\max\left\{  v_{p}\left(  n\right)
,v_{p}\left(  m\right)  \right\}  }$ are well-defined\footnote{\textit{Proof.}
Let $p$ be a prime such that $p>\max\left\{  \left\vert m\right\vert
,\left\vert n\right\vert \right\}  $. Thus, $p>\max\left\{  \left\vert
m\right\vert ,\left\vert n\right\vert \right\}  \geq\left\vert m\right\vert $
and therefore $v_{p}\left(  m\right)  =0$ (by Lemma \ref{lem.ent.prime.vpn=0}
\textbf{(a)}, applied to $m$ instead of $n$). Similarly, $v_{p}\left(
n\right)  =0$. Hence, $\max\left\{  \underbrace{v_{p}\left(  n\right)  }%
_{=0},\underbrace{v_{p}\left(  m\right)  }_{=0}\right\}  =\max\left\{
0,0\right\}  =0$ and therefore $p^{\max\left\{  v_{p}\left(  n\right)
,v_{p}\left(  m\right)  \right\}  }=p^{0}=1$.
\par
Now, forget that we fixed $p$. We thus have proven that every prime
$p>\max\left\{  \left\vert m\right\vert ,\left\vert n\right\vert \right\}  $
satisfies $p^{\max\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  }=1$. Hence, all but finitely many primes $p$ satisfy $p^{\max
\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  }=1$ (since
all but finitely many primes $p$ satisfy $p>\max\left\{  \left\vert
m\right\vert ,\left\vert n\right\vert \right\}  $). In other words, the
product $\prod_{p\text{ prime}}p^{\max\left\{  v_{p}\left(  n\right)
,v_{p}\left(  m\right)  \right\}  }$ has only finitely many factors different
from $1$. Hence, this product is well-defined. Similarly, we can show that the
product $\prod_{p\text{ prime}}p^{\min\left\{  v_{p}\left(  n\right)
,v_{p}\left(  m\right)  \right\}  }$ is well-defined.}.

Define two nonnegative integers%
\begin{equation}
g=\prod\limits_{p\text{ prime}}p^{\min\left\{  v_{p}\left(  n\right)
,v_{p}\left(  m\right)  \right\}  }\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ h=\gcd\left(  n,m\right)  .
\label{pf.prop.ent.prime.gcd.g=h=}%
\end{equation}


Note that $h=\gcd\left(  n,m\right)  $ is a positive integer (since $n$ and
$m$ are nonzero) and thus nonzero. Thus, $v_{p}\left(  h\right)  $ is a
nonnegative integer for each prime $p$.

Corollary \ref{cor.ent.prime.can-facZ} yields $\left\vert n\right\vert
=\prod\limits_{p\text{ prime}}p^{v_{p}\left(  n\right)  }$. But each prime $p$
satisfies \newline$\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  \leq v_{p}\left(  n\right)  $ (since the minimum of a set is $\leq$
to any element of the set). Hence, (\ref{eq.lem.ent.prime.prod|prod.claim})
(applied to $a_{p}=\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  $ and $b_{p}=v_{p}\left(  n\right)  $) yields $\prod\limits_{p\text{
prime}}p^{\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  }\mid\prod\limits_{p\text{ prime}}p^{v_{p}\left(  n\right)  }$. This
rewrites as $g\mid\left\vert n\right\vert $ (since $g=\prod\limits_{p\text{
prime}}p^{\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  }$ and $\left\vert n\right\vert =\prod\limits_{p\text{ prime}%
}p^{v_{p}\left(  n\right)  }$). Hence, $g\mid\left\vert n\right\vert \mid n$
(by Exercise \ref{exe.ent.div.aabs} \textbf{(b)}). Similarly, $g\mid m$. Thus,
$\left(  g\mid n\text{ and }g\mid m\right)  $. Hence, Lemma
\ref{lem.ent.gcd.uniprop} (applied to $g$, $n$ and $m$ instead of $m$, $a$ and
$b$) yields $g\mid\gcd\left(  n,m\right)  =h$.

Proposition \ref{prop.ent.gcd.props1} \textbf{(f)} (applied to $n$ and $m$
instead of $a$ and $b$) yields $\gcd\left(  n,m\right)  \mid n$ and
$\gcd\left(  n,m\right)  \mid m$. Thus, $h=\gcd\left(  n,m\right)  \mid n$ and
$h=\gcd\left(  n,m\right)  \mid m$.

On the other hand, Proposition \ref{prop.ent.prime.n|m} (applied to $h$ and
$n$ instead of $n$ and $m$) shows that $h\mid n$ if and only if each prime $p$
satisfies $v_{p}\left(  h\right)  \leq v_{p}\left(  n\right)  $. Thus, each
prime $p$ satisfies $v_{p}\left(  h\right)  \leq v_{p}\left(  n\right)  $
(since $h\mid n$).

Now, fix any prime $p$. Then, $v_{p}\left(  h\right)  \leq v_{p}\left(
n\right)  $ (as we have just seen) and $v_{p}\left(  h\right)  \leq
v_{p}\left(  m\right)  $ (similarly). Combining these two inequalities, we
obtain%
\[
v_{p}\left(  h\right)  \leq\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(
m\right)  \right\}
\]
(since $\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}
$ must be one of the two numbers $v_{p}\left(  n\right)  $ and $v_{p}\left(
m\right)  $, but we have just seen that $v_{p}\left(  h\right)  $ is $\leq$ to
each of these two numbers).

Now, forget that we fixed $p$. We thus have show that each prime $p$ satisfies
$v_{p}\left(  h\right)  \leq\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(
m\right)  \right\}  $. Hence, (\ref{eq.lem.ent.prime.prod|prod.claim})
(applied to $a_{p}=v_{p}\left(  h\right)  $ and $b_{p}=\min\left\{
v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  $) yields
$\prod\limits_{p\text{ prime}}p^{v_{p}\left(  h\right)  }\mid\prod
\limits_{p\text{ prime}}p^{\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(
m\right)  \right\}  }$. But $h$ is positive; hence, Corollary
\ref{cor.ent.prime.can-fac} (applied to $h$ instead of $n$) yields%
\[
h=\prod\limits_{p\text{ prime}}p^{v_{p}\left(  h\right)  }\mid\prod
\limits_{p\text{ prime}}p^{\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(
m\right)  \right\}  }=g.
\]


Thus, we know that $g\mid h$ and $h\mid g$. Hence, Exercise
\ref{exe.ent.div.abba} (applied to $a=g$ and $b=h$) yields $\left\vert
g\right\vert =\left\vert h\right\vert $. But $g$ is nonnegative; thus,
$\left\vert g\right\vert =g$. Hence, $g=\left\vert g\right\vert =\left\vert
h\right\vert =h$ (since $h$ is positive). In view of
(\ref{pf.prop.ent.prime.gcd.g=h=}), this rewrites as $\prod\limits_{p\text{
prime}}p^{\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  }=\gcd\left(  n,m\right)  $. This proves
(\ref{eq.prop.ent.prime.gcd.gcd}).

The proof of (\ref{eq.prop.ent.prime.gcd.lcm}) is entirely analogous to the
proof of (\ref{eq.prop.ent.prime.gcd.gcd}) we just gave: We merely need to

\begin{itemize}
\item flip all divisibilities and inequalities and replace \textquotedblleft%
$\min$\textquotedblright\ by \textquotedblleft$\max$\textquotedblright%
\ everywhere and replace \textquotedblleft$\gcd$\textquotedblright\ by
\textquotedblleft$\operatorname{lcm}$\textquotedblright\ everywhere;

\item use Proposition \ref{prop.ent.lcm.divides} \textbf{(c)} instead of
Proposition \ref{prop.ent.gcd.props1} \textbf{(f)};

\item use Lemma \ref{lem.ent.lcm.uniprop} instead of Lemma
\ref{lem.ent.gcd.uniprop}.
\end{itemize}
\end{proof}

\begin{example}
For this example, set $n=3^{2}\cdot5\cdot7^{8}$ and $m=2\cdot3^{3}\cdot7^{2}$.
Let us compute $\gcd\left(  n,m\right)  $ and $\operatorname{lcm}\left(
n,m\right)  $ using Proposition \ref{prop.ent.prime.gcd}.

From $n=3^{2}\cdot5\cdot7^{8}$, we obtain (using Corollary
\ref{cor.ent.prime.vp-of-can}) that%
\begin{align*}
v_{3}\left(  n\right)   &  =2,\ \ \ \ \ \ \ \ \ \ v_{5}\left(  n\right)
=1,\ \ \ \ \ \ \ \ \ \ v_{7}\left(  n\right)
=8,\ \ \ \ \ \ \ \ \ \ \text{and}\\
v_{p}\left(  n\right)   &  =0\text{ for each prime }p\notin\left\{
3,5,7\right\}  .
\end{align*}
Similarly, from $m=2\cdot3^{3}\cdot7^{2}$, we obtain%
\begin{align*}
v_{2}\left(  m\right)   &  =1,\ \ \ \ \ \ \ \ \ \ v_{3}\left(  m\right)
=3,\ \ \ \ \ \ \ \ \ \ v_{7}\left(  m\right)
=2,\ \ \ \ \ \ \ \ \ \ \text{and}\\
v_{p}\left(  n\right)   &  =0\text{ for each prime }p\notin\left\{
2,3,7\right\}  .
\end{align*}
Now, (\ref{eq.prop.ent.prime.gcd.gcd}) yields%
\begin{align*}
&  \gcd\left(  n,m\right) \\
&  =\prod_{p\text{ prime}}p^{\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(
m\right)  \right\}  }\\
&  =\underbrace{2^{\min\left\{  v_{2}\left(  n\right)  ,v_{2}\left(  m\right)
\right\}  }}_{=2^{\min\left\{  0,1\right\}  }=2^{0}}\cdot\underbrace{3^{\min
\left\{  v_{3}\left(  n\right)  ,v_{3}\left(  m\right)  \right\}  }}%
_{=3^{\min\left\{  2,3\right\}  }=3^{2}}\cdot\underbrace{5^{\min\left\{
v_{5}\left(  n\right)  ,v_{5}\left(  m\right)  \right\}  }}_{=5^{\min\left\{
1,0\right\}  }=5^{0}}\\
&  \ \ \ \ \ \ \ \ \ \ \cdot\underbrace{7^{\min\left\{  v_{7}\left(  n\right)
,v_{7}\left(  m\right)  \right\}  }}_{=7^{\min\left\{  8,2\right\}  }=7^{2}%
}\cdot\prod_{\substack{p\text{ prime;}\\p\notin\left\{  2,3,5,7\right\}
}}\underbrace{p^{\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  }}_{\substack{=1\\\text{(since }v_{p}\left(  n\right)  =0\text{ and
}v_{p}\left(  m\right)  =0\\\text{and thus }\min\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  =\min\left\{  0,0\right\}
=0\text{)}}}\\
&  =2^{0}\cdot3^{2}\cdot5^{0}\cdot7^{2}=3^{2}\cdot7^{2}.
\end{align*}
Likewise, (\ref{eq.prop.ent.prime.gcd.lcm}) yields%
\begin{align*}
&  \operatorname{lcm}\left(  n,m\right) \\
&  =\prod_{p\text{ prime}}p^{\max\left\{  v_{p}\left(  n\right)  ,v_{p}\left(
m\right)  \right\}  }\\
&  =\underbrace{2^{\max\left\{  v_{2}\left(  n\right)  ,v_{2}\left(  m\right)
\right\}  }}_{=2^{\max\left\{  0,1\right\}  }=2^{1}}\cdot\underbrace{3^{\max
\left\{  v_{3}\left(  n\right)  ,v_{3}\left(  m\right)  \right\}  }}%
_{=3^{\max\left\{  2,3\right\}  }=3^{3}}\cdot\underbrace{5^{\max\left\{
v_{5}\left(  n\right)  ,v_{5}\left(  m\right)  \right\}  }}_{=5^{\max\left\{
1,0\right\}  }=5^{1}}\\
&  \ \ \ \ \ \ \ \ \ \ \cdot\underbrace{7^{\max\left\{  v_{7}\left(  n\right)
,v_{7}\left(  m\right)  \right\}  }}_{=7^{\max\left\{  8,2\right\}  }=7^{8}%
}\cdot\prod_{\substack{p\text{ prime;}\\p\notin\left\{  2,3,5,7\right\}
}}\underbrace{p^{\max\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  }}_{\substack{=1\\\text{(since }v_{p}\left(  n\right)  =0\text{ and
}v_{p}\left(  m\right)  =0\\\text{and thus }\max\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  =\max\left\{  0,0\right\}
=0\text{)}}}\\
&  =2^{1}\cdot3^{3}\cdot5^{1}\cdot7^{8}.
\end{align*}

\end{example}

Proposition \ref{prop.ent.prime.gcd} can be generalized to the case of $k$
integers $b_{1},b_{2},\ldots,b_{k}$ instead of two integers $n,m$:

\begin{proposition}
\label{prop.ent.prime.gcd-k}Let $b_{1},b_{2},\ldots,b_{k}$ be finitely many
nonzero integers, with $k>0$. Then,%
\begin{equation}
\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\prod_{p\text{ prime}}%
p^{\min\left\{  v_{p}\left(  b_{1}\right)  ,v_{p}\left(  b_{2}\right)
,\ldots,v_{p}\left(  b_{k}\right)  \right\}  }
\label{eq.prop.ent.prime.gcd-k.gcd}%
\end{equation}
an%
\begin{equation}
\operatorname{lcm}\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\prod_{p\text{
prime}}p^{\max\left\{  v_{p}\left(  b_{1}\right)  ,v_{p}\left(  b_{2}\right)
,\ldots,v_{p}\left(  b_{k}\right)  \right\}  }.
\label{eq.prop.ent.prime.gcd-k.lcm}%
\end{equation}

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.prime.gcd-k}.]The proof of Proposition
\ref{prop.ent.prime.gcd-k} is analogous to the proof of Proposition
\ref{prop.ent.prime.gcd}, with two minor exceptions:

\begin{itemize}
\item Instead of applying Lemma \ref{lem.ent.gcd.uniprop} (in the proof of
(\ref{eq.prop.ent.prime.gcd-k.gcd})), we now have to apply the analogous claim
for $k$ integers\footnote{Namely: Let $m\in\mathbb{Z}$ and let $b_{1}%
,b_{2},\ldots,b_{k}$ be integers such that $\left(  m\mid b_{i}\text{ for all
}i\in\left\{  1,2,\ldots,k\right\}  \right)  $. Then, $m\mid\gcd\left(
b_{1},b_{2},\ldots,b_{k}\right)  $.}. The latter claim follows from Theorem
\ref{thm.ent.gcd.uniprop-mul} \textbf{(a)}.

\item Instead of applying Lemma \ref{lem.ent.lcm.uniprop} (in the proof of
(\ref{eq.prop.ent.prime.gcd-k.lcm})), we now have to apply the analogous claim
for $k$ integers\footnote{Namely: Let $m\in\mathbb{Z}$ and let $b_{1}%
,b_{2},\ldots,b_{k}$ be integers such that $\left(  b_{i}\mid m\text{ for all
}i\in\left\{  1,2,\ldots,k\right\}  \right)  $. Then, $\operatorname{lcm}%
\left(  b_{1},b_{2},\ldots,b_{k}\right)  \mid m$.}. The latter claim follows
from Theorem \ref{thm.ent.lcm.uniprop-mul} \textbf{(a)}.

Alternatively, instead of applying this claim, we can argue as follows:
Setting $g=\prod_{p\text{ prime}}p^{\max\left\{  v_{p}\left(  b_{1}\right)
,v_{p}\left(  b_{2}\right)  ,\ldots,v_{p}\left(  b_{k}\right)  \right\}  }$
and $h=\operatorname{lcm}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $, we see
that $\left(  b_{i}\mid g\text{ for all }i\in\left\{  1,2,\ldots,k\right\}
\right)  $ (by an argument analogous to the one we used to show $\left(  g\mid
n\text{ and }g\mid m\right)  $ in the original proof of
(\ref{eq.prop.ent.prime.gcd.gcd})). Thus, $g$ is a common multiple of
$b_{1},b_{2},\ldots,b_{k}$. In other words, $g\in\operatorname*{Mul}\left(
b_{1},b_{2},\ldots,b_{k}\right)  $. Hence, $g$ is a positive element of
$\operatorname*{Mul}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ (since $g$ is
positive). Hence, $g\geq\operatorname{lcm}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $ (since $\operatorname{lcm}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $ is the \textbf{smallest} positive element of
$\operatorname*{Mul}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $). In other
words, $g\geq h$ (since $h=\operatorname{lcm}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $). On the other hand, we prove $g\mid h$ (similarly to how we
proved $h\mid g$ in the original proof of (\ref{eq.prop.ent.prime.gcd.gcd})).
Thus, Proposition \ref{prop.ent.div.1} \textbf{(b)} (applied to $g$ and $h$
instead of $a$ and $b$) yields $\left\vert g\right\vert \leq\left\vert
h\right\vert $ (since $h\neq0$). Since $g$ is positive, we have $\left\vert
g\right\vert =g$ and thus $g=\left\vert g\right\vert \leq\left\vert
h\right\vert =h$ (since $h$ is positive). Combining this with $g\geq h$, we
obtain $g=h$. As before, this completes the proof of
(\ref{eq.prop.ent.prime.gcd-k.lcm}).
\end{itemize}
\end{proof}

We can use Propositions \ref{prop.ent.prime.gcd} and
\ref{prop.ent.prime.gcd-k} to reprove certain facts about lcms and gcds. For
example, let us prove Theorem \ref{thm.ent.lcm.gcd*lcm} and solve Exercise
\ref{exe.ent.lcm.lcmabc}:

\begin{fineprint}
\begin{proof}
[Second proof of Theorem \ref{thm.ent.lcm.gcd*lcm} (sketched).]WLOG assume
that $a$ and $b$ are nonzero (since otherwise, the claim of Theorem
\ref{thm.ent.lcm.gcd*lcm} easily reduces to $0=0$). Then, $ab$ is nonzero as
well. Hence, Corollary \ref{cor.ent.prime.can-facZ} (applied to $n=ab$) yields%
\[
\left\vert ab\right\vert =\prod_{p\text{ prime}}p^{v_{p}\left(  ab\right)  }.
\]
Now, Proposition \ref{prop.ent.prime.gcd} yields%
\begin{align*}
\gcd\left(  a,b\right)   &  =\prod_{p\text{ prime}}p^{\min\left\{
v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  \right\}  }%
\ \ \ \ \ \ \ \ \ \ \text{and}\\
\operatorname{lcm}\left(  a,b\right)   &  =\prod_{p\text{ prime}}%
p^{\max\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  \right\}  }.
\end{align*}
Multiplying these two equalities, we get%
\begin{align*}
\gcd\left(  a,b\right)  \cdot\operatorname{lcm}\left(  a,b\right)   &
=\left(  \prod_{p\text{ prime}}p^{\min\left\{  v_{p}\left(  a\right)
,v_{p}\left(  b\right)  \right\}  }\right)  \cdot\left(  \prod_{p\text{
prime}}p^{\max\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)
\right\}  }\right) \\
&  =\prod_{p\text{ prime}}\underbrace{\left(  p^{\min\left\{  v_{p}\left(
a\right)  ,v_{p}\left(  b\right)  \right\}  }p^{\max\left\{  v_{p}\left(
a\right)  ,v_{p}\left(  b\right)  \right\}  }\right)  }_{\substack{=p^{\min
\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  \right\}
+\max\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  \right\}
}\\=p^{v_{p}\left(  a\right)  +v_{p}\left(  b\right)  }\\\text{(since }%
\min\left\{  u,v\right\}  +\max\left\{  u,v\right\}  =u+v\text{ for any reals
}u,v\text{)}}}\\
&  =\prod_{p\text{ prime}}\underbrace{p^{v_{p}\left(  a\right)  +v_{p}\left(
b\right)  }}_{\substack{=p^{v_{p}\left(  ab\right)  }\\\text{(since }%
v_{p}\left(  a\right)  +v_{p}\left(  b\right)  =v_{p}\left(  ab\right)
\\\text{(by Theorem \ref{thm.ent.prime.vp-ring} \textbf{(a)}))}}%
}=\prod_{p\text{ prime}}p^{v_{p}\left(  ab\right)  }=\left\vert ab\right\vert
.
\end{align*}
Hence, Theorem \ref{thm.ent.lcm.gcd*lcm} is proven again.

See Section \ref{sect.sols.exe.ent.lcm.lcmabc.2} for a second solution to
Exercise \ref{exe.ent.lcm.lcmabc} using Propositions \ref{prop.ent.prime.gcd}
and \ref{prop.ent.prime.gcd-k} (and a slightly more general result that can be
proven in the same way).
\end{proof}
\end{fineprint}

\begin{exercise}
\label{exe.ent.prime.gcd.1}Let $n$ and $m$ be two integers. Let $p$ be a prime.

\textbf{(a)} Prove that $v_{p}\left(  \gcd\left(  n,m\right)  \right)
=\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  $.

\textbf{(b)} Prove that $v_{p}\left(  \operatorname{lcm}\left(  n,m\right)
\right)  =\max\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  $.
\end{exercise}

\begin{exercise}
\label{exe.ent.prime.gcd.distrib}Let $a,b,c$ be three integers.

\textbf{(a)} Prove that $\gcd\left(  a,\operatorname{lcm}\left(  b,c\right)
\right)  =\operatorname{lcm}\left(  \gcd\left(  a,b\right)  ,\gcd\left(
a,c\right)  \right)  $.

\textbf{(b)} Prove that $\operatorname{lcm}\left(  a,\gcd\left(  b,c\right)
\right)  =\gcd\left(  \operatorname{lcm}\left(  a,b\right)
,\operatorname{lcm}\left(  a,c\right)  \right)  $.
\end{exercise}

The two parts of Exercise \ref{exe.ent.prime.gcd.distrib} can be regarded as
\textquotedblleft distributivity laws\textquotedblright, but for the binary
operations $\gcd$ and $\operatorname{lcm}$ (or $\operatorname{lcm}$ and $\gcd
$, respectively) instead of $+$ and $\cdot$.

\subsubsection{Coprimality through prime factors}

\begin{proposition}
\label{prop.ent.coprime.via-primes}Let $n$ and $m$ be two integers. Then,
$n\perp m$ if and only if there exists no prime $p$ that divides both $n$ and
$m$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.coprime.via-primes}.]$\Longrightarrow:$
Assume that $n\perp m$. We must prove that there exists no prime $p$ that
divides both $n$ and $m$.

Let $p$ be a prime that divides both $n$ and $m$. Thus, $p\mid n$ and $p\mid
m$. Hence, $p\mid\gcd\left(  n,m\right)  $ (by Lemma \ref{lem.ent.gcd.uniprop}%
, applied to $p$, $n$ and $m$ instead of $m$, $a$ and $b$). But $\gcd\left(
n,m\right)  =1$ (since $n\perp m$). Hence, $p\mid\gcd\left(  n,m\right)  =1$.
Hence, Proposition \ref{prop.ent.div.1} \textbf{(b)} (applied to $a=p$ and
$b=1$) yields $\left\vert p\right\vert \leq\left\vert 1\right\vert =1$.

But $p$ is a prime; thus, $p>1>0$, so that $\left\vert p\right\vert =p$ and
thus $p=\left\vert p\right\vert \leq1$. This contradicts $p>1$.

Now, forget that we fixed $p$. We thus have obtained a contradiction for each
prime $p$ that divides both $n$ and $m$. Hence, there exists no prime $p$ that
divides both $n$ and $m$. This proves the \textquotedblleft$\Longrightarrow
$\textquotedblright\ direction of Proposition
\ref{prop.ent.coprime.via-primes}.

$\Longleftarrow:$ Assume that there exists no prime $p$ that divides both $n$
and $m$. We must prove that $n\perp m$.

Assume the contrary. Thus, we don't have $n\perp m$. In other words, we don't
have $\gcd\left(  n,m\right)  =1$. In other words, $\gcd\left(  n,m\right)
\neq1$. Hence, there exists at least one prime $p$ such that $p\mid\gcd\left(
n,m\right)  $\ \ \ \ \footnote{\textit{Proof.} This is obvious if $\gcd\left(
n,m\right)  =0$ (because in that case, we can take $p=2$, or any other prime).
Thus, for the rest of this proof, we WLOG assume that $\gcd\left(  n,m\right)
\neq0$. Thus, $\gcd\left(  n,m\right)  >1$ (since $\gcd\left(  n,m\right)  $
is a nonnegative integer satisfying $\gcd\left(  n,m\right)  \neq0$ and
$\gcd\left(  n,m\right)  \neq1$). Hence, Proposition
\ref{prop.ent.prime.ex-pri-div} (applied to $\gcd\left(  n,m\right)  $ instead
of $n$) yields that there exists at least one prime $p$ such that $p\mid
\gcd\left(  n,m\right)  $. Qed.}. Consider this $p$.

We have $p\mid\gcd\left(  n,m\right)  \mid n$ and $p\mid\gcd\left(
n,m\right)  \mid m$. Thus, the prime $p$ divides both $n$ and $m$. This
contradicts the assumption that there exists no prime $p$ that divides both
$n$ and $m$.

This contradiction shows that our assumption was false. Hence, $n\perp m$ is
proven. This proves the \textquotedblleft$\Longleftarrow$\textquotedblright%
\ direction of Proposition \ref{prop.ent.coprime.via-primes}.
\end{proof}

\begin{corollary}
\label{cor.ent.coprime.orthogonal}Let $n$ and $m$ be two nonzero integers. Then:

\textbf{(a)} The infinite sum $\sum_{p\text{ prime}}v_{p}\left(  n\right)
v_{p}\left(  m\right)  $ is well-defined (i.e., all but finitely many primes
$p$ satisfy $v_{p}\left(  n\right)  v_{p}\left(  m\right)  =0$).

\textbf{(b)} We have $n\perp m$ if and only if
\[
\sum_{p\text{ prime}}v_{p}\left(  n\right)  v_{p}\left(  m\right)  =0.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.ent.coprime.orthogonal} (sketched).]\textbf{(a)}
For every prime $p>\left\vert n\right\vert $, we have $v_{p}\left(  n\right)
=0$ (by Lemma \ref{lem.ent.prime.vpn=0} \textbf{(a)}) and thus
$\underbrace{v_{p}\left(  n\right)  }_{=0}v_{p}\left(  m\right)  =0$. Now,
Corollary \ref{cor.ent.coprime.orthogonal} \textbf{(a)} follows easily.

\textbf{(b)} A sum of nonnegative reals is $0$ if and only if each of its
addends is $0$. Thus, the sum $\sum_{p\text{ prime}}v_{p}\left(  n\right)
v_{p}\left(  m\right)  $ is $0$ if and only if we have
\[
\left(  v_{p}\left(  n\right)  v_{p}\left(  m\right)  =0\text{ for all primes
}p\right)
\]
(because all the addends $v_{p}\left(  n\right)  v_{p}\left(  m\right)  $ of
our sum are nonnegative reals). Hence, we have the following chain of
equivalences:%
\begin{align*}
&  \left(  \sum_{p\text{ prime}}v_{p}\left(  n\right)  v_{p}\left(  m\right)
=0\right) \\
&  \Longleftrightarrow\ \left(  v_{p}\left(  n\right)  v_{p}\left(  m\right)
=0\text{ for all primes }p\right) \\
&  \Longleftrightarrow\ \left(  \left(  v_{p}\left(  n\right)  =0\text{ or
}v_{p}\left(  m\right)  =0\right)  \text{ for all primes }p\right) \\
&  \Longleftrightarrow\ \left(  \left(  p\nmid n\text{ or }p\nmid m\right)
\text{ for all primes }p\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since Corollary \ref{cor.ent.prime.vp-0} yields the}\\
\text{equivalences }\left(  v_{p}\left(  n\right)  =0\right)
\Longleftrightarrow\left(  p\nmid n\right)  \text{ and }\left(  v_{p}\left(
m\right)  =0\right)  \Longleftrightarrow\left(  p\nmid m\right) \\
\text{for each prime }p
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  \text{there exists no prime }p\text{ such that
}\left(  p\mid n\text{ and }p\mid m\right)  \right) \\
&  \Longleftrightarrow\ \left(  \text{there exists no prime }p\text{ that
divides both }n\text{ and }m\right) \\
&  \Longleftrightarrow\ \left(  n\perp m\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.ent.coprime.via-primes}}\right)  .
\end{align*}
This proves Corollary \ref{cor.ent.coprime.orthogonal} \textbf{(b)}.
\end{proof}

Corollary \ref{cor.ent.coprime.orthogonal} \textbf{(b)} is the reason for the
notation \textquotedblleft$\perp$\textquotedblright\ that we are using for
coprimality. In fact, when $n$ is a positive integer, we can regard the
$p$-valuations $v_{p}\left(  n\right)  $ as the \textquotedblleft
coordinates\textquotedblright\ of $n$ in an (infinite-dimensional) Cartesian
coordinate system. Then, the sum $\sum_{p\text{ prime}}v_{p}\left(  n\right)
v_{p}\left(  m\right)  $ in Corollary \ref{cor.ent.coprime.orthogonal} is
something like a \textquotedblleft%
\href{https://en.wikipedia.org/wiki/Dot_product}{dot product}%
\textquotedblright\ between $n$ and $m$. Thus, Corollary
\ref{cor.ent.coprime.orthogonal} \textbf{(b)} shows that two integers $n$ and
$m$ are coprime if and only if their \textquotedblleft dot
product\textquotedblright\ is $0$. But for vectors in a Euclidean space, the
dot product is $0$ if and only if the vectors are orthogonal. Thus, coprime
integers are like orthogonal vectors. Of course, this analogy should be taken
with a grain of salt; in particular, our \textquotedblleft dot
product\textquotedblright\ is far from being bilinear\footnote{Or, rather, it
is bilinear \textbf{with respect to multiplication}: If we denote
$\sum_{p\text{ prime}}v_{p}\left(  n\right)  v_{p}\left(  m\right)  $ by
$\left\langle n,m\right\rangle $, then we have%
\[
\left\langle n_{1}n_{2},m\right\rangle =\left\langle n_{1},m\right\rangle
+\left\langle n_{2},m\right\rangle \ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \left\langle n,m_{1}m_{2}\right\rangle =\left\langle
n,m_{1}\right\rangle +\left\langle n,m_{2}\right\rangle
\]
for arbitrary integers $n_{1},n_{2},m,n,m_{1},m_{2}$.}.

\subsubsection{There are infinitely many primes}

\begin{theorem}
\label{thm.ent.prime.infin}There are infinitely many primes.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.prime.infin}.]The following proof is a classic,
appearing in Euclid's \textit{Elements}:

Let $\left(  p_{1},p_{2},\ldots,p_{k}\right)  $ be any finite list of primes.
We shall find a new prime distinct from each of $p_{1},p_{2},\ldots,p_{k}$.

Indeed, $p_{1},p_{2},\ldots,p_{k}$ are primes, and thus are integers $>1$ (by
the definition of a \textquotedblleft prime\textquotedblright). Hence, they
are positive integers; thus, their product $p_{1}p_{2}\cdots p_{k}$ is a
positive integer as well. Thus, $p_{1}p_{2}\cdots p_{k}>0$.

Now, let $n=p_{1}p_{2}\cdots p_{k}+1$. Then, $n=\underbrace{p_{1}p_{2}\cdots
p_{k}}_{>0}+1>1$. Hence, Proposition \ref{prop.ent.prime.ex-pri-div} shows
that there exists at least one prime $p$ such that $p\mid n$. Consider this
$p$.

We claim that $p$ is distinct from each of $p_{1},p_{2},\ldots,p_{k}$.

[\textit{Proof:} Assume the contrary. Thus, $p=p_{i}$ for some $i\in\left\{
1,2,\ldots,k\right\}  $. Consider this $i$.

We have $p_{1}p_{2}\cdots p_{k}=p_{i}\cdot\left(  p_{1}p_{2}\cdots
p_{i-1}p_{i+1}p_{i+2}\cdots p_{k}\right)  $. Thus, $p_{i}\mid p_{1}p_{2}\cdots
p_{k}$ (since $p_{1}p_{2}\cdots p_{i-1}p_{i+1}p_{i+2}\cdots p_{k}$ is an
integer). Hence, $p=p_{i}\mid p_{1}p_{2}\cdots p_{k}$. In other words,
$p_{1}p_{2}\cdots p_{k}\equiv0\operatorname{mod}p$. Now,%
\[
n=\underbrace{p_{1}p_{2}\cdots p_{k}}_{\equiv0\operatorname{mod}p}%
+1\equiv0+1=1\operatorname{mod}p.
\]
Hence, $1\equiv n\operatorname{mod}p$. But $p\mid n$ and thus $n\equiv
0\operatorname{mod}p$. Hence, $1\equiv n\equiv0\operatorname{mod}p$; in other
words, $p\mid1-0=1$. Thus, Proposition \ref{prop.ent.div.1} \textbf{(b)}
(applied to $a=p$ and $b=1$) yields $\left\vert p\right\vert \leq\left\vert
1\right\vert =1$. But $p$ is a prime; thus, $p>1>0$, so that $\left\vert
p\right\vert =p>1$. This contradicts $\left\vert p\right\vert \leq1$. This
contradiction shows that our assumption was wrong, qed.]

Thus, we have proven that $p$ is distinct from each of $p_{1},p_{2}%
,\ldots,p_{k}$. Hence, there exists a prime distinct from each of $p_{1}%
,p_{2},\ldots,p_{k}$ (namely, $p$).

Now, forget that we fixed $p_{1},p_{2},\ldots,p_{k}$. We thus have proven that
if $\left(  p_{1},p_{2},\ldots,p_{k}\right)  $ is any finite list of primes,
then there exists a prime distinct from each of $p_{1},p_{2},\ldots,p_{k}$. In
other words, given any finite list of primes, there exists at least one prime
that is not in this list. In other words, no finite list of primes can cover
all the primes. In other words, there are infinitely many primes. This proves
Theorem \ref{thm.ent.prime.infin}.
\end{proof}

Note that our proof of Theorem \ref{thm.ent.prime.infin} is constructive: It
gives an algorithm to construct arbitrarily many distinct primes. This
algorithm is not very efficient, since $p_{1}p_{2}\cdots p_{k}+1$ can be very
large even if $p_{1},p_{2},\ldots,p_{k}$ are fairly small. In practice, the
sieve of Eratosthenes is much better for generating primes.
\href{https://en.wikipedia.org/wiki/Generating_primes}{Much faster algorithms
are known}.

\begin{exercise}
\label{exe.ent.prime.aa-1}Let $p$ be a prime. Let $a\in\mathbb{Z}$ be such
that $a^{2}\equiv1\operatorname{mod}p$. Prove that $a\equiv1\operatorname{mod}%
p$ or $a\equiv-1\operatorname{mod}p$.
\end{exercise}

\begin{exercise}
\label{exe.ent.prime.pkdivs}Let $p$ be a prime. Let $k\in\mathbb{N}$. Prove
that the nonnegative divisors of $p^{k}$ are $p^{0},p^{1},\ldots,p^{k}$.
\end{exercise}

\subsection{Euler's totient function ($\phi$-function)}

\subsubsection{Definition and some formulas}

Recall that $\mathbb{P}$ stands for the set of all positive integers.

\begin{definition}
\label{def.ent.phi.phi}We define a function $\phi:\mathbb{P}\rightarrow
\mathbb{N}$ as follows: For each $n\in\mathbb{P}$, we let $\phi\left(
n\right)  $ be the number of all $i\in\left\{  1,2,\ldots,n\right\}  $ that
are coprime to $n$. In other words,%
\begin{equation}
\phi\left(  n\right)  =\left\vert \left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ i\perp n\right\}  \right\vert . \label{eq.def.ent.phi.phi.1}%
\end{equation}


This function $\phi$ is called \textit{Euler's totient function} or just
$\phi$\textit{-function}.
\end{definition}

\begin{example}
\textbf{(a)} We have $\phi\left(  12\right)  =4$, since the number of all
$i\in\left\{  1,2,\ldots,12\right\}  $ that are coprime to $12$ is $4$
(indeed, these $i$ are $1$, $5$, $7$ and $11$).

\textbf{(b)} We have $\phi\left(  13\right)  =12$, since the number of all
$i\in\left\{  1,2,\ldots,13\right\}  $ that are coprime to $13$ is $12$
(indeed, these $i$ are $1,2,\ldots,12$).

\textbf{(c)} We have $\phi\left(  14\right)  =6$, since the number of all
$i\in\left\{  1,2,\ldots,14\right\}  $ that are coprime to $14$ is $6$
(indeed, these $i$ are $1,3,5,9,11,13$).

\textbf{(d)} We have $\phi\left(  1\right)  =1$, since the number of all
$i\in\left\{  1,2,\ldots,1\right\}  $ that are coprime to $1$ is $1$ (indeed,
the only such $i$ is $1$).
\end{example}

The $\phi$-function $\phi$ is denoted by $\varphi$ by some authors.

\begin{proposition}
\label{prop.ent.phi.p}Let $p$ be a prime. Then, $\phi\left(  p\right)  =p-1$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.phi.p}.]Here is the idea: The definition
of $\phi$ shows that $\phi\left(  p\right)  $ is the number of all
$i\in\left\{  1,2,\ldots,p\right\}  $ that are coprime to $p$. But we know
exactly what these $i$ are: They are just the first $p-1$ positive integers
$1,2,\ldots,p-1$. (In fact, Proposition \ref{prop.ent.prime.each-i-coprime}
shows that each of the integers $1,2,\ldots,p-1$ is coprime to $p$, whereas
$\gcd\left(  p,p\right)  =p>1$ shows that $p$ is \textbf{not} coprime to $p$.)
Thus, $\phi\left(  p\right)  $ is the number of these $p-1$ integers; in other
words, $\phi\left(  p\right)  =p-1$.

\begin{fineprint}
For one last time, here is the proof in detail:

We have $p>1$ (since $p$ is a prime), thus $p\neq1$. Also, $p\mid p$; hence,
Proposition \ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $a=p$ and
$b=p$) yields $\gcd\left(  p,p\right)  =\left\vert p\right\vert =p$ (since
$p>1>0$).

Now, we claim that%
\begin{equation}
\left\{  i\in\left\{  1,2,\ldots,p\right\}  \ \mid\ i\perp p\right\}
\subseteq\left\{  1,2,\ldots,p-1\right\}  . \label{pf.prop.ent.phi.p.1}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.ent.phi.p.1}):} Let $i\in\left\{
1,2,\ldots,p\right\}  $ be such that $i\perp p$. From $i\perp p$, we obtain
$\gcd\left(  i,p\right)  =1$. If we had $i=p$, then we would have $\gcd\left(
\underbrace{i}_{=p},p\right)  =\gcd\left(  p,p\right)  =p\neq1$, which would
contradict $\gcd\left(  i,p\right)  =1$. Thus, we cannot have $i=p$. Hence, we
have $i\neq p$. Combining this with $i\in\left\{  1,2,\ldots,p\right\}  $, we
obtain $i\in\left\{  1,2,\ldots,p\right\}  \setminus\left\{  p\right\}
=\left\{  1,2,\ldots,p-1\right\}  $.

Now, forget that we fixed $i$. We thus have proven that every $i\in\left\{
1,2,\ldots,p\right\}  $ satisfying $i\perp p$ must belong to $\left\{
1,2,\ldots,p-1\right\}  $. In other words, $\left\{  i\in\left\{
1,2,\ldots,p\right\}  \ \mid\ i\perp p\right\}  \subseteq\left\{
1,2,\ldots,p-1\right\}  $. This proves (\ref{pf.prop.ent.phi.p.1}).]

Conversely, we have%
\begin{equation}
\left\{  1,2,\ldots,p-1\right\}  \subseteq\left\{  i\in\left\{  1,2,\ldots
,p\right\}  \ \mid\ i\perp p\right\}  . \label{pf.prop.ent.phi.p.2}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.ent.phi.p.2}):} Let $j\in\left\{
1,2,\ldots,p-1\right\}  $. Thus, $j$ is coprime to $p$ (by Proposition
\ref{prop.ent.prime.each-i-coprime}, applied to $i=j$). In other words,
$j\perp p$. Also, $j\in\left\{  1,2,\ldots,p-1\right\}  \subseteq\left\{
1,2,\ldots,p\right\}  $. Hence, $j$ is an $i\in\left\{  1,2,\ldots,p\right\}
$ satisfying $i\perp p$. In other words, $j\in\left\{  i\in\left\{
1,2,\ldots,p\right\}  \ \mid\ i\perp p\right\}  $.

Now, forget that we fixed $j$. We thus have shown that $j\in\left\{
i\in\left\{  1,2,\ldots,p\right\}  \ \mid\ i\perp p\right\}  $ for each
$j\in\left\{  1,2,\ldots,p-1\right\}  $. In other words, $\left\{
1,2,\ldots,p-1\right\}  \subseteq\left\{  i\in\left\{  1,2,\ldots,p\right\}
\ \mid\ i\perp p\right\}  $. This proves (\ref{pf.prop.ent.phi.p.2}).]

Combining (\ref{pf.prop.ent.phi.p.1}) with (\ref{pf.prop.ent.phi.p.2}), we
obtain%
\[
\left\{  i\in\left\{  1,2,\ldots,p\right\}  \ \mid\ i\perp p\right\}
=\left\{  1,2,\ldots,p-1\right\}  .
\]
Now, (\ref{eq.def.ent.phi.phi.1}) (applied to $n=p$) yields%
\[
\phi\left(  p\right)  =\left\vert \underbrace{\left\{  i\in\left\{
1,2,\ldots,p\right\}  \ \mid\ i\perp p\right\}  }_{=\left\{  1,2,\ldots
,p-1\right\}  }\right\vert =\left\vert \left\{  1,2,\ldots,p-1\right\}
\right\vert =p-1.
\]
This proves Proposition \ref{prop.ent.phi.p}.
\end{fineprint}
\end{proof}

Proposition \ref{prop.ent.phi.p} can be generalized as follows:

\begin{exercise}
\label{exe.ent.phi.pk}Let $p$ be a prime. Let $k$ be a positive integer. Prove
that $\phi\left(  p^{k}\right)  =\left(  p-1\right)  p^{k-1}$.
\end{exercise}

\begin{theorem}
\label{thm.ent.phi.mult}Let $m$ and $n$ be two coprime positive integers.
Then, $\phi\left(  mn\right)  =\phi\left(  m\right)  \cdot\phi\left(
n\right)  $.
\end{theorem}

We will prove Theorem \ref{thm.ent.phi.mult} later (in Section
\ref{sect.ent.phi-fml-proof}).

\begin{theorem}
\label{thm.ent.phi.explicit}Let $n$ be a positive integer. Then,%
\[
\phi\left(  n\right)  =\prod_{\substack{p\text{ prime;}\\p\mid n}}\left(
\left(  p-1\right)  p^{v_{p}\left(  n\right)  -1}\right)  =n\cdot
\prod_{\substack{p\text{ prime;}\\p\mid n}}\left(  1-\dfrac{1}{p}\right)  .
\]

\end{theorem}

Theorem \ref{thm.ent.phi.explicit} will be proven in Section
\ref{sect.ent.phi-fml-proof}.

\begin{exercise}
\label{exe.ent.phi.d-phid}Let $n$ be a positive integer.

\textbf{(a)} Prove that%
\[
n-\phi\left(  n\right)  =\left\vert \left\{  i\in\left\{  1,2,\ldots
,n\right\}  \ \mid\ \text{we don't have }i\perp n\right\}  \right\vert .
\]


\textbf{(b)} We have $n-\phi\left(  n\right)  \geq0$.

\textbf{(c)} Let $d$ be a positive divisor of $n$. Prove that $d-\phi\left(
d\right)  \leq n-\phi\left(  n\right)  $.

\textbf{(d)} Let $d$ be a positive divisor of $n$ such that $d\neq n$. Prove
that $d-\phi\left(  d\right)  <n-\phi\left(  n\right)  $.
\end{exercise}

\subsubsection{The totient sum theorem}

\begin{theorem}
\label{thm.ent.phi.sum-div}Let $n$ be a positive integer. Then,%
\[
\sum_{d\mid n}\phi\left(  d\right)  =n.
\]
Here and in the following, the symbol \textquotedblleft$\sum_{d\mid n}%
$\textquotedblright\ stands for \textquotedblleft sum over all
\textbf{positive} divisors $d$ of $n$\textquotedblright.
\end{theorem}

For example, for $n=12$, Theorem \ref{thm.ent.phi.sum-div} states that%
\[
\phi\left(  1\right)  +\phi\left(  2\right)  +\phi\left(  3\right)
+\phi\left(  4\right)  +\phi\left(  6\right)  +\phi\left(  12\right)  =12.
\]


Before we prove Theorem \ref{thm.ent.phi.sum-div}, let us motivate an argument
via a classical puzzle:

\begin{exercise}
\label{exe.ent.phi.ghosts}You have a corridor with $1000$ lamps, which are
initially all off. Each lamp has a lightswitch controlling its state.

Every night, a ghost glides through the corridor (always in the same
direction) and flips some of the switches:

On the $1$st night, the ghost flips every switch.

On the $2$nd night, the ghost flips switches $2,4,6,8,10,\ldots$.

On the $3$rd night, the ghost flips switches $3,6,9,12,15,\ldots$.

etc.

(That is: For each $k\in\left\{  1,2,\ldots,1000\right\}  $, the ghost spends
the $k$-th night flipping switches $k,2k,3k,\ldots$.)

Which lamps will be on after $1000$ nights?
\end{exercise}

In more rigorous terms, Exercise \ref{exe.ent.phi.ghosts} is simply asking
which of the numbers $1,2,\ldots,1000$ have an odd number of positive
divisors. (Indeed, the situation after $1000$ nights looks as follows: For
each $n\in\left\{  1,2,\ldots,1000\right\}  $, the $n$-th switch has been
flipped exactly once for each positive divisor of $n$; thus, the $n$-th lamp
is on if and only if $n$ has an odd number of positive divisors.)

Experiments reveal that among the first $10$ positive integers, only three
have an odd number of positive divisors: namely, $1$, $4$ and $9$. (For
example, $9$ has the $3$ positive divisors $1$, $3$ and $9$.) This suggests
the following:

\begin{proposition}
\label{prop.ent.phi.ghosts}A positive integer $n$ has an odd number of
positive divisors if and only if $n$ is a perfect square.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ent.phi.ghosts}.]Fix a positive integer $n$.
If $d$ is a positive divisor of $n$, then $n/d$ is a positive divisor of $n$
as well\footnote{\textit{Proof.} Let $d$ be a positive divisor of $n$. Thus,
$d$ is a positive integer satisfying $d\mid n$. But Proposition
\ref{prop.ent.div.1} \textbf{(c)} (applied to $a=d$ and $b=n$) yields that
$d\mid n$ if and only if $\dfrac{n}{d}\in\mathbb{Z}$ (since $d\neq0$). Hence,
$\dfrac{n}{d}\in\mathbb{Z}$ (since $d\mid n$). In other words, $n/d\in
\mathbb{Z}$. Moreover, $n/d$ is positive (since $n$ and $d$ are positive).
\par
So $n/d$ is a positive integer (since $n/d\in\mathbb{Z}$) and is a divisor of
$n$ (since $n=\left(  n/d\right)  \cdot d$). Hence, $n/d$ is a positive
divisor of $n$. Qed.}. This allows us to define a map%
\begin{align*}
F:\left\{  \text{positive divisors of }n\right\}   &  \rightarrow\left\{
\text{positive divisors of }n\right\}  ,\\
d  &  \mapsto n/d.
\end{align*}
This map $F$ has the property that $F\circ F=\operatorname*{id}$, because each
$d\in\left\{  \text{positive divisors of }n\right\}  $ satisfies%
\begin{align*}
\left(  F\circ F\right)  \left(  d\right)   &  =F\left(  \underbrace{F\left(
d\right)  }_{\substack{=n/d\\\text{(by the definition of }F\text{)}}}\right)
=F\left(  n/d\right) \\
&  =n/\left(  n/d\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition
of }F\right) \\
&  =d=\operatorname*{id}\left(  d\right)  .
\end{align*}
Hence, the map $F$ is inverse to itself. Thus, the map $F$ is invertible,
i.e., is a bijection.

For the rest of this proof, the word \textquotedblleft
divisor\textquotedblright\ shall mean \textquotedblleft positive divisor of
$n$\textquotedblright. Thus, $F$ is a map from $\left\{  \text{divisors}%
\right\}  $ to $\left\{  \text{divisors}\right\}  $.

The rough idea from here on is the following:\footnote{We shall give a more
rigorous proof shortly.} The map $F$ \textquotedblleft pairs
up\textquotedblright\ each divisor $d$ with the divisor $F\left(  d\right)
=n/d$. Thus, the divisors are \textquotedblleft grouped into
pairs\textquotedblright, except for those that satisfy $d=n/d$ (because these
would have to be paired up with themselves). When $n$ is not a perfect square,
there are no such \textquotedblleft exceptional\textquotedblright\ divisors,
since $d=n/d$ means $n=d^{2}$. When $n$ is a perfect square, there is exactly
one such \textquotedblleft exceptional\textquotedblright\ divisor, namely
$\sqrt{n}$. So the number of divisors is even if $n$ is not a perfect square,
and odd otherwise (because clearly, all the pairs have no effect on the parity
of the total number of divisors, and thus can be forgotten). In other words,
$n$ has an odd number of positive divisors if and only if $n$ is a perfect square.

\begin{fineprint}
There are several ways to make this argument rigorous; here is the easiest
(though perhaps the least instructive one): A divisor $d$ shall be called

\begin{itemize}
\item \textit{small} if $d<n/d$;

\item \textit{medium} if $d=n/d$;

\item \textit{large} if $d>n/d$.
\end{itemize}

It is easy to see that if $d$ is a small divisor, then $F\left(  d\right)  $
is a large divisor\footnote{\textit{Proof.} Let $d$ be a small divisor. Thus,
$d<n/d$. Hence, $n/d>d=n/\left(  n/d\right)  $. In view of $F\left(  d\right)
=n/d$, this rewrites as $F\left(  d\right)  >n/\left(  F\left(  d\right)
\right)  $. In other words, $F\left(  d\right)  $ is a large divisor (by the
definition of \textquotedblleft large divisor\textquotedblright). Qed.}.
Hence, the map%
\begin{align*}
F^{+}:\left\{  \text{small divisors}\right\}   &  \rightarrow\left\{
\text{large divisors}\right\}  ,\\
d  &  \mapsto F\left(  d\right)
\end{align*}
is well-defined. Similarly, the map%
\begin{align*}
F^{-}:\left\{  \text{large divisors}\right\}   &  \rightarrow\left\{
\text{small divisors}\right\}  ,\\
d  &  \mapsto F\left(  d\right)
\end{align*}
is well-defined. These two maps $F^{+}$ and $F^{-}$ are both restrictions of
the map $F$, and thus are mutually inverse (since the map $F$ is inverse to
itself). Hence, the map $F^{+}$ is invertible, i.e., is a bijection. Thus, we
have found a bijection from $\left\{  \text{small divisors}\right\}  $ to
$\left\{  \text{large divisors}\right\}  $ (namely, $F^{+}$). Therefore,%
\begin{equation}
\left\vert \left\{  \text{small divisors}\right\}  \right\vert =\left\vert
\left\{  \text{large divisors}\right\}  \right\vert .
\label{pf.prop.ent.phi.ghosts.s=l}%
\end{equation}


On the other hand, let us take a look at medium divisors. If $d$ is a medium
divisor, then $d=n/d$ (by the definition of \textquotedblleft
medium\textquotedblright), so that $d^{2}=n$ and thus $n$ must be a perfect
square. Thus, if $n$ is \textbf{not} a perfect square, then there are no
medium divisors. In other words, if $n$ is \textbf{not} a perfect square, then%
\begin{equation}
\left\vert \left\{  \text{medium divisors}\right\}  \right\vert =0.
\label{pf.prop.ent.phi.ghosts.m0}%
\end{equation}


But if $n$ \textbf{is} a perfect square, then $n$ has exactly one medium
divisor\footnote{\textit{Proof.} Assume that $n$ is a perfect square. Thus,
$n=w^{2}$ for some $w\in\mathbb{Z}$. Consider this $w$. Clearly, $w\neq0$
(since $ww=w^{2}=n\neq0$), so that $\left\vert w\right\vert >0$.
\par
Let $u=\left\vert w\right\vert $. Thus, $u\in\mathbb{Z}$ (since $w\in
\mathbb{Z}$). Hence, $u$ is a positive integer (since $u=\left\vert
w\right\vert >0$). Moreover, from $u=\left\vert w\right\vert $, we obtain
$u^{2}=\left\vert w\right\vert ^{2}=w^{2}=n$. Hence, $u=n/u$.
\par
This positive integer $u$ satisfies $uu=u^{2}=n$ and thus $u\mid n$. Hence,
$u$ is a positive divisor of $n$ (that is, a divisor, as we call it). This
divisor $u$ is medium, since it satisfies $u=n/u$.
\par
Moreover, if $d$ is any medium divisor, then $d=n/d$ (by the definition of
\textquotedblleft medium\textquotedblright), thus $d^{2}=n=u^{2}$, thus
$\sqrt{d^{2}}=\sqrt{u^{2}}=\left\vert u\right\vert =u$ (since $u$ is
positive), thus $u=\sqrt{d^{2}}=\left\vert d\right\vert =d$ (since $d$ is
positive) and therefore $d=u$. In other words, any medium divisor must equal
$u$. This shows that $u$ is the \textbf{only} medium divisor (since we already
know that $u$ is a medium divisor). Hence, $n$ has exactly one medium
divisor.}. In other words, if $n$ \textbf{is} a perfect square, then%
\begin{equation}
\left\vert \left\{  \text{medium divisors}\right\}  \right\vert =1.
\label{pf.prop.ent.phi.ghosts.m1}%
\end{equation}


But each divisor is either small or medium or large, and there are no overlaps
between these three classes (i.e., a divisor cannot be small and medium at the
same time, or small and large, or medium and large). Thus, in order to count
the number of all divisors, we can add the number of small divisors, the
number of medium divisors and the number of large divisors. In other words:%
\begin{align*}
\left\vert \left\{  \text{divisors}\right\}  \right\vert  &
=\underbrace{\left\vert \left\{  \text{small divisors}\right\}  \right\vert
}_{\substack{=\left\vert \left\{  \text{large divisors}\right\}  \right\vert
\\\text{(by (\ref{pf.prop.ent.phi.ghosts.s=l}))}}}+\left\vert \left\{
\text{medium divisors}\right\}  \right\vert +\left\vert \left\{  \text{large
divisors}\right\}  \right\vert \\
&  =\left\vert \left\{  \text{large divisors}\right\}  \right\vert +\left\vert
\left\{  \text{medium divisors}\right\}  \right\vert +\left\vert \left\{
\text{large divisors}\right\}  \right\vert \\
&  =\underbrace{2\cdot\left\vert \left\{  \text{large divisors}\right\}
\right\vert }_{\equiv0\operatorname{mod}2}+\left\vert \left\{  \text{medium
divisors}\right\}  \right\vert \\
&  \equiv\left\vert \left\{  \text{medium divisors}\right\}  \right\vert
\operatorname{mod}2.
\end{align*}


Hence, if $n$ is \textbf{not} a perfect square, then%
\[
\left\vert \left\{  \text{divisors}\right\}  \right\vert \equiv\left\vert
\left\{  \text{medium divisors}\right\}  \right\vert =0\operatorname{mod}2
\]
(by (\ref{pf.prop.ent.phi.ghosts.m0})). In other words, if $n$ is \textbf{not}
a perfect square, then the number of divisors is even.

On the other hand, if $n$ \textbf{is} a perfect square, then%
\[
\left\vert \left\{  \text{divisors}\right\}  \right\vert \equiv\left\vert
\left\{  \text{medium divisors}\right\}  \right\vert =1\operatorname{mod}2
\]
(by (\ref{pf.prop.ent.phi.ghosts.m1})). In other words, if $n$ \textbf{is} a
perfect square, then the number of divisors is odd.

Combining the results of the previous two paragraphs, we conclude that the
number of divisors is odd if $n$ is a perfect square, and is even otherwise.
In other words, $n$ has an odd number of positive divisors if and only if $n$
is a perfect square. This proves Proposition \ref{prop.ent.phi.ghosts}.
\end{fineprint}
\end{proof}

Having proven Proposition \ref{prop.ent.phi.ghosts}, we now can answer
Exercise \ref{exe.ent.phi.ghosts}: The $31$ lamps $1^{2},2^{2},\ldots,31^{2}$
(and no others) will be on after the $1000$ nights. (Indeed, these $31$ lamps
correspond to the $31$ perfect squares in the set $\left\{  1,2,\ldots
,1000\right\}  $.)

The bijection $F$ from the proof of Proposition \ref{prop.ent.phi.ghosts} will
serve us well in our proof of Theorem \ref{thm.ent.phi.sum-div}. Beside that,
we need the following lemma:

\begin{lemma}
\label{lem.ent.phi.sum-div.n/d}Let $n$ be a positive integer. Let $d$ be a
positive divisor of $n$. Then,%
\[
\left(  \text{the number of }i\in\left\{  1,2,\ldots,n\right\}  \text{ such
that }\gcd\left(  i,n\right)  =d\right)  =\phi\left(  n/d\right)  .
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.phi.sum-div.n/d}.]We have $d\mid n$ (since $d$ is
a divisor of $n$) and $d\neq0$ (since $d$ is positive). Thus, Proposition
\ref{prop.ent.div.1} \textbf{(c)} (applied to $d$ and $n$ instead of $a$ and
$b$) yields that $d\mid n$ if and only if $\dfrac{n}{d}\in\mathbb{Z}$. Thus,
$\dfrac{n}{d}\in\mathbb{Z}$ (since $d\mid n$). In other words, $n/d\in
\mathbb{Z}$. Thus, $n/d$ is an integer. This integer $n/d$ is positive (since
$n$ and $d$ are positive). Hence, $\phi\left(  n/d\right)  $ is well-defined.

Define two sets $I$ and $J$ by%
\begin{equation}
I=\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \gcd\left(  i,n\right)
=d\right\}  \label{pf.lem.ent.phi.sum-div.n/d.I=}%
\end{equation}
and%
\begin{equation}
J=\left\{  i\in\left\{  1,2,\ldots,n/d\right\}  \ \mid\ i\perp n/d\right\}  .
\label{pf.lem.ent.phi.sum-div.n/d.J=}%
\end{equation}
But (\ref{eq.def.ent.phi.phi.1}) (applied to $n/d$ instead of $n$) yields%
\begin{equation}
\phi\left(  n/d\right)  =\left\vert \left\{  i\in\left\{  1,2,\ldots
,n/d\right\}  \ \mid\ i\perp n/d\right\}  \right\vert =\left\vert J\right\vert
\label{pf.lem.ent.phi.sum-div.n/d.2}%
\end{equation}
(since $\left\{  i\in\left\{  1,2,\ldots,n/d\right\}  \ \mid\ i\perp
n/d\right\}  =J$).

We shall next construct a bijection from $I$ to $J$ (which will show that
$\left\vert I\right\vert =\left\vert J\right\vert $).

For each $a\in I$, we have $a/d\in J$\ \ \ \ \footnote{\textit{Proof.} Let
$a\in I$. Thus, $a\in I=\left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ \gcd\left(  i,n\right)  =d\right\}  $. In other words, $a$ is an
element of $\left\{  1,2,\ldots,n\right\}  $ satisfying $\gcd\left(
a,n\right)  =d$.
\par
Thus, $d=\gcd\left(  a,n\right)  \mid a$. But Proposition \ref{prop.ent.div.1}
\textbf{(c)} (applied to $d$ and $a$ instead of $a$ and $b$) yields that
$d\mid a$ if and only if $\dfrac{a}{d}\in\mathbb{Z}$. Thus, $\dfrac{a}{d}%
\in\mathbb{Z}$ (since $d\mid a$). In other words, $a/d\in\mathbb{Z}$. Also,
$a\in\left\{  1,2,\ldots,n\right\}  $, so that $0<a\leq n$. We can divide this
chain of inequalities by $d$ (since $d$ is positive), and thus obtain
$0<a/d\leq n/d$. Hence, $a/d\in\left\{  1,2,\ldots,n/d\right\}  $ (since
$a/d\in\mathbb{Z}$). Furthermore, Theorem \ref{thm.ent.gcd.sa,sb} (applied to
$d$, $a/d$ and $n/d$ instead of $s$, $a$ and $b$) yields%
\[
\gcd\left(  d\left(  a/d\right)  ,d\left(  n/d\right)  \right)
=\underbrace{\left\vert d\right\vert }_{\substack{=d\\\text{(since }d\text{ is
positive)}}}\gcd\left(  a/d,n/d\right)  =d\gcd\left(  a/d,n/d\right)  .
\]
Solving this for $\gcd\left(  a/d,n/d\right)  $, we obtain%
\[
\gcd\left(  a/d,n/d\right)  =\dfrac{1}{d}\gcd\left(  \underbrace{d\left(
a/d\right)  }_{=a},\underbrace{d\left(  n/d\right)  }_{=n}\right)  =\dfrac
{1}{d}\underbrace{\gcd\left(  a,n\right)  }_{=d}=\dfrac{1}{d}d=1.
\]
In other words, $a/d\perp n/d$.
\par
So we know that $a/d$ is an element of $\left\{  1,2,\ldots,n/d\right\}  $
satisfying $a/d\perp n/d$. In other words, $a/d\in\left\{  i\in\left\{
1,2,\ldots,n/d\right\}  \ \mid\ i\perp n/d\right\}  =J$. Qed.}. Hence, we can
define a map%
\begin{align*}
f:I  &  \rightarrow J,\\
a  &  \mapsto a/d.
\end{align*}


For each $b\in J$, we have $bd\in I$\ \ \ \ \footnote{\textit{Proof.} Let
$b\in J$. Thus, $b\in J=\left\{  i\in\left\{  1,2,\ldots,n/d\right\}
\ \mid\ i\perp n/d\right\}  $. In other words, $b$ is an element of $\left\{
1,2,\ldots,n/d\right\}  $ satisfying $b\perp n/d$.
\par
From $b\in\left\{  1,2,\ldots,n/d\right\}  \subseteq\mathbb{Z}$ and
$d\in\mathbb{Z}$, we obtain $bd\in\mathbb{Z}$. From $b\in\left\{
1,2,\ldots,n/d\right\}  $, we obtain $0<b\leq n/d$. We can multiply this chain
of inequalities by $d$ (since $d$ is positive), and thus obtain $0<bd\leq n$.
Thus, $bd\in\left\{  1,2,\ldots,n\right\}  $ (since $bd\in\mathbb{Z}$).
Theorem \ref{thm.ent.gcd.sa,sb} (applied to $d$, $b$ and $n/d$ instead of $s$,
$a$ and $b$) yields%
\[
\gcd\left(  db,d\left(  n/d\right)  \right)  =\underbrace{\left\vert
d\right\vert }_{\substack{=d\\\text{(since }d\text{ is positive)}%
}}\underbrace{\gcd\left(  b,n/d\right)  }_{\substack{=1\\\text{(since }b\perp
n/d\text{)}}}=d.
\]
Thus, $d=\gcd\left(  \underbrace{db}_{=bd},\underbrace{d\left(  n/d\right)
}_{=n}\right)  =\gcd\left(  bd,n\right)  $, so that $\gcd\left(  bd,n\right)
=d$.
\par
So we know that $bd$ is an element of $\left\{  1,2,\ldots,n\right\}  $
satisfying $\gcd\left(  bd,n\right)  =d$. In other words, $bd\in\left\{
i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \gcd\left(  i,n\right)  =d\right\}
=I$, qed.}. Thus, we can define a map%
\begin{align*}
g:J  &  \rightarrow I,\\
b  &  \mapsto bd.
\end{align*}


The two maps $f$ and $g$ are mutually inverse (since the map $f$ divides its
input by $d$, while the map $g$ multiplies its input by $d$). Hence, $f$ is
invertible, i.e., is a bijection. Thus, there exists a bijection from $I$ to
$J$ (namely, $f$). Hence, $\left\vert I\right\vert =\left\vert J\right\vert
=\phi\left(  n/d\right)  $ (by (\ref{pf.lem.ent.phi.sum-div.n/d.2})). Thus,%
\begin{align*}
\phi\left(  n/d\right)   &  =\left\vert I\right\vert =\left\vert \left\{
i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \gcd\left(  i,n\right)  =d\right\}
\right\vert \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.lem.ent.phi.sum-div.n/d.I=})}\right) \\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,n\right\}  \text{
such that }\gcd\left(  i,n\right)  =d\right)  .
\end{align*}
This proves Lemma \ref{lem.ent.phi.sum-div.n/d}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.ent.phi.sum-div}.]Consider the map $F$ we defined
in the proof of Proposition \ref{prop.ent.phi.ghosts}. This map $F$ is a
bijection (as we have seen back in that proof). In other words, the map%
\begin{align*}
\left\{  \text{positive divisors of }n\right\}   &  \rightarrow\left\{
\text{positive divisors of }n\right\}  ,\\
d  &  \mapsto n/d
\end{align*}
is a bijection (since this is precisely the map $F$). Thus, we can substitute
$n/d$ for $d$ in the sum $\sum_{d\mid n}\phi\left(  d\right)  $ (and, more
generally, in any sum that ranges over all positive divisors $d$ of $n$). We
thus obtain%
\begin{equation}
\sum_{d\mid n}\phi\left(  d\right)  =\sum_{d\mid n}\phi\left(  n/d\right)  .
\label{pf.thm.ent.phi.sum-div.subst}%
\end{equation}


But%
\begin{align*}
n  &  =\left\vert \left\{  1,2,\ldots,n\right\}  \right\vert =\left(
\text{the number of }i\in\left\{  1,2,\ldots,n\right\}  \right) \\
&  =\sum_{d\mid n}\underbrace{\left(  \text{the number of }i\in\left\{
1,2,\ldots,n\right\}  \text{ such that }\gcd\left(  i,n\right)  =d\right)
}_{\substack{=\phi\left(  n/d\right)  \\\text{(by Lemma
\ref{lem.ent.phi.sum-div.n/d})}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{because if }i\in\left\{  1,2,\ldots
,n\right\}  \text{, then }\gcd\left(  i,n\right)  \text{ is a positive divisor
of }n\right) \\
&  =\sum_{d\mid n}\phi\left(  n/d\right)  =\sum_{d\mid n}\phi\left(  d\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.ent.phi.sum-div.subst}%
)}\right)  .
\end{align*}
This proves Theorem \ref{thm.ent.phi.sum-div}.
\end{proof}

\begin{exercise}
\label{exe.ent.phi.even}Let $n\in\mathbb{N}$ satisfy $n>2$. Prove that
$\phi\left(  n\right)  $ is even.
\end{exercise}

\begin{exercise}
\label{exe.ent.phi.gauss}Let $n\in\mathbb{N}$ satisfy $n>1$. Prove that
\[
\sum_{\substack{i\in\left\{  1,2,\ldots,n\right\}  ;\\i\perp n}}i=n\phi\left(
n\right)  /2.
\]

\end{exercise}

\begin{teachingnote}
\textbf{2019-02-15 lecture}
\end{teachingnote}

\subsection{Fermat, Euler, Wilson}

\subsubsection{Fermat and Euler: statements}

The following theorem is known as \textit{Fermat's Little Theorem} (often
abbreviated as \textquotedblleft FLT\textquotedblright):

\begin{theorem}
\label{thm.ent.fermat}Let $p$ be a prime. Let $a\in\mathbb{Z}$.

\textbf{(a)} If $p\nmid a$, then $a^{p-1}\equiv1\operatorname{mod}p$.

\textbf{(b)} We always have $a^{p}\equiv a\operatorname{mod}p$.
\end{theorem}

The word \textquotedblleft little\textquotedblright\ in the name of Theorem
\ref{thm.ent.fermat} is meant to distinguish the theorem from
\textquotedblleft%
\href{https://en.wikipedia.org/wiki/Fermat's_Last_Theorem}{Fermat's Last
Theorem}\textquotedblright, a much more difficult result only proven in the
1990s. (Unfortunately, the latter result is also abbreviated as
\textquotedblleft FLT\textquotedblright.)

We will prove Theorem \ref{thm.ent.fermat} soon, by showing a more general
result (Theorem \ref{thm.ent.euler}). But before we do so, let us convince
ourselves that the parts \textbf{(a)} and \textbf{(b)} of Theorem
\ref{thm.ent.fermat} are equivalent:

\begin{remark}
Theorem \ref{thm.ent.fermat} \textbf{(b)} follows from Theorem
\ref{thm.ent.fermat} \textbf{(a)}, because (using the notations of Theorem
\ref{thm.ent.fermat}):

\begin{itemize}
\item If $p\nmid a$, then Theorem \ref{thm.ent.fermat} \textbf{(a)} yields
$a^{p-1}\equiv1\operatorname{mod}p$, thus $a^{p}=a\underbrace{a^{p-1}}%
_{\equiv1\operatorname{mod}p}\equiv a1=a\operatorname{mod}p$.

\item If $p\mid a$, then both $a^{p}$ and $a$ are $\equiv0\operatorname{mod}p$
(because $p\mid a$ entails $a\equiv0\operatorname{mod}p$ and thus $a^{p}%
\equiv0^{p}=0\operatorname{mod}p$ (since $p>0$)), and therefore $a^{p}%
\equiv0\equiv a\operatorname{mod}p$.
\end{itemize}

Conversely, Theorem \ref{thm.ent.fermat} \textbf{(a)} follows from Theorem
\ref{thm.ent.fermat} \textbf{(b)} by the following argument: Let $p$ and $a$
be as in Theorem \ref{thm.ent.fermat}. Assume that $p\nmid a$. Then, $p\perp
a$ (by Proposition \ref{prop.ent.prime.div-or-coprime}), so that $a\perp p$.
Thus, we can \textquotedblleft cancel\textquotedblright\ $a$ from any
congruence modulo $p$ (by Lemma \ref{lem.ent.coprime.cancel}). Doing this to
the congruence $a^{p}\equiv a\operatorname{mod}p$ (which follows from Theorem
\ref{thm.ent.fermat} \textbf{(b)}), we obtain $a^{p-1}\equiv
1\operatorname{mod}p$.
\end{remark}

The next result is known as \textit{Euler's theorem}:

\begin{theorem}
\label{thm.ent.euler}Let $n$ be a positive integer. Let $a\in\mathbb{Z}$ be
coprime to $n$.

Then, $a^{\phi\left(  n\right)  }\equiv1\operatorname{mod}n$.
\end{theorem}

Theorem \ref{thm.ent.euler} yields Theorem \ref{thm.ent.fermat} \textbf{(a)},
since $\phi\left(  p\right)  =p-1$ when $p$ is prime\footnote{See below for
details of this argument.}. Since we also know that Theorem
\ref{thm.ent.fermat} \textbf{(b)} follows from Theorem \ref{thm.ent.fermat}
\textbf{(a)}, we see that a proof of Theorem \ref{thm.ent.euler} will
immediately yield the whole Theorem \ref{thm.ent.fermat}. Before we give said
proof, let us show an example of how Theorem \ref{thm.ent.euler} can be used:

\begin{exercise}
\label{exe.ent.euler345}What is the last digit of $3^{4^{5}}$?

\textit{Notational remark:} An expression of the form \textquotedblleft%
$a^{b^{c}}$\textquotedblright\ always means $a^{\left(  b^{c}\right)  }$, not
$\left(  a^{b}\right)  ^{c}$. (Actually, there is no need for an extra
notation for $\left(  a^{b}\right)  ^{c}$, because $\left(  a^{b}\right)
^{c}=a^{bc}$.)
\end{exercise}

\begin{proof}
[Solution to Exercise \ref{exe.ent.euler345} (sketched).]The last digit of a
positive integer $n$ is $n\%10$ (that is, the remainder of $n$ upon division
by $10$). So we need to work modulo $10$.

Since $3$ is coprime to $10$, we can apply Theorem \ref{thm.ent.euler} to
$n=10$ and $a=3$. We thus get $3^{\phi\left(  10\right)  }\equiv
1\operatorname{mod}10$. Since $\phi\left(  10\right)  =4$, this rewrites as
$3^{4}\equiv1\operatorname{mod}10$. Now, $4^{5}=4\cdot4^{4}$, so that%
\[
3^{4^{5}}=3^{4\cdot4^{4}}=\left(  \underbrace{3^{4}}_{\equiv
1\operatorname{mod}10}\right)  ^{4^{4}}\equiv1^{4^{4}}=1\operatorname{mod}10.
\]
So the last digit of $3^{4^{5}}$ is $1$.
\end{proof}

Theorem \ref{thm.ent.euler} is also the reason why certain rational numbers
(such as $\dfrac{2}{7}=0.\overline{285714}$\ \ \ \ \footnote{The bar
($\ \overline{\ \ \text{\vphantom{5}}\ \ }\ $) over the \textquotedblleft%
$285714$\textquotedblright\ means that we are repeating $285714$ over and
over. So $0.\overline{285714}=0.285714285714285714\ldots$.}) have purely
periodic decimal expansions, while others (such as $\dfrac{1}{12}%
=0.08\overline{3}=0.0833333\ldots$ or $\dfrac{1}{2}=0.5\overline
{0}=0.50000\ldots$) have their periods start only after some initial
nonrepeating block. We refer \cite[\S 4]{Conrad-Euler} to the details of
this.\footnote{In brief, the rule is as follows: Any fraction $\dfrac{a}{b}$
with $a,b\in\mathbb{Z}$ (and $b\neq0$) has such a decimal representation with
a period. (A \textit{period} means a part that gets repeated over and over.) A
fraction $\dfrac{a}{b}$ is called \textit{purely periodic} if its period (in
decimal notation) begins straight after the decimal point. So $\dfrac{2}{7}$
is purely periodic but $\dfrac{1}{12}$ and $\dfrac{1}{2}$ are not. Now, the
answer is that a fraction $\dfrac{a}{b}$ (with $a\perp b$) is purely periodic
if and only if $b\perp10$ (in other words, $2\nmid b$ and $5\nmid b$). This
can be proven using Theorem \ref{thm.ent.euler}.}

\subsubsection{Proving Euler and Fermat}

Our proof of Theorem \ref{thm.ent.euler} will rely on the following lemma:

\begin{lemma}
\label{lem.ent.euler.phi0}Let $n$ be a positive integer. Then,%
\[
\phi\left(  n\right)  =\left\vert \left\{  i\in\left\{  0,1,\ldots
,n-1\right\}  \ \mid\ i\perp n\right\}  \right\vert .
\]

\end{lemma}

\begin{proof}
[First proof of Lemma \ref{lem.ent.euler.phi0} (sketched).]If $n=1$, then this
lemma can easily be proven by hand. Thus, WLOG assume that $n\neq1$. Hence,
$n>1$ (since $n$ is a positive integer). Thus, neither $0$ nor $n$ is coprime
to $n$ (since $\gcd\left(  0,n\right)  =n>1$ and $\gcd\left(  n,n\right)
=n>1$). Hence,%
\[
\left\{  i\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ i\perp n\right\}
=\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}
\]
(because these sets could only differ in the elements $0$ and $n$, but none of
these two elements belongs to any of these two sets\footnote{since neither $0$
nor $n$ is coprime to $n$}), and therefore%
\[
\left\vert \left\{  i\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ i\perp
n\right\}  \right\vert =\left\vert \left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ i\perp n\right\}  \right\vert =\phi\left(  n\right)
\]
(by \eqref{eq.def.ent.phi.phi.1}). This proves Lemma \ref{lem.ent.euler.phi0}.
\end{proof}

\begin{proof}
[Second proof of Lemma \ref{lem.ent.euler.phi0}.]We have $n \mid n$ and thus
$n \equiv0 \mod n$. Hence, Proposition \ref{prop.ent.gcd.props1} \textbf{(d)}
(applied to $a = n$, $b = n$ and $c = 0$) yields that $\gcd\left(  n, n
\right)  = \gcd\left(  n, 0 \right)  = \gcd\left(  0, n \right)  $ (by
Proposition \ref{prop.ent.gcd.props1} \textbf{(b)}). Hence, $\gcd\left(  0, n
\right)  = 1$ holds if and only if $\gcd\left(  n, n \right)  = 1$. In other
words, the number $0$ is coprime to $n$ if and only if $n$ is coprime to $n$.
Hence, if we remove $n$ from the set $\left\{  1,2,\ldots,n\right\}  $ and add
$0$ instead (so that our set becomes $\left\{  0, 1, \ldots, n-1 \right\}  $),
then the number of elements coprime to $n$ in that set does not change. In
other words,
\begin{align*}
&  \left(  \text{the number of all } i\in\left\{  0,1,\ldots,n-1\right\}
\text{ that are coprime to } n \right) \\
&  = \left(  \text{the number of all } i\in\left\{  1,2,\ldots,n\right\}
\text{ that are coprime to } n \right) \\
&  = \left\vert \left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp
n\right\}  \right\vert =\phi\left(  n\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by \eqref{eq.def.ent.phi.phi.1}} \right)  .
\end{align*}
In other words,
\begin{align*}
\phi\left(  n \right)   &  = \left(  \text{the number of all } i\in\left\{
0,1,\ldots,n-1\right\}  \text{ that are coprime to } n \right) \\
&  = \left\vert \left\{  i\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ i\perp
n\right\}  \right\vert .
\end{align*}
This proves Lemma \ref{lem.ent.euler.phi0} again.
\end{proof}

\begin{noncompile}
We will also need a fact about modular inverses, which we state as an
exercise. Namely, recall that Theorem \ref{thm.ent.coprime.modinv}
\textbf{(b)} guarantees the existence of a modular inverse for an integer $a$
modulo an integer $n$ as soon as $a$ and $n$ are coprime. We can slightly
improve this to guarantee a modular inverse that belongs to $\left\{  0, 1,
\ldots, n-1 \right\}  $ as long as $n$ is a positive integer:

\begin{exercise}
\label{exe.ent.coprime.modinv-in-set}Let $a$ be an integer, and $n$ be a
positive integer such that $a \perp n$. Then, there exists an $a^{\prime}%
\in\left\{  0,1,\ldots,n-1 \right\}  $ such that $aa^{\prime}\equiv
1\operatorname{mod}n$.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.modinv-in-set}.]Theorem
\ref{thm.ent.coprime.modinv} \textbf{(b)} shows that there exists an
$a^{\prime}\in\mathbb{Z}$ such that $aa^{\prime}\equiv1\operatorname{mod}n$.
Consider this $a^{\prime}$, and denote it by $u$. Thus, $u$ is an element of
$\mathbb{Z}$ and satisfies $au \equiv1 \mod n$. Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(a)} yields that $u\%n\in\left\{
0,1,\ldots,n-1\right\}  $ and $u\%n\equiv u\operatorname{mod}n$. Multiplying
the congruences $a \equiv a \mod n$ and $u \% n \equiv u \mod n$ together, we
find $a \left(  u\%n \right)  \equiv au \equiv1 \mod n$. Hence, there exists
an $a^{\prime}\in\left\{  0,1,\ldots,n-1 \right\}  $ such that $aa^{\prime
}\equiv1\operatorname{mod}n$ (namely, $a^{\prime} = u \% n$). This solves
Exercise \ref{exe.ent.coprime.modinv-in-set}.
\end{proof}
\end{fineprint}
\end{noncompile}

\begin{proof}
[Proof of Theorem \ref{thm.ent.euler}.]Let
\[
C=\left\{  i\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ i\perp n\right\}  .
\]
Then, Lemma \ref{lem.ent.euler.phi0} says that $\phi\left(  n\right)
=\left\vert C\right\vert $.

Now, set
\begin{equation}
z=\prod_{i\in C}i. \label{pf.thm.ent.euler.z=}%
\end{equation}
Exercise \ref{exe.ent.coprime.ab-to-cI} (applied to $I=C$, $c=n$ and $b_{i}%
=i$) yields $\prod_{i\in C}i\perp n$ (since each $i\in C$ satisfies $i\perp
n$). In other words, $z\perp n$ (since $z=\prod_{i\in C}i$).

We have $\left(  ai\right)  \%n\in C$ for each $i\in C$.

[\textit{Proof:} Let $i\in C$. Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(a)} (applied to $u=ai$) yields that $\left(  ai\right)
\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and $\left(  ai\right)  \%n\equiv
ai\operatorname{mod}n$. Thus, $ai\equiv\left(  ai\right)
\%n\operatorname{mod}n$.

From $a\perp n$ and $i\perp n$, we obtain $ai\perp n$ (by Theorem
\ref{thm.ent.coprime.ab-to-c}, applied to $i$ and $n$ instead of $b$ and $c$).
Hence, Exercise \ref{exe.ent.coprime.b==c} (applied to $ai$, $\left(
ai\right)  \%n$ and $n$ instead of $a$, $b$ and $c$) yields $\left(
ai\right)  \%n\perp n$ (since $ai\equiv\left(  ai\right)
\%n\operatorname{mod}n$). Combining this with $\left(  ai\right)
\%n\in\left\{  0,1,\ldots,n-1\right\}  $, we obtain $\left(  ai\right)  \%n\in
C$ (by the definition of $C$), qed.]

Thus, we can define a map%
\begin{align*}
f:C  &  \rightarrow C,\\
i  &  \mapsto\left(  ai\right)  \%n.
\end{align*}


The map $f$ is injective.

[\textit{Proof:} Let $i$ and $j$ be two elements of $C$ such that $f\left(
i\right)  =f\left(  j\right)  $. We must prove that $i=j$.

We have $f\left(  i\right)  =f\left(  j\right)  $. In view of $f\left(
i\right)  =\left(  ai\right)  \%n$ (by the definition of $f$) and $f\left(
j\right)  =\left(  aj\right)  \%n$, this rewrites as $\left(  ai\right)
\%n=\left(  aj\right)  \%n$. But Exercise \ref{exe.ent.quo-rem.mod=rem}
(applied to $u=ai$ and $v=aj$) shows that $ai\equiv aj\operatorname{mod}n$ if
and only if $\left(  ai\right)  \%n=\left(  aj\right)  \%n$. Hence, we have
$ai\equiv aj\operatorname{mod}n$ (since $\left(  ai\right)  \%n=\left(
aj\right)  \%n$). By Lemma \ref{lem.ent.coprime.cancel}, we can
\textquotedblleft cancel\textquotedblright\ $a$ from this congruence (since
$a\perp n$), and obtain $i\equiv j\operatorname{mod}n$. But both $i$ and $j$
belong to $C$ and thus belong to $\left\{  0,1,\ldots,n-1\right\}  $ (by the
definition of $C$). Hence, from $i\equiv j\operatorname{mod}n$, we can easily
obtain that $i=j$\ \ \ \ \footnote{\textit{Proof.} Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $u=j$ and $c=i$) yields
$i=j\%n$ (since $i\equiv j\operatorname{mod}n$ and $i\in\left\{
0,1,\ldots,n-1\right\}  $). But Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(c)} (applied to $u=j$ and $c=j$) yields $j=j\%n$ (since $j\equiv
j\operatorname{mod}n$ and $j\in\left\{  0,1,\ldots,n-1\right\}  $). Hence,
$i=j\%n=j$.}.

Now, forget that we fixed $i$ and $j$. We thus have proven that if $i$ and $j$
are two elements of $C$ such that $f\left(  i\right)  =f\left(  j\right)  $,
then $i=j$. In other words, $f$ is injective.]

The map $f$ is surjective.

[\textit{Proof:} Let $i\in C$. We shall prove that $i\in f\left(  C\right)  $.

Indeed, $i\in C$. By the definition of $C$, this means that $i\in\left\{
0,1,\ldots,n-1\right\}  $ and $i\perp n$.

But Proposition \ref{thm.ent.coprime.modinv} \textbf{(b)} shows that there
exists an $a^{\prime}\in\mathbb{Z}$ such that $aa^{\prime}\equiv
1\operatorname{mod}n$ (since $a\perp n$). Consider this $a^{\prime}$, and
denote it by $u$. Thus, $u$ is an element of $\mathbb{Z}$ and satisfies
$au\equiv1\mod n$. From $ua=au\equiv1\mod n$, we conclude that there exists an
$u^{\prime}\in\mathbb{Z}$ such that $uu^{\prime}\equiv1\mod n$ (namely,
$u^{\prime}=a$). Hence, Theorem \ref{thm.ent.coprime.modinv} \textbf{(c)}
(applied to $u$ and $u^{\prime}$ instead of $a$ and $a^{\prime}$) shows that
$u\perp n$.

Now, Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $ui$
instead of $u$) shows that \newline$\left(  ui\right)  \%n\in\left\{
0,1,\ldots,n-1\right\}  $ and $\left(  ui\right)  \%n\equiv
ui\operatorname{mod}n$. Set $j=\left(  ui\right)  \%n$. Thus, $j=\left(
ui\right)  \%n\in\left\{  0,1,\ldots,n-1\right\}  $ and $j=\left(  ui\right)
\%n\equiv ui\operatorname{mod}n$. Multiplying the congruences $a\equiv
a\operatorname{mod}n$ and $j\equiv ui\operatorname{mod}n$, we obtain%
\[
aj\equiv\underbrace{au}_{\equiv1\operatorname{mod}n}i\equiv
1i=i\operatorname{mod}n.
\]
In other words, $i\equiv aj\operatorname{mod}n$. Therefore, Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $aj$ and $i$ instead of
$u$ and $c$) yields $i=\left(  aj\right)  \%n$ (since $i\in\left\{
0,1,\ldots,n-1\right\}  $).

Combining $u\perp n$ with $i\perp n$, we obtain $ui\perp n$ (by Theorem
\ref{thm.ent.coprime.ab-to-c}, applied to $u$, $i$ and $n$ instead of $a$, $b$
and $c$). Also, $ui\equiv j\operatorname{mod}n$ (since $j\equiv
ui\operatorname{mod}n$). Hence, Exercise \ref{exe.ent.coprime.b==c} (applied
to $ui$, $j$ and $n$ instead of $a$, $b$ and $c$) yields $j\perp n$. From
$j\in\left\{  0,1,\ldots,n-1\right\}  $ and $j\perp n$, we obtain $j\in C$ (by
the definition of $C$). Thus, $f\left(  j\right)  $ is well-defined. The
definition of $f$ yields $f\left(  j\right)  =\left(  aj\right)  \%n=i$ (since
$i=\left(  aj\right)  \%n$). Hence, $i=f\left(  \underbrace{j}_{\in C}\right)
\in f\left(  C\right)  $.

Now, forget that we fixed $i$. We thus have proven that $i\in f\left(
C\right)  $ for each $i\in C$. In other words, $C\subseteq f\left(  C\right)
$. In other words, the map $f$ is surjective.]

Now we know that the map $f$ is injective and surjective. Hence, this map $f$
is bijective. In other words, $f$ is a bijection from $C$ to $C$. Thus, we can
substitute $f\left(  s\right)  $ for $i$ in the product $\prod\limits_{i\in
C}i$. So we obtain%
\begin{equation}
\prod_{i\in C}i=\prod_{s\in C}f\left(  s\right)  .
\label{pf.thm.ent.euler.finale.1}%
\end{equation}
But for each $s\in C$, we have%
\begin{align*}
f\left(  s\right)   &  =\left(  as\right)  \%n\ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of }f\right) \\
&  \equiv as\operatorname{mod}n\ \ \ \ \ \ \ \ \ \ \left(  \text{by Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(a)}, applied to }u=as\right)  .
\end{align*}
Hence, (\ref{eq.exe.ent.mod.k-sum.b}) (applied to $S=C$, $a_{s}=f\left(
s\right)  $ and $b_{s}=as$) yields%
\[
\prod_{s\in C}f\left(  s\right)  \equiv\prod_{s\in C}\left(  as\right)
=a^{\left\vert C\right\vert }\underbrace{\prod_{s\in C}s}_{\substack{=\prod
_{i\in C}i=z\\\text{(by (\ref{pf.thm.ent.euler.z=}))}}}=a^{\left\vert
C\right\vert }z=a^{\phi\left(  n\right)  }z\operatorname{mod}n
\]
(since $\left\vert C\right\vert =\phi\left(  n\right)  $). Now,
(\ref{pf.thm.ent.euler.z=}) becomes%
\begin{align*}
z  &  =\prod_{i\in C}i=\prod_{s\in C}f\left(  s\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.ent.euler.finale.1})}\right)
\\
&  \equiv a^{\phi\left(  n\right)  }z=za^{\phi\left(  n\right)  }%
\operatorname{mod}n.
\end{align*}
Thus, $z\cdot1=z\equiv za^{\phi\left(  n\right)  }\operatorname{mod}n$. Lemma
\ref{lem.ent.coprime.cancel} lets us \textquotedblleft
cancel\textquotedblright\ $z$ from this congruence (since $z\perp n$). We thus
obtain $1\equiv a^{\phi\left(  n\right)  }\operatorname{mod}n$. This proves
Theorem \ref{thm.ent.euler}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.ent.fermat}.]As we have explained above, Theorem
\ref{thm.ent.fermat} follows from Theorem \ref{thm.ent.euler}.

\begin{fineprint}
Here is the argument in more detail:

\textbf{(a)} Assume that $p\nmid a$. Proposition \ref{prop.ent.phi.p} yields
$\phi\left(  p\right)  =p-1$. But Proposition
\ref{prop.ent.prime.div-or-coprime} yields that either $p\mid a$ or $p\perp
a$. Hence, $p\perp a$ (since $p\nmid a$). In other words, $a\perp p$. In other
words, $a$ is coprime to $p$. Hence, Theorem \ref{thm.ent.euler} (applied to
$n=p$) yields $a^{\phi\left(  p\right)  }\equiv1\operatorname{mod}p$. This
rewrites as $a^{p-1}\equiv1\operatorname{mod}p$ (since $\phi\left(  p\right)
=p-1$). This proves Theorem \ref{thm.ent.fermat} \textbf{(a)}.

\textbf{(b)} We are in one of the following two cases:

\textit{Case 1:} We have $p\nmid a$.

\textit{Case 2:} We have $p\mid a$.

Let us first consider Case 1. In this case, we have $p\nmid a$. Hence, Theorem
\ref{thm.ent.fermat} \textbf{(a)} yields $a^{p-1}\equiv1\operatorname{mod}p$.
Multiplying this congruence with the congruence $a\equiv a\operatorname{mod}%
p$, we obtain $a^{p-1}a\equiv1a=a\operatorname{mod}p$. In view of
$a^{p-1}a=a^{p}$, this rewrites as $a^{p}\equiv a\operatorname{mod}p$. Hence,
Theorem \ref{thm.ent.fermat} \textbf{(b)} is proven in Case 1.

Let us now consider Case 2. In this case, we have $p\mid a$. In other words,
$a\equiv0\operatorname{mod}p$. Taking this congruence to the $p$-th power, we
obtain $a^{p}\equiv0^{p}=0\operatorname{mod}p$ (since $p>0$). Thus,
$a^{p}\equiv0\equiv a\operatorname{mod}p$ (since $a\equiv0\operatorname{mod}%
p$). Hence, Theorem \ref{thm.ent.fermat} \textbf{(b)} is proven in Case 2.

We have now proven Theorem \ref{thm.ent.fermat} \textbf{(b)} in both Cases 1
and 2. Hence, Theorem \ref{thm.ent.fermat} \textbf{(b)} always holds.
\end{fineprint}
\end{proof}

The next exercise shows an amusing (and useful) corollary of Fermat's Little
Theorem: a situation in which congruent exponents lead to congruent powers
(albeit under rather specific conditions, and with the congruent powers being
congruent modulo a different number than the exponents):

\begin{exercise}
\label{exe.ent.fermat.uv}Let $p$ be a prime. Let $a\in\mathbb{Z}$ be such that
$p\nmid a$. Let $u,v\in\mathbb{N}$ satisfy $u\equiv v\operatorname{mod}p-1$.
Prove that $a^{u}\equiv a^{v}\operatorname{mod}p$.
\end{exercise}

\subsubsection{The Pigeonhole Principles}

In our above proof of Theorem \ref{thm.ent.euler}, we have proven that the map
$f:C\rightarrow C$ (that we constructed) is injective and surjective. It turns
out that this was, to some extent, wasteful: It would have been enough to
prove one of the two properties only (i.e., injectivity \textbf{or}
surjectivity). The reason for this are the following two basic facts about
finite sets:

\begin{theorem}
[Pigeonhole Principle for Injections]\label{thm.pigeon.inj}Let $A$ and $B$ be
two finite sets such that $\left\vert A\right\vert \geq\left\vert B\right\vert
$. Let $f:A\rightarrow B$ be an injective map. Then, $f$ is bijective.
\end{theorem}

\begin{theorem}
[Pigeonhole Principle for Surjections]\label{thm.pigeon.surj}Let $A$ and $B$
be two finite sets such that $\left\vert A\right\vert \leq\left\vert
B\right\vert $. Let $f:A\rightarrow B$ be an surjective map. Then, $f$ is bijective.
\end{theorem}

Theorem \ref{thm.pigeon.inj} is called the \textit{Pigeonhole Principle for
Injections}, due to the following interpretation: If $a$ pigeons sit in $b$
pigeonholes with $a\geq b$ (that is, there are at least as many pigeons as
there are pigeonholes), and if no two pigeons are sharing the same hole, then
every hole must have at least one pigeon in it. (This corresponds to the
statement of Theorem \ref{thm.pigeon.inj} if you let $A$ be the set of
pigeons, $B$ be the set of holes, and $f$ be the map that sends each pigeon to
the hole it is sitting in. The injectivity of $f$ is then precisely the
statement that no two pigeons are sharing the same hole.)

Likewise, Theorem \ref{thm.pigeon.surj} is called the \textit{Pigeonhole
Principle for Surjections}, due to the following interpretation: If $a$
pigeons sit in $b$ pigeonholes with $a\leq b$ (that is, there are at most as
many pigeons as there are pigeonholes), and if each hole contains at least one
pigeon, then no two pigeons are sharing the same hole.

Theorem \ref{thm.pigeon.inj} and Theorem \ref{thm.pigeon.surj} are both basic
facts of set theory; how to prove them depends on how you define the size of a
finite set in the first place. See \cite[solution to Exercise 1.1]{detnotes}
for one way of proving them (more precisely, Theorem \ref{thm.pigeon.inj} is
the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction of
\cite[Lemma 1.5]{detnotes}, while Theorem \ref{thm.pigeon.surj} is the
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction of \cite[Lemma
1.4]{detnotes}).

Now, Theorem \ref{thm.pigeon.inj} can be used to simplify our above proof of
Theorem \ref{thm.ent.euler}. Indeed, in the latter proof, once we have shown
that $f$ is injective, we can immediately apply Theorem \ref{thm.pigeon.inj}
(to $A=C$ and $B=C$) in order to conclude that $f$ is bijective (since $C$ is
a finite set and satisfies $\left\vert C\right\vert \geq\left\vert
C\right\vert $). The proof of surjectivity of $f$ is thus unnecessary.
Alternatively, we could have omitted the proof of injectivity of $f$, and
instead used the surjectivity of $f$ to apply Theorem \ref{thm.pigeon.surj}
(to $A=C$ and $B=C$) in order to conclude that $f$ is bijective (since $C$ is
a finite set and satisfies $\left\vert C\right\vert \leq\left\vert
C\right\vert $). Either way, we would have obtained a shorter proof.

\subsubsection{Wilson}

The next theorem is known as \textit{Wilson's theorem}:

\begin{theorem}
\label{thm.ent.wilson}Let $p$ be a prime. Then, $\left(  p-1\right)
!\equiv-1\operatorname{mod}p$.
\end{theorem}

We shall prove Theorem \ref{thm.ent.wilson} using modular inverses modulo $p$.
The main idea is that we can \textquotedblleft pair up\textquotedblright\ each
factor in the product $\left(  p-1\right)  !=1\cdot2\cdot\cdots\cdot\left(
p-1\right)  $ with its modular inverse modulo $p$, where of course we take the
unique modular inverse that belongs to the set $\left\{  1,2,\ldots
,p-1\right\}  $. This relies on the following lemma:

\begin{lemma}
\label{lem.ent.wilson.modi}Let $p$ be a prime. Set $A=\left\{  1,2,\ldots
,p-1\right\}  $.

\textbf{(a)} If $a_{1}$ and $a_{2}$ are two elements of $A$ satisfying
$a_{1}\equiv a_{2}\operatorname{mod}p$, then $a_{1}=a_{2}$.

\textbf{(b)} For each $a\in A$, there exists a unique $a^{\prime}\in A$
satisfying $aa^{\prime}\equiv1\operatorname{mod}p$.

\textbf{(c)} Define a map $J:A\rightarrow A$ as follows: For each $a\in A$, we
let $J\left(  a\right)  $ denote the unique $a^{\prime}\in A$ satisfying
$aa^{\prime}\equiv1\operatorname{mod}p$. (This unique $a^{\prime}$ indeed
exists, by Lemma \ref{lem.ent.wilson.modi} \textbf{(b)}.)

Then, this map $J$ is a bijection satisfying $J\circ J=\operatorname*{id}$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.wilson.modi}.]\textbf{(a)} Let $a_{1}$ and
$a_{2}$ be two elements of $A$ satisfying $a_{1}\equiv a_{2}\operatorname{mod}%
p$. We must prove that $a_{1}=a_{2}$.

We have $a_{1}\equiv a_{2}\operatorname{mod}p$. Hence, Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $p$, $a_{2}$ and $a_{1}$
instead of $n$, $u$ and $c$) yields $a_{1}=a_{2}\%p$ (since $a_{1}\in
A=\left\{  1,2,\ldots,p-1\right\}  \subseteq\left\{  0,1,\ldots,p-1\right\}
$). Also, $a_{2}\equiv a_{2}\operatorname{mod}p$. Thus, Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $p$, $a_{2}$ and $a_{2}$
instead of $n$, $u$ and $c$) yields $a_{2}=a_{2}\%p$ (since $a_{2}\in
A=\left\{  1,2,\ldots,p-1\right\}  \subseteq\left\{  0,1,\ldots,p-1\right\}
$). Comparing this with $a_{1}=a_{2}\%p$, we obtain $a_{1}=a_{2}$. This proves
Lemma \ref{lem.ent.wilson.modi} \textbf{(a)}.

\textbf{(b)} Let $a\in A$. Thus, $a\in A=\left\{  1,2,\ldots,p-1\right\}  $.
Hence, Proposition \ref{prop.ent.prime.each-i-coprime} (applied to $i=a$)
shows that $a$ is coprime to $p$. In other words, $a\perp p$. Hence, Theorem
\ref{thm.ent.coprime.modinv} \textbf{(a)} shows that there exists a
$a^{\prime}\in\mathbb{Z}$ such that $aa^{\prime} \equiv\gcd\left(  a,p\right)
\operatorname{mod}p$. Consider this $a^{\prime}$, and denote it by $b$. Thus,
$b$ is an element of $\mathbb{Z}$ and satisfies $ab\equiv\gcd\left(
a,p\right)  \operatorname{mod}p$.

We have $ab\equiv\gcd\left(  a,p\right)  =1\operatorname{mod}p$ (since $a\perp
p$). Let $c=b\%p$. Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)}
(applied to $n=p$ and $u=b$) yields $b\%p\in\left\{  0,1,\ldots,p-1\right\}  $
and $b\%p\equiv b\operatorname{mod}p$. Now, $c=b\%p\in\left\{  0,1,\ldots
,p-1\right\}  $ and $a\underbrace{c}_{=b\%p\equiv b\operatorname{mod}p}\equiv
ab\equiv1\operatorname{mod}p$.

Assume (for the sake of contradiction) that $c=0$. Thus, $a\underbrace{c}%
_{=0}=0$ and thus $0=ac\equiv1\operatorname{mod}p$. Hence, $1\equiv
0\operatorname{mod}p$. In other words, $p\mid1-0=1$. Hence, Exercise
\ref{exe.ent.div.g|1} (applied to $g=p$) yields $p=1$. But $p>1$ (since $p$ is
prime). This contradicts $p=1$. This contradiction shows that our assumption
(that $c=0$) is false.

Hence, $c\neq0$. Combining this with $c\in\left\{  0,1,\ldots,p-1\right\}  $,
we obtain $c\in\left\{  0,1,\ldots,p-1\right\}  \setminus\left\{  0\right\}
=\left\{  1,2,\ldots,p-1\right\}  =A$. Recall that $ac\equiv
1\operatorname{mod}p$.

Thus, there exists \textbf{at least one} $a^{\prime}\in A$ satisfying
$aa^{\prime}\equiv1\operatorname{mod}p$ (namely, $a^{\prime}=c$). It remains
to prove that there is only one such $a^{\prime}$.

Indeed, let $a_{1}^{\prime}$ and $a_{2}^{\prime}$ be two elements $a^{\prime
}\in A$ satisfying $aa^{\prime}\equiv1\operatorname{mod}p$. We shall prove
that $a_{1}^{\prime}=a_{2}^{\prime}$.

We know that $a_{1}^{\prime}$ is an element $a^{\prime}\in A$ satisfying
$aa^{\prime}\equiv1\operatorname{mod}p$. In other words, $a_{1}^{\prime}$ is
an element of $A$ and satisfies $aa_{1}^{\prime}\equiv1\operatorname{mod}p$.
Similarly, $a_{2}^{\prime}$ is an element of $A$ and satisfies $aa_{2}%
^{\prime}\equiv1\operatorname{mod}p$. Hence, $1\equiv aa_{2}^{\prime
}\operatorname{mod}p$, so that $aa_{1}^{\prime}\equiv1\equiv aa_{2}^{\prime
}\operatorname{mod}p$. Thus, Lemma \ref{lem.ent.coprime.cancel} (applied to
$a_{1}^{\prime}$, $a_{2}^{\prime}$ and $p$ instead of $b$, $c$ and $n$) yields
$a_{1}^{\prime}\equiv a_{2}^{\prime}\operatorname{mod}p$ (since $a\perp p$).
Hence, Lemma \ref{lem.ent.wilson.modi} \textbf{(a)} (applied to $a_{1}%
=a_{1}^{\prime}$ and $a_{2}=a_{2}^{\prime}$) yields $a_{1}^{\prime}%
=a_{2}^{\prime}$.

Now, forget that we fixed $a_{1}^{\prime}$ and $a_{2}^{\prime}$. We thus have
shown that if $a_{1}^{\prime}$ and $a_{2}^{\prime}$ are two elements
$a^{\prime}\in A$ satisfying $aa^{\prime}\equiv1\operatorname{mod}p$, then
$a_{1}^{\prime}=a_{2}^{\prime}$. In other words, there exists \textbf{at most
one} $a^{\prime}\in A$ satisfying $aa^{\prime}\equiv1\operatorname{mod}p$.
Thus, there exists \textbf{a unique} such $a^{\prime}$ (because we have
already shown that there exists \textbf{at least one} such $a^{\prime}$). In
other words, there exists a unique $a^{\prime}\in A$ satisfying $aa^{\prime
}\equiv1\operatorname{mod}p$. This proves Lemma \ref{lem.ent.wilson.modi}
\textbf{(b)}.

\textbf{(c)} Let $a\in A$. Then, $J\left(  a\right)  $ is the unique
$a^{\prime}\in A$ satisfying $aa^{\prime}\equiv1\operatorname{mod}p$ (by the
definition of $J$). Hence, $J\left(  a\right)  $ is an $a^{\prime}\in A$
satisfying $aa^{\prime}\equiv1\operatorname{mod}p$. In other words, $J\left(
a\right)  $ is an element of $A$ and satisfies%
\begin{equation}
aJ\left(  a\right)  \equiv1\operatorname{mod}p.
\label{pf.lem.ent.wilson.modi.b.aJa}%
\end{equation}


Now, forget that we fixed $a$. We thus have proven
(\ref{pf.lem.ent.wilson.modi.b.aJa}) for each $a\in A$.

Now, let $a\in A$ be arbitrary. Then, $J\left(  a\right)  \in A$ (since $J$ is
a map from $A$ to $A$). Thus, (\ref{pf.lem.ent.wilson.modi.b.aJa}) (applied to
$J\left(  a\right)  $ instead of $a$) yields $J\left(  a\right)  J\left(
J\left(  a\right)  \right)  \equiv1\operatorname{mod}p$. Also, from $J\left(
a\right)  \in A$, we obtain $J\left(  J\left(  a\right)  \right)  \in A$
(since $J$ is a map from $A$ to $A$). On the other hand,
(\ref{pf.lem.ent.wilson.modi.b.aJa}) yields $aJ\left(  a\right)
\equiv1\operatorname{mod}p$. Thus, $1\equiv aJ\left(  a\right)
\operatorname{mod}p$. Now,%
\[
J\left(  a\right)  J\left(  J\left(  a\right)  \right)  \equiv1\equiv
aJ\left(  a\right)  =J\left(  a\right)  a\operatorname{mod}p.
\]
But $J\left(  a\right)  \in A=\left\{  1,2,\ldots,p-1\right\}  $. Hence,
Proposition \ref{prop.ent.prime.each-i-coprime} (applied to $i=J\left(
a\right)  $) shows that $J\left(  a\right)  $ is coprime to $p$. In other
words, $J\left(  a\right)  \perp p$. Hence, Lemma \ref{lem.ent.coprime.cancel}
(applied to $J\left(  a\right)  $, $J\left(  J\left(  a\right)  \right)  $,
$a$ and $p$ instead of $a$, $b$, $c$ and $n$) yields $J\left(  J\left(
a\right)  \right)  \equiv a\operatorname{mod}p$ (since $J\left(  a\right)
J\left(  J\left(  a\right)  \right)  \equiv J\left(  a\right)
a\operatorname{mod}p$). Therefore, Lemma \ref{lem.ent.wilson.modi}
\textbf{(a)} (applied to $a_{1}=J\left(  J\left(  a\right)  \right)  $ and
$a_{2}=a$) yields $J\left(  J\left(  a\right)  \right)  =a$. Thus, $\left(
J\circ J\right)  \left(  a\right)  =J\left(  J\left(  a\right)  \right)
=a=\operatorname*{id}\left(  a\right)  $.

Now, forget that we fixed $a$. We thus have proven that $\left(  J\circ
J\right)  \left(  a\right)  =\operatorname*{id}\left(  a\right)  $ for each
$a\in A$. In other words, $J\circ J=\operatorname*{id}$. Hence, the maps $J$
and $J$ are mutually inverse. Thus, the map $J$ is invertible, i.e., is a
bijection. Thus, Lemma \ref{lem.ent.wilson.modi} \textbf{(c)} is proven.
\end{proof}

\begin{remark}
Let $S$ be a set. An \textit{involution} on $S$ means a map $f:S\rightarrow S$
satisfying $f\circ f=\operatorname*{id}$. Thus, Lemma
\ref{lem.ent.wilson.modi} \textbf{(c)} says that the map $J:A\rightarrow A$
defined in this lemma is an involution on $A$.
\end{remark}

We are now ready to prove Theorem \ref{thm.ent.wilson}:

\begin{proof}
[First proof of Theorem \ref{thm.ent.wilson}.]We have $\left(  2-1\right)
!=1!=1\equiv-1\operatorname{mod}2$ (since $1-\left(  -1\right)  =2$ is
divisible by $2$). In other words, Theorem \ref{thm.ent.wilson} holds when
$p=2$. Hence, for the rest of this proof, we WLOG assume that we don't have
$p=2$. Hence, $p\neq2$. Thus, $1 \neq p-1$.

But $p$ is a prime; thus, $p>1$, so that $p\geq2$ (since $p$ is an integer).
Combining this with $p\neq2$, we obtain $p>2$, so that $p\geq3$ (since $p$ is
an integer).

Define the set $A$ and the map $J:A\rightarrow A$ as in Lemma
\ref{lem.ent.wilson.modi}. Hence, Lemma \ref{lem.ent.wilson.modi} \textbf{(c)}
shows that this map $J$ is a bijection satisfying $J\circ J=\operatorname*{id}%
$. The equality $J \circ J = \operatorname{id}$ shows that the map $J$ is
inverse to itself. For each $a\in A$, we have
\begin{equation}
aJ\left(  a\right)  \equiv1\operatorname{mod}p. \label{pf.thm.ent.wilson.aJa}%
\end{equation}
(This congruence is proven in the same way as it was proven in our above proof
of Lemma \ref{lem.ent.wilson.modi} \textbf{(c)}.)

Now, the rest of our proof shall follow the following plan (using the same
\textquotedblleft pairing\textquotedblright\ idea that we have seen in our
proof of Proposition \ref{prop.ent.phi.ghosts} and in the solution to Exercise
\ref{exe.ent.phi.even}): We will use the map $J$ to establish a pairing
between the factors of the product $1\cdot2\cdot\cdots\cdot\left(  p-1\right)
$ (pairing up each factor $a$ with the factor $J\left(  a\right)  $), which
will pair up almost all of them -- more precisely, all of them except for the
very first and very last factors (since these two factors would have to pair
up with themselves)\footnote{The reason \textbf{why} it is precisely these two
factors that will not be paired up is not completely trivial. It follows from
Exercise \ref{exe.ent.prime.aa-1}.}. For example, if $p=11$, then we have the
following table of values of $J$:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|c|c|c|c||}\hline
$a$ & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ & $9$ & $10$\\\hline
$J\left(  a\right)  $ & $1$ & $6$ & $4$ & $3$ & $9$ & $2$ & $8$ & $7$ & $5$ &
$10$\\\hline
\end{tabular}
\]
(indeed, for example, $J\left(  2\right)  =6$, since $6$ is the unique
$a^{\prime}\in A$ satisfying $2\cdot a^{\prime}\equiv1\operatorname{mod}11$),
and thus we pair up the factors of the product $1\cdot2\cdot\cdots\cdot\left(
p-1\right)  $ as follows:%
\begin{align*}
1\cdot2\cdot\cdots\cdot\left(  p-1\right)   &  =1\cdot2\cdot3\cdot4\cdot
5\cdot6\cdot7\cdot8\cdot9\cdot10\\
&  =1\cdot\left(  2\cdot6\right)  \cdot\left(  3\cdot4\right)  \cdot\left(
5\cdot9\right)  \cdot\left(  7\cdot8\right)  \cdot10.
\end{align*}
By the definition of the map $J$, each pair has the form $\left(  a,J\left(
a\right)  \right)  $ for some $a\in A$, and thus the product of any two
different factors paired up with each other is $\equiv1\operatorname{mod}p$
(by (\ref{pf.thm.ent.wilson.aJa})). For example, if $p=11$, then we have%
\begin{align*}
1\cdot2\cdot\cdots\cdot\left(  p-1\right)   &  =1\cdot\underbrace{\left(
2\cdot6\right)  }_{\equiv1\operatorname{mod}11}\cdot\underbrace{\left(
3\cdot4\right)  }_{\equiv1\operatorname{mod}11}\cdot\underbrace{\left(
5\cdot9\right)  }_{\equiv1\operatorname{mod}11}\cdot\underbrace{\left(
7\cdot8\right)  }_{\equiv1\operatorname{mod}11}\cdot10\\
&  \equiv1\cdot10\operatorname{mod}11.
\end{align*}
Thus, any two different factors paired up with each other \textquotedblleft
neutralize\textquotedblright\ each other when being multiplied (as long as we
are computing modulo $p$). Hence, the product of all the $p-1$ factors will
reduce (when working modulo $p$) to the product of the two factors that have
not been paired up, which will be $1\cdot\left(  p-1\right)  =p-1\equiv
-1\operatorname{mod}p$.

\begin{fineprint}
Here are the details of this argument:

An element $a$ of $A$ will be called

\begin{itemize}
\item \textit{small} if $a<J\left(  a\right)  $;

\item \textit{medium} if $a=J\left(  a\right)  $;

\item \textit{large} if $a>J\left(  a\right)  $.
\end{itemize}

Now, we claim that the medium elements of $A$ are precisely $1$ and $p-1$.

[\textit{Proof:} We have $1 \leq p-1$ (since $p \geq2$). Thus, $1 \in\left\{
1,2,\ldots,p-1\right\}  = A$ and $p-1 \in\left\{  1,2,\ldots,p-1\right\}  =
A$. The element $1$ of $A$ is medium\footnote{\textit{Proof.} We have $1\in
A$. Hence, $J\left(  1\right)  \in A$ (since $J$ is a map from $A$ to $A$).
Furthermore, (\ref{pf.thm.ent.wilson.aJa}) (applied to $a=1$) yields
$1J\left(  1\right)  \equiv1\operatorname{mod}p$. Thus, $1\equiv1J\left(
1\right)  =J\left(  1\right)  \operatorname{mod}p$. Thus, Lemma
\ref{lem.ent.wilson.modi} \textbf{(a)} (applied to $a_{1}=1$ and
$a_{2}=J\left(  1\right)  $) yields $1=J\left(  1\right)  $. In other words,
the element $1$ of $A$ is medium.}. The element $p-1$ of $A$ is
medium\footnote{\textit{Proof.} We have $p-1 \in A$. Hence, $J\left(
p-1\right)  \in A$ (since $J$ is a map from $A$ to $A$). Furthermore,
(\ref{pf.thm.ent.wilson.aJa}) (applied to $a=p-1$) yields $\left(  p-1\right)
J\left(  p-1\right)  \equiv1\operatorname{mod}p$. Multiplying this congruence
with the obvious congruence $p-1\equiv p-1\operatorname{mod}p$, we obtain%
\[
\left(  p-1\right)  \left(  p-1\right)  J\left(  p-1\right)  \equiv\left(
p-1\right)  1=p-1\operatorname{mod}p.
\]
Hence,%
\begin{align*}
p-1  &  \equiv\left(  p-1\right)  \left(  p-1\right)  J\left(  p-1\right)
=\left(  \underbrace{p-1}_{\equiv-1\operatorname{mod}p}\right)  ^{2}J\left(
p-1\right)  \equiv\underbrace{\left(  -1\right)  ^{2}}_{=1}J\left(  p-1\right)
\\
&  =J\left(  p-1\right)  \operatorname{mod}p.
\end{align*}
Thus, Lemma \ref{lem.ent.wilson.modi} \textbf{(a)} (applied to $a_{1}=p-1$ and
$a_{2}=J\left(  p-1\right)  $) yields $p-1=J\left(  p-1\right)  $. In other
words, the element $p-1$ of $A$ is medium.}. Hence, the two numbers $1$ and
$p-1$ are medium elements of $A$. It remains to prove that these two numbers
are the only medium elements of $A$.

Indeed, let $a$ be a medium element of $A$. We shall show that $a=1$ or
$a=p-1$.

Indeed, assume the contrary. Thus, neither $a=1$ nor $a=p-1$ holds.

If we had $a \equiv1 \mod p$, then Lemma \ref{lem.ent.wilson.modi}
\textbf{(a)} (applied to $a_{1}=a$ and $a_{2}=1$) would yield $a = 1$, which
would contradict the fact that $a=1$ does not hold. Thus, we do not have $a
\equiv1 \mod p$.

If we had $a \equiv p-1 \mod p$, then Lemma \ref{lem.ent.wilson.modi}
\textbf{(a)} (applied to $a_{1}=a$ and $a_{2}=p-1$) would yield $a = p-1$,
which would contradict the fact that $a=p-1$ does not hold. Thus, we do not
have $a \equiv p-1 \mod p$.

We have assumed that $a$ is medium. In other words, $a = J\left(  a\right)  $.
But (\ref{pf.thm.ent.wilson.aJa}) yields $aJ\left(  a \right)  \equiv1
\mod p$. Thus, $a^{2} = a \underbrace{a}_{= J\left(  a \right)  } = aJ\left(
a \right)  \equiv1 \mod p$. Hence, Exercise \ref{exe.ent.prime.aa-1} shows
that $a\equiv1\operatorname{mod}p$ or $a\equiv-1\operatorname{mod}p$. Hence,
we must have $a \equiv-1 \mod p$ (since we do not have $a \equiv1 \mod p$).
Thus, $a \equiv-1 \equiv p-1 \mod p$ (since $p-1 \equiv-1 \mod p$). This
contradicts the fact that we do not have $a \equiv p-1 \mod p$.

This contradiction shows that our assumption was false. Hence, $a = 1$ or $a =
p-1$.

Now, forget that we fixed $a$. We thus have proven that every medium element
$a$ of $A$ satisfies $a=1$ or $a=p-1$. In other words, every medium element of
$A$ is either $1$ or $p-1$. Since we know that $1$ and $p-1$ actually are
medium elements of $A$, we thus conclude that the medium elements of $A$ are
precisely $1$ and $p-1$.]

So we have shown that the medium elements of $A$ are precisely $1$ and $p-1$.
Since these two elements are distinct (because $p-1\neq1$), we thus obtain%
\begin{equation}
\prod_{\substack{a\in A;\\a\text{ is medium}}}a=1\cdot\left(  p-1\right)
=p-1\equiv-1\operatorname{mod}p. \label{pf.thm.ent.wilson.prodmed}%
\end{equation}


It is easy to see that if $a$ is a small element of $A$, then $J\left(
a\right)  $ is a large element of $A$\ \ \ \ \footnote{\textit{Proof.} Let $a$
be a small element of $A$. Thus, $a<J\left(  a\right)  $. Note that $J\left(
a\right)  \in A$ (since $J$ is a map from $A$ to $A$). But $J\circ
J=\operatorname{id}$, so that $\left(  J\circ J\right)  \left(  a\right)
=\operatorname{id}{a}=a<J\left(  a\right)  $. In view of $\left(  J\circ
J\right)  \left(  a\right)  =J\left(  J\left(  a\right)  \right)  $, this
rewrites as $J\left(  J\left(  a\right)  \right)  <J\left(  a\right)  $. In
other words, $J\left(  a\right)  > J\left(  J\left(  a\right)  \right)  $. In
other words, the element $J\left(  a\right)  $ of $A$ is large (by the
definition of \textquotedblleft large\textquotedblright). Qed.}. Hence, the
map%
\begin{align*}
J^{+}:\left\{  \text{small elements of }A\right\}   &  \rightarrow\left\{
\text{large elements of }A\right\}  ,\\
a  &  \mapsto J\left(  a\right)
\end{align*}
is well-defined. Similarly, the map%
\begin{align*}
J^{-}:\left\{  \text{large elements of }A\right\}   &  \rightarrow\left\{
\text{small elements of }A\right\}  ,\\
a  &  \mapsto J\left(  a\right)
\end{align*}
is well-defined. These two maps $J^{+}$ and $J^{-}$ are both restrictions of
the map $J$, and thus are mutually inverse (since the map $J$ is inverse to
itself). Hence, the map $J^{+}$ is invertible, i.e., is a bijection. In other
words, the map%
\begin{align*}
\left\{  \text{small elements of }A\right\}   &  \rightarrow\left\{
\text{large elements of }A\right\}  ,\\
a  &  \mapsto J\left(  a\right)
\end{align*}
is a bijection (since this map is just the map $J^{+}$). Thus, we can
substitute $J\left(  b\right)  $ for $a$ in the product $\prod_{\substack{a\in
A;\\a\text{ is large}}}a$. We thus obtain%
\begin{equation}
\prod_{\substack{a\in A;\\a\text{ is large}}}a=\prod_{\substack{b\in
A;\\b\text{ is small}}}J\left(  b\right)  =\prod_{\substack{a\in A;\\a\text{
is small}}}J\left(  a\right)  \label{pf.thm.ent.wilson.prodlar}%
\end{equation}
(here, we have renamed the index $b$ as $a$ in the product). Now, the
definition of $\left(  p-1\right)  !$ yields%
\begin{align}
\left(  p-1\right)  !  &  =1\cdot2\cdot\cdots\cdot\left(  p-1\right)
=\prod_{a\in A}a\nonumber\\
&  =\left(  \prod_{\substack{a\in A;\\a\text{ is small}}}a\right)
\cdot\underbrace{\left(  \prod_{\substack{a\in A;\\a\text{ is medium}%
}}a\right)  }_{\substack{\equiv-1\operatorname{mod}p\\\text{(by
(\ref{pf.thm.ent.wilson.prodmed}))}}}\cdot\underbrace{\left(  \prod
_{\substack{a\in A;\\a\text{ is large}}}a\right)  }_{\substack{=\prod
_{\substack{a\in A;\\a\text{ is small}}}J\left(  a\right)  \\\text{(by
(\ref{pf.thm.ent.wilson.prodlar}))}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }a\in A\text{ is either small or medium or large (but
never}\\
\text{has more than one of these three attributes simultaneously)}%
\end{array}
\right) \nonumber\\
&  \equiv\left(  \prod_{\substack{a\in A;\\a\text{ is small}}}a\right)
\cdot\left(  -1\right)  \cdot\left(  \prod_{\substack{a\in A;\\a\text{ is
small}}}J\left(  a\right)  \right)  =-\underbrace{\left(  \prod
_{\substack{a\in A;\\a\text{ is small}}}a\right)  \cdot\left(  \prod
_{\substack{a\in A;\\a\text{ is small}}}J\left(  a\right)  \right)  }%
_{=\prod_{\substack{a\in A;\\a\text{ is small}}}\left(  aJ\left(  a\right)
\right)  }\nonumber\\
&  =-\prod_{\substack{a\in A;\\a\text{ is small}}}\left(  aJ\left(  a\right)
\right)  \operatorname{mod}p. \label{pf.thm.ent.wilson.6}%
\end{align}


But it is clear that $\prod_{\substack{a\in A;\\a\text{ is small}%
}}\underbrace{\left(  aJ\left(  a\right)  \right)  }_{\substack{\equiv
1\operatorname{mod}p\\\text{(by (\ref{pf.thm.ent.wilson.aJa}))}}%
}\equiv1\operatorname{mod}p$\ \ \ \ \footnote{\textit{Proof.} Here is this
argument in more detail:
\par
Every $a\in\left\{  \text{small elements of }A\right\}  $ satisfies $aJ\left(
a\right)  \equiv1\operatorname{mod}p$ (by (\ref{pf.thm.ent.wilson.aJa})).
Renaming the index $a$ as $s$ in this statement, we obtain the following:
Every $s\in\left\{  \text{small elements of }A\right\}  $ satisfies $sJ\left(
s\right)  \equiv1\operatorname{mod}p$. Hence, (\ref{eq.exe.ent.mod.k-sum.b})
(applied to $n=p$, $S=\left\{  \text{small elements of }A\right\}  $,
$a_{s}=sJ\left(  s\right)  $ and $b_{s}=1$) yields
\[
\prod_{s\in\left\{  \text{small elements of }A\right\}  }\left(  sJ\left(
s\right)  \right)  \equiv\prod_{s\in\left\{  \text{small elements of
}A\right\}  }1=1\operatorname{mod}p.
\]
In view of%
\begin{align*}
\prod_{s\in\left\{  \text{small elements of }A\right\}  }\left(  sJ\left(
s\right)  \right)   &  =\prod_{a\in\left\{  \text{small elements of
}A\right\}  }\left(  aJ\left(  a\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have renamed the}\\
\text{index }s\text{ as }a\text{ in the product}%
\end{array}
\right) \\
&  =\prod_{\substack{a\in A;\\a\text{ is small}}}\left(  aJ\left(  a\right)
\right)  ,
\end{align*}
this rewrites as $\prod_{\substack{a\in A;\\a\text{ is small}}}\left(
aJ\left(  a\right)  \right)  \equiv1\operatorname{mod}p$.}. Hence,
(\ref{pf.thm.ent.wilson.6}) rewrites as%
\begin{equation}
\left(  p-1\right)  !\equiv-\underbrace{\prod_{\substack{a\in A;\\a\text{ is
small}}}\left(  aJ\left(  a\right)  \right)  }_{\equiv1\operatorname{mod}%
p}\equiv-1\operatorname{mod}p. \label{pf.thm.ent.wilson.8}%
\end{equation}
This proves Theorem \ref{thm.ent.wilson}.
\end{fineprint}
\end{proof}

Later, in Section \ref{sect.equiv.modinv}, we shall give a different version
of this proof.

Theorem \ref{thm.ent.wilson} has a converse:

\begin{exercise}
\label{exe.ent.wilson.converse}If an integer $p>1$ satisfies $\left(
p-1\right)  !\equiv-1\operatorname{mod}p$, then prove that $p$ is a prime.
\end{exercise}

(This is actually easier to prove than Theorem \ref{thm.ent.wilson} itself.)

\begin{exercise}
\label{exe.ent.wilson.gauss}Let $p$ be a prime. Prove that
\[
\left(  p-1\right)  !\equiv p-1\operatorname{mod}1+2+\cdots+\left(
p-1\right)  .
\]

\end{exercise}

\begin{exercise}
\label{exe.ent.wilson.-1qr}Let $p$ be an odd prime. Write $p$ in the form
$p=2k+1$ for some $k\in\mathbb{N}$. Prove that $k!^{2}\equiv-\left(
-1\right)  ^{k}\operatorname{mod}p$.

[\textbf{Hint:} Each $j\in\mathbb{Z}$ satisfies $j\left(  p-j\right)
\equiv-j^{2}\operatorname{mod}p$.]
\end{exercise}

\subsection{The Chinese Remainder Theorem as a bijection}

\subsubsection{The bijection $K_{m,n}$}

Here comes another of the many facts known as the \textquotedblleft Chinese
Remainder Theorem\textquotedblright:

\begin{theorem}
\label{thm.ent.CRT-bij}Let $m$ and $n$ be two coprime positive integers. Then,
the map%
\begin{align*}
K_{m,n}:\left\{  0,1,\ldots,mn-1\right\}   &  \rightarrow\left\{
0,1,\ldots,m-1\right\}  \times\left\{  0,1,\ldots,n-1\right\}  ,\\
a  &  \mapsto\left(  a\%m,a\%n\right)
\end{align*}
is well-defined and is a bijection.
\end{theorem}

\begin{example}
\label{exa.ent.CRT-bij.exa1}\textbf{(a)} Theorem \ref{thm.ent.CRT-bij}
(applied to $m=3$ and $n=2$) says that the map%
\begin{align*}
K_{3,2}:\left\{  0,1,2,3,4,5\right\}   &  \rightarrow\left\{  0,1,2\right\}
\times\left\{  0,1\right\}  ,\\
a  &  \mapsto\left(  a\%3,a\%2\right)
\end{align*}
is a bijection. This map sends%
\[%
\begin{array}
[c]{cccccccc}%
0, & 1, & 2, & 3, & 4, & 5 &  & \text{to}\\
\left(  0,0\right)  , & \left(  1,1\right)  , & \left(  2,0\right)  , &
\left(  0,1\right)  , & \left(  1,0\right)  , & \left(  2,1\right)  , &  &
\end{array}
\]
respectively (since $0\%3=0$ and $0\%2=0$ and $1\%3=1$ and $1\%2=1$ and
$2\%3=2$ and $2\%2=0$ and so on). This list of values shows that this map is
bijective (since it takes on every possible value in $\left\{  0,1,2\right\}
\times\left\{  0,1\right\}  $ exactly once). Theorem \ref{thm.ent.CRT-bij}
says that this holds for arbitrary coprime $m$ and $n$.

\textbf{(b)} Let us see how Theorem \ref{thm.ent.CRT-bij} fails when $m$ and
$n$ are \textbf{not} coprime. For example, take $m=6$ and $n=4$. Then, the map%
\begin{align*}
K_{6,4}:\left\{  0,1,\ldots,23\right\}   &  \rightarrow\left\{
0,1,2,3,4,5\right\}  \times\left\{  0,1,2,3\right\}  ,\\
a  &  \mapsto\left(  a\%6,a\%4\right)
\end{align*}
is \textbf{not} a bijection. Indeed, it is neither injective (for example, it
sends both $0$ and $12$ to the same pair $\left(  0,0\right)  $) nor
surjective (for example, it never takes the value $\left(  1,2\right)  $).
\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.ent.CRT-bij}.]For every $a\in\left\{
0,1,\ldots,mn-1\right\}  $, we have $\left(  a\%m,a\%n\right)  \in\left\{
0,1,\ldots,m-1\right\}  \times\left\{  0,1,\ldots,n-1\right\}  $%
\ \ \ \ \footnote{\textit{Proof.} Let $a\in\left\{  0,1,\ldots,mn-1\right\}
$. We must prove that $\left(  a\%m,a\%n\right)  \in\left\{  0,1,\ldots
,m-1\right\}  \times\left\{  0,1,\ldots,n-1\right\}  $.
\par
Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $u=a$) yields
that $a\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and $a\%n\equiv
a\operatorname{mod}n$. Thus, $a\%n\in\left\{  0,1,\ldots,n-1\right\}  $. The
same argument (applied to $m$ instead of $n$) yields $a\%m\in\left\{
0,1,\ldots,m-1\right\}  $. Combining this with $a\%n\in\left\{  0,1,\ldots
,n-1\right\}  $, we obtain $\left(  a\%m,a\%n\right)  \in\left\{
0,1,\ldots,m-1\right\}  \times\left\{  0,1,\ldots,n-1\right\}  $. Qed.}.
Hence, the map $K_{m,n}$ is well-defined. It remains to prove that this map
$K_{m,n}$ is a bijection. To that aim, we shall prove that $K_{m,n}$ is
injective and surjective.

[\textit{Proof that the map }$K_{m,n}$ \textit{is injective:} Let
$a,b\in\left\{  0,1,\ldots,mn-1\right\}  $ be such that $K_{m,n}\left(
a\right)  =K_{m,n}\left(  b\right)  $. We want to prove $a=b$.

The definition of $K_{m,n}$ yields $K_{m,n}\left(  a\right)  =\left(
a\%m,a\%n\right)  $ and $K_{m,n}\left(  b\right)  =\left(  b\%m,b\%n\right)
$. Hence, the equality $K_{m,n}\left(  a\right)  =K_{m,n}\left(  b\right)  $
(which is true by assumption) rewrites as $\left(  a\%m,a\%n\right)  =\left(
b\%m,b\%n\right)  $. In other words, $a\%m=b\%m$ and $a\%n=b\%n$.

Now, Exercise \ref{exe.ent.quo-rem.mod=rem} (applied to $u=a$ and $v=b$)
yields that $a\equiv b\operatorname{mod}n$ if and only if $a\%n=b\%n$. Hence,
$a\equiv b\operatorname{mod}n$ (since $a\%n=b\%n$). In other words, $n\mid
a-b$. The same argument (but applied to $m$ instead of $n$) yields $m\mid a-b$.

Now, we have $m\perp n$ (since $m$ and $n$ are coprime) and $m\mid a-b$ and
$n\mid a-b$. Hence, Theorem \ref{thm.ent.coprime.combine} (applied to $m$, $n$
and $a-b$ instead of $a$, $b$ and $c$) yields $mn\mid a-b$. In other words,
$a\equiv b\operatorname{mod}mn$. Hence, Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(c)} (applied to $mn$, $b$ and $a$ instead of $n$, $u$ and $c$) yields
$a=b\%\left(  mn\right)  $ (since $a\in\left\{  0,1,\ldots,mn-1\right\}  $).

On the other hand, $b\equiv b\operatorname{mod}mn$. Hence, Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $mn$, $b$ and $b$
instead of $n$, $u$ and $c$) yields $b=b\%\left(  mn\right)  $ (since
$b\in\left\{  0,1,\ldots,mn-1\right\}  $). Comparing this with $a=b\%\left(
mn\right)  $, we obtain $a=b$.

Now, forget that we fixed $a$ and $b$. We thus have shown that if
$a,b\in\left\{  0,1,\ldots,mn-1\right\}  $ are such that $K_{m,n}\left(
a\right)  =K_{m,n}\left(  b\right)  $, then $a=b$. In other words, the map
$K_{m,n}$ is injective.]

[\textit{Proof that the map }$K_{m,n}$ \textit{is surjective:} Fix $\left(
a,b\right)  \in\left\{  0,1,\ldots,m-1\right\}  \times\left\{  0,1,\ldots
,n-1\right\}  $. We want to find a $c\in\left\{  0,1,\ldots,mn-1\right\}  $
such that $K_{m,n}\left(  c\right)  =\left(  a,b\right)  $.

We have $\left(  a,b\right)  \in\left\{  0,1,\ldots,m-1\right\}
\times\left\{  0,1,\ldots,n-1\right\}  $. In other words, $a\in\left\{
0,1,\ldots,m-1\right\}  $ and $b\in\left\{  0,1,\ldots,n-1\right\}  $. Theorem
\ref{thm.ent.crt1} \textbf{(a)} shows that there exists an integer
$x\in\mathbb{Z}$ such that%
\[
\left(  x\equiv a\operatorname{mod}m\text{ and }x\equiv b\operatorname{mod}%
n\right)  .
\]
Consider such an $x$. We have $x\equiv a\operatorname{mod}m$, thus $a\equiv
x\operatorname{mod}m$. From $x\equiv b\operatorname{mod}n$, we obtain $b\equiv
x\operatorname{mod}n$.

Let $y=x\%\left(  mn\right)  $. Then, Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(a)} (applied to $mn$ and $x$ instead of $n$ and $u$) yields
$x\%\left(  mn\right)  \in\left\{  0,1,\ldots,mn-1\right\}  $ and $x\%\left(
mn\right)  \equiv x\operatorname{mod}mn$. Hence, $x\equiv x\%\left(
mn\right)  =y\operatorname{mod}mn$ (since $y=x\%\left(  mn\right)  $).

Since $m\mid mn$, we thus obtain $x\equiv y\operatorname{mod}m$ (by
Proposition \ref{prop.ent.mod.basics} \textbf{(e)}, applied to $mn$, $x$, $y$
and $m$ instead of $n$, $a$, $b$ and $m$). Thus, $a\equiv x\equiv
y\operatorname{mod}m$. Hence, Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(c)} (applied to $m$, $y$ and $a$ instead of $n$, $u$ and $c$) yields
$a=y\%m$ (since $a\in\left\{  0,1,\ldots,m-1\right\}  $).

Also, from $x\equiv y\operatorname{mod}mn$ and $n\mid mn$, we obtain $x\equiv
y\operatorname{mod}n$ (by Proposition \ref{prop.ent.mod.basics} \textbf{(e)},
applied to $mn$, $x$, $y$ and $n$ instead of $n$, $a$, $b$ and $m$). Thus,
$b\equiv x\equiv y\operatorname{mod}n$. Hence, Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $y$ and $b$ instead of
$u$ and $c$) yields $b=y\%n$ (since $b\in\left\{  0,1,\ldots,n-1\right\}  $).

From $a=y\%m$ and $b=y\%n$, we obtain $\left(  a,b\right)  =\left(
y\%m,y\%n\right)  $.

We have $y=x\%\left(  mn\right)  \in\left\{  0,1,\ldots,mn-1\right\}  $; thus,
the definition of the map $K_{m,n}$ yields $K_{m,n}\left(  y\right)  =\left(
y\%m,y\%n\right)  =\left(  a,b\right)  $ (since $\left(  a,b\right)  =\left(
y\%m,y\%n\right)  $). Thus, there exists a $c\in\left\{  0,1,\ldots
,mn-1\right\}  $ such that $K_{m,n}\left(  c\right)  =\left(  a,b\right)  $
(namely, $c=y$).

Now, forget that we fixed $\left(  a,b\right)  $. We thus have shown that for
any $\left(  a,b\right)  \in\left\{  0,1,\ldots,m-1\right\}  \times\left\{
0,1,\ldots,n-1\right\}  $, there exists a $c\in\left\{  0,1,\ldots
,mn-1\right\}  $ such that $K_{m,n}\left(  c\right)  =\left(  a,b\right)  $.
In other words, the map $K_{m,n}$ is surjective.]

We have now proven that the map $K_{m,n}$ is both injective and surjective.
Hence, this map $K_{m,n}$ is bijective, i.e., is a bijection. This proves
Theorem \ref{thm.ent.CRT-bij}.

[\textit{Remark:} We could have saved ourselves some of the work done in this
proof by invoking the Pigeonhole Principle. Indeed, our goal was to show that
the map $K_{m,n}$ is bijective. By the Pigeonhole Principle for Injections
(Theorem \ref{thm.pigeon.inj}), it suffices to prove that it is injective,
because $\left\{  0,1,\ldots,mn-1\right\}  $ and $\left\{  0,1,\ldots
,m-1\right\}  \times\left\{  0,1,\ldots,n-1\right\}  $ are two finite sets of
the same size. Alternatively, by the Pigeonhole Principle for Surjections
(Theorem \ref{thm.pigeon.surj}), it would instead suffice to prove that the
map $K_{m,n}$ is surjective].
\end{proof}

\subsubsection{Coprime remainders}

For the rest of this section, we shall use the following notation:

\begin{definition}
\label{def.ent.CRT-bij.Cn}Let $n$ be a positive integer. Then, let $C_{n}$ be
the subset $\left\{  i\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ i\perp
n\right\}  $ of $\left\{  0,1,\ldots,n-1\right\}  $.
\end{definition}

For instance,%
\[
C_{4}=\left\{  1,3\right\}  ,\ \ \ \ \ \ \ \ \ \ C_{5}=\left\{
1,2,3,4\right\}  ,\ \ \ \ \ \ \ \ \ \ C_{6}=\left\{  1,5\right\}
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ C_{1}=\left\{  0\right\}  .
\]


Now, we claim the following:

\begin{proposition}
\label{prop.ent.CRT-bij.Cn}Let $m$ and $n$ be two coprime positive integers.
Consider the map $K_{m,n}$ defined in Theorem \ref{thm.ent.CRT-bij}. Then,%
\[
K_{m,n}\left(  C_{mn}\right)  =C_{m}\times C_{n}.
\]
(Here, $K_{m,n}\left(  C_{mn}\right)  $ denotes the image of the subset
$C_{mn}$ of $\left\{  0,1,\ldots,mn-1\right\}  $ under the map $K_{m,n}$; that
is, $K_{m,n}\left(  C_{mn}\right)  =\left\{  K_{m,n}\left(  x\right)
\ \mid\ x\in C_{mn}\right\}  $.)
\end{proposition}

\begin{example}
Theorem \ref{thm.ent.CRT-bij} (applied to $m=3$ and $n=5$) says that the map%
\begin{align*}
K_{3,5}:\left\{  0,1,\ldots,14\right\}   &  \rightarrow\left\{  0,1,2\right\}
\times\left\{  0,1,2,3,4\right\}  ,\\
a  &  \mapsto\left(  a\%3,a\%5\right)
\end{align*}
is a bijection. Proposition \ref{prop.ent.CRT-bij.Cn} (applied to $m=3$ and
$n=5$) says that this map satisfies $K_{3,5}\left(  C_{15}\right)
=C_{3}\times C_{5}$. In view of
\begin{align*}
C_{15}  &  =\left\{  i\in\left\{  0,1,\ldots,14\right\}  \ \mid\ i\perp
15\right\}  =\left\{  1,2,4,7,8,11,13,14\right\}  ,\\
C_{3}  &  =\left\{  i\in\left\{  0,1,2\right\}  \ \mid\ i\perp3\right\}
=\left\{  1,2\right\}  ,\ \ \ \ \ \ \ \ \ \ \text{and}\\
C_{5}  &  =\left\{  i\in\left\{  0,1,2,3,4\right\}  \ \mid\ i\perp5\right\}
=\left\{  1,2,3,4\right\}  ,
\end{align*}
this rewrites as%
\[
K_{3,5}\left(  \left\{  1,2,4,7,8,11,13,14\right\}  \right)  =\left\{
1,2\right\}  \times\left\{  1,2,3,4\right\}  .
\]
And indeed, this can easily be checked: The map $K_{3,5}$ sends%
\[%
\begin{array}
[c]{cccccccccc}%
1, & 2, & 4, & 7, & 8, & 11, & 13, & 14, &  & \text{to}\\
\left(  1,1\right)  , & \left(  2,2\right)  , & \left(  1,4\right)  , &
\left(  1,2\right)  , & \left(  2,3\right)  , & \left(  2,1\right)  , &
\left(  1,3\right)  & \left(  2,4\right)  , &  &
\end{array}
\]
respectively, which entails%
\begin{align*}
&  K_{3,5}\left(  \left\{  1,2,4,7,8,11,13,14\right\}  \right) \\
&  =\left\{  \left(  1,1\right)  ,\left(  2,2\right)  ,\left(  1,4\right)
,\left(  1,2\right)  ,\left(  2,3\right)  ,\left(  2,1\right)  ,\left(
1,3\right)  ,\left(  2,4\right)  \right\}  =\left\{  1,2\right\}
\times\left\{  1,2,3,4\right\}  .
\end{align*}

\end{example}

\begin{proof}
[Proof of Proposition \ref{prop.ent.CRT-bij.Cn}.]Theorem \ref{thm.ent.CRT-bij}
yields that the map $K_{m,n}$ is well-defined and is a bijection.

The definition of $C_{n}$ yields%
\[
C_{n}=\left\{  i\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ i\perp n\right\}
\subseteq\left\{  0,1,\ldots,n-1\right\}  .
\]
The definition of $C_{m}$ yields%
\[
C_{m}=\left\{  i\in\left\{  0,1,\ldots,m-1\right\}  \ \mid\ i\perp m\right\}
\subseteq\left\{  0,1,\ldots,m-1\right\}  .
\]
The definition of $C_{mn}$ yields
\[
C_{mn}=\left\{  i\in\left\{  0,1,\ldots,mn-1\right\}  \ \mid\ i\perp
mn\right\}  \subseteq\left\{  0,1,\ldots,mn-1\right\}  .
\]
Hence, $K_{m,n}\left(  C_{mn}\right)  $ is well-defined. Also, from
$C_{m}\subseteq\left\{  0,1,\ldots,m-1\right\}  $ and $C_{n}\subseteq\left\{
0,1,\ldots,n-1\right\}  $, we obtain
\[
C_{m}\times C_{n}\subseteq\left\{  0,1,\ldots,m-1\right\}  \times\left\{
0,1,\ldots,n-1\right\}  .
\]


Now, we claim that%
\begin{equation}
K_{m,n}\left(  C_{mn}\right)  \subseteq C_{m}\times C_{n}\text{.}
\label{pf.prop.ent.CRT-bij.Cn.1}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.ent.CRT-bij.Cn.1}):} Let $z\in K_{m,n}\left(
C_{mn}\right)  $. Thus, $z=K_{m,n}\left(  x\right)  $ for some $x\in C_{mn}$.
Consider this $x$.

We have $x\in C_{mn}=\left\{  i\in\left\{  0,1,\ldots,mn-1\right\}
\ \mid\ i\perp mn\right\}  $. In other words, $x$ is an $i\in\left\{
0,1,\ldots,mn-1\right\}  $ satisfying $i\perp mn$. In other words, $x$ is an
element of $\left\{  0,1,\ldots,mn-1\right\}  $ and satisfies $x\perp mn$. In
other words, $x\perp nm$ (since $mn=nm$).

We have $x\mid x$ and $m\mid mn$. Hence, Exercise \ref{exe.ent.gcd.div}
(applied to $a_{1}=x$, $a_{2}=m$, $b_{1}=x$ and $b_{2}=mn$) yields
$\gcd\left(  x,m\right)  \mid\gcd\left(  x,mn\right)  =1$ (since $x\perp mn$).
Since $\gcd\left(  x,m\right)  $ is a nonnegative integer\footnote{because any
gcd is a nonnegative integer}, this entails $\gcd\left(  x,m\right)  =1$ (by
Exercise \ref{exe.ent.div.g|1}, applied to $g=\gcd\left(  x,m\right)  $). In
other words, $x\perp m$. But Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(a)} (applied to $m$ and $x$ instead of $n$ and $u$) yields
$x\%m\in\left\{  0,1,\ldots,m-1\right\}  $ and $x\%m\equiv x\operatorname{mod}%
m$. From $x\%m\equiv x\operatorname{mod}m$, we obtain $x\equiv
x\%m\operatorname{mod}m$. Hence, Exercise \ref{exe.ent.coprime.b==c} (applied
to $x$, $x\%m$ and $m$ instead of $a$, $b$ and $c$) yields $x\%m\perp m$
(since $x\perp m$). Hence, $x\%m$ is an $i\in\left\{  0,1,\ldots,m-1\right\}
$ satisfying $i\perp m$ (since $x\%m\in\left\{  0,1,\ldots,m-1\right\}  $). In
other words, $x\%m\in\left\{  i\in\left\{  0,1,\ldots,m-1\right\}
\ \mid\ i\perp m\right\}  $. In other words, $x\%m\in C_{m}$ (since
$C_{m}=\left\{  i\in\left\{  0,1,\ldots,m-1\right\}  \ \mid\ i\perp m\right\}
$).

The same argument (with the roles of $m$ and $n$ swapped) yields $x\%n\in
C_{n}$ (since $x\perp nm$). Now,
\begin{align*}
z  &  =K_{m,n}\left(  x\right)  =\left(  x\%m,x\%n\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }K_{m,n}\right) \\
&  \in C_{m}\times C_{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }x\%m\in
C_{m}\text{ and }x\%n\in C_{n}\right)  .
\end{align*}


Now, forget that we fixed $z$. We thus have proven that $z\in C_{m}\times
C_{n}$ for each $z\in K_{m,n}\left(  C_{mn}\right)  $. In other words,
$K_{m,n}\left(  C_{mn}\right)  \subseteq C_{m}\times C_{n}$. This proves
(\ref{pf.prop.ent.CRT-bij.Cn.1}).]

Next, we claim that%
\begin{equation}
C_{m}\times C_{n}\subseteq K_{m,n}\left(  C_{mn}\right)  .
\label{pf.prop.ent.CRT-bij.Cn.2}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.ent.CRT-bij.Cn.2}):} Let $y\in C_{m}\times
C_{n}$. We shall prove that $y\in K_{m,n}\left(  C_{mn}\right)  $.

We have $y\in C_{m}\times C_{n}\subseteq\left\{  0,1,\ldots,m-1\right\}
\times\left\{  0,1,\ldots,n-1\right\}  =K_{m,n}\left(  \left\{  0,1,\ldots
,mn-1\right\}  \right)  $ (since the map $K_{m,n}$ is a bijection). In other
words, there exists some $x\in\left\{  0,1,\ldots,mn-1\right\}  $ such that
$y=K_{m,n}\left(  x\right)  $. Consider this $x$. The definition of $K_{m,n}$
yields $K_{m,n}\left(  x\right)  =\left(  x\%m,x\%n\right)  $. Hence,%
\[
\left(  x\%m,x\%n\right)  =K_{m,n}\left(  x\right)  =y\in C_{m}\times C_{n}.
\]
In other words, $x\%m\in C_{m}$ and $x\%n\in C_{n}$.

We have $x\%m\in C_{m}=\left\{  i\in\left\{  0,1,\ldots,m-1\right\}
\ \mid\ i\perp m\right\}  $. In other words, $x\%m$ is an $i\in\left\{
0,1,\ldots,m-1\right\}  $ satisfying $i\perp m$. In other words, $x\%m$ is an
element of $\left\{  0,1,\ldots,m-1\right\}  $ and satisfies $x\%m\perp m$.

But Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $m$ and
$x$ instead of $n$ and $u$) yields $x\%m\in\left\{  0,1,\ldots,m-1\right\}  $
and $x\%m\equiv x\operatorname{mod}m$. Hence, Exercise
\ref{exe.ent.coprime.b==c} (applied to $x\%m$, $x$ and $m$ instead of $a$, $b$
and $c$) yields $x\perp m$ (since $x\%m\perp m$). This yields $m\perp x$ (by
Proposition \ref{prop.ent.coprime.perp-symm}). The same argument (applied to
$n$ instead of $m$) yields $n\perp x$ (since $x\%n\in C_{n}$). Hence, Theorem
\ref{thm.ent.coprime.ab-to-c} (applied to $m$, $n$ and $x$ instead of $a$, $b$
and $c$) yields $mn\perp x$. This yields $x\perp mn$ (by Proposition
\ref{prop.ent.coprime.perp-symm}). Thus, $x$ is an $i\in\left\{
0,1,\ldots,mn-1\right\}  $ satisfying $i\perp mn$ (since $x\in\left\{
0,1,\ldots,mn-1\right\}  $). In other words, $x\in\left\{  i\in\left\{
0,1,\ldots,mn-1\right\}  \ \mid\ i\perp mn\right\}  $. In other words, $x\in
C_{mn}$ (since $C_{mn}=\left\{  i\in\left\{  0,1,\ldots,mn-1\right\}
\ \mid\ i\perp mn\right\}  $). Hence, $y=K_{m,n}\left(  \underbrace{x}_{\in
C_{mn}}\right)  \in K_{m,n}\left(  C_{mn}\right)  $.

Now, forget that we fixed $y$. We thus have shown that $y\in K_{m,n}\left(
C_{mn}\right)  $ for each $y\in C_{m}\times C_{n}$. In other words,
$C_{m}\times C_{n}\subseteq K_{m,n}\left(  C_{mn}\right)  $. This proves
(\ref{pf.prop.ent.CRT-bij.Cn.2}).]

Combining (\ref{pf.prop.ent.CRT-bij.Cn.1}) with
(\ref{pf.prop.ent.CRT-bij.Cn.2}), we obtain $K_{m,n}\left(  C_{mn}\right)
=C_{m}\times C_{n}$. This proves Proposition \ref{prop.ent.CRT-bij.Cn}.
\end{proof}

\subsubsection{\label{sect.ent.phi-fml-proof}Proving the formula for $\phi$}

We now can prove Theorem \ref{thm.ent.phi.mult}:

\begin{proof}
[First proof of Theorem \ref{thm.ent.phi.mult}.]The definition of $C_{n}$
yields
\begin{equation}
C_{n}=\left\{  i\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ i\perp n\right\}
. \label{pf.thm.ent.phi.mult.Cn=}%
\end{equation}
Lemma \ref{lem.ent.euler.phi0} yields%
\[
\phi\left(  n\right)  =\left\vert \underbrace{\left\{  i\in\left\{
0,1,\ldots,n-1\right\}  \ \mid\ i\perp n\right\}  }_{\substack{=C_{n}%
\\\text{(by (\ref{pf.thm.ent.phi.mult.Cn=}))}}}\right\vert =\left\vert
C_{n}\right\vert .
\]
The same argument (applied to $mn$ instead of $n$) yields $\phi\left(
mn\right)  =\left\vert C_{mn}\right\vert $.

We have shown that $\phi\left(  n\right)  =\left\vert C_{n}\right\vert $, so
that $\left\vert C_{n}\right\vert =\phi\left(  n\right)  $. The same argument
(applied to $m$ instead of $n$) yields $\left\vert C_{m}\right\vert
=\phi\left(  m\right)  $.

It is well-known that any two finite sets $A$ and $B$ satisfy $\left\vert
A\times B\right\vert =\left\vert A\right\vert \cdot\left\vert B\right\vert
$\ \ \ \ \footnote{This is the so-called \textit{product rule} in its simplest
form (see, e.g., \cite[1.5]{Loehr-BC} or \cite[\S 15.2.1]{LeLeMe}).}. Applying
this to $A=C_{m}$ and $B=C_{n}$, we obtain%
\[
\left\vert C_{m}\times C_{n}\right\vert =\underbrace{\left\vert C_{m}%
\right\vert }_{=\phi\left(  m\right)  }\cdot\underbrace{\left\vert
C_{n}\right\vert }_{=\phi\left(  n\right)  }=\phi\left(  m\right)  \cdot
\phi\left(  n\right)  .
\]


Note that $C_{mn}$ is a subset of $\left\{  0,1,\ldots,mn-1\right\}  $ (since
the definition of $C_{mn}$ yields $C_{mn}=\left\{  i\in\left\{  0,1,\ldots
,mn-1\right\}  \ \mid\ i\perp mn\right\}  \subseteq\left\{  0,1,\ldots
,mn-1\right\}  $).

Now, consider the map $K_{m,n}$ defined in Theorem \ref{thm.ent.CRT-bij}.
Then, Theorem \ref{thm.ent.CRT-bij} shows that this map $K_{m,n}$ is a
bijection. Thus, in particular, $K_{m,n}$ is injective. Hence, $\left\vert
K_{m,n}\left(  S\right)  \right\vert =\left\vert S\right\vert $ for each
subset $S$ of $\left\{  0,1,\ldots,mn-1\right\}  $\ \ \ \ \footnote{This
follows from the following general principle: If $f:X\rightarrow Y$ is an
injective map between two finite sets $X$ and $Y$, then $\left\vert f\left(
S\right)  \right\vert =\left\vert S\right\vert $ for each subset $S$ of $X$.}.
Applying this to $S=C_{mn}$, we obtain $\left\vert K_{m,n}\left(
C_{mn}\right)  \right\vert =\left\vert C_{mn}\right\vert $. Thus,%
\[
\left\vert C_{mn}\right\vert =\left\vert \underbrace{K_{m,n}\left(
C_{mn}\right)  }_{\substack{=C_{m}\times C_{n}\\\text{(by Proposition
\ref{prop.ent.CRT-bij.Cn})}}}\right\vert =\left\vert C_{m}\times
C_{n}\right\vert =\phi\left(  m\right)  \cdot\phi\left(  n\right)  .
\]
Hence, $\phi\left(  mn\right)  =\left\vert C_{mn}\right\vert =\phi\left(
m\right)  \cdot\phi\left(  n\right)  $. This proves Theorem
\ref{thm.ent.phi.mult}.
\end{proof}

We now take aim at proving Theorem \ref{thm.ent.phi.explicit}. First, let us
extend Theorem \ref{thm.ent.phi.mult} to products of $k$ mutually coprime integers:

\begin{exercise}
\label{exe.ent.phi.multk.1}Let $n_{1},n_{2},\ldots,n_{k}$ be mutually coprime
positive integers. Prove that $\phi\left(  n_{1}n_{2}\cdots n_{k}\right)
=\phi\left(  n_{1}\right)  \cdot\phi\left(  n_{2}\right)  \cdot\cdots\cdot
\phi\left(  n_{k}\right)  $.
\end{exercise}

\begin{exercise}
\label{exe.ent.phi.multk.2}Let $I$ be a finite set. For each $i\in I$, let
$n_{i}$ be a positive integer. Assume that%
\begin{equation}
\text{every two distinct elements }i\text{ and }j\text{ of }I\text{ satisfy
}n_{i}\perp n_{j}. \label{eq.exe.ent.phi.multk.2.ass}%
\end{equation}
Prove that
\[
\phi\left(  \prod_{i\in I}n_{i}\right)  =\prod_{i\in I}\phi\left(
n_{i}\right)  .
\]

\end{exercise}

We are finally ready to prove Theorem \ref{thm.ent.phi.explicit}:

\begin{proof}
[Proof of Theorem \ref{thm.ent.phi.explicit}.]The integer $n$ is positive and
thus nonzero. In other words, $n\neq0$.

If $p$ is a prime satisfying $p\nmid n$, then $v_{p}\left(  n\right)  =0$ (by
Corollary \ref{cor.ent.prime.vp-0}) and therefore
\begin{equation}
p^{v_{p}\left(  n\right)  }=p^{0}=1. \label{pf.thm.ent.phi.explicit.=1}%
\end{equation}


If $p$ is a prime satisfying $p\mid n$, then $v_{p}\left(  n\right)  $ is a
positive integer\footnote{\textit{Proof.} Let $p$ be a prime satisfying $p\mid
n$. If we had $v_{p}\left(  n\right)  =0$, then we would have $p\nmid n$ (by
Corollary \ref{cor.ent.prime.vp-0}), and this would contradict $p\mid n$.
Hence, we cannot have $v_{p}\left(  n\right)  =0$. Thus, $v_{p}\left(
n\right)  \neq0$. But $v_{p}\left(  n\right)  \in\mathbb{N}$ (since $n$ is
nonzero). Thus, from $v_{p}\left(  n\right)  \neq0$, we conclude that
$v_{p}\left(  n\right)  $ is a positive integer. Qed.} and therefore satisfies%
\begin{equation}
\phi\left(  p^{v_{p}\left(  n\right)  }\right)  =\left(  p-1\right)
p^{v_{p}\left(  n\right)  -1} \label{pf.thm.ent.phi.explicit.=p-1}%
\end{equation}
(by Exercise \ref{exe.ent.phi.pk}, applied to $k=v_{p}\left(  n\right)  $).

Corollary \ref{cor.ent.prime.can-fac} yields%
\begin{align}
n  &  =\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }=\left(
\prod_{\substack{p\text{ prime;}\\p\mid n}}p^{v_{p}\left(  n\right)  }\right)
\cdot\left(  \prod_{\substack{p\text{ prime;}\\p\nmid n}}\underbrace{p^{v_{p}%
\left(  n\right)  }}_{\substack{=1\\\text{(by
(\ref{pf.thm.ent.phi.explicit.=1}))}}}\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each prime }p\text{ satisfies either }p\mid n\text{ or }p\nmid n\\
\text{(but not both at the same time)}%
\end{array}
\right) \nonumber\\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\mid n}}p^{v_{p}\left(
n\right)  }\right)  \cdot\underbrace{\left(  \prod_{\substack{p\text{
prime;}\\p\nmid n}}1\right)  }_{=1}=\prod_{\substack{p\text{ prime;}\\p\mid
n}}p^{v_{p}\left(  n\right)  }. \label{pf.thm.ent.phi.explicit.2}%
\end{align}


Let $P$ be the set of all primes $p$ satisfying $p\mid n$. This set $P$ is
finite\footnote{\textit{Proof.} We shall show that $P\subseteq\left\{
1,2,\ldots,n\right\}  $.
\par
Indeed, let $p\in P$. Thus, $p$ is a prime satisfying $p\mid n$ (by the
definition of $P$). Hence, $p$ is positive (since $p$ is prime). Also,
$n\neq0$. Thus, from $p\mid n$, we obtain $\left\vert p\right\vert
\leq\left\vert n\right\vert $ (by Proposition \ref{prop.ent.div.1}
\textbf{(b)}, applied to $a=p$ and $b=n$). In view of $\left\vert p\right\vert
=p$ (since $p$ is positive) and $\left\vert n\right\vert =n$ (since $n$ is
positive), this rewrites as $p\leq n$. Hence, $p\in\left\{  1,2,\ldots
,n\right\}  $ (since $p$ is a positive integer).
\par
Now, forget that we fixed $p$. We thus have shown that $p\in\left\{
1,2,\ldots,n\right\}  $ for each $p\in P$. In other words, $P\subseteq\left\{
1,2,\ldots,n\right\}  $. Hence, the set $P$ is finite (since the set $\left\{
1,2,\ldots,n\right\}  $ is finite).}. For each $i\in P$, the number
$i^{v_{i}\left(  n\right)  }$ is a positive integer\footnote{since
$v_{i}\left(  n\right)  \in\mathbb{N}$ (since $n$ is nonzero) and since $i$ is
a positive integer}. Moreover, every two distinct elements $i$ and $j$ of $P$
satisfy $i^{v_{i}\left(  n\right)  }\perp j^{v_{j}\left(  n\right)  }%
$\ \ \ \ \footnote{\textit{Proof.} Let $i$ and $j$ be two distinct elements of
$P$. All elements of $P$ are primes (by the definition of $P$); thus, $i$ and
$j$ are primes (since $i$ and $j$ are elements of $P$). Also, $i$ and $j$ are
distinct. Hence, Exercise \ref{exe.ent.prime.dist=cop} (applied to $p=i$ and
$q=j$) yields $i\perp j$. But $v_{i}\left(  n\right)  \in\mathbb{N}$ (since
$n$ is nonzero) and $v_{j}\left(  n\right)  \in\mathbb{N}$ (for the same
reason). Hence, Exercise \ref{exe.ent.coprime.powers} (applied to $i$, $j$,
$v_{i}\left(  n\right)  $ and $v_{j}\left(  n\right)  $ instead of $a$, $b$,
$n$ and $m$) yields $i^{v_{i}\left(  n\right)  }\perp j^{v_{j}\left(
n\right)  }$. Qed.}. Hence, Exercise \ref{exe.ent.phi.multk.2} (applied to
$I=P$ and $n_{i}=i^{v_{i}\left(  n\right)  }$) yields
\[
\phi\left(  \prod_{i\in P}i^{v_{i}\left(  n\right)  }\right)  =\prod_{i\in
P}\phi\left(  i^{v_{i}\left(  n\right)  }\right)  .
\]
Renaming the index $i$ as $p$ in both products, we can rewrite this equality
as
\begin{equation}
\phi\left(  \prod_{p\in P}p^{v_{p}\left(  n\right)  }\right)  =\prod_{p\in
P}\phi\left(  p^{v_{p}\left(  n\right)  }\right)  .
\label{pf.thm.ent.phi.explicit.4}%
\end{equation}
But the product signs \textquotedblleft$\prod_{p\in P}$\textquotedblright\ in
this equality can be replaced by \textquotedblleft$\prod_{\substack{p\text{
prime;}\\p\mid n}}$\textquotedblright\ without changing their meaning (since
$P$ is the set of all primes $p$ satisfying $p\mid n$). Hence, the equality
(\ref{pf.thm.ent.phi.explicit.4}) rewrites as%
\begin{equation}
\phi\left(  \prod_{\substack{p\text{ prime;}\\p\mid n}}p^{v_{p}\left(
n\right)  }\right)  =\prod_{\substack{p\text{ prime;}\\p\mid n}}\phi\left(
p^{v_{p}\left(  n\right)  }\right)  . \label{pf.thm.ent.phi.explicit.5}%
\end{equation}
Now, applying the map $\phi$ to both sides of the equality
(\ref{pf.thm.ent.phi.explicit.2}), we find%
\begin{align*}
\phi\left(  n\right)   &  =\phi\left(  \prod_{\substack{p\text{ prime;}\\p\mid
n}}p^{v_{p}\left(  n\right)  }\right)  =\prod_{\substack{p\text{
prime;}\\p\mid n}}\underbrace{\phi\left(  p^{v_{p}\left(  n\right)  }\right)
}_{\substack{=\left(  p-1\right)  p^{v_{p}\left(  n\right)  -1}\\\text{(by
(\ref{pf.thm.ent.phi.explicit.=p-1}))}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.ent.phi.explicit.5})}\right) \\
&  =\prod_{\substack{p\text{ prime;}\\p\mid n}}\underbrace{\left(  \left(
p-1\right)  p^{v_{p}\left(  n\right)  -1}\right)  }_{\substack{=pp^{v_{p}%
\left(  n\right)  -1}-p^{v_{p}\left(  n\right)  -1}\\=p^{v_{p}\left(
n\right)  }-p^{v_{p}\left(  n\right)  -1}\\=p^{v_{p}\left(  n\right)
}-p^{v_{p}\left(  n\right)  }/p\\=p^{v_{p}\left(  n\right)  }\left(
1-\dfrac{1}{p}\right)  }}=\prod_{\substack{p\text{ prime;}\\p\mid n}}\left(
p^{v_{p}\left(  n\right)  }\left(  1-\dfrac{1}{p}\right)  \right) \\
&  =\underbrace{\left(  \prod_{\substack{p\text{ prime;}\\p\mid n}%
}p^{v_{p}\left(  n\right)  }\right)  }_{\substack{=n\\\text{(by
(\ref{pf.thm.ent.phi.explicit.2}))}}}\cdot\prod_{\substack{p\text{
prime;}\\p\mid n}}\left(  1-\dfrac{1}{p}\right)  =n\cdot\prod
_{\substack{p\text{ prime;}\\p\mid n}}\left(  1-\dfrac{1}{p}\right)  .
\end{align*}
This proves Theorem \ref{thm.ent.phi.explicit}.
\end{proof}

Theorem \ref{thm.ent.euler} generalizes Theorem \ref{thm.ent.fermat}
\textbf{(a)}. Likewise, the following exercise generalizes Theorem
\ref{thm.ent.fermat} \textbf{(b)}:

\begin{exercise}
\label{exe.ent.euler.non-coprime}Let $a$ be an integer, and let $n$ be a
positive integer. Prove that $a^{n}\equiv a^{n-\phi\left(  n\right)
}\operatorname{mod}n$.

[\textbf{Hint:} Use Exercises \ref{exe.ent.prime.modpvp} and
\ref{exe.ent.phi.d-phid} and Theorems \ref{thm.ent.euler} and
\ref{thm.ent.phi.mult}.]
\end{exercise}

\begin{teachingnote}
\textbf{2019-02-18 lecture}
\end{teachingnote}

\subsection{Binomial coefficients}

\subsubsection{Definitions and basics}

Next, we shall introduce and briefly study binomial coefficients. While
binomial coefficients belong more to (enumerative) combinatorics than to
algebra, they are used significantly in algebra, so we have to derive some of
their properties.

Here is the definition of binomial coefficients (at least the one I am going
to follow in these notes):

\begin{definition}
\label{def.binom.binom}Let $n\in\mathbb{Q}$ and $k\in\mathbb{Q}$. Then, we
define the \textit{binomial coefficient} $\dbinom{n}{k}$ as follows:

\textbf{(a)} If $k\in\mathbb{N}$, then we set
\[
\dbinom{n}{k}=\dfrac{n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-k+1\right)  }{k!}=\dfrac{\prod_{i=0}^{k-1}\left(  n-i\right)  }{k!}.
\]


\textbf{(b)} If $k\notin\mathbb{N}$, then we set $\dbinom{n}{k}=0$.
\end{definition}

This definition is exactly the definition of $\dbinom{n}{k}$ that we used in
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.
It is also almost exactly the definition given in \cite[(5.1)]{GKP} (except
that we are allowing $k$ to be non-integer, while the authors of \cite{GKP} do
not). Definition \ref{def.binom.binom} \textbf{(a)} is also identical with the
definition of binomial coefficients in \cite{detnotes}. Our choice to require
$n\in\mathbb{Q}$ is more or less arbitrary -- we could have as well made the
same definition for $n\in\mathbb{R}$ or $n\in\mathbb{C}$ (but I am not aware
of this generality being of much use).

Generally, when you read literature on binomial coefficients, be aware that
some authors use somewhat different definitions of $\dbinom{n}{k}$. All known
definitions give the same results when $n$ and $k$ are nonnegative integers,
but in the other cases there may be discrepancies.

Here are some examples of binomial coefficients:

\begin{example}
\textbf{(a)} Definition \ref{def.binom.binom} \textbf{(a)} yields $\dbinom
{n}{2}=\dfrac{n\left(  n-1\right)  }{2!}=\dfrac{n\left(  n-1\right)  }{2}$ for
all $n\in\mathbb{Q}$. Thus, for example,%
\[
\dbinom{5}{2}=\dfrac{5\cdot4}{2}=10.
\]


\textbf{(b)} Definition \ref{def.binom.binom} \textbf{(a)} yields $\dbinom
{n}{3}=\dfrac{n\left(  n-1\right)  \left(  n-2\right)  }{3!}=\dfrac{n\left(
n-1\right)  \left(  n-2\right)  }{6}$ for all $n\in\mathbb{Q}$. Thus, for
example,%
\begin{align*}
\dbinom{5}{3}  &  =\dfrac{5\cdot4\cdot3}{6}=\dfrac{60}{6}=10;\\
\dbinom{1}{3}  &  =\dfrac{1\cdot0\cdot\left(  -1\right)  }{6}=\dfrac{0}%
{6}=0;\\
\dbinom{-2}{3}  &  =\dfrac{\left(  -2\right)  \cdot\left(  -3\right)
\cdot\left(  -4\right)  }{6}=\dfrac{-24}{6}=-4;\\
\dbinom{1/2}{3}  &  =\dfrac{\left(  1/2\right)  \cdot\left(  -1/2\right)
\cdot\left(  -3/2\right)  }{6}=\dfrac{3/8}{6}=\dfrac{1}{16}.
\end{align*}


\textbf{(c)} Definition \ref{def.binom.binom} \textbf{(a)} yields $\dbinom
{n}{1}=\dfrac{n}{1!}=\dfrac{n}{1}=n$ for all $n\in\mathbb{Q}$.

\textbf{(d)} Definition \ref{def.binom.binom} \textbf{(b)} yields $\dbinom
{4}{1/2}=0$ (since $1/2\notin\mathbb{N}$).
\end{example}

The binomial coefficients $\dbinom{n}{k}$ for $n\in\mathbb{N}$ and
$k\in\left\{  0,1,\ldots,n\right\}  $ are particularly important. They are
usually tabulated in a triangle-shaped table known as
\textit{\href{https://en.wikipedia.org/wiki/Pascal's_triangle}{\textit{Pascal's
triangle}}}, which starts as follows:%
\[%
\begin{array}
[c]{ccccccccccccc}%
\phantom{15} & \phantom{15} & \phantom{15} & \phantom{15} & \phantom{15} &
\phantom{15} & 1 & \phantom{15} & \phantom{15} & \phantom{15} & \phantom{15} &
\phantom{15} & \phantom{15}\\
&  &  &  &  & 1 &  & 1 &  &  &  &  & \\
&  &  &  & 1 &  & 2 &  & 1 &  &  &  & \\
&  &  & 1 &  & 3 &  & 3 &  & 1 &  &  & \\
&  & 1 &  & 4 &  & 6 &  & 4 &  & 1 &  & \\
& 1 &  & 5 &  & 10 &  & 10 &  & 5 &  & 1 & \\
1 &  & 6 &  & 15 &  & 20 &  & 15 &  & 6 &  & 1
\end{array}
\ .
\]
In this table, the binomial coefficient $\dbinom{n}{k}$ appears as the $k$-th
entry (from the left) of the $n$-th row (but we count the rows from $0$; that
is, the topmost row, consisting just of a single \textquotedblleft%
$1$\textquotedblright, is actually the $0$-th row). We advise the reader to
peruse \href{https://en.wikipedia.org/wiki/Pascal's_triangle}{the Wikipedia
article} for the history and the multiple illustrious properties of Pascal's triangle.

The expression $\dbinom{n}{k}$ is pronounced as \textquotedblleft$n$ choose
$k$\textquotedblright. The reason for the word \textquotedblleft
choose\textquotedblright\ will become clearer once we have seen Theorem
\ref{thm.binom.comb-int} further below.

Some of these properties are so fundamental that we are going to list them
right now:

\begin{theorem}
\label{thm.binom.n!k!}Let $n\in\mathbb{N}$ and $k\in\mathbb{N}$ be such that
$n\geq k$. Then,%
\[
\dbinom{n}{k}=\dfrac{n!}{k!\left(  n-k\right)  !}.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.n!k!}.]This was Exercise 3 \textbf{(a)} on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.
\end{proof}

Several authors use the formula $\dbinom{n}{k}=\dfrac{n!}{k!\left(
n-k\right)  !}$ as a definition of the binomial coefficients. However, this
definition has the massive disadvantage of being less general than Definition
\ref{def.binom.binom} (since it only covers the case when $n,k\in\mathbb{N}$
and $n\geq k$). To us, this formula is not a definition, but a result that can
be proven.

\begin{theorem}
\label{thm.binom.k>n0}Let $n\in\mathbb{N}$ and $k\in\mathbb{Q}$ be such that
$k>n$. Then,
\[
\dbinom{n}{k}=0.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.k>n0}.]This was Exercise 3 \textbf{(b)} on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.
\end{proof}

\begin{theorem}
\label{thm.binom.n0}Let $n\in\mathbb{Q}$. Then,%
\[
\dbinom{n}{0}=1.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.n0}.]Definition \ref{def.binom.binom}
\textbf{(a)} (applied to $k=0$) yields%
\[
\dbinom{n}{0}=\dfrac{\prod_{i=0}^{0-1}\left(  n-i\right)  }{0!}=\dfrac{1}{1}%
\]
(since $\prod_{i=0}^{0-1}\left(  n-i\right)  =\left(  \text{empty
product}\right)  =1$ and $0!=1$). Thus, $\dbinom{n}{0}=\dfrac{1}{1}=1$. This
proves Theorem \ref{thm.binom.n0}.
\end{proof}

\begin{theorem}
\label{thm.binom.symmetry}Let $n\in\mathbb{N}$ and $k\in\mathbb{Q}$. Then,%
\[
\dbinom{n}{k}=\dbinom{n}{n-k}.
\]

\end{theorem}

Theorem \ref{thm.binom.symmetry} is known as the \textit{symmetry of binomial
coefficients}. Note that it fails if $n\notin\mathbb{N}$; thus, be careful
when applying it!

\begin{proof}
[Proof of Theorem \ref{thm.binom.symmetry}.]This was Exercise 3 \textbf{(c)}
on \href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set
\#0}.
\end{proof}

\begin{theorem}
\label{thm.binom.upneg-n}Let $n\in\mathbb{Q}$ and $k\in\mathbb{Z}$. Then,%
\[
\dbinom{-n}{k}=\left(  -1\right)  ^{k}\dbinom{k+n-1}{k}.
\]

\end{theorem}

Theorem \ref{thm.binom.upneg-n} is one of the versions of the \textit{upper
negation formula}.

\begin{proof}
[Proof of Theorem \ref{thm.binom.upneg-n}.]This was Exercise 3 \textbf{(d)} on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.
\end{proof}

\begin{theorem}
\label{thm.binom.rec}Any $n\in\mathbb{Q}$ and $k\in\mathbb{Q}$ satisfy
\[
\dbinom{n}{k}=\dbinom{n-1}{k}+\dbinom{n-1}{k-1}.
\]

\end{theorem}

Theorem \ref{thm.binom.rec} is known as the \textit{recurrence of the binomial
coefficients}, and is the reason why each entry of
\href{https://en.wikipedia.org/wiki/Pascal%27s_triangle}{Pascal's triangle} is
the sum of the two entries above it\footnote{Of course, this does not apply to
the \textquotedblleft$1$\textquotedblright\ at the apex of Pascal's triangle
(unless we extend the triangle further to the top by a $\left(  -1\right)
$-st row).}.

\begin{proof}
[Proof of Theorem \ref{thm.binom.rec}.]This was Exercise 3 \textbf{(e)} on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.
\end{proof}

\begin{theorem}
\label{thm.binom.abs}Any $n\in\mathbb{Q}$ and $k\in\mathbb{Q}$ satisfy
\[
k\dbinom{n}{k}=n\dbinom{n-1}{k-1}.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.binom.abs}.]This was Exercise 3 \textbf{(f)} on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.
\end{proof}

\subsubsection{Combinatorial interpretation}

The next property of binomial coefficients is one of the major motivations for
defining them:

\begin{theorem}
\label{thm.binom.comb-int}Let $n\in\mathbb{N}$ and $k\in\mathbb{Q}$. Let $N$
be an $n$-element set. Then, $\dbinom{n}{k}$ is the number of $k$-element
subsets of $N$.
\end{theorem}

We shall refer to Theorem \ref{thm.binom.comb-int} as the
\textit{Combinatorial interpretation of binomial coefficients}. Theorem
\ref{thm.binom.comb-int} can be restated as \textquotedblleft$\dbinom{n}{k}$
is the number of ways to choose $k$ elements (with no repetitions and with no
regard for the order) from a given $n$-element set (when $n\in\mathbb{N}%
$)\textquotedblright. This is the reason why $\dbinom{n}{k}$ is called
\textquotedblleft$n$ choose $k$\textquotedblright. Note, however, that Theorem
\ref{thm.binom.comb-int} does not directly help us compute $\dbinom{n}{k}$
when $n\notin\mathbb{N}$.

\begin{proof}
[Proof of Theorem \ref{thm.binom.comb-int}.]What follows is an outline of the
proof. For a detailed proof, see \cite[Exercise 3.4]{detnotes}, where I
thoroughly prove Theorem \ref{thm.binom.comb-int} in the case $k\in\mathbb{N}%
$. (The remaining case $k\notin\mathbb{N}$ is obvious, because in that case
the theorem simply says $0=0$.)

We proceed by induction on $n$:

\textit{Induction base:} Let $n$, $k$ and $N$ be as in Theorem
\ref{thm.binom.comb-int}, and let us assume that $n=0$. From $n=0$, we obtain
$\dbinom{n}{k}=\dbinom{0}{k}=%
\begin{cases}
1, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
$ (this is easy to derive from Definition \ref{def.binom.binom}\footnote{To
wit:
\par
\begin{itemize}
\item If $k=0$, then $\dbinom{0}{k}=\dbinom{0}{0}=1$ (by Theorem
\ref{thm.binom.n0}).
\par
\item If $k>0$, then Theorem \ref{thm.binom.k>n0} (applied to $0$ instead of
$n$) yields $\dbinom{0}{k}=0$.
\par
\item If $k<0$, then $k\notin\mathbb{N}$ and thus $\dbinom{0}{k}=0$ (by
Definition \ref{def.binom.binom} \textbf{(b)}).
\end{itemize}
\par
Thus, in all three cases ($k=0$, $k>0$ and $k<0$), we conclude that
$\dbinom{0}{k}=%
\begin{cases}
1, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
$.}). On the other hand, the set $N$ is empty (since $\left\vert N\right\vert
=n=0$). Thus, its only subset is $\varnothing$, which is a $0$-element subset.
Hence, $N$ has exactly one $0$-element subset, and no subsets of any other
size. Hence, the number of $k$-element subsets of $N$ is $%
\begin{cases}
1, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
$. Comparing this with $\dbinom{n}{k}=%
\begin{cases}
1, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
$, we conclude that $\dbinom{n}{k}$ is the number of $k$-element subsets of
$N$. Thus, we have proven Theorem \ref{thm.binom.comb-int} under the
assumption that $n=0$. This completes the induction base.

\textit{Induction step:} Let $m$ be a positive integer. Assume (as the
induction hypothesis) that Theorem \ref{thm.binom.comb-int} holds for $n=m-1$.
We must now prove that Theorem \ref{thm.binom.comb-int} holds for $n=m$.

Let $k\in\mathbb{Q}$. Let $N$ be an $m$-element set. Thus, $\left\vert
N\right\vert =m>0$. Hence, the set $N$ is nonempty; in other words, there
exists some $a\in N$. Pick such an $a$. (It does not matter which one we
choose, but we need to leave it fixed from now on.) Clearly, $\left\vert
N\setminus\left\{  a\right\}  \right\vert =m-1$ (since $\left\vert
N\right\vert =m$). In other words, $N\setminus\left\{  a\right\}  $ is an
$\left(  m-1\right)  $-element set.

Now, the $k$-element subsets of $N$ can be classified into two types:

\begin{itemize}
\item We say that a $k$-element subset is \textit{type-1} if it doesn't
contain $a$.

\item We say that a $k$-element subset is \textit{type-2} if it does contain
$a$.
\end{itemize}

(We shall use the adjectives \textquotedblleft type-1\textquotedblright\ and
\textquotedblleft type-2\textquotedblright\ for $k$-element subsets of $N$
only. Thus, whenever we say \textquotedblleft type-1 subset\textquotedblright%
\ in the following, we will always mean \textquotedblleft type-1 $k$-element
subset of $N$\textquotedblright, and similarly for \textquotedblleft type-2
subset\textquotedblright.)

Clearly, any $k$-element subset of $N$ is either type-1 or type-2 (but never
both at the same time).

The type-1 subsets are precisely the $k$-element subsets of the $\left(
m-1\right)  $-element set $N\setminus\left\{  a\right\}  $. By our induction
hypothesis, we know that Theorem \ref{thm.binom.comb-int} holds for $n=m-1$.
Hence, we can apply Theorem \ref{thm.binom.comb-int} to $m-1$ and
$N\setminus\left\{  a\right\}  $ instead of $n$ and $N$. We thus conclude that
$\dbinom{m-1}{k}$ is the number of $k$-element subsets of $N\setminus\left\{
a\right\}  $. In other words, $\dbinom{m-1}{k}$ is the number of type-1
subsets (since the type-1 subsets are precisely the $k$-element subsets of
$N\setminus\left\{  a\right\}  $). In other words,%
\begin{equation}
\dbinom{m-1}{k}=\left(  \text{the number of type-1 subsets}\right)  .
\label{pf.thm.binom.comb-int.IS.1}%
\end{equation}


Now, let us count the type-2 subsets\footnote{Keep in mind that
\textquotedblleft type-2 subset\textquotedblright\ means \textquotedblleft
type-2 $k$-element subset of $N$\textquotedblright.}. This is a bit harder,
since they are not subsets of $N\setminus\left\{  a\right\}  $ anymore.
However, they are in 1-to-1 correspondence (aka bijection) with some such
subsets. Namely, there is a bijection%
\begin{align*}
\left\{  \left(  k-1\right)  \text{-element subsets of }N\setminus\left\{
a\right\}  \right\}   &  \rightarrow\left\{  \text{type-2 subsets}\right\}
,\\
S  &  \mapsto S\cup\left\{  a\right\}  .
\end{align*}
(The inverse of this bijection sends each type-2 subset $T$ to $T\setminus
\left\{  a\right\}  $. You can easily show that these two maps are actually
well-defined and mutually inverse, so that they really are bijections.) This
bijection shows that%
\begin{equation}
\left\vert \left\{  \text{type-2 subsets}\right\}  \right\vert =\left\vert
\left\{  \left(  k-1\right)  \text{-element subsets of }N\setminus\left\{
a\right\}  \right\}  \right\vert . \label{pf.thm.binom.comb-int.IS.2}%
\end{equation}
But recall that Theorem \ref{thm.binom.comb-int} holds for $n=m-1$. Hence, we
can apply Theorem \ref{thm.binom.comb-int} to $m-1$, $k-1$ and $N\setminus
\left\{  a\right\}  $ instead of $n$, $k$ and $N$. We thus conclude that
$\dbinom{m-1}{k-1}$ is the number of $\left(  k-1\right)  $-element subsets of
$N\setminus\left\{  a\right\}  $. In other words,
\[
\dbinom{m-1}{k-1}=\left\vert \left\{  \left(  k-1\right)  \text{-element
subsets of }N\setminus\left\{  a\right\}  \right\}  \right\vert .
\]
Comparing this equality with (\ref{pf.thm.binom.comb-int.IS.2}), we obtain%
\begin{align}
\dbinom{m-1}{k-1}  &  =\left\vert \left\{  \text{type-2 subsets}\right\}
\right\vert \nonumber\\
&  =\left(  \text{the number of type-2 subsets}\right)  .
\label{pf.thm.binom.comb-int.IS.3}%
\end{align}


Now, recall that any $k$-element subset of $N$ is either type-1 or type-2 (but
never both at the same time). Hence, we can count all $k$-element subsets of
$N$ by first counting the type-1 subsets, then counting the type-2 subsets,
and then adding these two results. We thus find\footnote{The combinatorial
principle we are using in the following computation is the so-called
\textit{sum rule} in its simplest form (see, e.g., \cite[1.1]{Loehr-BC} or
\cite[\S 15.2.3]{LeLeMe}).}%
\begin{align*}
&  \left(  \text{the number of }k\text{-element subsets of }N\right) \\
&  =\underbrace{\left(  \text{the number of type-1 subsets}\right)
}_{\substack{=\dbinom{m-1}{k}\\\text{(by (\ref{pf.thm.binom.comb-int.IS.1}))}%
}}+\underbrace{\left(  \text{the number of type-2 subsets}\right)
}_{\substack{=\dbinom{m-1}{k-1}\\\text{(by (\ref{pf.thm.binom.comb-int.IS.3}%
))}}}\\
&  =\dbinom{m-1}{k}+\dbinom{m-1}{k-1}=\dbinom{m}{k}%
\end{align*}
(since Theorem \ref{thm.binom.rec} (applied to $n=m$) yields $\dbinom{m}%
{k}=\dbinom{m-1}{k}+\dbinom{m-1}{k-1}$). In other words, $\dbinom{m}{k}$ is
the number of $k$-element subsets of $N$.

Now, forget that we fixed $N$ and $k$. We thus have shown that if
$k\in\mathbb{Q}$ and if $N$ is an $m$-element set, then $\dbinom{m}{k}$ is the
number of $k$-element subsets of $N$. In other words, Theorem
\ref{thm.binom.comb-int} holds for $n=m$. This completes the induction step.
Hence, Theorem \ref{thm.binom.comb-int} is proven.
\end{proof}

\begin{corollary}
\label{cor.binom.N->N}Let $n\in\mathbb{N}$ and $k\in\mathbb{Q}$. Then,
$\dbinom{n}{k}$ is a nonnegative integer.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.binom.N->N}.]Let $N=\left\{  1,2,\ldots
,n\right\}  $; thus, $N$ is an $n$-element set. Hence, Theorem
\ref{thm.binom.comb-int} shows that $\dbinom{n}{k}$ is the number of
$k$-element subsets of $N$. But the latter number is clearly a nonnegative
integer (since it counts something). Thus, $\dbinom{n}{k}$ is a nonnegative
integer. This proves Corollary \ref{cor.binom.N->N}.
\end{proof}

\begin{proposition}
\label{prop.binom.Z->Z}Let $n\in\mathbb{Z}$ and $k\in\mathbb{Q}$. Then,
$\dbinom{n}{k}$ is a integer.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.binom.Z->Z}.]If $n\geq0$, then this follows
from Corollary \ref{cor.binom.N->N} (because $n\geq0$ implies $n\in\mathbb{N}%
$, and thus we can apply Corollary \ref{cor.binom.N->N}). Thus, for the rest
of this proof, we WLOG assume that $n<0$. Hence, $n\leq-1$ (since $n$ is an
integer), so that $n+1\leq0$ and thus $-\left(  n+1\right)  \geq0$. Therefore,
$-\left(  n+1\right)  \in\mathbb{N}$ (since $-\left(  n+1\right)  $ is an integer).

If $k\notin\mathbb{N}$, then $\dbinom{n}{k}$ is a integer (since Definition
\ref{def.binom.binom} \textbf{(b)} yields $\dbinom{n}{k}=0$ in this case).
Thus, for the rest of this proof, we WLOG assume that $k\in\mathbb{N}$. Thus,
$k+\left(  -n\right)  -1=\underbrace{k}_{\in\mathbb{N}}+\underbrace{\left(
-\left(  n+1\right)  \right)  }_{\in\mathbb{N}}\in\mathbb{N}$. Hence,
Corollary \ref{cor.binom.N->N} (applied to $k+\left(  -n\right)  -1$ instead
of $n$) yields that $\dbinom{k+\left(  -n\right)  -1}{k}$ is a nonnegative
integer. Thus, $\dbinom{k+\left(  -n\right)  -1}{k}\in\mathbb{Z}$.

Theorem \ref{thm.binom.upneg-n} (applied to $-n$ instead of $n$) yields%
\[
\dbinom{-\left(  -n\right)  }{k}=\underbrace{\left(  -1\right)  ^{k}}%
_{\in\mathbb{Z}}\underbrace{\dbinom{k+\left(  -n\right)  -1}{k}}%
_{\in\mathbb{Z}}\in\mathbb{Z}.
\]
In other words, $\dbinom{n}{k}\in\mathbb{Z}$. In other words, $\dbinom{n}{k}$
is an integer. Thus, Proposition \ref{prop.binom.Z->Z} is proven.
\end{proof}

\begin{exercise}
\label{exe.binom.k!divprod}Let $k\in\mathbb{N}$. Prove that the product of any
$k$ consecutive integers is divisible by $k!$.
\end{exercise}

\begin{exercise}
\label{exe.binom.legendre}In this exercise, we shall use
\href{https://en.wikipedia.org/wiki/Iverson_bracket}{the \textit{Iverson
bracket notation}}: If $\mathcal{A}$ is any statement, then $\left[
\mathcal{A}\right]  $ stands for the integer $%
\begin{cases}
1, & \text{if $\mathcal{A}$ is true;}\\
0, & \text{if $\mathcal{A}$ is false}%
\end{cases}
$ (which is also known as the \textit{truth value} of $\mathcal{A}$). For
instance, $\left[  1+1=2\right]  =1$ and $\left[  1+1=1\right]  =0$.

\textbf{(a)} Prove that $n//k=\sum_{i=1}^{n}\left[  k\mid i\right]  $ for any
$n\in\mathbb{N}$ and any positive integer $k$.

\textbf{(b)} Prove that $v_{p}\left(  n\right)  =\sum_{i\geq1}\left[
p^{i}\mid n\right]  $ for any prime $p$ and any nonzero integer $n$. Here, the
sum $\sum_{i\geq1}\left[  p^{i}\mid n\right]  $ is a sum over all positive
integers; but it is well-defined, since it has only finitely many nonzero addends.

\textbf{(c)} Prove that $v_{p}\left(  n!\right)  =\sum_{i\geq1}n//p^{i}$ for
any prime $p$ and any $n\in\mathbb{N}$. (Here, the expression
\textquotedblleft$\sum_{i\geq1}n//p^{i}$\textquotedblright\ should be
understood as $\sum_{i\geq1}\left(  n//p^{i}\right)  $. Again, this sum
$\sum_{i\geq1}\left(  n//p^{i}\right)  $ is well-defined, since it has only
finitely many nonzero addends.)

\textbf{(d)} Use part \textbf{(c)} to prove Corollary \ref{cor.binom.N->N} again.
\end{exercise}

The claim of Exercise \ref{exe.binom.legendre} \textbf{(c)} is usually
rewritten in the form $v_{p}\left(  n!\right)  =\sum_{i\geq1}\left\lfloor
\dfrac{n}{p^{i}}\right\rfloor $ (which is equivalent, because of Proposition
\ref{prop.ent.floor.quorem}); in this form, it is
\href{https://en.wikipedia.org/wiki/Legendre's_formula}{known as Legendre's
formula or as de Polignac's formula} (see, e.g., \cite[Theorem 1.3.3]{floor}).
It is often a helpful tool in proving divisibility properties of factorials
and binomial coefficients. One application, for example, is to quickly compute
how many zeroes the decimal expansion of $n!$ ends with. (Note that Exercise
\ref{exe.binom.legendre} \textbf{(b)} can be rewritten as $v_{p}\left(
n\right)  =\sum_{\substack{i\geq1;\\p^{i}\mid n}}1$; in this form it appears
in \cite[Lemma 1.3.4]{floor}.)

\subsubsection{\label{subsect.ent.vandermonde}Binomial formula and Vandermonde
convolution}

One of the staples of enumerative combinatorics are identities that involve
binomial coefficients. Hundreds of such identities have been found (see, e.g.,
\href{https://www.math.wvu.edu/~gould/}{Henry W. Gould's website} for a list
of some of them; see also \cite[Chapter 5]{GKP} and \cite[Chapter 3]{detnotes}
for introductions). At this point, let us only show two of the most important
ones (not counting the ones we have already shown above). Probably the most
famous one is the \textit{binomial formula}:

\begin{theorem}
\label{thm.binom.binf}Let $x,y$ be any numbers (e.g., rational or real or
complex numbers). Let $n\in\mathbb{N}$. Then,%
\[
\left(  x+y\right)  ^{n}=\sum_{k=0}^{n}\dbinom{n}{k}x^{k}y^{n-k}.
\]

\end{theorem}

Theorem \ref{thm.binom.binf} is known as the \textit{binomial formula} or the
\textit{binomial theorem}. It generalizes the well-known and beloved
identities%
\begin{align*}
\left(  x+y\right)  ^{2}  &  =x^{2}+2xy+y^{2};\\
\left(  x+y\right)  ^{3}  &  =x^{3}+3x^{2}y+3xy^{2}+y^{3};\\
\left(  x+y\right)  ^{4}  &  =x^{4}+4x^{3}y+6x^{2}y^{2}+4xy^{3}+y^{4}%
\end{align*}
(as well as $\left(  x+y\right)  ^{1}=x^{1}+y^{1}$ and $\left(  x+y\right)
^{0}=1$, of course).

\begin{proof}
[Proof of Theorem \ref{thm.binom.binf} (sketched).]This can be proven by a
straightforward induction on $n$ (using Theorem \ref{thm.binom.rec} in the
induction step). See \cite[Exercise 3.6]{detnotes} for details of this proof.
Alternatively, see \cite[Identity 11.4]{Galvin} for combinatorial proofs
(which rely on Theorem \ref{thm.binom.comb-int}).
\end{proof}

The next identity we want to show is the \textit{Vandermonde convolution
identity}:

\begin{theorem}
\label{thm.binom.vandermonde}Let $x,y\in\mathbb{Q}$ and $n\in\mathbb{N}$.
Then,%
\[
\dbinom{x+y}{n}=\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{y}{n-k}.
\]

\end{theorem}

For example, for $n=2$, Theorem \ref{thm.binom.vandermonde} says that
\[
\dbinom{x+y}{2}=\underbrace{\dbinom{x}{0}}_{=1}\dbinom{y}{2}%
+\underbrace{\dbinom{x}{1}}_{=x}\underbrace{\dbinom{y}{1}}_{=y}+\dbinom{x}%
{2}\underbrace{\dbinom{y}{0}}_{=1}=\dbinom{y}{2}+xy+\dbinom{x}{2}.
\]


The proof of Theorem \ref{thm.binom.vandermonde} that we are soon going to
sketch is similar to the one given in \cite[\S 3.3.3]{detnotes} (but, unlike
the latter proof, we will use polynomials in $1$ variable only). It will not
be a complete proof, since it will rely on some properties of polynomials, and
not only have we not proven these properties -- we have actually not
rigorously defined polynomials yet! (We will do so later, in Chapter
\ref{chp.pol}.) See \cite[\S 3.3.2]{detnotes} for another (more boring and
tedious, but conceptually simpler) proof of Theorem
\ref{thm.binom.vandermonde}.

Our proof of Theorem \ref{thm.binom.vandermonde} proceeds via several
intermediate steps. The first one is to prove Theorem
\ref{thm.binom.vandermonde} in the particular case when $x,y\in\mathbb{N}$:

\begin{lemma}
\label{lem.binom.vandermonde.NN}Let $a,b\in\mathbb{N}$ and $n\in\mathbb{N}$.
Then,%
\[
\dbinom{a+b}{n}=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}.
\]

\end{lemma}

(We have renamed the variables $x$ and $y$ from Theorem
\ref{thm.binom.vandermonde} as $a$ and $b$ here, since we will soon use the
letter \textquotedblleft$x$\textquotedblright\ for something completely different.)

\begin{proof}
[Proof of Lemma \ref{lem.binom.vandermonde.NN} (sketched).]Let%
\[
C=\left\{  1,2,\ldots,a\right\}  \cup\left\{  -1,-2,\ldots,-b\right\}  .
\]
Thus, $C$ is an $\left(  a+b\right)  $-element set, containing only positive
and negative integers. How many $n$-element subsets does $C$ have?

\begin{itemize}
\item On the one hand: The set $C$ is an $\left(  a+b\right)  $-element set.
Hence, Theorem \ref{thm.binom.comb-int} (applied to $a+b$, $n$ and $C$ instead
of $n$, $k$ and $N$) shows that the number of $n$-element subsets of $C$ is
$\dbinom{a+b}{n}$.

\item On the other hand: Let us classify the $n$-element subsets of $C$
according to how many positive elements they have. We claim the following:

\begin{statement}
\textit{Claim 1:} For each $k\in\left\{  0,1,\ldots,n\right\}  $, the number
of $n$-element subsets of $C$ having \textbf{exactly }$k$ \textbf{positive
elements} is $\dbinom{a}{k}\dbinom{b}{n-k}$.
\end{statement}

[\textit{Proof of Claim 1:} Let $k\in\left\{  0,1,\ldots,n\right\}  $. In
order to choose an $n$-element subset of $C$ having exactly $k$ positive
elements, we need to choose

\begin{itemize}
\item its $k$ positive elements from the set of all positive elements of $C$
(that is, from the set $\left\{  1,2,\ldots,a\right\}  $), and

\item its remaining $n-k$ (negative) elements from the set of all negative
elements of $C$ (that is, from the set $\left\{  -1,-2,\ldots,-b\right\}  $).
\end{itemize}

In other words, we need to choose

\begin{itemize}
\item a $k$-element subset of the set $\left\{  1,2,\ldots,a\right\}  $, and

\item an $\left(  n-k\right)  $-element subset of the set $\left\{
-1,-2,\ldots,-b\right\}  $.
\end{itemize}

Theorem \ref{thm.binom.comb-int} (applied to $a$, $k$ and $\left\{
1,2,\ldots,a\right\}  $ instead of $n$, $k$ and $N$) shows that the number of
$k$-element subsets of the set $\left\{  1,2,\ldots,a\right\}  $ is
$\dbinom{a}{k}$ (since $\left\{  1,2,\ldots,a\right\}  $ is an $a$-element
set). Similarly, the number of $\left(  n-k\right)  $-element subsets of the
set $\left\{  -1,-2,\ldots,-b\right\}  $ is $\dbinom{b}{n-k}$. Since we need
to choose one of the former subsets and one of the latter subsets (and our
choices are independent -- i.e., any of the former subsets can be combined
with any of the latter), we thus conclude that the total number of options we
have is $\dbinom{a}{k}\dbinom{b}{n-k}$\ \ \ \ \footnote{The combinatorial
principle we are using here is the so-called \textit{product rule} (see, e.g.,
\cite[1.8]{Loehr-BC} or \cite[\S 15.2.1]{LeLeMe}).}. In other words, the
number of $n$-element subsets of $C$ having \textbf{exactly }$k$
\textbf{positive elements} is $\dbinom{a}{k}\dbinom{b}{n-k}$. This proves
Claim 1.]

Now, the total number of $n$-element subsets of $C$ is\footnote{The
combinatorial principle we are using in the following computation is the
so-called \textit{sum rule} (see, e.g., \cite[1.2]{Loehr-BC} or
\cite[\S 15.2.3]{LeLeMe}).}%
\begin{align*}
&  \left(  \text{the number of }n\text{-element subsets of }C\right) \\
&  =\sum_{k=0}^{n}\underbrace{\left(  \text{the number of }n\text{-element
subsets of }C\text{ having exactly }k\text{ positive elements}\right)
}_{\substack{=\dbinom{a}{k}\dbinom{b}{n-k}\\\text{(by Claim 1)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the number of positive elements of an }n\text{-element}\\
\text{subset of }C\text{ must always be an integer between }0\text{ and }n
\end{array}
\right) \\
&  =\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}.
\end{align*}

\end{itemize}

Now, we have computed the number of $n$-element subsets of $C$ in two ways.
The first way yielded the result $\dbinom{a+b}{n}$, while the second way
yielded $\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}$. But these two results
clearly have to be equal. In other words, we have%
\[
\dbinom{a+b}{n}=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}.
\]
Thus, Lemma \ref{lem.binom.vandermonde.NN} holds.

(This was an example of a proof by \textit{double counting}, also known as a
\textit{combinatorial proof}. See \cite[\S 15.10]{LeLeMe} for some more
examples of such proofs, and see most textbooks on combinatorics for more.)
\end{proof}

This shows that Theorem \ref{thm.binom.vandermonde} holds for all
$x\in\mathbb{N}$ and $y\in\mathbb{N}$. In order to extend its reach to
arbitrary rational $a$ and $b$, we shall use the \textquotedblleft polynomial
identity trick\textquotedblright. First, let us briefly explain what
polynomials are, without giving a formal definition.

Informally, a \textit{polynomial} (in $1$ variable $x$, with rational
coefficients) is an \textquotedblleft expression\textquotedblright\ of the
form $a_{k}x^{k}+a_{k-1}x^{k-1}+\cdots+a_{0}$, where $a_{k},a_{k-1}%
,\ldots,a_{0}$ are (fixed) rational numbers and where $x$ is a (so far
meaningless) symbol (called \textit{indeterminate} or \textit{variable}). For
example, $4x^{3}+2x^{2}-\dfrac{1}{3}x+\dfrac{2}{7}$ is a polynomial, and so is
$0x^{3}+x^{2}-0x+\dfrac{1}{3}$. We can omit terms of the form
\textquotedblleft$0x^{i}$\textquotedblright\ when writing down a polynomial
and treat the result as being the same polynomial; thus, $0x^{3}%
+x^{2}-0x+\dfrac{1}{3}$ can also be written as $x^{2}-0x+\dfrac{1}{3}$ and as
$x^{2}+\dfrac{1}{3}$. Likewise, we can treat the \textquotedblleft%
$+$\textquotedblright\ signs as signifying addition and behaving like it, so,
e.g., commutativity holds: $2x^{3}+5x$ and $5x+2x^{3}$ are the same polynomial
(but $2x+5x^{3}$ is different). We also pretend that distributivity holds, so
\textquotedblleft like terms\textquotedblright\ can be combined: e.g., we have
$4x^{3}+9x^{3}=\left(  4+9\right)  x^{3}=13x^{3}$ or $4x^{3}-12x^{3}=\left(
4-12\right)  x^{3}=-8x^{3}$. Thus, we can add two polynomials: for example,%
\[
\left(  3x^{2}-1x+\dfrac{1}{2}\right)  +\left(  6x-7\right)  =3x^{2}%
+\underbrace{\left(  -1+6\right)  }_{=5}x+\underbrace{\left(  \dfrac{1}%
{2}-7\right)  }_{=\dfrac{-13}{2}}=3x^{2}+5x+\dfrac{-13}{2}.
\]
By pretending that the $x^{i}$ (with $i\in\mathbb{N}$) are actual powers of
the symbol $x$, and that multiplication obeys the associativity law (so that
$\left(  \lambda x^{i}\right)  x^{j}=\lambda\left(  x^{i}x^{j}\right)
=\lambda x^{i+j}$ for rational $\lambda$ and $i,j\in\mathbb{N}$), we can
multiply polynomials as well (first use distributivity to expand the product):%
\begin{align*}
\left(  3x-5\right)  \left(  x^{2}+3x+2\right)   &  =3x\left(  x^{2}%
+3x+2\right)  -5\left(  x^{2}+3x+2\right) \\
&  =\left(  3x^{3}+9x^{2}+6x\right)  -\left(  5x^{2}+15x+10\right) \\
&  =3x^{3}+4x^{2}-9x-10.
\end{align*}


Most importantly, it is possible to \textit{substitute} a number into a
polynomial: If $u\in\mathbb{Q}$ and if $P=a_{k}x^{k}+a_{k-1}x^{k-1}%
+\cdots+a_{0}$ is a polynomial, then we define $P\left(  u\right)  $ (called
the \textit{evaluation} of $P$ \textit{at} $u$, or the \textit{result of
substituting }$u$ \textit{for }$x$ \textit{in} $P$) to be the number
$a_{k}u^{k}+a_{k-1}u^{k-1}+\cdots+a_{0}$. More generally, if the polynomial
$P$ is given in any of its forms (e.g., as a product of other polynomials),
then we can compute $P\left(  u\right)  $ by replacing each $x$ appearing in
this form by an $u$. For example, if $P=\left(  2x+1\right)  \left(
3x+1\right)  -\left(  4x+1\right)  \left(  5x+1\right)  $, then $P\left(
u\right)  =\left(  2u+1\right)  \left(  3u+1\right)  -\left(  4u+1\right)
\left(  5u+1\right)  $; thus, we do not need to expand $P$ before substituting
$u$ into it.

Even more generally, $u$ does not have to be a rational number in order to be
substituted in a polynomial $P$ -- it can be (roughly speaking!) anything that
can be taken to the $i$-th power for $i\in\mathbb{N}$ and that can be added
and multiplied by a rational number. For example, $u$ can be a real number or
a square matrix or another polynomial. (We will later learn the precise
meaning of \textquotedblleft anything\textquotedblright\ here\footnote{Namely,
\textquotedblleft anything\textquotedblright\ will be concretized to mean
\textquotedblleft any element of a $\mathbb{Q}$-algebra\textquotedblright. See
Definition \ref{def.pol.eval} for the details.}.)

We have been vague in our definition of polynomials, since making it rigorous
would take us a fair way afield. But we \textbf{will} eventually (in Chapter
\ref{chp.pol}) define polynomials rigorously and prove that all of the above
claims (e.g., about associativity and distributivity) actually hold. For now,
we need a basic property of polynomials:

\begin{proposition}
\label{prop.poly.informal.f=g}Let $P$ and $Q$ be two polynomials in $1$
variable $x$ with rational coefficients. Assume that infinitely many
$u\in\mathbb{Q}$ satisfy $P\left(  u\right)  =Q\left(  u\right)  $. Then,
$P=Q$ (as polynomials).
\end{proposition}

We will prove Proposition \ref{prop.poly.informal.f=g} later (in Section
\ref{sect.pol.id}).\footnote{Note that it is closely related to the
Proposition \ref{prop.intro.shamir.quadpol} we used above.}

Note that polynomials are not functions -- despite the fact that we can
substitute numbers into them and obtain other numbers. However, in many
regards, they behave like functions. For what we are going to do in this
section, the difference does not matter; we can treat polynomials as functions here.

With Lemma \ref{lem.binom.vandermonde.NN}, we have proven Theorem
\ref{thm.binom.vandermonde} in the case when $x$ and $y$ belong to
$\mathbb{N}$. Our goal, however, is to prove it for arbitrary $x,y\in
\mathbb{Q}$. Let us first lift it to an intermediate level of generality --
allowing $x$ to be arbitrary, but still requiring $y\in\mathbb{N}$. Thus, we
want to prove the following lemma:

\begin{lemma}
\label{lem.binom.vandermonde.QN}Let $a\in\mathbb{Q}$, $b\in\mathbb{N}$ and
$n\in\mathbb{N}$. Then,%
\[
\dbinom{a+b}{n}=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.vandermonde.QN} (sketched).]Let us define a
polynomial $P$ in $1$ variable $x$ with rational coefficients as follows:%
\begin{equation}
P=\dbinom{x+b}{n}. \label{pf.lem.binom.vandermonde.NN.P=}%
\end{equation}
The \textquotedblleft binomial coefficient\textquotedblright\ $\dbinom{x+b}%
{n}$ here is to be understood by extending Definition \ref{def.binom.binom}
\textbf{(a)} in the obvious fashion to the case when $n$ is a polynomial (in
our case, $x+b$) rather than a rational number. Thus,%
\[
\dbinom{x+b}{n}=\dfrac{\left(  x+b\right)  \left(  x+b-1\right)  \left(
x+b-2\right)  \cdots\left(  x+b-n+1\right)  }{n!}.
\]


Let us also define a polynomial $Q$ in $1$ variable $x$ with rational
coefficients as follows:%
\begin{equation}
Q=\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{b}{n-k}.
\label{pf.lem.binom.vandermonde.NN.Q=}%
\end{equation}
(Again, the \textquotedblleft binomial coefficients\textquotedblright%
\ $\dbinom{x}{k}$ are defined via our extension of Definition
\ref{def.binom.binom} \textbf{(a)}, and can be explicitly written as
$\dbinom{x}{k}=\dfrac{x\left(  x-1\right)  \left(  x-2\right)  \cdots\left(
x-k+1\right)  }{k!}$. Meanwhile, the $\dbinom{b}{n-k}$ are just constant integers.)

Now, for each $u\in\mathbb{N}$, we have%
\begin{align*}
P\left(  u\right)   &  =\dbinom{u+b}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
substituting }u\text{ for }x\text{ in the equality
(\ref{pf.lem.binom.vandermonde.NN.P=})}\right) \\
&  =\sum_{k=0}^{n}\dbinom{u}{k}\dbinom{b}{n-k}%
\end{align*}
(by Lemma \ref{lem.binom.vandermonde.NN}, applied to $u$ instead of $a$) and%
\[
Q\left(  u\right)  =\sum_{k=0}^{n}\dbinom{u}{k}\dbinom{b}{n-k}%
\]
(by substituting $u$ for $x$ in the equality
(\ref{pf.lem.binom.vandermonde.NN.Q=})). Comparing these two equalities, we
obtain $P\left(  u\right)  =Q\left(  u\right)  $ for all $u\in\mathbb{N}$.
Hence, infinitely many $u\in\mathbb{Q}$ satisfy $P\left(  u\right)  =Q\left(
u\right)  $ (since infinitely many $u\in\mathbb{Q}$ satisfy $u\in\mathbb{N}$).
Thus, Proposition \ref{prop.poly.informal.f=g} yields $P=Q$. In view of
(\ref{pf.lem.binom.vandermonde.NN.P=}) and
(\ref{pf.lem.binom.vandermonde.NN.Q=}), this rewrites as%
\begin{equation}
\dbinom{x+b}{n}=\sum_{k=0}^{n}\dbinom{x}{k}\dbinom{b}{n-k}.
\label{pf.lem.binom.vandermonde.NN.final}%
\end{equation}
Now, substituting $a$ for $x$ in this equality of polynomials, we obtain
$\dbinom{a+b}{n}=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}$. This proves
Lemma \ref{lem.binom.vandermonde.QN}.
\end{proof}

Let us summarize the main idea of this proof: We replaced the rational number
$a$ by the indeterminate $x$, thus transforming the identity we were proving
into an equality between two polynomials (namely, $P=Q$). But in order to
prove an equality between polynomials, it suffices to prove that it holds at
infinitely many numbers (by Proposition \ref{prop.poly.informal.f=g}); thus,
in particular, it suffices to check it at all nonnegative integers. But this
is precisely what we did in Lemma \ref{lem.binom.vandermonde.NN} above. This
kind of argument (with its use of Proposition \ref{prop.poly.informal.f=g}) is
known as the \textquotedblleft polynomial identity trick\textquotedblright.

Now, let us extend the reach of Lemma \ref{lem.binom.vandermonde.QN} further,
allowing both $a$ and $b$ to be arbitrary (and thus obtaining the whole
Theorem \ref{thm.binom.vandermonde}):

\begin{lemma}
\label{lem.binom.vandermonde.QQ}Let $a,b\in\mathbb{Q}$ and $n\in\mathbb{N}$.
Then,%
\[
\dbinom{a+b}{n}=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.vandermonde.QQ} (sketched).]Deriving Lemma
\ref{lem.binom.vandermonde.QQ} from Lemma \ref{lem.binom.vandermonde.QN} is
very similar to deriving Lemma \ref{lem.binom.vandermonde.QN} from Lemma
\ref{lem.binom.vandermonde.NN}. The main difference is that we replace $b$
(rather than $a$) by the indeterminate $x$ now.

\begin{fineprint}
Here are the details: Let us define a polynomial $P$ in $1$ variable $x$ with
rational coefficients as follows:%
\begin{equation}
P=\dbinom{a+x}{n}. \label{pf.lem.binom.vandermonde.QQ.P=}%
\end{equation}


Let us also define a polynomial $Q$ in $1$ variable $x$ with rational
coefficients as follows:%
\begin{equation}
Q=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{x}{n-k}.
\label{pf.lem.binom.vandermonde.QQ.Q=}%
\end{equation}


Now, for each $u\in\mathbb{N}$, we have%
\begin{align*}
P\left(  u\right)   &  =\dbinom{a+u}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
substituting }u\text{ for }x\text{ in the equality
(\ref{pf.lem.binom.vandermonde.QQ.P=})}\right) \\
&  =\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{u}{n-k}%
\end{align*}
(by Lemma \ref{lem.binom.vandermonde.QN}, applied to $u$ instead of $b$) and%
\[
Q\left(  u\right)  =\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{u}{n-k}%
\]
(by substituting $u$ for $x$ in the equality
(\ref{pf.lem.binom.vandermonde.QQ.Q=})). Comparing these two equalities, we
obtain $P\left(  u\right)  =Q\left(  u\right)  $ for all $u\in\mathbb{N}$.
Hence, infinitely many $u\in\mathbb{Q}$ satisfy $P\left(  u\right)  =Q\left(
u\right)  $ (since infinitely many $u\in\mathbb{Q}$ satisfy $u\in\mathbb{N}$).
Thus, Proposition \ref{prop.poly.informal.f=g} yields $P=Q$. In view of
(\ref{pf.lem.binom.vandermonde.QQ.P=}) and
(\ref{pf.lem.binom.vandermonde.QQ.Q=}), this rewrites as%
\[
\dbinom{a+x}{n}=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{x}{n-k}.
\]
Now, substituting $b$ for $x$ in this equality of polynomials, we obtain
$\dbinom{a+b}{n}=\sum_{k=0}^{n}\dbinom{a}{k}\dbinom{b}{n-k}$. This proves
Lemma \ref{lem.binom.vandermonde.QQ}.
\end{fineprint}
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.binom.vandermonde} (sketched).]Theorem
\ref{thm.binom.vandermonde} is just Lemma \ref{lem.binom.vandermonde.QQ}, with
$a$ and $b$ renamed as $x$ and $y$.
\end{proof}

\begin{noncompile}
See \cite{GKP} and \cite{detnotes} for further identities involving binomial coefficients.
\end{noncompile}

\begin{exercise}
\label{exe.binom.subsets-ctg}Let $a,b\in\mathbb{N}$ and $m\in\mathbb{Q}$. Let
$A$ be an $a$-element set. Let $B$ be a $b$-element subset of $A$. Prove that%
\[
\left(  \text{the number of }m\text{-element subsets }S\text{ of }A\text{
satisfying }B\subseteq S\right)  =\dbinom{a-b}{m-b}.
\]

\end{exercise}

\subsubsection{Some divisibilities and congruences}

So far we have been proving identities between binomial coefficients. Let us
now step to divisibilities and congruences.

Proposition \ref{prop.binom.Z->Z} shows that binomial coefficients $\dbinom
{n}{k}$ are integers whenever $n$ is an integer. This allows us to study
divisibilities and congruences between binomial coefficients (and you have
seen a few of them on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw1s.pdf}{homework set \#1}).
One of the most important such divisibilities is the following fact:

\begin{theorem}
\label{thm.binom.p|bin}Let $p$ be a prime. Let $k\in\left\{  1,2,\ldots
,p-1\right\}  $. Then, $p\mid\dbinom{p}{k}$.
\end{theorem}

\begin{proof}
[First proof of Theorem \ref{thm.binom.p|bin}.]Applying Theorem
\ref{thm.binom.abs} to $n=p$, we obtain%
\[
k\dbinom{p}{k}=p\dbinom{p-1}{k-1}.
\]
Thus, $p\mid k\dbinom{p}{k}$ (since $\dbinom{p-1}{k-1}$ is an
integer\footnote{by an application of Proposition \ref{prop.binom.Z->Z}}). But
Proposition \ref{prop.ent.prime.each-i-coprime} (applied to $i=k$) yields that
$k$ is coprime to $p$. In other words, $k\perp p$, and thus $p\perp k$. Hence,
Theorem \ref{thm.ent.coprime.cancel} (applied to $a=p$, $b=k$ and
$c=\dbinom{p}{k}$) yields $p\mid\dbinom{p}{k}$ (since $p\mid k\dbinom{p}{k}$).
This proves Theorem \ref{thm.binom.p|bin}.
\end{proof}

We shall see a second, combinatorial proof of Theorem \ref{thm.binom.p|bin}
further below; it will rely on the concept of group actions.

\begin{noncompile}
\begin{proof}
[Second proof of Theorem \ref{thm.binom.p|bin} (outline).]The following is not
rigorous and probably not readable; we will make sense of this later.

We know that $\dbinom{p}{k}$ counts $k$-element subsets of $\left\{
1,2,\ldots,p\right\}  $. We can restate this using $p$\textit{-bitstrings}.

A $p$\textit{-bitstring} is a $p$-tuple $\left(  i_{1},i_{2},\ldots
,i_{p}\right)  \in\left\{  0,1\right\}  ^{p}$. For example, the $2$-bitstrings
are $\left(  0,0\right)  ,\ \left(  0,1\right)  ,\ \left(  1,0\right)
,\ \left(  1,1\right)  $.

I claim that there is a bijection%
\begin{align*}
\left\{  k\text{-element subsets of }\left\{  1,2,\ldots,p\right\}  \right\}
&  \rightarrow\left\{  p\text{-bitstrings with }k\text{ 1's}\right\}  ,\\
S  &  \mapsto\left\{  \left(  i_{1},i_{2},\ldots,i_{p}\right)  \right\}  ,
\end{align*}
where $i_{x}=%
\begin{cases}
1, & \text{if }x\in S;\\
0, & \text{if }x\notin S
\end{cases}
$.

(Example: If $p=3$ and $k=2$, then

\begin{itemize}
\item the $k$-element subsets of $\left\{  1,2,\ldots,p\right\}  $ are
$\left\{  1,2\right\}  ,\ \left\{  1,3\right\}  ,\ \left\{  2,3\right\}  $;

\item the $p$-bitstrings with $k$ 1's are $\left(  1,1,0\right)  ,\ \left(
1,0,1\right)  ,\ \left(  0,1,1\right)  $.
\end{itemize}

These are listed in a way that the bijection sends them to each other in order.)

Thus,%
\begin{align*}
&  \left(  \text{the number of }p\text{-bitstrings with }k\text{ 1's}\right)
\\
&  =\left(  \text{the number of }k\text{-element subsets of }\left\{
1,2,\ldots,p\right\}  \right) \\
&  =\dbinom{p}{k}.
\end{align*}


\textit{Cyclic rotation} is the map $\mathbf{c}$ sending a $p$-bitstring
$\left(  i_{1},i_{2},\ldots,i_{p}\right)  $ to $\left(  i_{2},i_{3}%
,\ldots,i_{p},i_{1}\right)  $.

A \textit{necklace} is (essentially) a bitstring up to cyclic rotation.

If $\left(  i_{1},i_{2},\ldots,i_{p}\right)  $ is any $p$-bitstring, then
\begin{align*}
&  \left(  i_{1},i_{2},\ldots,i_{p}\right)  ,\ \ \ \ \ \ \ \ \ \ \mathbf{c}%
\left(  i_{1},i_{2},\ldots,i_{p}\right)  ,\ \ \ \ \ \ \ \ \ \ \mathbf{c}%
^{2}\left(  i_{1},i_{2},\ldots,i_{p}\right)  ,\\
&  \ldots,\ \ \ \ \ \ \ \ \ \ \mathbf{c}^{p-1}\left(  i_{1},i_{2},\ldots
,i_{p}\right)
\end{align*}
are all distinct \textbf{unless} it is either $\left(  0,0,\ldots,0\right)  $
or $\left(  1,1,\ldots,1\right)  $.

(Example: $\left(  1,1,0\right)  ,\ \left(  1,0,1\right)  ,\ \left(
0,1,1\right)  $ are distinct.

$\left(  1,0,1,0\right)  ,\ \left(  0,1,0,1\right)  ,\ \left(  1,0,1,0\right)
,\ \left(  0,1,0,1\right)  $ are \textbf{not} distinct, but $4$ is not prime.)

We don't claim that this is mathematically obvious! It will be a consequence
of things we do later (group actions on sets).

Thus, the $p$-bitstrings with $k$ 1's can be grouped into \textquotedblleft
necklaces\textquotedblright: A necklace is always a group formed by a
$p$-bitstring $\left(  i_{1},i_{2},\ldots,i_{p}\right)  $ and all its images
$\mathbf{c}^{\ell}\left(  i_{1},i_{2},\ldots,i_{p}\right)  $ under cyclic
rotation (applied several times). Each necklace contains exactly $p$ many
$p$-bitstrings. So the number of $p$-bitstrings with $k$ 1's equals $p$ times
the number of necklaces.
\end{proof}
\end{noncompile}

Let us state two congruences for binomial coefficients, which we will show
later using tools from abstract algebra:

\begin{theorem}
[Lucas's congruence]\label{thm.binom.lucas}Let $p$ be a prime. Let
$a,b\in\mathbb{Z}$. Let $c,d\in\left\{  0,1,\ldots,p-1\right\}  $. Then,%
\[
\dbinom{pa+c}{pb+d}\equiv\dbinom{a}{b}\dbinom{c}{d}\operatorname{mod}p.
\]

\end{theorem}

\begin{theorem}
[Babbage's congruence]\label{thm.binom.babbage}Let $p$ be a prime. Let
$a,b\in\mathbb{Z}$. Then,%
\[
\dbinom{pa}{pb}\equiv\dbinom{a}{b}\operatorname{mod}p^{2}.
\]

\end{theorem}

For the impatient: Elementary proofs of Theorem \ref{thm.binom.lucas} and
Theorem \ref{thm.binom.babbage} can be found in \cite{lucas}.

\begin{remark}
Lucas's congruence has the following consequence: Let $p$ be a prime. Let
$a,b\in\mathbb{N}$. Write $a$ and $b$ in base $p$ as follows:%
\begin{align*}
a  &  =a_{k}p^{k}+a_{k-1}p^{k-1}+\cdots+a_{0}p^{0}%
\ \ \ \ \ \ \ \ \ \ \text{and}\\
b  &  =b_{k}p^{k}+b_{k-1}p^{k-1}+\cdots+b_{0}p^{0}%
\end{align*}
with $k\in\mathbb{N}$ and $a_{k},a_{k-1},\ldots,a_{0},b_{k},b_{k-1}%
,\ldots,b_{0}\in\left\{  0,1,\ldots,p-1\right\}  $. (Note that we allow
\textquotedblleft leading zeroes\textquotedblright\ -- i.e., any of $a_{k}$
and $b_{k}$ can be $0$.) Then,%
\[
\dbinom{a}{b}\equiv\dbinom{a_{k}}{b_{k}}\dbinom{a_{k-1}}{b_{k-1}}\cdots
\dbinom{a_{0}}{b_{0}}\operatorname{mod}p.
\]
(This can be easily proven by induction on $k$, using Theorem
\ref{thm.binom.lucas} in the induction step.) This allows for quick
computation of remainders of $\dbinom{a}{b}$ modulo prime numbers, and also
explains (when applied to $p=2$) why
\href{https://en.wikipedia.org/wiki/Sierpinski_triangle#Pascal's_triangle}{we
can obtain (an approximation of) Sierpinski's triangle from Pascal's triangle
by coloring all even numbers white and all odd numbers black}.
\end{remark}

See \cite{Mestro14} and \cite{Granvi05} for overviews of more complicated
divisibilities and congruences for binomial coefficients.

\begin{exercise}
\label{exe.binom.p-for-EGZ}Let $p$ be a prime.

\textbf{(a)} Prove that $\dbinom{2p}{p}\equiv2\operatorname{mod}p$.

\textbf{(b)} Prove that $\dbinom{2p-1}{p}\equiv1\operatorname{mod}p$.

\textbf{(c)} Prove that $\dbinom{p-1+k}{k}\equiv0\operatorname{mod}p$ for each
$k\in\left\{  1,2,\ldots,p-1\right\}  $.

[\textbf{Hint:} This is very easy using Lucas's congruence, but you can also
solve it without it.]
\end{exercise}

\begin{teachingnote}
\textbf{2019-02-20 lecture}
\end{teachingnote}

\subsubsection{Integer-valued polynomials}

Now that we have introduced polynomials (albeit informally and on somewhat
shaky foundations) and binomial coefficients (albeit briefly), it would be a
shame to leave unmentioned a subject that connects the two particularly
closely: the \textit{integer-valued polynomials}. We are going to state a few
basic facts, but we will not prove them.

If $f=a_{k}x^{k}+a_{k-1}x^{k-1}+\cdots+a_{0}$ is a polynomial (in $1$ variable
$x$, with rational coefficients), then the rational numbers $a_{k}%
,a_{k-1},\ldots,a_{0}$ are called the \textit{coefficients} of $f$. The
coefficients of a polynomial $f$ are uniquely determined by $f$ (except for
the fact that we can always add terms of the form $0x^{\ell}$ and thus obtain
extra coefficients that are equal to $0$). (This fact is not obvious, given
our \textquotedblleft definition\textquotedblright\ of polynomials
above\footnote{For example, why cannot we start with (say) $6x^{2}+5x+4$, then
rewrite it as $\left(  2x+1\right)  \left(  3x+1\right)  +3$, then do some
other transformations (using commutativity, associativity and other laws), and
finally end up with a polynomial that has different coefficients (say,
$3x^{2}+9x+4$) ? We cannot, but it is not easy to prove with what we have.}.
We will later define polynomials more formally as sequences of coefficients;
then this will become clear.)

If $f=a_{k}x^{k}+a_{k-1}x^{k-1}+\cdots+a_{0}$ is a polynomial (in $1$ variable
$x$, with rational coefficients) such that $a_{k}\neq0$ (each polynomial that
is not just $0$ can be uniquely written in such a form), then the integer $k$
is called the \textit{degree} of $f$.

\begin{definition}
\label{def.ivp.ivp}A polynomial $P$ with rational coefficients is said to be
\textit{integer-valued} if $\left(  P\left(  n\right)  \in\mathbb{Z}\text{ for
all }n\in\mathbb{Z}\right)  $.
\end{definition}

Of course, a polynomial with integer coefficients is always integer-valued.
But there are other integer-valued polynomials, too:

\begin{example}
\label{exa.ivp.ivps1}\textbf{(a)} The polynomial $\dbinom{x}{2}=\dfrac
{x\left(  x-1\right)  }{2}=\dfrac{1}{2}x^{2}-\dfrac{1}{2}x$ is integer-valued
(since $\dbinom{n}{2}\in\mathbb{Z}$ for each $n\in\mathbb{Z}$), but its
coefficients are $\dfrac{1}{2},-\dfrac{1}{2},0$.

\textbf{(b)} More generally: If $k\in\mathbb{N}$ is arbitrary, then the
polynomial $\dbinom{x}{k}=\dfrac{x\left(  x-1\right)  \left(  x-2\right)
\cdots\left(  x-k+1\right)  }{k!}$ is integer-valued (since $\dbinom{n}{k}%
\in\mathbb{Z}$ for each $n\in\mathbb{Z}$).

\textbf{(c)} If $p$ is any prime, then the polynomial $\dfrac{x^{p}-x}{p}$ is
integer-valued (since Theorem \ref{thm.ent.fermat} \textbf{(b)} yields
$a^{p}\equiv a\operatorname{mod}p$ for each $a\in\mathbb{Z}$, which means that
$\dfrac{a^{p}-a}{p}\in\mathbb{Z}$ for each $a\in\mathbb{Z}$). Its coefficients
are not integers.
\end{example}

This suggests the following question\textbf{:} How can we describe the
integer-valued polynomials? The following result of P\'{o}lya \cite{Polya19}
gives an answer:

\begin{theorem}
\label{thm.ivp.binomial}Let $k\in\mathbb{N}$.

\textbf{(a)} Any polynomial $P$ (in $1$ variable $x$, with rational
coefficients) of degree $k$ can be uniquely written in the form%
\[
P\left(  x\right)  =a_{k}\dbinom{x}{k}+a_{k-1}\dbinom{x}{k-1}+\cdots
+a_{0}\dbinom{x}{0}%
\]
with \textbf{rational} $a_{k},a_{k-1},\ldots,a_{0}$.

\textbf{(b)} The polynomial $P$ is integer-valued if and only if these
$a_{k},a_{k-1},\ldots,a_{0}$ are integers.
\end{theorem}

For example, the integer-valued polynomial $\dfrac{x^{3}-x}{3}$ can be written
as%
\[
\dfrac{x^{3}-x}{3}=a_{3}\dbinom{x}{3}+a_{2}\dbinom{x}{2}+a_{1}\dbinom{x}%
{1}+a_{0}\dbinom{x}{0}%
\]
for
\[
a_{3}=2,\ \ \ \ \ \ \ \ \ \ a_{2}=2,\ \ \ \ \ \ \ \ \ \ a_{1}%
=0,\ \ \ \ \ \ \ \ \ \ a_{0}=0.
\]
These $a_{3},a_{2},a_{1},a_{0}$ are integers -- exactly as Theorem
\ref{thm.ivp.binomial} \textbf{(b)} says.

I sketched a proof of Theorem \ref{thm.ivp.binomial} \textbf{(b)} in a talk in
2013 ( \url{https://www.cip.ifi.lmu.de/~grinberg/storrs2013.pdf} )\footnote{In
this talk, I refer to integer-valued polynomials as \textquotedblleft
integral-valued polynomials\textquotedblright.}. See also \cite{daSilv12} for
a self-contained proof.

\subsection{Counting divisors}

\subsubsection{The number of divisors of $n$}

Now that we have seen some combinatorial reasoning (e.g., in the proof of
Theorem \ref{thm.binom.vandermonde}), let us solve a rather natural counting
problem: Let us count the divisors of a nonzero integer $n$.

\begin{proposition}
\label{prop.ent.count-divs}Let $n\in\mathbb{Z}$ be nonzero. Then:

\textbf{(a)} The product $\prod_{p\text{ prime}}\left(  v_{p}\left(  n\right)
+1\right)  $ is well-defined, since all but finitely many of its factors are
$1$.

\textbf{(b)} We have
\[
\left(  \text{the number of positive divisors of }n\right)  =\prod_{p\text{
prime}}\left(  v_{p}\left(  n\right)  +1\right)  .
\]


\textbf{(c)} We have%
\[
\left(  \text{the number of divisors of }n\right)  =2\prod_{p\text{ prime}%
}\left(  v_{p}\left(  n\right)  +1\right)  .
\]

\end{proposition}

\begin{example}
If $n=12$, then
\[
\left(  \text{the number of positive divisors of }n\right)  =6
\]
(since the positive divisors of $n=12$ are $1,2,3,4,6,12$) and%
\begin{align*}
\prod_{p\text{ prime}}\left(  v_{p}\left(  n\right)  +1\right)   &  =\left(
\underbrace{v_{2}\left(  n\right)  }_{=2}+1\right)  \left(  \underbrace{v_{3}%
\left(  n\right)  }_{=1}+1\right)  \prod_{\substack{p\text{ prime;}%
\\p\notin\left\{  2,3\right\}  }}\left(  \underbrace{v_{p}\left(  n\right)
}_{=0}+1\right) \\
&  =\left(  2+1\right)  \left(  1+1\right)  \underbrace{\prod
_{\substack{p\text{ prime;}\\p\notin\left\{  2,3\right\}  }}1}_{=1}=\left(
2+1\right)  \left(  1+1\right)  =6.
\end{align*}
This confirms Proposition \ref{prop.ent.count-divs} \textbf{(b)} for $n=12$.
In order to confirm Proposition \ref{prop.ent.count-divs} \textbf{(c)} for
$n=12$ as well, we observe that $\left(  \text{the number of divisors of
}n\right)  =12$ (since the divisors of $n=12$ are
$-12,-6,-4,-3,-2,-1,1,2,3,4,6,12$).
\end{example}

The function
\begin{align*}
\left\{  1,2,3,\ldots\right\}   &  \rightarrow\mathbb{N},\\
n  &  \mapsto\left(  \text{the number of positive divisors of }n\right)
\end{align*}
is known as \href{https://en.wikipedia.org/wiki/Divisor_function}{the
\textit{divisor function}} and is commonly denoted by $\tau$. So Proposition
\ref{prop.ent.count-divs} \textbf{(b)} gives a formula for $\tau\left(
n\right)  $. See \cite[Theorem 2.1.7 (proof sketched in \S 2.7)]{floor} for a
different proof of this formula.

\begin{noncompile}
Sketch of an old proof of Proposition \ref{prop.ent.count-divs} \textbf{(b)}:

Consider the set $\prod_{p\text{ prime}}\left\{  0,1,\ldots,v_{p}\left(
n\right)  \right\}  $. This is the set of all families $\left(  a_{p}\right)
_{p\text{ prime}}$ indexed by all the primes such that $a_{p}\in\left\{
0,1,\ldots,v_{p}\left(  n\right)  \right\}  $ for each prime $p$. (You can
regard these families as sequences $\left(  a_{2},a_{3},a_{5},a_{7}%
,a_{11},\ldots\right)  $ of nonnegative integers.)

Consider the bijection%
\begin{align*}
M:\prod_{p\text{ prime}}\left\{  0,1,\ldots,v_{p}\left(  n\right)  \right\}
&  \rightarrow\left\{  \text{positive divisors of }n\right\}  ,\\
\left(  a_{p}\right)  _{p\text{ prime}}  &  \mapsto\prod_{p\text{ prime}%
}p^{a_{p}}%
\end{align*}
with inverse map%
\begin{align*}
\left\{  \text{positive divisors of }n\right\}   &  \rightarrow\prod_{p\text{
prime}}\left\{  0,1,\ldots,v_{p}\left(  n\right)  \right\}  ,\\
d  &  \mapsto\left(  v_{p}\left(  d\right)  \right)  _{p\text{ prime}}.
\end{align*}

\end{noncompile}

Our proof of Proposition \ref{prop.ent.count-divs} will rely on the following
lemma, which classifies all divisors of a positive integer in terms of its
prime factorization:

\begin{lemma}
\label{lem.ent.divs-bijs}Let $p_{1},p_{2},\ldots,p_{u}$ be finitely many
distinct primes. For each $i\in\left\{  1,2,\ldots,u\right\}  $, let $a_{i}$
be a nonnegative integer. Let $n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}%
^{a_{u}}$.

Define a set $T$ by%
\begin{align*}
T  &  =\left\{  0,1,\ldots,a_{1}\right\}  \times\left\{  0,1,\ldots
,a_{2}\right\}  \times\cdots\times\left\{  0,1,\ldots,a_{u}\right\} \\
&  =\left\{  \left(  b_{1},b_{2},\ldots,b_{u}\right)  \ \mid\text{ }b_{i}%
\in\left\{  0,1,\ldots,a_{i}\right\}  \text{ for each }i\in\left\{
1,2,\ldots,u\right\}  \right\} \\
&  =\left\{  \left(  b_{1},b_{2},\ldots,b_{u}\right)  \in\mathbb{N}^{u}%
\ \mid\ b_{i}\leq a_{i}\text{ for each }i\in\left\{  1,2,\ldots,u\right\}
\right\}  .
\end{align*}
Then, the map%
\begin{align*}
\Lambda:T  &  \rightarrow\left\{  \text{positive divisors of }n\right\}  ,\\
\left(  b_{1},b_{2},\ldots,b_{u}\right)   &  \mapsto p_{1}^{b_{1}}p_{2}%
^{b_{2}}\cdots p_{u}^{b_{u}}%
\end{align*}
is well-defined and bijective.
\end{lemma}

\begin{example}
For this example, let $u=2$, $p_{1}=2$, $p_{2}=3$, $a_{1}=2$ and $a_{2}=1$.
Define the integer $n$ and the set $T$ as in Lemma \ref{lem.ent.divs-bijs};
then,%
\[
n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}=2^{2}\cdot3^{1}=12
\]
and%
\begin{align*}
T  &  =\left\{  0,1,\ldots,a_{1}\right\}  \times\left\{  0,1,\ldots
,a_{2}\right\}  \times\cdots\times\left\{  0,1,\ldots,a_{u}\right\}  =\left\{
0,1,2\right\}  \times\left\{  0,1\right\} \\
&  =\left\{  \left(  0,0\right)  ,\left(  0,1\right)  ,\left(  1,0\right)
,\left(  1,1\right)  ,\left(  2,0\right)  ,\left(  2,1\right)  \right\}  .
\end{align*}
Now, Lemma \ref{lem.ent.divs-bijs} says that the map
\begin{align*}
\Lambda:T  &  \rightarrow\left\{  \text{positive divisors of }n\right\}  ,\\
\left(  b_{1},b_{2},\ldots,b_{u}\right)   &  \mapsto p_{1}^{b_{1}}p_{2}%
^{b_{2}}\cdots p_{u}^{b_{u}}%
\end{align*}
is well-defined and bijective. Here is a table of values of this map $\Lambda
$:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c||}\hline
$\mathbf{b}$ & $\left(  0,0\right)  $ & $\left(  0,1\right)  $ & $\left(
1,0\right)  $ & $\left(  1,1\right)  $ & $\left(  2,0\right)  $ & $\left(
2,1\right)  $\\\hline
$\Lambda\left(  \mathbf{b}\right)  $ & $1$ & $3$ & $2$ & $6$ & $4$ &
$12$\\\hline
\end{tabular}
\ .\
\]

\end{example}

\begin{proof}
[Proof of Lemma \ref{lem.ent.divs-bijs}.]The numbers $p_{1},p_{2},\ldots
,p_{u}$ are primes, and thus positive integers. Hence, the product
$p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}$ is a positive integer as well
(since $a_{1},a_{2},\ldots,a_{u}$ are nonnegative integers). In other words,
$n$ is a positive integer (since $n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots
p_{u}^{a_{u}}$). Note that%
\[
n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}=\prod_{i=1}^{u}p_{i}^{a_{i}%
}.
\]
Each $i\in\left\{  1,2,\ldots,u\right\}  $ satisfies%
\begin{equation}
v_{p_{i}}\left(  \underbrace{n}_{=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots
p_{u}^{a_{u}}}\right)  =v_{p_{i}}\left(  p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots
p_{u}^{a_{u}}\right)  =a_{i} \label{pf.lem.ent.divs-bijs.vpi}%
\end{equation}
(by Exercise \ref{exe.ent.prime.p1a1puau} \textbf{(a)}). Furthermore, if $p$
is a prime satisfying $p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  $,
then%
\begin{equation}
v_{p}\left(  \underbrace{n}_{=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}%
}\right)  =v_{p}\left(  p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}\right)
=0 \label{pf.lem.ent.divs-bijs.vp}%
\end{equation}
(by Exercise \ref{exe.ent.prime.p1a1puau} \textbf{(b)}).

For each $\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in T$, we have%
\begin{equation}
p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}\in\left\{  \text{positive
divisors of }n\right\}  . \label{pf.lem.ent.divs-bijs.wd}%
\end{equation}


\begin{fineprint}
[\textit{Proof of (\ref{pf.lem.ent.divs-bijs.wd}):} Let $\left(  b_{1}%
,b_{2},\ldots,b_{u}\right)  \in T$. We must prove
(\ref{pf.lem.ent.divs-bijs.wd}).

We have $\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in T=\left\{
0,1,\ldots,a_{1}\right\}  \times\left\{  0,1,\ldots,a_{2}\right\}
\times\cdots\times\left\{  0,1,\ldots,a_{u}\right\}  $. In other words,
$b_{i}\in\left\{  0,1,\ldots,a_{i}\right\}  $ for each $i\in\left\{
1,2,\ldots,u\right\}  $. Hence, for each $i\in\left\{  1,2,\ldots,u\right\}
$, we have%
\begin{align*}
a_{i}-b_{i}  &  \in\left\{  0,1,\ldots,a_{i}\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }b_{i}\in\left\{  0,1,\ldots
,a_{i}\right\}  \right) \\
&  \subseteq\mathbb{N},
\end{align*}
and thus $p_{i}^{a_{i}-b_{i}}$ is an integer. Hence, $\prod_{i=1}^{u}%
p_{i}^{a_{i}-b_{i}}$ is a product of integers, and thus is an integer as well.
Likewise, $\prod_{i=1}^{u}p_{i}^{b_{i}}$ is an integer (since $b_{i}%
\in\left\{  0,1,\ldots,a_{i}\right\}  \subseteq\mathbb{N}$ for each
$i\in\left\{  1,2,\ldots,u\right\}  $). Now,%
\[
n=\prod_{i=1}^{u}\underbrace{p_{i}^{a_{i}}}_{\substack{=p_{i}^{b_{i}+\left(
a_{i}-b_{i}\right)  }\\=p_{i}^{b_{i}}p_{i}^{a_{i}-b_{i}}}}=\prod_{i=1}%
^{u}\left(  p_{i}^{b_{i}}p_{i}^{a_{i}-b_{i}}\right)  =\left(  \prod_{i=1}%
^{u}p_{i}^{b_{i}}\right)  \left(  \prod_{i=1}^{u}p_{i}^{a_{i}-b_{i}}\right)
.
\]
Thus, $\prod_{i=1}^{u}p_{i}^{b_{i}}\mid n$ (since $\prod_{i=1}^{u}p_{i}%
^{a_{i}-b_{i}}$ is an integer). In other words, $\prod_{i=1}^{u}p_{i}^{b_{i}}$
is a divisor of $n$. Hence, $\prod_{i=1}^{u}p_{i}^{b_{i}}$ is a positive
divisor of $n$ (since $\prod_{i=1}^{u}p_{i}^{b_{i}}$ is clearly positive). In
other words, $\prod_{i=1}^{u}p_{i}^{b_{i}}\in\left\{  \text{positive divisors
of }n\right\}  $. Hence, $p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}%
=\prod_{i=1}^{u}p_{i}^{b_{i}}\in\left\{  \text{positive divisors of
}n\right\}  $. This proves (\ref{pf.lem.ent.divs-bijs.wd}).]
\end{fineprint}

The equality (\ref{pf.lem.ent.divs-bijs.wd}) shows that the map $\Lambda$ in
Lemma \ref{lem.ent.divs-bijs} is well-defined. It remains to prove that it is bijective.

We shall achieve this by constructing an inverse to $\Lambda$.

Indeed, for each $d\in\left\{  \text{positive divisors of }n\right\}  $, we
have%
\begin{equation}
\left(  v_{p_{1}}\left(  d\right)  ,v_{p_{2}}\left(  d\right)  ,\ldots
,v_{p_{u}}\left(  d\right)  \right)  \in T. \label{pf.lem.ent.divs-bijs.Vwd}%
\end{equation}


\begin{fineprint}
[\textit{Proof of (\ref{pf.lem.ent.divs-bijs.Vwd}):} Let $d\in\left\{
\text{positive divisors of }n\right\}  $. Thus, $d$ is a positive divisor of
$n$. In other words, $d$ is a positive integer satisfying $d\mid n$.

Fix $i\in\left\{  1,2,\ldots,u\right\}  $. We shall show that $v_{p_{i}%
}\left(  d\right)  \in\left\{  0,1,\ldots,a_{i}\right\}  $.

The integer $d$ is positive and thus nonzero. Hence, $v_{p_{i}}\left(
d\right)  \in\mathbb{N}$. But Proposition \ref{prop.ent.prime.n|m} (applied to
$d$ and $n$ instead of $n$ and $m$) shows that $d\mid n$ if and only if each
prime $p$ satisfies $v_{p}\left(  d\right)  \leq v_{p}\left(  n\right)  $.
Thus, each prime $p$ satisfies $v_{p}\left(  d\right)  \leq v_{p}\left(
n\right)  $ (since $d\mid n$). Applying this to $p=p_{i}$, we obtain
$v_{p_{i}}\left(  d\right)  \leq v_{p_{i}}\left(  n\right)  =a_{i}$ (by
(\ref{pf.lem.ent.divs-bijs.vpi})). Hence, $v_{p_{i}}\left(  d\right)
\in\left\{  0,1,\ldots,a_{i}\right\}  $ (since $v_{p_{i}}\left(  d\right)
\in\mathbb{N}$).

Now, forget that we fixed $i$. We thus have shown that $v_{p_{i}}\left(
d\right)  \in\left\{  0,1,\ldots,a_{i}\right\}  $ for each $i\in\left\{
1,2,\ldots,u\right\}  $. In other words,%
\[
\left(  v_{p_{1}}\left(  d\right)  ,v_{p_{2}}\left(  d\right)  ,\ldots
,v_{p_{u}}\left(  d\right)  \right)  \in\left\{  0,1,\ldots,a_{1}\right\}
\times\left\{  0,1,\ldots,a_{2}\right\}  \times\cdots\times\left\{
0,1,\ldots,a_{u}\right\}  .
\]
This rewrites as $\left(  v_{p_{1}}\left(  d\right)  ,v_{p_{2}}\left(
d\right)  ,\ldots,v_{p_{u}}\left(  d\right)  \right)  \in T$ (since
$T=\left\{  0,1,\ldots,a_{1}\right\}  \times\left\{  0,1,\ldots,a_{2}\right\}
\times\cdots\times\left\{  0,1,\ldots,a_{u}\right\}  $). Thus,
(\ref{pf.lem.ent.divs-bijs.Vwd}) is proven.]
\end{fineprint}

We now define a map%
\begin{align*}
V:\left\{  \text{positive divisors of }n\right\}   &  \rightarrow T,\\
d  &  \mapsto\left(  v_{p_{1}}\left(  d\right)  ,v_{p_{2}}\left(  d\right)
,\ldots,v_{p_{u}}\left(  d\right)  \right)  .
\end{align*}
This map is well-defined, because of (\ref{pf.lem.ent.divs-bijs.Vwd}).

Now, we claim that $\Lambda\circ V=\operatorname*{id}$.

\begin{fineprint}
[\textit{Proof:} Let $d\in\left\{  \text{positive divisors of }n\right\}  $.
We shall show that $\left(  \Lambda\circ V\right)  \left(  d\right)
=\operatorname*{id}\left(  d\right)  $.

Indeed, $d$ is a positive divisor of $n$ (since $d\in\left\{  \text{positive
divisors of }n\right\}  $). Hence, $d$ is a positive integer and satisfies
$d\mid n$. But Proposition \ref{prop.ent.prime.n|m} (applied to $d$ and $n$
instead of $n$ and $m$) shows that $d\mid n$ if and only if each prime $p$
satisfies $v_{p}\left(  d\right)  \leq v_{p}\left(  n\right)  $. Thus, each
prime $p$ satisfies $v_{p}\left(  d\right)  \leq v_{p}\left(  n\right)  $
(since $d\mid n$). Hence, if $p$ is a prime satisfying $p\notin\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  $, then we have%
\[
v_{p}\left(  d\right)  \leq v_{p}\left(  n\right)
=0\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.lem.ent.divs-bijs.vp}%
)}\right)
\]
and therefore
\[
v_{p}\left(  d\right)  =0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }v_{p}\left(
d\right)  \in\mathbb{N}\cup\left\{  \infty\right\}  \text{ and }v_{p}\left(
d\right)  \leq0\right)
\]
and therefore%
\begin{equation}
p^{v_{p}\left(  d\right)  }=p^{0}=1. \label{pf.lem.ent.divs-bijs.LVid.pf.2}%
\end{equation}


The elements $p_{1},p_{2},\ldots,p_{u}$ are distinct. Thus, the map $\left\{
1,2,\ldots,u\right\}  \rightarrow\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
,\ i\mapsto p_{i}$ is a bijection\footnote{Indeed, this map is injective,
since the elements $p_{1},p_{2},\ldots,p_{u}$ are distinct; and it is
surjective, since its image is clearly $\left\{  p_{1},p_{2},\ldots
,p_{u}\right\}  $.}.

But $d$ is a positive integer. Thus, Corollary \ref{cor.ent.prime.can-fac}
(applied to $d$ instead of $n$) yields
\begin{align*}
d  &  =\prod_{p\text{ prime}}p^{v_{p}\left(  d\right)  }=\left(
\prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2},\ldots
,p_{u}\right\}  }}p^{v_{p}\left(  d\right)  }\right)  \left(  \prod
_{\substack{p\text{ prime;}\\p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}}\underbrace{p^{v_{p}\left(  d\right)  }}_{\substack{=1\\\text{(by
(\ref{pf.lem.ent.divs-bijs.LVid.pf.2}))}}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each prime }p\text{ satisfies either }p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\} \\
\text{or }p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  \text{ (but not
both simultaneously)}%
\end{array}
\right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}p^{v_{p}\left(  d\right)  }\right)
\underbrace{\left(  \prod_{\substack{p\text{ prime;}\\p\notin\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  }}1\right)  }_{=1}=\underbrace{\prod
_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}}}_{\substack{=\prod_{p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}\\\text{(since each }p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
\\\text{is a prime)}}}p^{v_{p}\left(  d\right)  }\\
&  =\prod_{p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  }p^{v_{p}\left(
d\right)  }=\prod_{i=1}^{u}p_{i}^{v_{p_{i}}\left(  d\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }p_{i}\text{ for }p\text{ in the product,}\\
\text{since the map }\left\{  1,2,\ldots,u\right\}  \rightarrow\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  ,\ i\mapsto p_{i}\text{ is a bijection}%
\end{array}
\right)  .
\end{align*}
Comparing this with%
\begin{align*}
\left(  \Lambda\circ V\right)  \left(  d\right)   &  =\Lambda\left(
\underbrace{V\left(  d\right)  }_{\substack{=\left(  v_{p_{1}}\left(
d\right)  ,v_{p_{2}}\left(  d\right)  ,\ldots,v_{p_{u}}\left(  d\right)
\right)  \\\text{(by the definition of }V\text{)}}}\right)  =\Lambda\left(
\left(  v_{p_{1}}\left(  d\right)  ,v_{p_{2}}\left(  d\right)  ,\ldots
,v_{p_{u}}\left(  d\right)  \right)  \right) \\
&  =p_{1}^{v_{p_{1}}\left(  d\right)  }p_{2}^{v_{p_{2}}\left(  d\right)
}\cdots p_{u}^{v_{p_{u}}\left(  d\right)  }=\prod_{i=1}^{u}p_{i}^{v_{p_{i}%
}\left(  d\right)  },
\end{align*}
we obtain $\left(  \Lambda\circ V\right)  \left(  d\right)
=d=\operatorname*{id}\left(  d\right)  $.

Now, forget that we fixed $d$. We thus have shown that $\left(  \Lambda\circ
V\right)  \left(  d\right)  =\operatorname*{id}\left(  d\right)  $ for each
$d\in\left\{  \text{positive divisors of }n\right\}  $. In other words,
$\Lambda\circ V=\operatorname*{id}$.]
\end{fineprint}

Next, we claim that $V\circ\Lambda=\operatorname*{id}$.

\begin{fineprint}
[\textit{Proof:} Let $\mathbf{b}\in T$. We shall show that $\left(
V\circ\Lambda\right)  \left(  \mathbf{b}\right)  =\operatorname*{id}\left(
\mathbf{b}\right)  $.

Indeed, we have $\mathbf{b}\in T=\left\{  0,1,\ldots,a_{1}\right\}
\times\left\{  0,1,\ldots,a_{2}\right\}  \times\cdots\times\left\{
0,1,\ldots,a_{u}\right\}  $. Thus, $\mathbf{b}$ is a $u$-tuple of nonnegative
integers. Hence, write $\mathbf{b}$ in the form $\mathbf{b}=\left(
b_{1},b_{2},\ldots,b_{u}\right)  $ for some $u$ nonnegative integers
$b_{1},b_{2},\ldots,b_{u}$. Then, the definition of $\Lambda$ yields
$\Lambda\left(  \mathbf{b}\right)  =p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots
p_{u}^{b_{u}}$. Hence, for each $i\in\left\{  1,2,\ldots,u\right\}  $, we have%
\[
v_{p_{i}}\left(  \underbrace{\Lambda\left(  \mathbf{b}\right)  }%
_{=p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}}\right)  =v_{p_{i}}\left(
p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}\right)  =b_{i}%
\]
(by Exercise \ref{exe.ent.prime.p1a1puau} \textbf{(a)}, applied to $b_{i}$
instead of $a_{i}$). In other words,%
\[
\left(  v_{p_{1}}\left(  \Lambda\left(  \mathbf{b}\right)  \right)  ,v_{p_{2}%
}\left(  \Lambda\left(  \mathbf{b}\right)  \right)  ,\ldots,v_{p_{u}}\left(
\Lambda\left(  \mathbf{b}\right)  \right)  \right)  =\left(  b_{1}%
,b_{2},\ldots,b_{u}\right)  .
\]
Now,%
\begin{align*}
\left(  V\circ\Lambda\right)  \left(  \mathbf{b}\right)   &  =V\left(
\Lambda\left(  \mathbf{b}\right)  \right) \\
&  =\left(  v_{p_{1}}\left(  \Lambda\left(  \mathbf{b}\right)  \right)
,v_{p_{2}}\left(  \Lambda\left(  \mathbf{b}\right)  \right)  ,\ldots,v_{p_{u}%
}\left(  \Lambda\left(  \mathbf{b}\right)  \right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }V\right) \\
&  =\left(  b_{1},b_{2},\ldots,b_{u}\right)  =\mathbf{b}=\operatorname*{id}%
\left(  \mathbf{b}\right)  .
\end{align*}


Now, forget that we fixed $\mathbf{b}$. We have thus proven that $\left(
V\circ\Lambda\right)  \left(  \mathbf{b}\right)  =\operatorname*{id}\left(
\mathbf{b}\right)  $ for each $\mathbf{b}\in T$. In other words,
$V\circ\Lambda=\operatorname*{id}$.]
\end{fineprint}

We have now proven the equalities $\Lambda\circ V=\operatorname*{id}$ and
$V\circ\Lambda=\operatorname*{id}$. These equalities show that the maps
$\Lambda$ and $V$ are mutually inverse. Hence, the map $\Lambda$ is
invertible, i.e., bijective. This completes the proof of Lemma
\ref{lem.ent.divs-bijs}.
\end{proof}

\begin{proof}
[Proof of Proposition \ref{prop.ent.count-divs}.]The integer $\left\vert
n\right\vert $ is positive (since $n$ is nonzero) and thus nonzero. We observe
that%
\begin{equation}
\left\{  \text{positive divisors of }\left\vert n\right\vert \right\}
=\left\{  \text{positive divisors of }n\right\}
\label{pf.prop.ent.count-divs.abs-1}%
\end{equation}
\footnote{\textit{Proof of (\ref{pf.prop.ent.count-divs.abs-1}):} Let
$d\in\left\{  \text{positive divisors of }\left\vert n\right\vert \right\}  $.
Thus, $d$ is a positive divisor of $\left\vert n\right\vert $. In other words,
$d$ is a positive integer and satisfies $d\mid\left\vert n\right\vert $. But
$\left\vert n\right\vert \mid n$ (by Exercise \ref{exe.ent.div.aabs}
\textbf{(b)}, applied to $a=n$). Hence, Proposition \ref{prop.ent.div.2}
\textbf{(b)} (applied to $a=d$, $b=\left\vert n\right\vert $ and $c=n$) shows
that $d\mid n$. Thus, $d$ is a positive integer and satisfies $d\mid n$. In
other words, $d$ is a positive divisor of $n$. In other words, $d\in\left\{
\text{positive divisors of }n\right\}  $.
\par
Now, forget that we fixed $d$. We thus have proven that $d\in\left\{
\text{positive divisors of }n\right\}  $ for each $d\in\left\{  \text{positive
divisors of }\left\vert n\right\vert \right\}  $. In other words,%
\begin{equation}
\left\{  \text{positive divisors of }\left\vert n\right\vert \right\}
\subseteq\left\{  \text{positive divisors of }n\right\}  .
\label{pf.prop.ent.count-divs.abs-1.pf.1}%
\end{equation}
\par
Let $e\in\left\{  \text{positive divisors of }n\right\}  $. Thus, $e$ is a
positive divisor of $n$. In other words, $e$ is a positive integer and
satisfies $e\mid n$. But $n\mid\left\vert n\right\vert $ (by Exercise
\ref{exe.ent.div.aabs} \textbf{(a)}, applied to $a=n$). Hence, Proposition
\ref{prop.ent.div.2} \textbf{(b)} (applied to $a=e$, $b=n$ and $c=\left\vert
n\right\vert $) shows that $e\mid\left\vert n\right\vert $. Thus, $e$ is a
positive integer and satisfies $e\mid\left\vert n\right\vert $. In other
words, $e$ is a positive divisor of $\left\vert n\right\vert $. In other
words, $e\in\left\{  \text{positive divisors of }\left\vert n\right\vert
\right\}  $.
\par
Now, forget that we fixed $e$. We thus have proven that $e\in\left\{
\text{positive divisors of }\left\vert n\right\vert \right\}  $ for each
$e\in\left\{  \text{positive divisors of }n\right\}  $. In other words,%
\[
\left\{  \text{positive divisors of }n\right\}  \subseteq\left\{
\text{positive divisors of }\left\vert n\right\vert \right\}  .
\]
Combining this with (\ref{pf.prop.ent.count-divs.abs-1.pf.1}), we obtain
$\left\{  \text{positive divisors of }\left\vert n\right\vert \right\}
=\left\{  \text{positive divisors of }n\right\}  $. Thus,
(\ref{pf.prop.ent.count-divs.abs-1}) is proven.}. Hence,%
\begin{align}
&  \left(  \text{the number of positive divisors of }\left\vert n\right\vert
\right) \nonumber\\
&  =\left(  \text{the number of positive divisors of }n\right)  .
\label{pf.prop.ent.count-divs.abs-2}%
\end{align}
The same argument (but with the word \textquotedblleft
positive\textquotedblright\ removed) yields%
\begin{equation}
\left(  \text{the number of divisors of }\left\vert n\right\vert \right)
=\left(  \text{the number of divisors of }n\right)  .
\label{pf.prop.ent.count-divs.abs-3}%
\end{equation}
Finally, Exercise \ref{exe.ent.prime.vp-abs} yields that
\begin{equation}
v_{p}\left(  \left\vert n\right\vert \right)  =v_{p}\left(  n\right)
\ \ \ \ \ \ \ \ \ \ \text{for each prime }p.
\label{pf.prop.ent.count-divs.abs-4}%
\end{equation}


The claim of Proposition \ref{prop.ent.count-divs} does not change if we
replace $n$ by $\left\vert n\right\vert $ (because of
(\ref{pf.prop.ent.count-divs.abs-2}), (\ref{pf.prop.ent.count-divs.abs-3}) and
(\ref{pf.prop.ent.count-divs.abs-4})). Thus, we can WLOG assume that $n\geq0$
(since otherwise, we can just replace $n$ by $\left\vert n\right\vert $).
Assume this. Combining $n\neq0$ (since $n$ is nonzero) with $n\geq0$, we find
$n>0$. Hence, $n$ is a positive integer.

\textbf{(a)} For every prime $p>\left\vert n\right\vert $, we have
$v_{p}\left(  n\right)  =0$ (by Lemma \ref{lem.ent.prime.vpn=0} \textbf{(a)})
and thus $\underbrace{v_{p}\left(  n\right)  }_{=0}+1=1$. Thus, all but
finitely many primes $p$ satisfy $v_{p}\left(  n\right)  +1=1$ (since all but
finitely many primes $p$ satisfy $p>\left\vert n\right\vert $). Therefore, all
but finitely many factors of the product $\prod_{p\text{ prime}}\left(
v_{p}\left(  n\right)  +1\right)  $ are $1$. In other words, the product
$\prod_{p\text{ prime}}\left(  v_{p}\left(  n\right)  +1\right)  $ has only
finitely many factors different from $1$. Hence, this product is well-defined.
This proves Proposition \ref{prop.ent.count-divs} \textbf{(a)}.

\textbf{(b)} For every prime $p>\left\vert n\right\vert $, we have
$v_{p}\left(  n\right)  =0$ (by Lemma \ref{lem.ent.prime.vpn=0} \textbf{(a)}).
Thus, all but finitely many primes $p$ satisfy $v_{p}\left(  n\right)  =0$
(since all but finitely many primes $p$ satisfy $p>\left\vert n\right\vert $).
In other words, the set of all primes $p$ satisfying $v_{p}\left(  n\right)
\neq0$ is finite. Let $P$ be this set. Thus, $P$ is finite.

Let $\left(  p_{1},p_{2},\ldots,p_{u}\right)  $ be a list of elements of $P$,
with no repetitions.\footnote{Such a list exists, since $P$ is finite.} Thus,
\[
\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  =P.
\]
The elements $p_{1},p_{2},\ldots,p_{u}$ are distinct (since $\left(
p_{1},p_{2},\ldots,p_{u}\right)  $ is a list with no repetitions). Thus, the
map $\left\{  1,2,\ldots,u\right\}  \rightarrow\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  ,\ i\mapsto p_{i}$ is a bijection\footnote{Indeed, this
map is injective, since the elements $p_{1},p_{2},\ldots,p_{u}$ are distinct;
and it is surjective, since its image is clearly $\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  $.}. Moreover, the elements $p_{1},p_{2},\ldots,p_{u}$
belong to $\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  =P$, and thus are primes
(since $P$ is a set of primes).

If $p$ is a prime such that $p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
$, then
\begin{equation}
v_{p}\left(  n\right)  =0. \label{pf.prop.ent.count-divs.vpn=0}%
\end{equation}


\begin{fineprint}
[\textit{Proof of (\ref{pf.prop.ent.count-divs.vpn=0}):} Recall that $P$ is
the set of all primes $p$ satisfying $v_{p}\left(  n\right)  \neq0$ (by the
definition of $P$). Hence, every prime $p$ satisfying $v_{p}\left(  n\right)
\neq0$ must belong to $P$. Thus, if $p$ is a prime that does not belong to
$P$, then $p$ cannot satisfy $v_{p}\left(  n\right)  \neq0$. In other words,
if $p$ is a prime that does not belong to $P$, then $p$ must satisfy
$v_{p}\left(  n\right)  =0$. In other words, if $p$ is a prime such that
$p\notin P$, then $v_{p}\left(  n\right)  =0$. Since $\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  =P$, this rewrites as follows: If $p$ is a prime
such that $p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  $, then
$v_{p}\left(  n\right)  =0$. This proves (\ref{pf.prop.ent.count-divs.vpn=0}).]
\end{fineprint}

If $p$ is a prime such that $p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
$, then%
\begin{align}
p^{v_{p}\left(  n\right)  }  &  =p^{0}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
(\ref{pf.prop.ent.count-divs.vpn=0}) yields }v_{p}\left(  n\right)  =0\right)
\nonumber\\
&  =1 \label{pf.prop.ent.count-divs.pvpn=1}%
\end{align}
and%
\begin{equation}
\underbrace{v_{p}\left(  n\right)  }_{\substack{=0\\\text{(by
(\ref{pf.prop.ent.count-divs.vpn=0}))}}}+1=1.
\label{pf.prop.ent.count-divs.vpn+1=1}%
\end{equation}


For each $i\in\left\{  1,2,\ldots,u\right\}  $, define a nonnegative integer
$a_{i}$ by%
\begin{equation}
a_{i}=v_{p_{i}}\left(  n\right)  . \label{pf.prop.ent.count-divs.ai=}%
\end{equation}
This is well-defined, since $p_{i}$ is a prime (because $p_{1},p_{2}%
,\ldots,p_{u}$ are primes) and since $n$ is nonzero.

Define a set $T$ as in Lemma \ref{lem.ent.divs-bijs}.

Recall that $n$ is a positive integer. Thus, Corollary
\ref{cor.ent.prime.can-fac} yields%
\begin{align*}
n  &  =\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }=\left(
\prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2},\ldots
,p_{u}\right\}  }}p^{v_{p}\left(  n\right)  }\right)  \left(  \prod
_{\substack{p\text{ prime;}\\p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}}\underbrace{p^{v_{p}\left(  n\right)  }}_{\substack{=1\\\text{(by
(\ref{pf.prop.ent.count-divs.pvpn=1}))}}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each prime }p\text{ satisfies either }p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\} \\
\text{or }p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  \text{ (but not
both simultaneously)}%
\end{array}
\right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}p^{v_{p}\left(  n\right)  }\right)
\underbrace{\left(  \prod_{\substack{p\text{ prime;}\\p\notin\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  }}1\right)  }_{=1}=\underbrace{\prod
_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}}}_{\substack{=\prod_{p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}\\\text{(since each }p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
\\\text{is a prime)}}}p^{v_{p}\left(  n\right)  }\\
&  =\prod_{p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  }p^{v_{p}\left(
n\right)  }=\prod_{i=1}^{u}\underbrace{p_{i}^{v_{p_{i}}\left(  n\right)  }%
}_{\substack{=p_{i}^{a_{i}}\\\text{(since (\ref{pf.prop.ent.count-divs.ai=}%
)}\\\text{yields }v_{p_{i}}\left(  n\right)  =a_{i}\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }p_{i}\text{ for }p\text{ in the product,}\\
\text{since the map }\left\{  1,2,\ldots,u\right\}  \rightarrow\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  ,\ i\mapsto p_{i}\text{ is a bijection}%
\end{array}
\right) \\
&  =\prod_{i=1}^{u}p_{i}^{a_{i}}=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}%
^{a_{u}}.
\end{align*}
Hence, Lemma \ref{lem.ent.divs-bijs} shows that the map
\begin{align*}
\Lambda:T  &  \rightarrow\left\{  \text{positive divisors of }n\right\}  ,\\
\left(  b_{1},b_{2},\ldots,b_{u}\right)   &  \mapsto p_{1}^{b_{1}}p_{2}%
^{b_{2}}\cdots p_{u}^{b_{u}}%
\end{align*}
is well-defined and bijective.

Thus, there is a bijective map from $T$ to $\left\{  \text{positive divisors
of }n\right\}  $ (namely, $\Lambda$). Hence,
\begin{align*}
&  \left\vert \left\{  \text{positive divisors of }n\right\}  \right\vert \\
&  =\left\vert T\right\vert =\left\vert \left\{  0,1,\ldots,a_{1}\right\}
\times\left\{  0,1,\ldots,a_{2}\right\}  \times\cdots\times\left\{
0,1,\ldots,a_{u}\right\}  \right\vert \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }T=\left\{  0,1,\ldots
,a_{1}\right\}  \times\left\{  0,1,\ldots,a_{2}\right\}  \times\cdots
\times\left\{  0,1,\ldots,a_{u}\right\}  \right) \\
&  =\left\vert \left\{  0,1,\ldots,a_{1}\right\}  \right\vert \cdot\left\vert
\left\{  0,1,\ldots,a_{2}\right\}  \right\vert \cdot\cdots\cdot\left\vert
\left\{  0,1,\ldots,a_{u}\right\}  \right\vert \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the product rule }\left\vert A_{1}\times A_{2}\times\cdots\times
A_{u}\right\vert =\left\vert A_{1}\right\vert \cdot\left\vert A_{2}\right\vert
\cdot\cdots\cdot\left\vert A_{u}\right\vert \\
\text{holds whenever }A_{1},A_{2},\ldots,A_{u}\text{ are any }u\text{ finite
sets}%
\end{array}
\right) \\
&  =\prod_{i=1}^{u}\underbrace{\left\vert \left\{  0,1,\ldots,a_{i}\right\}
\right\vert }_{=a_{i}+1}=\prod_{i=1}^{u}\left(  a_{i}+1\right)  .
\end{align*}
Comparing this with%
\begin{align*}
&  \prod_{p\text{ prime}}\left(  v_{p}\left(  n\right)  +1\right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}\left(  v_{p}\left(  n\right)  +1\right)  \right)
\left(  \prod_{\substack{p\text{ prime;}\\p\notin\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}\underbrace{\left(  v_{p}\left(  n\right)  +1\right)
}_{\substack{=1\\\text{(by (\ref{pf.prop.ent.count-divs.vpn+1=1}))}}}\right)
\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each prime }p\text{ satisfies either }p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\} \\
\text{or }p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  \text{ (but not
both simultaneously)}%
\end{array}
\right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}\left(  v_{p}\left(  n\right)  +1\right)  \right)
\underbrace{\left(  \prod_{\substack{p\text{ prime;}\\p\notin\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  }}1\right)  }_{=1}=\underbrace{\prod
_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}}}_{\substack{=\prod_{p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}\\\text{(since each }p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
\\\text{is a prime)}}}\left(  v_{p}\left(  n\right)  +1\right) \\
&  =\prod_{p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  }\left(
v_{p}\left(  n\right)  +1\right)  =\prod_{i=1}^{u}\left(  \underbrace{v_{p_{i}%
}\left(  n\right)  }_{\substack{=a_{i}\\\text{(by
(\ref{pf.prop.ent.count-divs.ai=}))}}}+1\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }p_{i}\text{ for }p\text{ in the product,}\\
\text{since the map }\left\{  1,2,\ldots,u\right\}  \rightarrow\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  ,\ i\mapsto p_{i}\text{ is a bijection}%
\end{array}
\right) \\
&  =\prod_{i=1}^{u}\left(  a_{i}+1\right)  ,
\end{align*}
we obtain%
\[
\left\vert \left\{  \text{positive divisors of }n\right\}  \right\vert
=\prod_{p\text{ prime}}\left(  v_{p}\left(  n\right)  +1\right)  .
\]
Hence,%
\begin{align*}
\left(  \text{the number of positive divisors of }n\right)   &  =\left\vert
\left\{  \text{positive divisors of }n\right\}  \right\vert \\
&  =\prod_{p\text{ prime}}\left(  v_{p}\left(  n\right)  +1\right)  .
\end{align*}
This proves Proposition \ref{prop.ent.count-divs} \textbf{(b)}.

\textbf{(c)} Every divisor of $n$ is either positive or
negative\footnote{\textit{Proof.} Let $d$ be a divisor of $n$. We must prove
that $d$ is either positive or negative.
\par
We have $d\mid n$ (since $d$ is a divisor of $n$). Thus, there is an integer
$e$ such that $n=de$. Consider this $e$. If we had $d=0$, then we would have
$n=\underbrace{d}_{=0}e=0$, which would contradict the fact that $n$ is
nonzero. Hence, we cannot have $d=0$. In other words, we have $d\neq0$. Thus,
$d$ is a nonzero integer. Hence, $d$ is either positive or negative. Qed.}
(but clearly cannot be both at the same time). Hence,%
\begin{align*}
&  \left(  \text{the number of divisors of }n\right) \\
&  =\left(  \text{the number of positive divisors of }n\right)  +\left(
\text{the number of negative divisors of }n\right)  .
\end{align*}


If $d$ is a positive divisor of $n$, then $-d$ is a negative divisor of
$n$\ \ \ \ \footnote{\textit{Proof.} Let $d$ be a positive divisor of $n$. We
must prove that $-d$ is a negative divisor of $n$. Clearly, $-d$ is negative
(since $d$ is positive).
\par
We have assumed that $d$ is a positive divisor of $n$. In other words, $d$ is
a positive integer and satisfies $d\mid n$. But $d=\left(  -d\right)  \left(
-1\right)  $; thus, $-d\mid d$ (since $-1$ is an integer). Hence, $-d\mid
d\mid n$. Hence, $-d$ is a divisor of $n$. Thus, $-d$ is a negative divisor of
$n$ (since $-d$ is negative). Qed.}. Hence, we can define a map%
\begin{align*}
A:\left\{  \text{positive divisors of }n\right\}   &  \rightarrow\left\{
\text{negative divisors of }n\right\}  ,\\
d  &  \mapsto-d.
\end{align*}
For similar reasons, we can define a map%
\begin{align*}
B:\left\{  \text{negative divisors of }n\right\}   &  \rightarrow\left\{
\text{positive divisors of }n\right\}  ,\\
d  &  \mapsto-d.
\end{align*}
Consider these two maps $A$ and $B$. Clearly, $A\circ B=\operatorname*{id}$
(since each negative divisor $d$ of $n$ satisfies $\left(  A\circ B\right)
\left(  d\right)  =A\left(  \underbrace{B\left(  d\right)  }_{=-d}\right)
=A\left(  -d\right)  =-\left(  -d\right)  =d=\operatorname*{id}\left(
d\right)  $) and $B\circ A=\operatorname*{id}$ (similarly). Thus, these maps
$A$ and $B$ are mutually inverse. Hence, the map $A$ is invertible, i.e., a bijection.

Hence, there is a bijection between $\left\{  \text{positive divisors of
}n\right\}  $ and $\left\{  \text{negative divisors of }n\right\}  $ (namely,
$A$). Thus,%
\[
\left\vert \left\{  \text{negative divisors of }n\right\}  \right\vert
=\left\vert \left\{  \text{positive divisors of }n\right\}  \right\vert ,
\]
so that%
\begin{align*}
&  \left(  \text{the number of negative divisors of }n\right) \\
&  =\left\vert \left\{  \text{negative divisors of }n\right\}  \right\vert
=\left\vert \left\{  \text{positive divisors of }n\right\}  \right\vert \\
&  =\left(  \text{the number of positive divisors of }n\right)  .
\end{align*}
Therefore,%
\begin{align*}
&  \left(  \text{the number of divisors of }n\right) \\
&  =\left(  \text{the number of positive divisors of }n\right)
+\underbrace{\left(  \text{the number of negative divisors of }n\right)
}_{=\left(  \text{the number of positive divisors of }n\right)  }\\
&  =\left(  \text{the number of positive divisors of }n\right)  +\left(
\text{the number of positive divisors of }n\right) \\
&  =2\cdot\underbrace{\left(  \text{the number of positive divisors of
}n\right)  }_{\substack{=\prod_{p\text{ prime}}\left(  v_{p}\left(  n\right)
+1\right)  \\\text{(by Proposition \ref{prop.ent.count-divs} \textbf{(b)})}%
}}=2\prod_{p\text{ prime}}\left(  v_{p}\left(  n\right)  +1\right)  .
\end{align*}
Hence, Proposition \ref{prop.ent.count-divs} \textbf{(c)} follows.
\end{proof}

\begin{remark}
Proposition \ref{prop.ent.count-divs} can be used to re-prove Proposition
\ref{prop.ent.phi.ghosts}. We leave the details of this argument to the reader.
\end{remark}

\subsubsection{The sum of the divisors of $n$}

The method by which we proved Proposition \ref{prop.ent.count-divs} can be
used (with a minor modification) to not just count the positive divisors of a
positive integer $n$, but also (for example) to compute their sum or the sum
of their squares. This relies on the following basic property of $\sum$ and
$\prod$ signs:

\begin{lemma}
\label{lem.prodrule.nums}Let $n\in\mathbb{N}$. For every $i\in\left\{
1,2,\ldots,n\right\}  $, let $Z_{i}$ be a finite set. For every $i\in\left\{
1,2,\ldots,n\right\}  $ and every $k\in Z_{i}$, let $p_{i,k}$ be a number.
Then,%
\[
\prod_{i=1}^{n}\sum_{k\in Z_{i}}p_{i,k}=\sum_{\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in Z_{1}\times Z_{2}\times\cdots\times Z_{n}}\ \ \prod
_{i=1}^{n}p_{i,k_{i}}.
\]
(Note that if $n=0$, then the Cartesian product $Z_{1}\times Z_{2}\times
\cdots\times Z_{n}$ has no factors; it is what is called an \textit{empty
Cartesian product}. It is understood to be a $1$-element set, and its single
element is the $0$-tuple $\left(  {}\right)  $ (also known as the empty list).)
\end{lemma}

Lemma \ref{lem.prodrule.nums} is essentially a version of the distributivity
law (or the \href{https://en.wikipedia.org/wiki/FOIL_method}{FOIL method}) for
expanding a product of several sums, each of which has several factors. For
example, if we take $n=3$ and $Z_{i}=\left\{  1,2\right\}  $ for each
$i\in\left\{  1,2,3\right\}  $, then Lemma \ref{lem.prodrule.nums} says that%
\begin{align*}
&  \left(  p_{1,1}+p_{1,2}\right)  \left(  p_{2,1}+p_{2,2}\right)  \left(
p_{3,1}+p_{3,2}\right) \\
&  =p_{1,1}p_{2,1}p_{3,1}+p_{1,1}p_{2,1}p_{3,2}+p_{1,1}p_{2,2}p_{3,1}%
+p_{1,1}p_{2,2}p_{3,2}\\
&  \ \ \ \ \ \ \ \ \ \ +p_{1,2}p_{2,1}p_{3,1}+p_{1,2}p_{2,1}p_{3,2}%
+p_{1,2}p_{2,2}p_{3,1}+p_{1,2}p_{2,2}p_{3,2}%
\end{align*}
(which is precisely what you get if you expand the product \newline$\left(
p_{1,1}+p_{1,2}\right)  \left(  p_{2,1}+p_{2,2}\right)  \left(  p_{3,1}%
+p_{3,2}\right)  $ using the distributivity law). For another example, if we
take $n=2$ and $Z_{i}=\left\{  1,2,3\right\}  $ for each $i\in\left\{
1,2\right\}  $, then Lemma \ref{lem.prodrule.nums} says that%
\begin{align*}
\left(  p_{1,1}+p_{1,2}+p_{1,3}\right)  \left(  p_{2,1}+p_{2,2}+p_{2,3}%
\right)   &  =p_{1,1}p_{2,1}+p_{1,1}p_{2,2}+p_{1,1}p_{2,3}\\
&  \ \ \ \ \ \ \ \ \ \ +p_{1,2}p_{2,1}+p_{1,2}p_{2,2}+p_{1,2}p_{2,3}\\
&  \ \ \ \ \ \ \ \ \ \ +p_{1,3}p_{2,1}+p_{1,3}p_{2,2}+p_{1,3}p_{2,3}%
\end{align*}
(which is, again, simply the result of expanding the left hand side). In the
general case, the idea behind Lemma \ref{lem.prodrule.nums} is that if you
expand the product\footnote{We are here assuming (for the sake of simplicity)
that each set $Z_{i}$ is $\left\{  1,2,\ldots,m_{i}\right\}  $ for some
$m_{i}\in\mathbb{N}$. This does not weaken the reach of Lemma
\ref{lem.prodrule.nums}, since each finite set $Z_{i}$ can be relabelled as
$\left\{  1,2,\ldots,m_{i}\right\}  $ for $m_{i}=\left\vert Z_{i}\right\vert
$.}%
\begin{align*}
&  \prod_{i=1}^{n}\sum_{k=1}^{m_{i}}p_{i,k}\\
&  =\prod_{i=1}^{n}\left(  p_{i,1}+p_{i,2}+\cdots+p_{i,m_{i}}\right) \\
&  =\left(  p_{1,1}+p_{1,2}+\cdots+p_{1,m_{1}}\right)  \left(  p_{2,1}%
+p_{2,2}+\cdots+p_{2,m_{2}}\right)  \cdots\left(  p_{n,1}+p_{n,2}%
+\cdots+p_{n,m_{n}}\right)  ,
\end{align*}
then you get a sum of $m_{1}m_{2}\cdots m_{n}$ terms, each of which has the
form
\[
p_{1,k_{1}}p_{2,k_{2}}\cdots p_{n,k_{n}}=\prod_{i=1}^{n}p_{i,k_{i}}%
\]
for some $\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in\left\{  1,2,\ldots
,m_{1}\right\}  \times\left\{  1,2,\ldots,m_{2}\right\}  \times\cdots
\times\left\{  1,2,\ldots,m_{n}\right\}  $. See \cite[proof of Lemma
7.160]{detnotes} for a rigorous proof of Lemma \ref{lem.prodrule.nums} (which
uses induction and the distributivity law).

Now, we can state a formula for the sum of all positive divisors of a positive
integer $n$, and more generally for the sum of the $k$-th powers of these
positive divisors, where $k$ is a fixed integer:

\begin{exercise}
\label{exe.ent.count-divs-k}Let $n$ be a positive integer. Let $k\in
\mathbb{Z}$. Prove that:

\textbf{(a)} The product $\prod_{p\text{ prime}}\left(  p^{0k}+p^{1k}%
+\cdots+p^{v_{p}\left(  n\right)  \cdot k}\right)  $ is well-defined, since
all but finitely many of its factors are $1$.

\textbf{(b)} We have
\[
\sum_{d\mid n}d^{k}=\prod_{p\text{ prime}}\left(  p^{0k}+p^{1k}+\cdots
+p^{v_{p}\left(  n\right)  \cdot k}\right)  .
\]

\end{exercise}

(Recall that the summation sign \textquotedblleft$\sum_{d\mid n}%
$\textquotedblright\ means a sum over all \textbf{positive} divisors $d$ of
$n$.)

\begin{example}
If $n=6$, then the positive divisors of $n$ are $1,2,3,6$. Thus, in this case,
the claim of Exercise \ref{exe.ent.count-divs-k} \textbf{(b)} becomes%
\[
1^{k}+2^{k}+3^{k}+6^{k}=\prod_{p\text{ prime}}\left(  p^{0k}+p^{1k}%
+\cdots+p^{v_{p}\left(  6\right)  \cdot k}\right)  .
\]
This equality can easily be verified, since the right hand side is%
\begin{align*}
&  \prod_{p\text{ prime}}\left(  p^{0k}+p^{1k}+\cdots+p^{v_{p}\left(
6\right)  \cdot k}\right) \\
&  =\underbrace{\left(  2^{0k}+2^{1k}+\cdots+2^{v_{2}\left(  6\right)  \cdot
k}\right)  }_{\substack{=2^{0k}+2^{1k}\\\text{(since }v_{2}\left(  6\right)
=1\text{)}}}\cdot\underbrace{\left(  3^{0k}+3^{1k}+\cdots+3^{v_{3}\left(
6\right)  \cdot k}\right)  }_{\substack{=3^{0k}+3^{1k}\\\text{(since }%
v_{3}\left(  6\right)  =1\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \cdot\prod_{\substack{p\text{ prime;}\\p\notin\left\{
2,3\right\}  }}\underbrace{\left(  p^{0k}+p^{1k}+\cdots+p^{v_{p}\left(
6\right)  \cdot k}\right)  }_{\substack{=p^{0k}\\\text{(since }v_{p}\left(
6\right)  =0\text{ (because }p\notin\left\{  2,3\right\}  \text{))}}}\\
&  =\left(  \underbrace{2^{0k}}_{=1}+\underbrace{2^{1k}}_{=2^{k}}\right)
\cdot\left(  \underbrace{3^{0k}}_{=1}+\underbrace{3^{1k}}_{=3^{k}}\right)
\cdot\prod_{\substack{p\text{ prime;}\\p\notin\left\{  2,3\right\}
}}\underbrace{p^{0k}}_{=1}\\
&  =\left(  1+2^{k}\right)  \cdot\left(  1+3^{k}\right)  =\underbrace{1}%
_{=1^{k}}+2^{k}+3^{k}+\underbrace{2^{k}\cdot3^{k}}_{=\left(  2\cdot3\right)
^{k}=6^{k}}=1^{k}+2^{k}+3^{k}+6^{k}.
\end{align*}

\end{example}

Note that Proposition \ref{prop.ent.count-divs} \textbf{(b)} is the particular
case of Exercise \ref{exe.ent.count-divs-k} \textbf{(b)} obtained when setting
$k=0$ (because each integer $z$ satisfies $z^{0}=1$, and thus $\sum_{d\mid
n}d^{0}$ is the number of positive divisors of $n$).

\begin{exercise}
\label{exe.ent.count-divs-134}Let $n$ be a positive integer. Let%
\begin{align*}
z  &  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv1\mod 4$}\right) \\
&  \ \ \ \ \ \ \ \ \ \ -\left(  \text{the number of positive divisors $d$ of
$n$ such that $d\equiv3\mod 4$}\right)  .
\end{align*}


Prove the following:

\textbf{(a)} If there exists a prime $p$ satisfying $p\equiv
3\operatorname{mod}4$ and $v_{p}\left(  n\right)  \equiv1\operatorname{mod}2$,
then $z=0$.

\textbf{(b)} If there exists no prime $p$ satisfying $p\equiv
3\operatorname{mod}4$ and $v_{p}\left(  n\right)  \equiv1\operatorname{mod}2$,
then
\[
z=\prod_{\substack{p\text{ prime;}\\p\equiv1\operatorname{mod}4}}\left(
v_{p}\left(  n\right)  +1\right)  .
\]


[\textbf{Hint:} For every $u\in\mathbb{Z}$, set $L\left(  u\right)  =%
\begin{cases}
1, & \text{if }u\%4=1;\\
-1, & \text{if }u\%4=3;\\
0, & \text{otherwise.}%
\end{cases}
$ Prove that $L\left(  uv\right)  =L\left(  u\right)  \cdot L\left(  v\right)
$ for any integers $u$ and $v$. Then, show that $z=\sum_{d\mid n}L\left(
d\right)  $. Exploit the similarity between the sum $\sum_{d\mid n}L\left(
d\right)  $ and the sum in Exercise \ref{exe.ent.count-divs-k} \textbf{(b)}.]
\end{exercise}

\subsection{\textquotedblleft Application\textquotedblright: The
Erd\"{o}s--Ginzburg--Ziv theorem}

In this section (which can be skipped at will), we shall apply some of what we
learned above to prove a curious result found in 1961 by Erd\H{o}s, Ginzburg
and Ziv \cite{ErGiZi61}:

\begin{theorem}
\label{thm.ent.egz}Let $n$ be a positive integer. Let $a_{1},a_{2}%
,\ldots,a_{2n-1}$ be any $2n-1$ integers (not necessarily distinct). Then,
there exists an $n$-element subset $S$ of $\left\{  1,2,\ldots,2n-1\right\}  $
such that $n\mid\sum_{s\in S}a_{s}$.
\end{theorem}

In other words, this theorem says that if you are given $2n-1$ integers, then
you can pick $n$ of them (without picking the same one twice\footnote{But if
two of the $2n-1$ integers are equal, then you can have them both in your
pick.}) such that the sum of your pick is divisible by $n$.

\begin{example}
In the case when $n=2$, Theorem \ref{thm.ent.egz} can be restated as follows:
If $a,b,c$ are three integers, then at least one of the sums $b+c$, $c+a$ and
$a+b$ is even. This is easy to prove by contradiction: Assume the contrary;
thus, all three sums $b+c$, $c+a$ and $a+b$ are odd. Hence, $\left(
b+c\right)  +\left(  c+a\right)  +\left(  a+b\right)  $ is a sum of three odd
numbers, and thus itself must be odd (since odd $+$ odd is even, and odd $+$
even is odd). But this contradicts the fact that $\left(  b+c\right)  +\left(
c+a\right)  +\left(  a+b\right)  =2\left(  a+b+c\right)  $ is even. Thus, we
have proven Theorem \ref{thm.ent.egz} in the case when $n=2$.
\end{example}

Many proofs of Theorem \ref{thm.ent.egz} are known (see \cite{AloDub93} for an
exposition), but none of them is overly easy. We shall present one of these
proofs (the one in \cite[\S 2.3]{AloDub93}) that uses prime factorization,
Fermat's little theorem and binomial coefficients.

First of all, we need a combinatorial lemma, which easily follows from Lemma
\ref{lem.prodrule.nums}:

\begin{lemma}
\label{lem.ent.egz-prod}Let $S$ be a finite set. For each $s\in S$, let
$a_{s}$ be an integer. Let $n\in\mathbb{N}$. Then,%
\[
\left(  \sum_{s\in S}a_{s}\right)  ^{n}=\sum_{\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in S^{n}}\ \ \prod_{i=1}^{n}a_{k_{i}}.
\]
(Note that if $n=0$, then the Cartesian power $S^{n}$ has no factors; it
consists of a single element, namely the empty $0$-tuple $\left(  {}\right)  $.)
\end{lemma}

\begin{exercise}
\label{exe.ent.egz-prod}Prove Lemma \ref{lem.ent.egz-prod}.
\end{exercise}

We shall first prove Theorem \ref{thm.ent.egz} in the case when $n$ is prime;
i.e., we shall prove the following result:

\begin{lemma}
\label{lem.ent.egz-p}Let $p$ be a prime. Let $a_{1},a_{2},\ldots,a_{2p-1}$ be
any $2p-1$ integers (not necessarily distinct). Then, there exists a
$p$-element subset $S$ of $\left\{  1,2,\ldots,2p-1\right\}  $ such that
$p\mid\sum_{s\in S}a_{s}$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.egz-p}.]Assume the contrary. Thus, there exists
no $p$-element subset $S$ of $\left\{  1,2,\ldots,2p-1\right\}  $ such that
$p\mid\sum_{s\in S}a_{s}$.

But $p>1$ (since $p$ is a prime) and thus $p-1>0$, so that $p-1\in\mathbb{N}$.
Also, $2p-1=p+\underbrace{\left(  p-1\right)  }_{>0}>p>1$, so that
$2p-1\in\mathbb{N}$.

Let $A$ be the set $\left\{  1,2,\ldots,2p-1\right\}  $. This set $A$ is a
$\left(  2p-1\right)  $-element set (since $2p-1\in\mathbb{N}$). Hence,
Theorem \ref{thm.binom.comb-int} (applied to $n=2p-1$, $k=p$ and $N=A$) shows
that $\dbinom{2p-1}{p}$ is the number of $p$-element subsets of $A$. In other
words,%
\begin{equation}
\dbinom{2p-1}{p}=\left(  \text{the number of }p\text{-element subsets of
}A\right)  . \label{pf.lem.ent.egz-p.ct1}%
\end{equation}


Recall that there exists no $p$-element subset $S$ of $\left\{  1,2,\ldots
,2p-1\right\}  $ such that $p\mid\sum_{s\in S}a_{s}$. Since $A=\left\{
1,2,\ldots,2p-1\right\}  $, this rewrites as follows: There exists no
$p$-element subset $S$ of $A$ such that $p\mid\sum_{s\in S}a_{s}$. In other
words, for each $p$-element subset $S$ of $A$, we have $p\nmid\sum_{s\in
S}a_{s}$. Thus, for each $p$-element subset $S$ of $A$, we have%
\[
\left(  \sum_{s\in S}a_{s}\right)  ^{p-1}\equiv1\operatorname{mod}p
\]
(by Theorem \ref{thm.ent.fermat} \textbf{(a)}, applied to $a=\sum_{s\in
S}a_{s}$). Summing these congruences over all $p$-element subsets $S$ of $A$,
we obtain%
\begin{align}
\sum_{\substack{S\subseteq A;\\\left\vert S\right\vert =p}}\underbrace{\left(
\sum_{s\in S}a_{s}\right)  ^{p-1}}_{\equiv1\operatorname{mod}p}  &  \equiv
\sum_{\substack{S\subseteq A;\\\left\vert S\right\vert =p}}1\nonumber\\
&  =\left(  \text{the number of }p\text{-element subsets }S\text{ of
}A\right)  \cdot1\nonumber\\
&  =\left(  \text{the number of }p\text{-element subsets }S\text{ of }A\right)
\nonumber\\
&  =\left(  \text{the number of }p\text{-element subsets of }A\right)
\nonumber\\
&  =\dbinom{2p-1}{p}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.lem.ent.egz-p.ct1})}\right) \nonumber\\
&  \equiv1\operatorname{mod}p\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise
\ref{exe.binom.p-for-EGZ} \textbf{(b)}}\right)  . \label{pf.lem.ent.egz-p.LHS}%
\end{align}


On the other hand, we are going to show that $\sum_{\substack{S\subseteq
A;\\\left\vert S\right\vert =p}}\left(  \sum_{s\in S}a_{s}\right)
^{p-1}\equiv0\operatorname{mod}p$. Comparing these two congruences, we will
then obtain a contradiction.

Set $n=p-1$. Then, $n=p-1>0$.

Let $S$ be any subset of $A$. Then, Lemma \ref{lem.ent.egz-prod} yields%
\begin{equation}
\left(  \sum_{s\in S}a_{s}\right)  ^{n}=\sum_{\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in S^{n}}\prod_{i=1}^{n}a_{k_{i}}. \label{pf.lem.ent.egz-p.3}%
\end{equation}
But $S\subseteq A$. Hence, $S^{n}\subseteq A^{n}$. Thus, the $n$-tuples
$\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in S^{n}$ are precisely those
$n$-tuples $\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n}$ that happen to
lie in $S^{n}$. Therefore, the summation sign \textquotedblleft$\sum_{\left(
k_{1},k_{2},\ldots,k_{n}\right)  \in S^{n}}$\textquotedblright\ can be
replaced by \textquotedblleft$\sum_{\substack{\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in A^{n};\\\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in S^{n}%
}}$\textquotedblright. Thus, we can rewrite the equality
(\ref{pf.lem.ent.egz-p.3}) as%
\begin{equation}
\left(  \sum_{s\in S}a_{s}\right)  ^{n}=\sum_{\substack{\left(  k_{1}%
,k_{2},\ldots,k_{n}\right)  \in A^{n};\\\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in S^{n}}}\prod_{i=1}^{n}a_{k_{i}}. \label{pf.lem.ent.egz-p.4}%
\end{equation}


For any $n$-tuple $\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n}$, we
have the following chain of equivalences:%
\begin{align*}
\left(  \left(  k_{1},k_{2},\ldots,k_{n}\right)  \in S^{n}\right)  \  &
\Longleftrightarrow\ \left(  k_{1},k_{2},\ldots,k_{n}\text{ all belong to
}S\right) \\
&  \Longleftrightarrow\ \left(  \left\{  k_{1},k_{2},\ldots,k_{n}\right\}
\subseteq S\right)  .
\end{align*}
Hence, the summation sign \textquotedblleft$\sum_{\substack{\left(
k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n};\\\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in S^{n}}}$\textquotedblright\ can be replaced by
\textquotedblleft$\sum_{\substack{\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in
A^{n};\\\left\{  k_{1},k_{2},\ldots,k_{n}\right\}  \subseteq S}}$%
\textquotedblright. Thus, we can rewrite the equality
(\ref{pf.lem.ent.egz-p.4}) as%
\begin{equation}
\left(  \sum_{s\in S}a_{s}\right)  ^{n}=\sum_{\substack{\left(  k_{1}%
,k_{2},\ldots,k_{n}\right)  \in A^{n};\\\left\{  k_{1},k_{2},\ldots
,k_{n}\right\}  \subseteq S}}\prod_{i=1}^{n}a_{k_{i}}.
\label{pf.lem.ent.egz-p.5}%
\end{equation}


Now, forget that we fixed $S$. Thus, we have shown the equality
(\ref{pf.lem.ent.egz-p.5}) for every subset $S$ of $A$. Now,%
\begin{align}
&  \sum_{\substack{S\subseteq A;\\\left\vert S\right\vert =p}}\left(
\sum_{s\in S}a_{s}\right)  ^{p-1}\nonumber\\
&  =\sum_{\substack{S\subseteq A;\\\left\vert S\right\vert =p}%
}\underbrace{\left(  \sum_{s\in S}a_{s}\right)  ^{n}}_{\substack{=\sum
_{\substack{\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n};\\\left\{
k_{1},k_{2},\ldots,k_{n}\right\}  \subseteq S}}\prod_{i=1}^{n}a_{k_{i}%
}\\\text{(by (\ref{pf.lem.ent.egz-p.5}))}}}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }p-1=n\right) \nonumber\\
&  =\underbrace{\sum_{\substack{S\subseteq A;\\\left\vert S\right\vert
=p}}\sum_{\substack{\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in
A^{n};\\\left\{  k_{1},k_{2},\ldots,k_{n}\right\}  \subseteq S}}}%
_{=\sum_{\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n}}\sum
_{\substack{S\subseteq A;\\\left\vert S\right\vert =p;\\\left\{  k_{1}%
,k_{2},\ldots,k_{n}\right\}  \subseteq S}}}\underbrace{\prod_{i=1}^{n}%
a_{k_{i}}}_{=\left(  \prod_{i=1}^{n}a_{k_{i}}\right)  \cdot1}\nonumber\\
&  =\sum_{\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n}}\sum
_{\substack{S\subseteq A;\\\left\vert S\right\vert =p;\\\left\{  k_{1}%
,k_{2},\ldots,k_{n}\right\}  \subseteq S}}\left(  \prod_{i=1}^{n}a_{k_{i}%
}\right)  \cdot1\nonumber\\
&  =\sum_{\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n}}\left(
\prod_{i=1}^{n}a_{k_{i}}\right)  \sum_{\substack{S\subseteq A;\\\left\vert
S\right\vert =p;\\\left\{  k_{1},k_{2},\ldots,k_{n}\right\}  \subseteq S}}1.
\label{pf.lem.ent.egz-p.6}%
\end{align}


Next, we shall analyze the inner sum on the right hand side of this equality.

Fix an $n$-tuple $\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n}$. Let $B$
be the subset $\left\{  k_{1},k_{2},\ldots,k_{n}\right\}  $ of $A$. Then, $B$
consists of the $n$ elements $k_{1},k_{2},\ldots,k_{n}$, which may and may not
be distinct; but either way, this shows that $B$ has at least one element
(since $n>0$). In other words, $\left\vert B\right\vert \geq1$. Also,
$\left\vert B\right\vert \leq n$ (since $B$ consists of the $n$ elements
$k_{1},k_{2},\ldots,k_{n}$). Combining $\left\vert B\right\vert \geq1$ with
$\left\vert B\right\vert \leq n$, we obtain $\left\vert B\right\vert
\in\left\{  1,2,\ldots,n\right\}  =\left\{  1,2,\ldots,p-1\right\}  $ (since
$n=p-1$). Therefore, $p-\left\vert B\right\vert \in\left\{  1,2,\ldots
,p-1\right\}  $. Hence, Exercise \ref{exe.binom.p-for-EGZ} \textbf{(c)}
(applied to $k=p-\left\vert B\right\vert $) yields%
\begin{equation}
\dbinom{p-1+\left(  p-\left\vert B\right\vert \right)  }{p-\left\vert
B\right\vert }\equiv0\operatorname{mod}p. \label{pf.lem.ent.egz-p.7}%
\end{equation}


Moreover, $B$ is clearly a $\left\vert B\right\vert $-element subset of $A$.
Now,%
\begin{align}
&  \sum_{\substack{S\subseteq A;\\\left\vert S\right\vert =p;\\\left\{
k_{1},k_{2},\ldots,k_{n}\right\}  \subseteq S}}1\nonumber\\
&  =\sum_{\substack{S\subseteq A;\\\left\vert S\right\vert =p;\\B\subseteq
S}}1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\{  k_{1},k_{2},\ldots
,k_{n}\right\}  =B\text{ (by the definition of }B\text{)}\right) \nonumber\\
&  =\left(  \text{the number of }p\text{-element subsets }S\text{ of }A\text{
satisfying }B\subseteq S\right)  \cdot1\nonumber\\
&  =\left(  \text{the number of }p\text{-element subsets }S\text{ of }A\text{
satisfying }B\subseteq S\right) \nonumber\\
&  =\dbinom{\left(  2p-1\right)  -\left\vert B\right\vert }{p-\left\vert
B\right\vert }\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.binom.subsets-ctg},
applied to }a=2p-1\text{, }b=\left\vert B\right\vert \text{ and }m=p\right)
\nonumber\\
&  =\dbinom{p-1+\left(  p-\left\vert B\right\vert \right)  }{p-\left\vert
B\right\vert }\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  2p-1\right)
-\left\vert B\right\vert =p-1+\left(  p-\left\vert B\right\vert \right)
\right) \nonumber\\
&  \equiv0\operatorname{mod}p\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.lem.ent.egz-p.7})}\right)  . \label{pf.lem.ent.egz-p.9}%
\end{align}


Now, forget that we fixed $\left(  k_{1},k_{2},\ldots,k_{n}\right)  $. We thus
have proven (\ref{pf.lem.ent.egz-p.9}) for each $n$-tuple $\left(  k_{1}%
,k_{2},\ldots,k_{n}\right)  \in A^{n}$. Hence, (\ref{pf.lem.ent.egz-p.6})
becomes%
\begin{align*}
\sum_{\substack{S\subseteq A;\\\left\vert S\right\vert =p}}\left(  \sum_{s\in
S}a_{s}\right)  ^{p-1}  &  =\sum_{\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in
A^{n}}\left(  \prod_{i=1}^{n}a_{k_{i}}\right)  \underbrace{\sum
_{\substack{S\subseteq A;\\\left\vert S\right\vert =p;\\\left\{  k_{1}%
,k_{2},\ldots,k_{n}\right\}  \subseteq S}}1}_{\substack{\equiv
0\operatorname{mod}p\\\text{(by (\ref{pf.lem.ent.egz-p.9}))}}}\\
&  \equiv\sum_{\left(  k_{1},k_{2},\ldots,k_{n}\right)  \in A^{n}}\left(
\prod_{i=1}^{n}a_{k_{i}}\right)  0=0\operatorname{mod}p.
\end{align*}
Hence,
\[
0\equiv\sum_{\substack{S\subseteq A;\\\left\vert S\right\vert =p}}\left(
\sum_{s\in S}a_{s}\right)  ^{p-1}\equiv1\operatorname{mod}%
p\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.lem.ent.egz-p.LHS})}\right)  .
\]
In other words, $p\mid0-1$, so that $p\mid0-1=-1\mid1$. Hence, $p=1$ (by
Exercise \ref{exe.ent.div.g|1}, applied to $g=p$). This contradicts $p>1$.
This contradiction shows that our assumption was wrong. Hence, Lemma
\ref{lem.ent.egz-p} is proven.
\end{proof}

Having established Lemma \ref{lem.ent.egz-p}, we shall next extend it to a
larger list of numbers:

\begin{lemma}
\label{lem.ent.egz-p2}Let $p$ be a prime. Let $u$ be a positive integer. Let
$a_{1},a_{2},\ldots,a_{up-1}$ be any $up-1$ integers (not necessarily
distinct). Then, there exist $u-1$ disjoint $p$-element subsets $S_{1}%
,S_{2},\ldots,S_{u-1}$ of $\left\{  1,2,\ldots,up-1\right\}  $ such that
\[
p\mid\sum_{s\in S_{i}}a_{s}\ \ \ \ \ \ \ \ \ \ \text{for all }i\in\left\{
1,2,\ldots,u-1\right\}  .
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.ent.egz-p2} (sketched).]We shall give the informal
idea of the proof, and delegate the formalization to an exercise (Exercise
\ref{exe.ent.egz-p2} below).

Lemma \ref{lem.ent.egz-p} can be restated as follows:

\begin{statement}
\textit{Claim 1:} If you are given $2p-1$ integers, then you can pick $p$ of
them such that the sum of your pick is divisible by $p$.
\end{statement}

Here and in the following, \textquotedblleft picking\textquotedblright\ is
always understood to mean choosing a subset -- i.e., you cannot pick a number
more than once. (But if two of the $2p-1$ integers are equal, then you can
have them both in your pick.)

Now, imagine that our $up-1$ integers $a_{1},a_{2},\ldots,a_{up-1}$ are laid
out on a desk, while $u-1$ empty bags are laid out on the floor. Lemma
\ref{lem.ent.egz-p2} claims that we can pack some of the integers from the
desk into the bags in such a way that each bag is neatly filled. Here, we say
that a bag is \textit{neatly filled} if it is filled with exactly $p$ integers
and the sum of these $p$ integers is divisible by $p$. (Note that if $u-1$
bags are neatly filled, then there are a total of $\left(  u-1\right)  p$
integers in these bags, while the remaining $up-1-\left(  u-1\right)  p=p-1$
integers remain on the desk.)

Let us consider the case $u=5$. In this case, we have $5p-1$ integers on the
desk and $4$ bags that we want neatly filled. To fill the bags, we proceed as follows:

\begin{itemize}
\item We have $5p-1$ integers on the desk, thus at least $2p-1$ integers.
Hence, Claim 1 tells us that we can pick $p$ of them such that the sum of our
pick is divisible by $p$. We do so, and move the $p$ integers we have picked
into the first bag.

\item Now, we have $4p-1$ integers on the desk, thus at least $2p-1$ integers.
Hence, Claim 1 tells us that we can pick $p$ of them such that the sum of our
pick is divisible by $p$. We do so, and move the $p$ integers we have picked
into the second bag.

\item Now, we have $3p-1$ integers on the desk, thus at least $2p-1$ integers.
Hence, Claim 1 tells us that we can pick $p$ of them such that the sum of our
pick is divisible by $p$. We do so, and move the $p$ integers we have picked
into the third bag.

\item Now, we have $2p-1$ integers on the desk, thus at least $2p-1$ integers.
Hence, Claim 1 tells us that we can pick $p$ of them such that the sum of our
pick is divisible by $p$. We do so, and move the $p$ integers we have picked
into the fourth bag.
\end{itemize}

\noindent Now, all four bags are neatly filled. This proves Lemma
\ref{lem.ent.egz-p2} in the case when $u=5$. The general case proceeds in the
same way (formally speaking, this is an induction over $u$).
\end{proof}

\begin{exercise}
\label{exe.ent.egz-p2}Formalize the above proof of Lemma \ref{lem.ent.egz-p2}.
\end{exercise}

Now the hard part is done: It turns out that non-prime integers $n$ in Theorem
\ref{thm.ent.egz} can be dealt with by splitting out a prime factor $p$, and
applying Lemma \ref{lem.ent.egz-p2} to this $p$. Here is the argument in detail:

\begin{proof}
[Proof of Theorem \ref{thm.ent.egz}.]We shall prove Theorem \ref{thm.ent.egz}
by strong induction on $n$.

\textit{Induction step:} Fix a positive integer $m$. Assume that Theorem
\ref{thm.ent.egz} holds for all $n<m$. We must prove that Theorem
\ref{thm.ent.egz} holds for $n=m$.

We have assumed that Theorem \ref{thm.ent.egz} holds for all $n<m$. In other
words, the following claim holds:

\begin{statement}
\textit{Claim 1:} Let $n$ be a positive integer such that $n<m$. Let
$a_{1},a_{2},\ldots,a_{2n-1}$ be any $2n-1$ integers. Then, there exists an
$n$-element subset $S$ of $\left\{  1,2,\ldots,2n-1\right\}  $ such that
$n\mid\sum_{s\in S}a_{s}$.
\end{statement}

We must prove that Theorem \ref{thm.ent.egz} holds for $n=m$. In other words,
we must prove the following claim:

\begin{statement}
\textit{Claim 2:} Let $a_{1},a_{2},\ldots,a_{2m-1}$ be any $2m-1$ integers.
Then, there exists an $m$-element subset $S$ of $\left\{  1,2,\ldots
,2m-1\right\}  $ such that $m\mid\sum_{s\in S}a_{s}$.
\end{statement}

[\textit{Proof of Claim 2:} It is very easy to prove Claim 2 when $m=1$ (just
take $S=\left\{  1\right\}  $; then $m\mid\sum_{s\in S}a_{s}$ will
automatically hold because $m=1$). Thus, for the rest of this proof, we WLOG
assume that we don't have $m=1$. Hence, $m>1$ (since $m$ is a positive integer).

Proposition \ref{prop.ent.prime.ex-pri-div} (applied to $n=m$) shows that
there exists at least one prime $p$ such that $p\mid m$. Consider this $p$. We
are in one of the following two cases:

\textit{Case 1:} We have $p=m$.

\textit{Case 2:} We have $p\neq m$.

Let us first consider Case 1. In this case, we have $p=m$. Hence, the integer
$m$ is prime (since $p$ is prime). Hence, Lemma \ref{lem.ent.egz-p} (applied
to $m$ instead of $p$) shows that there exists an $m$-element subset $S$ of
$\left\{  1,2,\ldots,2m-1\right\}  $ such that $m\mid\sum_{s\in S}a_{s}$.
Hence, Claim 2 is proven in Case 1.

Let us now consider Case 2. In this case, we have $p\neq m$. But $p\mid m$;
thus, there exists some integer $c$ such that $m=pc$. Consider this $c$. We
have $c>0$\ \ \ \ \footnote{\textit{Proof.} Assume the contrary. Thus,
$c\leq0$. We can multiply this inequality by $p$ (since $p>0$), and thus find
$pc\leq p0=0$, so that $m=pc\leq0$. This contradicts $m>0$. This contradiction
shows that our assumption was false. Qed.} and $c<m$%
\ \ \ \ \footnote{\textit{Proof.} We have $p>1$ (since $p$ is prime).
Multiplying this inequality by $m$, we obtain $pm>1m$ (since $m>0$). Thus,
$pm>1m=m=pc$. We can divide this inequality by $p$ (since $p>0$), and thus
obtain $m>c$. Hence, $c<m$.}. From $c>0$, we obtain $2c>0$; thus, $2c$ is a
positive integer.

From $m=pc$, we obtain $2m=2pc=\left(  2c\right)  p$. Recall that we are given
$2m-1$ integers $a_{1},a_{2},\ldots,a_{2m-1}$. Since $2m=\left(  2c\right)
p$, this rewrites as follows: We are given $\left(  2c\right)  p-1$ integers
$a_{1},a_{2},\ldots,a_{\left(  2c\right)  p-1}$.

Hence, Lemma \ref{lem.ent.egz-p2} (applied to $u=2c$) shows that there exist
$2c-1$ disjoint $p$-element subsets $S_{1},S_{2},\ldots,S_{2c-1}$ of $\left\{
1,2,\ldots,\left(  2c\right)  p-1\right\}  $ such that
\[
p\mid\sum_{s\in S_{i}}a_{s}\ \ \ \ \ \ \ \ \ \ \text{for all }i\in\left\{
1,2,\ldots,2c-1\right\}  .
\]
Consider these $2c-1$ subsets $S_{1},S_{2},\ldots,S_{2c-1}$.

For each $i\in\left\{  1,2,\ldots,2c-1\right\}  $, we have $p\mid\sum_{s\in
S_{i}}a_{s}$ and thus $\dfrac{\sum_{s\in S_{i}}a_{s}}{p}\in\mathbb{Z}$. Thus,
for each $i\in\left\{  1,2,\ldots,2c-1\right\}  $, we can define an integer
$b_{i}\in\mathbb{Z}$ by
\begin{equation}
b_{i}=\dfrac{\sum_{s\in S_{i}}a_{s}}{p}. \label{pf.thm.ent.egz.4}%
\end{equation}
Consider these $2c-1$ integers $b_{1},b_{2},\ldots,b_{2c-1}$. Recall that
$c<m$. Hence, Claim 1 (applied to $c$ and $b_{i}$ instead of $n$ and $a_{i}$)
shows that there exists a $c$-element subset $S$ of $\left\{  1,2,\ldots
,2c-1\right\}  $ such that $c\mid\sum_{s\in S}b_{s}$. We can WLOG assume that
this $c$-element subset is actually $\left\{  1,2,\ldots,c\right\}  $ (because
we can always achieve this by changing the order of the sets $S_{1}%
,S_{2},\ldots,S_{2c-1}$). Assume this. Thus, $\left\{  1,2,\ldots,c\right\}  $
is a $c$-element subset $S$ of $\left\{  1,2,\ldots,2c-1\right\}  $ such that
$c\mid\sum_{s\in S}b_{s}$. In other words, $\left\{  1,2,\ldots,c\right\}  $
is a $c$-element subset of $\left\{  1,2,\ldots,2c-1\right\}  $ and satisfies
\begin{equation}
c\mid\sum_{s\in\left\{  1,2,\ldots,c\right\}  }b_{s}. \label{pf.thm.ent.egz.5}%
\end{equation}
From the divisibility (\ref{pf.thm.ent.egz.5}), we conclude that there exists
an integer $d$ such that
\begin{equation}
\sum_{s\in\left\{  1,2,\ldots,c\right\}  }b_{s}=cd. \label{pf.thm.ent.egz.6}%
\end{equation}
Consider this $d$.

The sets $S_{1},S_{2},\ldots,S_{2c-1}$ are subsets of $\left\{  1,2,\ldots
,\left(  2c\right)  p-1\right\}  $. In other words, they are subsets of
$\left\{  1,2,\ldots,2m-1\right\}  $ (since $2m=\left(  2c\right)  p$).

The sets $S_{1},S_{2},\ldots,S_{2c-1}$ are disjoint. Hence, in particular, the
sets $S_{1},S_{2},\ldots,S_{c}$ are disjoint. Thus, the size of their union is
the sum of their sizes. In other words,%
\[
\left\vert S_{1}\cup S_{2}\cup\cdots\cup S_{c}\right\vert =\left\vert
S_{1}\right\vert +\left\vert S_{2}\right\vert +\cdots+\left\vert
S_{c}\right\vert =\sum_{i=1}^{c}\underbrace{\left\vert S_{i}\right\vert
}_{\substack{=p\\\text{(since }S_{i}\text{ is a}\\p\text{-element set)}}%
}=\sum_{i=1}^{c}p=cp=pc=m.
\]
In other words, $S_{1}\cup S_{2}\cup\cdots\cup S_{c}$ is an $m$-element set.
Of course, this set is a subset of $\left\{  1,2,\ldots,2m-1\right\}  $ (since
$S_{1},S_{2},\ldots,S_{c}$ are subsets of $\left\{  1,2,\ldots,2m-1\right\}
$). Moreover, since the $c$ sets $S_{1},S_{2},\ldots,S_{c}$ are disjoint, we
see that each element of $S_{1}\cup S_{2}\cup\cdots\cup S_{c}$ belongs to
exactly one of these $c$ sets. Thus, we can split up the sum $\sum_{s\in
S_{1}\cup S_{2}\cup\cdots\cup S_{c}}a_{s}$ as follows:%
\begin{align*}
\sum_{s\in S_{1}\cup S_{2}\cup\cdots\cup S_{c}}a_{s}  &  =\sum_{s\in S_{1}%
}a_{s}+\sum_{s\in S_{2}}a_{s}+\cdots+\sum_{s\in S_{c}}a_{s}=\sum_{i=1}%
^{c}\underbrace{\sum_{s\in S_{i}}a_{s}}_{\substack{=pb_{i}\\\text{(by
(\ref{pf.thm.ent.egz.4}))}}}=\sum_{i=1}^{c}pb_{i}=\sum_{s=1}^{c}pb_{s}\\
&  =\sum_{s\in\left\{  1,2,\ldots,c\right\}  }pb_{s}=p\underbrace{\sum
_{s\in\left\{  1,2,\ldots,c\right\}  }b_{s}}_{\substack{=cd\\\text{(by
(\ref{pf.thm.ent.egz.6}))}}}=\underbrace{pc}_{=m}d=md.
\end{align*}
Hence, $m\mid\sum_{s\in S_{1}\cup S_{2}\cup\cdots\cup S_{c}}a_{s}$.

Thus, there exists an $m$-element subset $S$ of $\left\{  1,2,\ldots
,2m-1\right\}  $ such that $m\mid\sum_{s\in S}a_{s}$ (namely, $S=S_{1}\cup
S_{2}\cup\cdots\cup S_{c}$). Therefore, Claim 2 is proven in Case 2.

We have now proven Claim 2 in both Cases 1 and 2. Hence, Claim 2 always holds.]

So we have proven Claim 2. In other words, Theorem \ref{thm.ent.egz} holds for
$n=m$. This completes the induction step, and with it the proof of Theorem
\ref{thm.ent.egz}.
\end{proof}

\section{Equivalence relations and residue classes}

\subsection{Relations}

Loosely speaking, a \textit{relation} on a set $S$ is a property that two
elements $a$ and $b$ of $S$ (or, more formally, a pair $\left(  a,b\right)
\in S\times S$ of two elements of $S$) can either have or not have. For
example, equality (denoted $=$) is a relation, since two elements $a$ and $b$
of $S$ are either equal (i.e., satisfy $a=b$) or not equal. Likewise, the
divisibility relation (denoted $\mid$) is a relation on $\mathbb{Z}$, since
two elements $a$ and $b$ of $\mathbb{Z}$ either satisfy $a\mid b$ or do not.

A formal definition of relations proceeds as follows:

\begin{definition}
\label{def.eqrel.rel.rel}Fix a set $S$. A \textit{binary relation} on $S$ is a
subset of $S\times S$ (that is, a set of pairs of elements of $S$).

If $R$ is a binary relation (on $S$), and if $a,b\in S$, then we write $aRb$
for $\left(  a,b\right)  \in R$.

The word \textquotedblleft\textit{relation}\textquotedblright\ shall always
mean \textquotedblleft binary relation\textquotedblright\ unless we say otherwise.
\end{definition}

So a relation on a set $S$ is, formally speaking, a subset of $S\times S$ --
but in practice, we think of it as a property that holds for some pairs
$\left(  a,b\right)  \in S\times S$ (namely, for the ones that belong to this
subset) and does not hold for some others (namely, for the ones that do not
belong to this subset).\footnote{Here, the word \textquotedblleft
some\textquotedblright\ can mean \textquotedblleft none\textquotedblright\ or
\textquotedblleft all\textquotedblright\ or anything inbetween.} In order to
define a relation $R$ on a given set $S$, it suffices to tell which pairs
$\left(  a,b\right)  \in S\times S$ satisfy $aRb$ (because then, $R$ will
simply be the set of all these pairs $\left(  a,b\right)  $). Let us define
several relations on the set $\mathbb{Z}$ by this strategy:

\begin{example}
\label{exa.eqrel.rel.rels1}Let $S=\mathbb{Z}$.

\textbf{(a)} The relation $=$ is a binary relation on $S$. As a subset of
$S\times S$, this relation is%
\begin{align*}
&  \left\{  \left(  a,b\right)  \in S\times S\ \mid\ a=b\right\} \\
&  =\left\{  \left(  c,c\right)  \ \mid\ c\in S\right\}  =\left\{
\ldots,\left(  -1,-1\right)  ,\left(  0,0\right)  ,\left(  1,1\right)
,\ldots\right\}  .
\end{align*}


\textbf{(b)} The relation $<$ is a binary relation on $S$. As a subset of
$S\times S$, this relation is%
\[
\left\{  \left(  a,b\right)  \in S\times S\ \mid\ a<b\right\}  .
\]


\textbf{(c)} The relation $\leq$ is a binary relation on $S$. As a subset of
$S\times S$, this relation is%
\[
\left\{  \left(  a,b\right)  \in S\times S\ \mid\ a\leq b\right\}  .
\]


\textbf{(d)} The relation $\neq$ is also a binary relation on $S$.

\textbf{(e)} Fix $n\in\mathbb{Z}$. Define a relation $\underset{n}{\equiv}$ on
$S=\mathbb{Z}$ by
\[
\left(  a\underset{n}{\equiv}b\right)  \Longleftrightarrow\left(  a\equiv
b\operatorname{mod}n\right)  .
\]
As a subset of $S\times S=\mathbb{Z}\times\mathbb{Z}$, this relation
$\underset{n}{\equiv}$ is%
\begin{align*}
&  \left\{  \left(  a,b\right)  \in\mathbb{Z}\times\mathbb{Z}\ \mid\ a\equiv
b\operatorname{mod}n\right\} \\
&  =\left\{  \left(  a,b\right)  \in\mathbb{Z}\times\mathbb{Z}\ \mid
\ \text{there exists an integer }d\text{ such that }b=a+nd\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.ent.mod.a+nd}%
}\right) \\
&  =\left\{  \left(  a,a+nd\right)  \ \mid\ a,d\in\mathbb{Z}\right\}  .
\end{align*}


Note that the relation $\underset{0}{\equiv}$ is exactly the relation $=$ (by
Example \ref{exa.ent.cong.triv} \textbf{(c)}).

\textbf{(f)} Define a binary relation $\relnever$ on $S$ by%
\[
\left(  a \relnever b\right)  \Longleftrightarrow\left(  \text{false}\right)
\]
(that is, $a \relnever b$ never holds, no matter what $a$ and $b$ are). As a
subset of $S\times S$, this relation $\relnever$ is just the empty subset of
$S\times S$.

\textbf{(g)} On the other extreme: Define a binary relation $\relalways$ on
$S$ by%
\[
\left(  a \relalways b\right)  \Longleftrightarrow\left(  \text{true}\right)
\]
(that is, $a\relalways b$ holds for all $a$ and $b$). As a subset of $S\times
S$, this relation $\relalways$ is the whole set $S\times S$. Note that the
relation $\relalways$ is exactly the relation $\underset{1}{\equiv}$ (by
Example \ref{exa.ent.cong.triv} \textbf{(d)}).

\textbf{(h)} The relation $\mid$ (divisibility) is also a relation on
$S=\mathbb{Z}$.

\textbf{(i)} The relation $\perp$ (coprimality) is also a relation on
$S=\mathbb{Z}$.

\textbf{(j)} We have defined several relations on the set $S=\mathbb{Z}$ now.
The relations $=$, $\neq$, $\relnever$ and $\relalways$ (or, rather, relations
analogous to them) can be defined on \textbf{any} set.
\end{example}

\subsection{Equivalence relations}

Relations occur frequently in mathematics, and there is a bunch of properties
that a relation can have or not have. (See
\href{https://en.wikipedia.org/wiki/Binary_relation}{the Wikipedia article on
binary relations} for a long list of such properties.) We shall need only the
following three:

\begin{definition}
\label{def.eqrel.rel.rst}Let $R$ be a binary relation on a set $S$.

\textbf{(a)} We say that $R$ is \textit{reflexive} if every $a\in S$ satisfies
$aRa$.

\textbf{(b)} We say that $R$ is \textit{symmetric} if every $a,b\in S$
satisfying $aRb$ satisfy $bRa$.

\textbf{(c)} We say that $R$ is \textit{transitive} if every $a,b,c\in S$
satisfying $aRb$ and $bRc$ satisfy $aRc$.
\end{definition}

(Here are mnemonics for the three words we just defined:

\begin{itemize}
\item \textquotedblleft Reflexive\textquotedblright\ should make you think of
$R$ as a mirror through which $a$ can see itself (that is, satisfy $aRa$).

\item \textquotedblleft Symmetric\textquotedblright\ means that the roles of
$a$ and $b$ in $aRb$ are interchangeable -- a symmetry.

\item \textquotedblleft Transitive\textquotedblright\ means that you can
\textquotedblleft transit\textquotedblright\ an element $b$ on your way from
$a$ to $c$ (that is, if you treat $aRb$ as the existence of a
\textquotedblleft path\textquotedblright\ from $a$ to $b$, and $bRc$ as the
existence of a \textquotedblleft path\textquotedblright\ from $b$ to $c$, then
you can combine a \textquotedblleft path\textquotedblright\ from $a$ to $b$
with a \textquotedblleft path\textquotedblright\ from $b$ to $c$ to get a
\textquotedblleft path\textquotedblright\ from $a$ to $c$).)
\end{itemize}

Let us see some examples of these properties of relations\footnote{See further
below for the proofs of the claims made in this example.}:

\begin{example}
\label{exa.eqrel.rel.rst1}Let $S$ be the set $\mathbb{Z}$. Consider the
relations on $\mathbb{Z}$ defined in Example \ref{exa.eqrel.rel.rels1}.

\textbf{(a)} The relation $=$ is reflexive, symmetric and transitive.

\textbf{(b)} The relation $<$ is transitive, but neither reflexive nor symmetric.

\textbf{(c)} The relation $\leq$ is transitive and reflexive, but not symmetric.

\textbf{(d)} The relation $\neq$ is symmetric, but neither reflexive nor transitive.

\textbf{(e)} For each $n\in\mathbb{Z}$, the relation $\underset{n}{\equiv}$ is
reflexive, symmetric and transitive.

\textbf{(f)} The relation $\relnever$ is symmetric and transitive, but not reflexive.

\textbf{(g)} The relation $\relalways$ is reflexive, symmetric and transitive.

\textbf{(h)} The divisibility relation $\mid$ is reflexive and transitive, but
not symmetric.

\textbf{(i)} The coprimality relation $\perp$ is symmetric, but neither
reflexive nor transitive.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.eqrel.rel.rst1}.]\textbf{(a)} Indeed:

\begin{itemize}
\item The relation $=$ is reflexive, because every $a\in S$ satisfies $a=a$.

\item The relation $=$ is symmetric, because every $a,b\in S$ satisfying $a=b$
satisfy $b=a$.

\item The relation $=$ is transitive, because every $a,b,c\in S$ satisfying
$a=b$ and $b=c$ satisfy $a=c$.
\end{itemize}

\textbf{(b)} Indeed:

\begin{itemize}
\item The relation $<$ is transitive (because every $a,b,c\in S$ satisfying
$a<b$ and $b<c$ satisfy $a<c$).

\item Not every $a\in S$ satisfies $a<a$ (in fact, no $a\in S$ satisfies
$a<a$); thus, $<$ is not reflexive.

\item Similarly, $<$ is not symmetric, since $a<b$ does not imply $b<a$ (quite
the opposite).
\end{itemize}

\textbf{(c)} Indeed:

\begin{itemize}
\item The relation $\leq$ is transitive (because every $a,b,c\in S$ satisfying
$a\leq b$ and $b\leq c$ satisfy $a\leq c$).

\item The relation $\leq$ is reflexive (since every $a\in S$ satisfies $a\leq
a$).

\item The relation $\leq$ is not symmetric (since $a\leq b$ does not imply
$b\leq a$; for example, $1\leq2$ holds but $2\leq1$ does not).
\end{itemize}

\textbf{(d)} Indeed:

\begin{itemize}
\item The relation $\neq$ is symmetric (because every $a,b\in S$ satisfying
$a\neq b$ satisfy $b\neq a$).

\item The relation $\neq$ is not reflexive (since we don't have $2\neq2$).

\item The relation $\neq$ is not transitive (since $2\neq3$ and $3\neq2$ do
not lead to $2\neq2$).
\end{itemize}

\textbf{(e)} Let $n\in\mathbb{Z}$.

\begin{itemize}
\item Proposition \ref{prop.ent.mod.basics} \textbf{(b)} shows that every
$a,b,c\in\mathbb{Z}$ satisfying $a\equiv b\operatorname{mod}n$ and $b\equiv
c\operatorname{mod}n$ satisfy $a\equiv c\operatorname{mod}n$. In other words,
every $a,b,c\in S$ satisfying $a\underset{n}{\equiv}b$ and
$b\underset{n}{\equiv}c$ satisfy $a\underset{n}{\equiv}c$ (since the
definition of $\underset{n}{\equiv}$ shows that the three statements
\[
\left(  a\underset{n}{\equiv}b\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
b\underset{n}{\equiv}c\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
a\underset{n}{\equiv}c\right)
\]
are equivalent to%
\[
\left(  a\equiv b\operatorname{mod}n\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
b\equiv c\operatorname{mod}n\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  a\equiv
c\operatorname{mod}n\right)  ,
\]
respectively). But this means precisely that the relation $\underset{n}{\equiv
}$ is transitive.

\item Similarly, the relation $\underset{n}{\equiv}$ is reflexive (by
Proposition \ref{prop.ent.mod.basics} \textbf{(a)}).

\item Similarly, the relation $\underset{n}{\equiv}$ is symmetric (by
Proposition \ref{prop.ent.mod.basics} \textbf{(c)}).
\end{itemize}

\textbf{(f)} This may appear strange, but is a completely straightforward
consequence of the concept of \textquotedblleft%
\href{https://en.wikipedia.org/wiki/Vacuous_truth}{vacuous truth}%
\textquotedblright:

\begin{itemize}
\item Every $a,b\in S$ satisfying $a \relnever b$ satisfy $b \relnever a$
(because there are no such $a,b$ to begin with -- since $a \relnever b$ never
holds). Thus, $\relnever$ is symmetric.

\item Similarly, $\relnever$ is transitive.

\item But $\relnever$ is not reflexive, since (for example) $1 \relnever 1$
does not hold.
\end{itemize}

\textbf{(g)} All of this is trivial, because $a \relalways b$ holds for all
$a,b\in S$.

\textbf{(h)} The divisibility relation $\mid$ is reflexive (by Proposition
\ref{prop.ent.div.2} \textbf{(a)}) and transitive (by Proposition
\ref{prop.ent.div.2} \textbf{(b)}), but not symmetric (since $1\mid2$ does not
lead to $2\mid1$).

\textbf{(i)} The coprimality relation is symmetric (by Proposition
\ref{prop.ent.coprime.perp-symm}), but neither reflexive (since we don't have
$2\perp2$) nor transitive (since $2\perp3$ and $3\perp2$ do not lead to
$2\perp2$).
\end{proof}

\begin{definition}
\label{def.eqrel.rel.eqrel}An \textit{equivalence relation} on a set $S$ means
a relation on $S$ that is reflexive, symmetric and transitive.
\end{definition}

\begin{example}
\label{exa.eqrel.eqrel.eqrel=}Let $S$ be any set. The relation $=$ on the set
$S$ is an equivalence relation, because it is reflexive, symmetric and transitive.
\end{example}

\begin{example}
\label{exa.eqrel.eqrel.eqrelmodn}Let $n\in\mathbb{Z}$. The relation
$\underset{n}{\equiv}$ on $\mathbb{Z}$ (defined in Example
\ref{exa.eqrel.rel.rels1} \textbf{(e)}) is an equivalence relation, because
(as we saw in Example \ref{exa.eqrel.rel.rst1} \textbf{(e)}) it is reflexive,
symmetric and transitive.
\end{example}

\begin{example}
Here are some examples from elementary plane geometry: Congruence (e.g., of
triangles) is an equivalence relation. Similarity is also an equivalence
relation. The same holds for direct similarity (i.e., orientation-preserving
similarity). The same holds for parallelism of lines.
\end{example}

\begin{example}
\label{exa.eqrel.eqrel.eqrelf}Let $S$ and $T$ be two sets, and let
$f:S\rightarrow T$ be a map. Define a relation $\underset{f}{\equiv}$ on $S$
by%
\[
\left(  a\underset{f}{\equiv}b\right)  \Longleftrightarrow\left(  f\left(
a\right)  =f\left(  b\right)  \right)  .
\]
This relation $\underset{f}{\equiv}$ is an equivalence relation.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.eqrel.eqrel.eqrelf}.]Indeed:

\begin{itemize}
\item The relation $\underset{f}{\equiv}$ is reflexive, because every $a\in S$
satisfies $a\underset{f}{\equiv}a$ (since $f\left(  a\right)  =f\left(
a\right)  $).

\item The relation $\underset{f}{\equiv}$ is symmetric, because every $a,b\in
S$ satisfying $a\underset{f}{\equiv}b$ satisfy $b\underset{f}{\equiv}a$.
(Indeed, $a\underset{f}{\equiv}b$ means $f\left(  a\right)  =f\left(
b\right)  $, which entails $f\left(  b\right)  =f\left(  a\right)  $, which in
turn rewrites as $b\underset{f}{\equiv}a$.)

\item The relation $\underset{f}{\equiv}$ is transitive, because every
$a,b,c\in S$ satisfying $a\underset{f}{\equiv}b$ and $b\underset{f}{\equiv}c$
satisfy $a\underset{f}{\equiv}c$. (Indeed, the assumptions
$a\underset{f}{\equiv}b$ and $b\underset{f}{\equiv}c$ rewrite as $f\left(
a\right)  =f\left(  b\right)  $ and $f\left(  b\right)  =f\left(  c\right)  $;
therefore, $f\left(  a\right)  =f\left(  b\right)  =f\left(  c\right)  $,
which rewrites as $a\underset{f}{\equiv}c$.)
\end{itemize}

\noindent Thus, $\underset{f}{\equiv}$ is an equivalence relation.
\end{proof}

We will soon learn that \textbf{every} equivalence relation on a set $S$ is
actually of the form $\underset{f}{\equiv}$ for some set $T$ and some map
$f:S\rightarrow T$. (Namely, this is proven in Exercise
\ref{exe.eqrel.eqrel.=f} below.)

\begin{example}
\label{exa.eqrel.eqrel.eqrel-continents}Let $S$ be the set of all points on
the landmass of the Earth, and let $\sim$ be the relation on $S$ defined by%
\[
\left(  a\sim b\right)  \Longleftrightarrow\left(  \text{there is a land route
from }a\text{ to }b\right)  .
\]
This $\sim$ is an equivalence relation (with the caveat that $S$ is not a
mathematical object and thus not really well-defined).
\end{example}

\begin{example}
\label{exa.eqrel.eqrel.eqrelQ}Let
\[
S=\mathbb{Z}\times\left(  \mathbb{Z}\setminus\left\{  0\right\}  \right)
=\left\{  \left(  a_{1},a_{2}\right)  \ \mid\ a_{1}\in\mathbb{Z}\text{ and
}a_{2}\in\mathbb{Z}\setminus\left\{  0\right\}  \right\}  .
\]
This is the set of all pairs whose first entry is an integer and whose second
entry is a nonzero integer. We define a relation $\underset{\ast}{\sim}$ on
$S$ by%
\[
\left(  \left(  a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(  b_{1}%
,b_{2}\right)  \right)  \ \Longleftrightarrow\ \left(  a_{1}b_{2}=a_{2}%
b_{1}\right)  .
\]
This relation $\underset{\ast}{\sim}$ is an equivalence relation.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.eqrel.eqrel.eqrelQ}.]Indeed:

\begin{itemize}
\item The relation $\underset{\ast}{\sim}$ is reflexive.

\begin{fineprint}
[\textit{Proof:} Let $a\in S$. Thus, $a\in S=\mathbb{Z}\times\left(
\mathbb{Z}\setminus\left\{  0\right\}  \right)  $; in other words, we can
write $a$ as $a=\left(  a_{1},a_{2}\right)  $ for some $a_{1}\in\mathbb{Z}$
and $a_{2}\in\mathbb{Z}\setminus\left\{  0\right\}  $. Consider these $a_{1}$
and $a_{2}$.

Clearly, $a_{1}a_{2}=a_{2}a_{1}$. In other words, $\left(  a_{1},a_{2}\right)
\underset{\ast}{\sim}\left(  a_{1},a_{2}\right)  $ (because the definition of
the relation $\underset{\ast}{\sim}$ yields that $\left(  a_{1},a_{2}\right)
\underset{\ast}{\sim}\left(  a_{1},a_{2}\right)  $ means $a_{1}a_{2}%
=a_{2}a_{1}$). In other words, $a\underset{\ast}{\sim}a$ (since $a=\left(
a_{1},a_{2}\right)  $).

Now, forget that we fixed $a$. We thus have shown that every $a\in S$
satisfies $a\underset{\ast}{\sim}a$. In other words, the relation
$\underset{\ast}{\sim}$ is reflexive.]
\end{fineprint}

\item The relation $\underset{\ast}{\sim}$ is symmetric.

\begin{fineprint}
[\textit{Proof:} Let $a,b\in S$ be such that $a\underset{\ast}{\sim}b$. We
shall prove that $b\underset{\ast}{\sim}a$.

We have $a\in S=\mathbb{Z}\times\left(  \mathbb{Z}\setminus\left\{  0\right\}
\right)  $; in other words, we can write $a$ as $a=\left(  a_{1},a_{2}\right)
$ for some $a_{1}\in\mathbb{Z}$ and $a_{2}\in\mathbb{Z}\setminus\left\{
0\right\}  $. Similarly, we can write $b$ as $b=\left(  b_{1},b_{2}\right)  $
for some $b_{1}\in\mathbb{Z}$ and $b_{2}\in\mathbb{Z}\setminus\left\{
0\right\}  $. Consider these $a_{1}$, $a_{2}$, $b_{1}$ and $b_{2}$.

We have assumed that $a\underset{\ast}{\sim}b$. In other words, $\left(
a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(  b_{1},b_{2}\right)  $ (since
$a=\left(  a_{1},a_{2}\right)  $ and $b=\left(  b_{1},b_{2}\right)  $). In
other words, $a_{1}b_{2}=a_{2}b_{1}$ (because this is what $\left(
a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(  b_{1},b_{2}\right)  $ means,
by the definition of the relation $\underset{\ast}{\sim}$). Thus, $b_{2}%
a_{1}=a_{1}b_{2}=a_{2}b_{1}=b_{1}a_{2}$; in other words, $b_{1}a_{2}%
=b_{2}a_{1}$. In other words, $\left(  b_{1},b_{2}\right)  \underset{\ast
}{\sim}\left(  a_{1},a_{2}\right)  $ (by the definition of the relation
$\underset{\ast}{\sim}$). In other words, $b\underset{\ast}{\sim}a$ (since
$a=\left(  a_{1},a_{2}\right)  $ and $b=\left(  b_{1},b_{2}\right)  $).

Now, forget that we fixed $a$ and $b$. We thus have shown that every $a,b\in
S$ satisfying $a\underset{\ast}{\sim}b$ satisfy $b\underset{\ast}{\sim}a$. In
other words, the relation $\underset{\ast}{\sim}$ is symmetric.]
\end{fineprint}

\item The relation $\underset{\ast}{\sim}$ is transitive.

\begin{fineprint}
[\textit{Proof:} Let $a,b,c\in S$ be such that $a\underset{\ast}{\sim}b$ and
$b\underset{\ast}{\sim}c$. We shall prove that $a\underset{\ast}{\sim}c$.

We have $a\in S=\mathbb{Z}\times\left(  \mathbb{Z}\setminus\left\{  0\right\}
\right)  $; in other words, we can write $a$ as $a=\left(  a_{1},a_{2}\right)
$ for some $a_{1}\in\mathbb{Z}$ and $a_{2}\in\mathbb{Z}\setminus\left\{
0\right\}  $. Similarly, we can write $b$ as $b=\left(  b_{1},b_{2}\right)  $
for some $b_{1}\in\mathbb{Z}$ and $b_{2}\in\mathbb{Z}\setminus\left\{
0\right\}  $. Similarly, we can write $c$ as $c=\left(  c_{1},c_{2}\right)  $
for some $c_{1}\in\mathbb{Z}$ and $c_{2}\in\mathbb{Z}\setminus\left\{
0\right\}  $. Consider these $a_{1}$, $a_{2}$, $b_{1}$, $b_{2}$, $c_{1}$ and
$c_{2}$. Note that $b_{2}\in\mathbb{Z}\setminus\left\{  0\right\}  $, so that
$b_{2}\neq0$.

We have assumed that $a\underset{\ast}{\sim}b$. In other words, $\left(
a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(  b_{1},b_{2}\right)  $ (since
$a=\left(  a_{1},a_{2}\right)  $ and $b=\left(  b_{1},b_{2}\right)  $). In
other words, $a_{1}b_{2}=a_{2}b_{1}$ (by the definition of the relation
$\underset{\ast}{\sim}$). Similarly (by exploiting the assumption
$b\underset{\ast}{\sim}c$ instead of $a\underset{\ast}{\sim}b$), we can obtain
$b_{1}c_{2}=b_{2}c_{1}$. Hence,%
\[
\underbrace{a_{1}b_{2}}_{=a_{2}b_{1}}c_{2}=a_{2}\underbrace{b_{1}c_{2}%
}_{=b_{2}c_{1}}=a_{2}b_{2}c_{1}.
\]
We can cancel $b_{2}$ from this equality (since $b_{2}\neq0$), and thus obtain
$a_{1}c_{2}=a_{2}c_{1}$. In other words, $\left(  a_{1},a_{2}\right)
\underset{\ast}{\sim}\left(  c_{1},c_{2}\right)  $ (by the definition of the
relation $\underset{\ast}{\sim}$). In other words, $a\underset{\ast}{\sim}c$
(since $a=\left(  a_{1},a_{2}\right)  $ and $c=\left(  c_{1},c_{2}\right)  $).

Now, forget that we fixed $a,b,c$. We thus have shown that every $a,b,c\in S$
satisfying $a\underset{\ast}{\sim}b$ and $b\underset{\ast}{\sim}c$ satisfy
$a\underset{\ast}{\sim}c$. In other words, the relation $\underset{\ast}{\sim
}$ is transitive.]
\end{fineprint}
\end{itemize}

\noindent We have now proven that the relation $\underset{\ast}{\sim}$ is
reflexive, symmetric and transitive. In other words, $\underset{\ast}{\sim}$
is an equivalence relation (by the definition of \textquotedblleft equivalence
relation\textquotedblright). This proves Example \ref{exa.eqrel.eqrel.eqrelQ}.
\end{proof}

The relation $\underset{\ast}{\sim}$ from Example \ref{exa.eqrel.eqrel.eqrelQ}
may appear familiar to you. In fact, its definition can be restated as
follows:%
\[
\left(  \left(  a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(  b_{1}%
,b_{2}\right)  \right)  \ \Longleftrightarrow\ \left(  \dfrac{a_{1}}{a_{2}%
}=\dfrac{b_{1}}{b_{2}}\right)  ,
\]
and this makes the claims of Example \ref{exa.eqrel.eqrel.eqrelQ} a lot more
obvious. However, this is (in a sense) circular reasoning: The statement
\textquotedblleft$\dfrac{a_{1}}{a_{2}}=\dfrac{b_{1}}{b_{2}}$\textquotedblright%
\ only makes sense if the rational numbers have been defined\footnote{since
$\dfrac{a_{1}}{a_{2}}$ and $\dfrac{b_{1}}{b_{2}}$ are (in general) not
integers but rational numbers}, but the definition of rational numbers (at
least the usual definition, given in \cite[\S 3.6]{Swanso18} and in many other
places) already relies on the claims of Example \ref{exa.eqrel.eqrel.eqrelQ}.
(Namely, the rational numbers are defined as the equivalence classes of the
relation $\underset{\ast}{\sim}$; this is explained in Example
\ref{exa.eqrel.eqcl.rat} below.) Thus, our above proof of Example
\ref{exa.eqrel.eqrel.eqrelQ} was not a waste of time, but rather an important
prerequisite for the construction of rational numbers (one of the cornerstones
of mathematics).

If you are familiar with basic linear algebra, you may notice that the
relation $\underset{\ast}{\sim}$ from Example \ref{exa.eqrel.eqrel.eqrelQ} can
also be regarded as linear dependence. Namely, two pairs $\left(  a_{1}%
,a_{2}\right)  $ and $\left(  b_{1},b_{2}\right)  $ in $\mathbb{Z}%
\times\left(  \mathbb{Z}\setminus\left\{  0\right\}  \right)  $ satisfy
$\left(  a_{1},a_{2}\right)  \underset{\ast}{\sim}\left(  b_{1},b_{2}\right)
$ if and only if the vectors $\left(  a_{1},a_{2}\right)  $ and $\left(
b_{1},b_{2}\right)  $ in $\mathbb{Q}^{2}$ are linearly
dependent.\footnote{Note, however, that linear dependence is no longer an
equivalence relation if we allow the vector $\left(  0,0\right)  $ in our set
$S$, because then, it is no longer transitive (for example, $\left(
1,1\right)  $ and $\left(  0,0\right)  $ are linearly dependent, and $\left(
0,0\right)  $ and $\left(  1,2\right)  $ are linearly dependent, but $\left(
1,1\right)  $ and $\left(  1,2\right)  $ are not).}

One simple property of symmetric relations will come useful:

\begin{proposition}
\label{prop.eqrel.rel.symm-ba}Let $\sim$ be a symmetric relation on a set $S$.
Let $a,b\in S$. Then, $a\sim b$ if and only if $b\sim a$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.rel.symm-ba}.]The relation $\sim$ is
symmetric. Thus, if $a$ and $b$ satisfy $a\sim b$, then they also satisfy
$b\sim a$ (by the definition of \textquotedblleft symmetric\textquotedblright%
). In other words, we have the logical implication $\left(  a\sim b\right)
\Longrightarrow\left(  b\sim a\right)  $. But the same argument (with the
roles of $a$ and $b$ interchanged) yields the implication $\left(  b\sim
a\right)  \Longrightarrow\left(  a\sim b\right)  $. Combining these two
implications, we obtain the equivalence $\left(  a\sim b\right)
\Longleftrightarrow\left(  b\sim a\right)  $. This proves Proposition
\ref{prop.eqrel.rel.symm-ba}.
\end{proof}

\subsection{Equivalence classes}

\subsubsection{Definition of equivalence classes}

We can now state one of the most important definitions in mathematics:

\begin{definition}
\label{def.eqrel.eqcl.eqcl}Let $\sim$ be an equivalence relation on a set $S$.

\textbf{(a)} For each $a\in S$, we define a subset $\left[  a\right]  _{\sim}$
of $S$ by%
\begin{equation}
\left[  a\right]  _{\sim}=\left\{  b\in S\ \mid\ b\sim a\right\}  .
\label{eq.def.eqrel.eqcl.eqcl.a.eq}%
\end{equation}
This subset $\left[  a\right]  _{\sim}$ is called the \textit{equivalence
class} of $a$, or the $\sim$\textit{-equivalence class} of $a$.

\textbf{(b)} The \textit{equivalence classes} of $\sim$ are defined to be the
sets $\left[  a\right]  _{\sim}$ for $a\in S$. They are also known as the
$\sim$\textit{-equivalence classes}.
\end{definition}

\begin{example}
\label{exa.eqrel.eqcl.mod3}Consider the relation $\underset{3}{\equiv}$ on
$\mathbb{Z}$ (defined in Example \ref{exa.eqrel.rel.rels1} \textbf{(e)}). We
have%
\begin{align*}
\left[  5\right]  _{\underset{3}{\equiv}}  &  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\underset{3}{\equiv}5\right\}  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\equiv5\operatorname{mod}3\right\} \\
&  =\left\{  \ldots,-4,-1,2,5,8,11,14,\ldots\right\}
\end{align*}
and%
\begin{align*}
\left[  3\right]  _{\underset{3}{\equiv}}  &  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\underset{3}{\equiv}3\right\}  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\equiv3\operatorname{mod}3\right\} \\
&  =\left\{  \ldots,-6,-3,0,3,6,9,12,\ldots\right\}
\end{align*}
and%
\begin{align*}
\left[  2\right]  _{\underset{3}{\equiv}}  &  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\underset{3}{\equiv}2\right\}  =\left\{  b\in\mathbb{Z}%
\ \mid\ b\equiv2\operatorname{mod}3\right\} \\
&  =\left\{  \ldots,-4,-1,2,5,8,11,14,\ldots\right\}  .
\end{align*}
Note that $\left[  5\right]  _{\underset{3}{\equiv}}=\left[  2\right]
_{\underset{3}{\equiv}}$, as you can easily see.
\end{example}

\begin{teachingnote}
Add a simple example here: e.g., the set $\left\{  -3,\ldots,5\right\}  $ with
the \textquotedblleft$\left\vert a\right\vert =\left\vert b\right\vert
$\textquotedblright\ equivalence. Visualize with a \textquotedblleft blob
picture\textquotedblright\ (can probably repurpose the one I gave on a
combinatorics homework set).
\end{teachingnote}

\subsubsection{Basic properties}

\begin{proposition}
\label{prop.eqrel.eqcl.ab}Let $\sim$ be an equivalence relation on a set $S$.
Let $a\in S$. Then,%
\[
\left[  a\right]  _{\sim}=\left\{  b\in S\ \mid\ a\sim b\right\}  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.eqcl.ab}.]The relation $\sim$ is
symmetric (since it is an equivalence relation). Thus, for any $b\in S$, we
have $\left(  a\sim b\text{ if and only if }b\sim a\right)  $ (by Proposition
\ref{prop.eqrel.rel.symm-ba}). Hence, $\left\{  b\in S\ \mid\ a\sim b\right\}
=\left\{  b\in S\ \mid\ b\sim a\right\}  $. Comparing this with
(\ref{eq.def.eqrel.eqcl.eqcl.a.eq}), we obtain $\left[  a\right]  _{\sim
}=\left\{  b\in S\ \mid\ a\sim b\right\}  $. This proves Proposition
\ref{prop.eqrel.eqcl.ab}.
\end{proof}

Proposition \ref{prop.eqrel.eqcl.ab} shows that we can replace the condition
\textquotedblleft$b\sim a$\textquotedblright\ by \textquotedblleft$a\sim
b$\textquotedblright\ in Definition \ref{def.eqrel.eqcl.eqcl} \textbf{(a)}
without changing the meaning of the definition. (Some authors, such as Swanson
in \cite[Definition 2.3.6]{Swanso18}, do exactly that.)

\begin{proposition}
\label{prop.eqrel.eqcl.aina}Let $\sim$ be an equivalence relation on a set
$S$. Let $a\in S$. Then, $a\in\left[  a\right]  _{\sim}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.eqcl.aina}.]The relation $\sim$ is
reflexive (since it is an equivalence relation). Thus, $a\sim a$. In other
words, $a$ is a $b\in S$ satisfying $b\sim a$. In other words, $a\in\left\{
b\in S\ \mid\ b\sim a\right\}  $. But $\left[  a\right]  _{\sim}=\left\{  b\in
S\ \mid\ b\sim a\right\}  $ (by the definition of $\left[  a\right]  _{\sim}%
$). Hence, $a\in\left\{  b\in S\ \mid\ b\sim a\right\}  =\left[  a\right]
_{\sim}$. This proves Proposition \ref{prop.eqrel.eqcl.aina}.
\end{proof}

Proposition \ref{prop.eqrel.eqcl.aina} shows that all equivalence classes of
an equivalence relation are nonempty sets (because each equivalence class
$\left[  a\right]  _{\sim}$ contains at least the element $a$).

\begin{theorem}
\label{thm.eqrel.eqcl.disj}Let $\sim$ be an equivalence relation on a set $S$.
Let $x,y\in S$.

\textbf{(a)} If $x\sim y$, then $\left[  x\right]  _{\sim}=\left[  y\right]
_{\sim}$.

\textbf{(b)} If not $x\sim y$, then the sets $\left[  x\right]  _{\sim}$ and
$\left[  y\right]  _{\sim}$ are disjoint.

\textbf{(c)} We have $x\sim y$ if and only if $x\in\left[  y\right]  _{\sim}$.

\textbf{(d)} We have $x\sim y$ if and only if $y\in\left[  x\right]  _{\sim}$.

\textbf{(e)} We have $x\sim y$ if and only if $\left[  x\right]  _{\sim
}=\left[  y\right]  _{\sim}$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.eqrel.eqcl.disj}.]The relation $\sim$ is transitive
(since it is an equivalence relation) and symmetric (for the same reason).

The definition of $\left[  x\right]  _{\sim}$ yields $\left[  x\right]
_{\sim}=\left\{  b\in S\ \mid\ b\sim x\right\}  $. Similarly, $\left[
y\right]  _{\sim}=\left\{  b\in S\ \mid\ b\sim y\right\}  $.

\textbf{(a)} Assume that $x\sim y$. Thus, $y\sim x$ (since the relation $\sim$
is symmetric).

Let $c\in\left[  x\right]  _{\sim}$. Thus, $c\in\left[  x\right]  _{\sim
}=\left\{  b\in S\ \mid\ b\sim x\right\}  $. Thus, $c\sim x$. From $c\sim x$
and $x\sim y$, we obtain $c\sim y$ (since the relation $\sim$ is transitive).
Hence, $c\in\left\{  b\in S\ \mid\ b\sim y\right\}  $. In other words,
$c\in\left[  y\right]  _{\sim}$ (since $\left[  y\right]  _{\sim}=\left\{
b\in S\ \mid\ b\sim y\right\}  $).

Forget that we fixed $c$. We thus have proven that $c\in\left[  y\right]
_{\sim}$ for each $c\in\left[  x\right]  _{\sim}$. Thus, $\left[  x\right]
_{\sim}\subseteq\left[  y\right]  _{\sim}$. The same argument (with $x$ and
$y$ switched) yields $\left[  y\right]  _{\sim}\subseteq\left[  x\right]
_{\sim}$ (since $y\sim x$). Combining $\left[  x\right]  _{\sim}%
\subseteq\left[  y\right]  _{\sim}$ with $\left[  y\right]  _{\sim}%
\subseteq\left[  x\right]  _{\sim}$, we obtain $\left[  x\right]  _{\sim
}=\left[  y\right]  _{\sim}$. This proves Theorem \ref{thm.eqrel.eqcl.disj}
\textbf{(a)}.

\textbf{(b)} Assume that we don't have $x\sim y$. Let $c\in\left[  x\right]
_{\sim}\cap\left[  y\right]  _{\sim}$. We aim for a contradiction.

We have $c\in\left[  x\right]  _{\sim}\cap\left[  y\right]  _{\sim}%
\subseteq\left[  x\right]  _{\sim}=\left\{  b\in S\ \mid\ b\sim x\right\}  $,
so that $c\sim x$. Likewise, $c\sim y$. From $c\sim x$, we obtain $x\sim c$
(since the relation $\sim$ is symmetric). Combining this with $c\sim y$, we
obtain $x\sim y$ (since $\sim$ is transitive). This contradicts our assumption
that we don't have $x\sim y$.

Now, forget that we fixed $c$. So we have found a contradiction for each
$c\in\left[  x\right]  _{\sim}\cap\left[  y\right]  _{\sim}$. Thus, there is
no such $c$. In other words, $\left[  x\right]  _{\sim}\cap\left[  y\right]
_{\sim}=\varnothing$. In other words, the sets $\left[  x\right]  _{\sim}$ and
$\left[  y\right]  _{\sim}$ are disjoint. This proves Theorem
\ref{thm.eqrel.eqcl.disj} \textbf{(b)}.

\textbf{(c)} Recall that $\left[  y\right]  _{\sim}=\left\{  b\in
S\ \mid\ b\sim y\right\}  $. Thus, we have $x\in\left[  y\right]  _{\sim}$ if
and only if $x\sim y$. In other words, we have $x\sim y$ if and only if
$x\in\left[  y\right]  _{\sim}$. This proves Theorem \ref{thm.eqrel.eqcl.disj}
\textbf{(c)}.

\textbf{(d)} Theorem \ref{thm.eqrel.eqcl.disj} \textbf{(c)} (applied to $y$
and $x$ instead of $x$ and $y$) shows that we have $y\sim x$ if and only if
$y\in\left[  x\right]  _{\sim}$. In other words, we have the logical
equivalence $\left(  y\sim x\right)  \Longleftrightarrow\left(  y\in\left[
x\right]  _{\sim}\right)  $.

Proposition \ref{prop.eqrel.rel.symm-ba} (applied to $a=x$ and $b=y$) shows
that we have $x\sim y$ if and only if $y\sim x$. Thus, we have the following
chain of logical equivalences:
\[
\left(  x\sim y\right)  \Longleftrightarrow\left(  y\sim x\right)
\Longleftrightarrow\left(  y\in\left[  x\right]  _{\sim}\right)  .
\]
In other words, we have $x\sim y$ if and only if $y\in\left[  x\right]
_{\sim}$. This proves Theorem \ref{thm.eqrel.eqcl.disj} \textbf{(d)}.

\textbf{(e)} $\Longrightarrow:$ Assume that $x\sim y$. Then, Theorem
\ref{thm.eqrel.eqcl.disj} \textbf{(a)} yields $\left[  x\right]  _{\sim
}=\left[  y\right]  _{\sim}$. Thus, the \textquotedblleft$\Longrightarrow
$\textquotedblright\ direction of Theorem \ref{thm.eqrel.eqcl.disj}
\textbf{(e)} is proven.

$\Longleftarrow:$ Assume that $\left[  x\right]  _{\sim}=\left[  y\right]
_{\sim}$. Then, Proposition \ref{prop.eqrel.eqcl.aina} (applied to $a=x$)
yields $x\in\left[  x\right]  _{\sim}=\left[  y\right]  _{\sim}=\left\{  b\in
S\ \mid\ b\sim y\right\}  $. In other words, $x\sim y$. This proves the
\textquotedblleft$\Longleftarrow$\textquotedblright\ direction of Theorem
\ref{thm.eqrel.eqcl.disj} \textbf{(e)}.
\end{proof}

Theorem \ref{thm.eqrel.eqcl.disj} yields an important property of equivalence classes:

\begin{exercise}
\label{exe.eqrel.eqcl.dj}Let $\sim$ be an equivalence relation on a set $S$.
Prove that any two equivalence classes of $\sim$ are either identical or disjoint.
\end{exercise}

In the following, we will try to use Greek letters for equivalence classes and
Roman letters for their representatives. (See the solution to Exercise
\ref{exe.eqrel.eqcl.dj} for an example.)

\begin{teachingnote}
\textbf{2019-02-22 lecture}
\end{teachingnote}

\subsubsection{More examples}

\begin{example}
\label{exa.eqrel.eqcl.rat}Consider the relation $\underset{\ast}{\sim}$ on
$S=\mathbb{Z}\times\left(  \mathbb{Z}\setminus\left\{  0\right\}  \right)  $
defined in Example \ref{exa.eqrel.eqrel.eqrelQ}. Its equivalence classes are
the rational numbers. Indeed, the equivalence class $\left[  \left(
a_{1},a_{2}\right)  \right]  _{\underset{\ast}{\sim}}$ of a pair $\left(
a_{1},a_{2}\right)  \in S$ is commonly denoted by $\dfrac{a_{1}}{a_{2}}$ (or
by $a_{1}/a_{2}$). This is how rational numbers are defined!
\end{example}

Equivalence classes appear in real life too, at least in the modern world.
When you say that the sun rises approximately at 7 AM in February\footnote{in
Minneapolis}, what do \textquotedblleft7 AM\textquotedblright\ and
\textquotedblleft February\textquotedblright\ mean? Clearly, \textquotedblleft
February\textquotedblright\ is not a specific month in history, since each
year has its own February. Rather, it stands for an equivalence class of
months, with respect to the relation of \textquotedblleft being an integer
number of years apart\textquotedblright. Similarly, \textquotedblleft7
AM\textquotedblright\ means an equivalence class of moments with respect to
the relation of \textquotedblleft being an integer number of days
apart\textquotedblright. Likewise, \textquotedblleft the
horse\textquotedblright\ in \textquotedblleft the horse has a lifespan of 25
years\textquotedblright\ refers not to a specific horse, but to the whole
species, which is an equivalence class of creatures with respect to a certain
relation\footnote{According to Darwin, the relation is \textquotedblleft being
able to procreate\textquotedblright\ -- although this is not per se an
equivalence relation, so some tweaks need to be made (\textquotedblleft
reflexive-and-transitive closure\textquotedblright) to turn it into one.}.
Finally, the equivalence classes of the relation $\sim$ in Example
\ref{exa.eqrel.eqrel.eqrel-continents} are commonly referred to as
\textquotedblleft continents\textquotedblright\footnote{at least if one
considers Eurasia to be a single continent} or \textquotedblleft
islands\textquotedblright. Equivalence classes provide a way to refer to
multiple objects (usually similar in some way) as if they were one.

\subsubsection{The \textquotedblleft is a permutation of\textquotedblright%
\ relation on tuples}

Let us give a few more mathematical examples for equivalences and equivalence classes:

\begin{definition}
\label{def.eqrel.eqcl.perm}Let $A$ be a set, and let $k\in\mathbb{N}$. As we
know, $A^{k}$ denotes the set of all $k$-tuples of elements of $A$.

The relation $\underset{\operatorname*{perm}}{\sim}$ on $A^{k}$ is defined as
follows:%
\[
\left(  \mathbf{p}\underset{\operatorname*{perm}}{\sim}\mathbf{q}\right)
\Longleftrightarrow\left(  \mathbf{p}\text{ is a permutation of }%
\mathbf{q}\right)  .
\]
(We are using Definition \ref{def.comb.tuples.perm-tup} here.) For example,
$\left(  3,8,8,2\right)  \underset{\operatorname*{perm}}{\sim}\left(
8,3,2,8\right)  $.
\end{definition}

\begin{exercise}
\label{exe.eqrel.eqcl.perm.eq}Prove that the relation
$\underset{\operatorname*{perm}}{\sim}$ is an equivalence relation.
\end{exercise}

\begin{definition}
\label{def.eqrel.eqcl.perm.unord-tup}Let $A$ be a set, and let $k\in
\mathbb{N}$. The relation $\underset{\operatorname*{perm}}{\sim}$ on $A^{k}$
is an equivalence relation (by Exercise \ref{exe.eqrel.eqcl.perm.eq}). Its
equivalence classes are called the \textit{unordered }$k$\textit{-tuples} of
elements of $A$. For example, for $k=2$ and $A=\mathbb{Z}$, the two $2$-tuples
$\left(  6,8\right)  $ and $\left(  8,6\right)  $ are permutations of each
other, so $\left(  6,8\right)  \underset{\operatorname*{perm}}{\sim}\left(
8,6\right)  $ and thus $\left[  \left(  6,8\right)  \right]
_{\underset{\operatorname*{perm}}{\sim}}=\left[  \left(  8,6\right)  \right]
_{\underset{\operatorname*{perm}}{\sim}}$.
\end{definition}

\subsubsection{The \textquotedblleft is a cyclic rotation of\textquotedblright%
\ relation on tuples}

Another example of an equivalence relation is the following:

\begin{definition}
\label{def.eqrel.eqcl.cyc}Again, let $A$ be a set and $k\in\mathbb{N}$. If
$\mathbf{a}=\left(  a_{1},a_{2},\ldots,a_{k}\right)  \in A^{k}$, then a
\textit{cyclic rotation} of $\mathbf{a}$ means a $k$-tuple of the form%
\[
\left(  a_{i+1},a_{i+2},\ldots,a_{k},a_{1},a_{2},\ldots,a_{i}\right)  \in
A^{k}%
\]
for some $i\in\left\{  0,1,\ldots,k\right\}  $.

For example, the cyclic rotations of the $3$-tuple $\left(  1,4,5\right)  $
are $\left(  1,4,5\right)  $, $\left(  4,5,1\right)  $ and $\left(
5,1,4\right)  $.

(Here is an equivalent description of cyclic rotations: Let $C$ be the map
$A^{k}\rightarrow A^{k}$ that sends each $k$-tuple $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $ to $\left(  a_{2},a_{3},\ldots,a_{k},a_{1}\right)  $.
Then, it is easy to see that a cyclic rotation of $\mathbf{a}$ is the same as
a $k$-tuple of the form $C^{i}\left(  \mathbf{a}\right)  $ for some
$i\in\left\{  0,1,\ldots,k\right\}  $. But it is also easy to see that
$C^{k}=\operatorname*{id}$. Thus, the $C^{i}\left(  \mathbf{a}\right)  $ for
$i\in\left\{  0,1,\ldots,k\right\}  $ are exactly the $C^{i}\left(
\mathbf{a}\right)  $ for $i\in\mathbb{N}$.)

The relation $\underset{\operatorname*{cyc}}{\sim}$ on $A^{k}$ is defined as
follows:%
\begin{align*}
\left(  \mathbf{p}\underset{\operatorname*{cyc}}{\sim}\mathbf{q}\right)   &
\Longleftrightarrow\ \left(  \mathbf{p}\text{ is a cyclic rotation of
}\mathbf{q}\right) \\
&  \Longleftrightarrow\ \left(  \mathbf{p}=C^{i}\left(  \mathbf{q}\right)
\text{ for some }i\in\mathbb{N}\right)  .
\end{align*}


This relation $\underset{\operatorname*{cyc}}{\sim}$ is an equivalence
relation. Its equivalence classes are called \textit{necklaces} of length $k$
over $A$.
\end{definition}

We shall not prove the statements claimed in this definition, since they are
particular cases of more general results that will be proven below (about
groups acting on sets).

For example, the necklaces of length $3$ over the set $A=\left\{  1,2\right\}
$ are%
\begin{align*}
\left[  \left(  1,1,1\right)  \right]  _{\underset{\operatorname*{cyc}}{\sim
}}  &  =\left\{  \left(  1,1,1\right)  \right\}  ,\\
\left[  \left(  1,1,2\right)  \right]  _{\underset{\operatorname*{cyc}}{\sim
}}  &  =\left\{  \left(  1,1,2\right)  ,\left(  1,2,1\right)  ,\left(
2,1,1\right)  \right\}  ,\\
\left[  \left(  1,2,2\right)  \right]  _{\underset{\operatorname*{cyc}}{\sim
}}  &  =\left\{  \left(  1,2,2\right)  ,\left(  2,2,1\right)  ,\left(
2,1,2\right)  \right\}  ,\\
\left[  \left(  2,2,2\right)  \right]  _{\underset{\operatorname*{cyc}}{\sim
}}  &  =\left\{  \left(  2,2,2\right)  \right\}  .
\end{align*}
This may suggest that a necklace $\left[  \left(  a_{1},a_{2},\ldots
,a_{k}\right)  \right]  _{\underset{\operatorname*{cyc}}{\sim}}$ is uniquely
determined by how often each element appears in the tuple $\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $. But this is not true in general; for example,
if $A=\left\{  1,2,3\right\}  $, then%
\begin{align*}
\left[  \left(  1,2,3\right)  \right]  _{\underset{\operatorname*{cyc}}{\sim
}}  &  =\left\{  \left(  1,2,3\right)  ,\left(  2,3,1\right)  ,\left(
3,1,2\right)  \right\}  \ \ \ \ \ \ \ \ \ \ \text{and}\\
\left[  \left(  1,3,2\right)  \right]  _{\underset{\operatorname*{cyc}}{\sim
}}  &  =\left\{  \left(  1,3,2\right)  ,\left(  3,2,1\right)  ,\left(
2,1,3\right)  \right\}
\end{align*}
are two different necklaces of length $3$ over the set $A=\left\{
1,2,3\right\}  $.

How many necklaces of length $k$ over a $q$-element set $A$ exist? It turns
out that there is a nice formula for this, involving Euler's totient function
$\phi$:

\begin{theorem}
\label{thm.eqrel.eqcl.necklace-count}Let $k$ be a positive integer. Let $A$ be
a $q$-element set (where $q\in\mathbb{N}$). Then, the number of necklaces of
length $k$ over the set $A$ is%
\[
\dfrac{1}{k}\sum_{d\mid k}\phi\left(  d\right)  q^{k/d}.
\]

\end{theorem}

Note that it is not (a priori) clear that $\dfrac{1}{k}\sum_{d\mid k}%
\phi\left(  d\right)  q^{k/d}$ is an integer! Actually, this holds even when
$q$ is a negative integer, even though there exist no $q$-element sets in that
case. Thus, $\dfrac{1}{k}\sum_{d\mid k}\phi\left(  d\right)  x^{k/d}$ is
another integer-valued polynomial for each positive integer $k$.

We will prove Theorem \ref{thm.eqrel.eqcl.necklace-count} using the concept of
group actions further below.

\subsubsection{Definition of the quotient set and the projection map}

\begin{definition}
\label{def.eqrel.eqcl.proj}Let $S$ be a set, and let $\sim$ be an equivalence
relation on $S$.

\textbf{(a)} The set of equivalence classes of $\sim$ is denoted by $S/\sim$.
It is called the \textit{quotient} (or \textit{quotient set}) of $S$ by $\sim$.

\textbf{(b)} The map%
\begin{align*}
S  &  \rightarrow\left.  S/\sim\right.  ,\\
s  &  \mapsto\left[  s\right]  _{\sim}%
\end{align*}
(which sends each element $s\in S$ to its equivalence class) is called the
\textit{canonical projection (onto the quotient)}, and we will denote it by
$\pi_{\sim}$.

\textbf{(c)} An element of an equivalence class of $\sim$ is also called a
\textit{representative} of this class.
\end{definition}

\begin{exercise}
\label{exe.eqrel.eqrel.=f}Let $S$ be a set.

Recall that if $T$ is a further set, and if $f:S\rightarrow T$ is a map, then
an equivalence relation $\underset{f}{\equiv}$ is defined on the set $S$. (See
Example \ref{exa.eqrel.eqrel.eqrelf} for its definition.)

Now, let $\sim$ be \textbf{any} equivalence relation on $S$. Prove that $\sim$
has the form $\underset{f}{\equiv}$ for a properly chosen set $T$ and a
properly chosen $f:S\rightarrow T$.

More precisely, prove that $\sim$ equals $\underset{f}{\equiv}$, where $T$ is
the quotient set $S/\sim$ and where $f:S\rightarrow T$ is the canonical
projection $\pi_{\sim}:S\rightarrow S/\sim$.

[\textbf{Hint:} To prove that two relations $R_{1}$ and $R_{2}$ on $S$ are
equal, you need to check that every pair $\left(  a,b\right)  $ of elements of
$S$ satisfies the equivalence $\left(  aR_{1}b\right)  \iff\left(
aR_{2}b\right)  $.]
\end{exercise}

\subsection{\label{sect.eqrel.Z/n}$\mathbb{Z}/n$ (\textquotedblleft integers
modulo $n$\textquotedblright)}

We now come to one of the most important example of equivalence classes: the
residue classes of integers modulo a given positive integer $n$.

\begin{convention}
For the whole Section \ref{sect.eqrel.Z/n}, we fix an integer $n$.
\end{convention}

\subsubsection{Definition of $\mathbb{Z}/n$}

\begin{definition}
\label{def.eqrel.Z/n.res-class}\textbf{(a)} Define a relation
$\underset{n}{\equiv}$ on the set $\mathbb{Z}$ by
\[
\left(  a\underset{n}{\equiv}b\right)  \Longleftrightarrow\left(  a\equiv
b\operatorname{mod}n\right)  .
\]
(This is precisely the relation $\underset{n}{\equiv}$ from Example
\ref{exa.eqrel.rel.rels1} \textbf{(e)}.)

Recall that $\underset{n}{\equiv}$ is an equivalence relation (by Example
\ref{exa.eqrel.eqrel.eqrelmodn}).

\textbf{(b)} A \textit{residue class modulo}\textbf{ }$n$ means an equivalence
class of the relation $\underset{n}{\equiv}$.
\end{definition}

For example,%
\begin{align*}
\left[  0\right]  _{\underset{5}{\equiv}}  &  =\left\{  \ldots
,-15,-10,-5,0,5,10,15,20,\ldots\right\}  ,\\
\left[  1\right]  _{\underset{5}{\equiv}}  &  =\left\{  \ldots
,-14,-9,-4,1,6,11,16,21,\ldots\right\}  ,\\
\left[  2\right]  _{\underset{5}{\equiv}}  &  =\left\{  \ldots
,-13,-8,-3,2,7,12,17,22,\ldots\right\}  ,\\
\left[  3\right]  _{\underset{5}{\equiv}}  &  =\left\{  \ldots
,-12,-7,-2,3,8,13,18,23,\ldots\right\}  ,\\
\left[  4\right]  _{\underset{5}{\equiv}}  &  =\left\{  \ldots
,-11,-6,-1,4,9,14,19,24,\ldots\right\}
\end{align*}
are all the residue classes modulo $5$. As you see, these classes are in
1-to-1 correspondence with the $5$ possible remainders $0,1,2,3,4$ modulo $5$.
This generalizes (see Theorem \ref{thm.eqrel.Z/n.explicit} below). First, let
us introduce a few notations:

\begin{definition}
\label{def.eqrel.Z/n.Z/n}\textbf{(a)} If $i$ is an integer, then we denote the
residue class $\left[  i\right]  _{\underset{n}{\equiv}}$ by $\left[
i\right]  _{n}$. (Some authors denote this residue class by $\overline{i}_{n}$
or $i\operatorname{mod}n$. Be careful with the notation $i\operatorname{mod}%
n$, since other authors use it for the integer $i\%n$ when $n$ is positive.)

\textbf{(b)} The set $\mathbb{Z}/\underset{n}{\equiv}$ of all residue classes
modulo $n$ is called $\mathbb{Z}/n$. (Some authors call it $\mathbb{Z}/\left(
n\right)  $ or $\mathbb{Z}/n\mathbb{Z}$ or $\mathbb{Z}_{n}$. Be careful with
the notation $\mathbb{Z}_{n}$, since it has a different meaning, too.)
\end{definition}

\subsubsection{What $\mathbb{Z}/n$ looks like}

Let us now state and rigorously prove what we have just observed on the
example of $n=5$:

\begin{theorem}
\label{thm.eqrel.Z/n.explicit}Assume that the integer $n$ is positive.

The set $\mathbb{Z}/n$ has exactly $n$ elements, namely $\left[  0\right]
_{n},\left[  1\right]  _{n},\ldots,\left[  n-1\right]  _{n}$. (In particular,
these elements $\left[  0\right]  _{n},\left[  1\right]  _{n},\ldots,\left[
n-1\right]  _{n}$ are distinct.)
\end{theorem}

Before we prove this, let us make a simple observation:

\begin{proposition}
\label{prop.eqrel.Z/n.ab}\textbf{(a)} Each element of $\mathbb{Z}/n$ can be
written in the form $\left[  s\right]  _{n}$ for some integer $s$.

\textbf{(b)} Let $a$ and $b$ be integers. Then, we have $\left[  a\right]
_{n}=\left[  b\right]  _{n}$ if and only if $a\equiv b\operatorname{mod}n$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.Z/n.ab}.]\textbf{(a)} If $\sigma
\in\mathbb{Z}/n$, then $\sigma$ is a residue class modulo $n$ (by the
definition of $\mathbb{Z}/n$), and thus is an equivalence class of the
relation $\underset{n}{\equiv}$ (by the definition of a residue class). Hence,
this $\sigma$ can be written in the form $\left[  s\right]
_{\underset{n}{\equiv}}$ for some integer $s$. In other words, this $\sigma$
can be written in the form $\left[  s\right]  _{n}$ for some integer $s$
(since we have defined $\left[  s\right]  _{n}$ to be a shorthand for $\left[
s\right]  _{\underset{n}{\equiv}}$). In other words, each element of
$\mathbb{Z}/n$ can be written in the form $\left[  s\right]  _{n}$ for some
integer $s$. This proves Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(a)}.

\textbf{(b)} Theorem \ref{thm.eqrel.eqcl.disj} \textbf{(e)} (applied to
$\mathbb{Z}$, $\underset{n}{\equiv}$, $a$ and $b$ instead of $S$, $\sim$, $x$
and $y$) shows that we have $a\underset{n}{\equiv}b$ if and only if $\left[
a\right]  _{\underset{n}{\equiv}}=\left[  b\right]  _{\underset{n}{\equiv}}$.
Thus, we have the logical equivalence
\begin{equation}
\left(  a\underset{n}{\equiv}b\right)  \ \Longleftrightarrow\ \left(  \left[
a\right]  _{\underset{n}{\equiv}}=\left[  b\right]  _{\underset{n}{\equiv}%
}\right)  . \label{pf.prop.eqrel.Z/n.ab.1}%
\end{equation}


Definition \ref{def.eqrel.Z/n.Z/n} \textbf{(a)} shows that $\left[  a\right]
_{n}=\left[  a\right]  _{\underset{n}{\equiv}}$ and $\left[  b\right]
_{n}=\left[  b\right]  _{\underset{n}{\equiv}}$. Hence, we have the following
chain of logical equivalences:
\begin{align*}
\left(  \left[  a\right]  _{n}=\left[  b\right]  _{n}\right)  \  &
\Longleftrightarrow\ \left(  \left[  a\right]  _{\underset{n}{\equiv}}=\left[
b\right]  _{\underset{n}{\equiv}}\right)  \ \Longleftrightarrow\ \left(
a\underset{n}{\equiv}b\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.eqrel.Z/n.ab.1})}\right) \\
&  \Longleftrightarrow\ \left(  a\equiv b\operatorname{mod}n\right)
\end{align*}
(by the definition of the relation $\underset{n}{\equiv}$). In other words, we
have $\left[  a\right]  _{n}=\left[  b\right]  _{n}$ if and only if $a\equiv
b\operatorname{mod}n$. This proves Proposition \ref{prop.eqrel.Z/n.ab}
\textbf{(b)}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.eqrel.Z/n.explicit}.]We have a map%
\begin{align*}
\pi_{\underset{n}{\equiv}}:\mathbb{Z}  &  \rightarrow\mathbb{Z}/n,\\
s  &  \mapsto\left[  s\right]  _{n}.
\end{align*}
(This is simply the map $\pi_{\sim}$ defined in Definition
\ref{def.eqrel.eqcl.proj} \textbf{(b)}, applied to the case when
$S=\mathbb{Z}$ and when $\sim$ is the equivalence relation
$\underset{n}{\equiv}$.)

We restrict this map $\underset{n}{\equiv}$ to the set $\left\{
0,1,\ldots,n-1\right\}  $; we thus obtain a map%
\begin{align*}
P:\left\{  0,1,\ldots,n-1\right\}   &  \rightarrow\mathbb{Z}/n,\\
s  &  \mapsto\left[  s\right]  _{n}.
\end{align*}
Our goal is to prove that this map $P$ is bijective.

In general, there are two ways in which one usually proves that a map is
bijective: One way is to prove that it is surjective and injective; the other
way is by constructing an inverse to this map. Both ways can be used here; let
us follow the second way, since it demonstrates an important point about
equivalence classes.

So we want to construct an inverse to the map $P$. To do so, we try to define
a map%
\begin{align*}
R:\mathbb{Z}/n  &  \rightarrow\left\{  0,1,\ldots,n-1\right\}  ,\\
\left[  s\right]  _{n}  &  \mapsto s\%n
\end{align*}
(that is, a map $R:\mathbb{Z}/n\rightarrow\left\{  0,1,\ldots,n-1\right\}  $
that sends each residue class $\left[  s\right]  _{n}$ to the remainder
$s\%n$). Can we do this? Would this map $R$ be actually well-defined?

First of all, our definition of $R$ does indeed specify a value of $R\left(
\sigma\right)  $ for each $\sigma\in\mathbb{Z}/n$. This is because each
element of $\mathbb{Z}/n$ can be written in the form $\left[  s\right]  _{n}$
for some integer $s$ (because of Proposition \ref{prop.eqrel.Z/n.ab}
\textbf{(a)}), and therefore our definition tells us where this element should
go under $R$.

Furthermore, if $s$ is an integer, then $s\%n\in\left\{  0,1,\ldots
,n-1\right\}  $ (by Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)},
applied to $u=s$). Hence, our definition of $R$ does not require the map $R$
to take values lying outside of its target\footnote{This is one way in which
maps can fail to be well-defined. For example, the map
\[
\mathbb{N}\rightarrow\mathbb{N},\ \ \ \ \ \ \ \ \ \ i\mapsto i-1
\]
is not well-defined for this reason (because $i-1\notin\mathbb{N}$ for
$i=0$).}.

However, there is one more thing that could go wrong with our definition of
$R$: One element $\sigma$ of $\mathbb{Z}/n$ can be written as $\left[
s\right]  _{n}$ for several different integers $s$. For instance, $\left[
2\right]  _{5}=\left[  7\right]  _{5}=\left[  12\right]  _{5}=\left[
17\right]  _{5}=\cdots$. If the remainders $s\%n$ of these integers $s$ were
different, then the map $R$ would have to send the class $\sigma$ to several
different numbers, and this is not something a map can do. To see an example
where this does go wrong, let us try to define a map%
\begin{align*}
R_{\operatorname*{wrong}}:\mathbb{Z}/n  &  \rightarrow\left\{  0,1,\ldots
,n-1\right\}  ,\\
\left[  s\right]  _{n}  &  \mapsto s\%\left(  n+1\right)  .
\end{align*}
So this definition of $R_{\operatorname*{wrong}}$ is identical to our
definition of $R$ above, except that we are sending $\left[  s\right]  _{n}$
to $s\%\left(  n+1\right)  $ rather than to $s\%n$. However,
$R_{\operatorname*{wrong}}$ does not actually exist. In fact, if this
ostensible map $R_{\operatorname*{wrong}}$ would exist, then it would have to
send $\left[  0\right]  _{n}$ to $0\%\left(  n+1\right)  =0$ and send $\left[
-n\right]  _{n}$ to $\left(  -n\right)  \%\left(  n+1\right)  =1$%
\ \ \ \ \footnote{The equality $\left(  -n\right)  \%\left(  n+1\right)  =1$
follows from writing $-n$ in the form $-n=\left(  -1\right)  \cdot\left(
n+1\right)  +1$.}; however, $\left[  0\right]  _{n}$ and $\left[  -n\right]
_{n}$ are the same residue class (since $0\equiv-n\operatorname{mod}n$),
whereas $0$ and $1$ are not the same number, and thus this map
$R_{\operatorname*{wrong}}$ would send the same class to two different
numbers. Thus, the map $R_{\operatorname*{wrong}}$ does not exist.

We shall now check that our above definition of $R$ does \textbf{not} suffer
from this problem. In other words, we shall check that in the definition of
\begin{align*}
R:\mathbb{Z}/n  &  \rightarrow\left\{  0,1,\ldots,n-1\right\}  ,\\
\left[  s\right]  _{n}  &  \mapsto s\%n,
\end{align*}
any two possible integers $s$ leading to the same class $\left[  s\right]
_{n}$ also lead to the same remainder $s\%n$. In other words, we shall prove
the following claim:

\begin{statement}
\textit{Claim 1:} If $s_{1}$ and $s_{2}$ are two integers such that $\left[
s_{1}\right]  _{n}=\left[  s_{2}\right]  _{n}$, then $s_{1}\%n=s_{2}\%n$.
\end{statement}

[\textit{Proof of Claim 1:} Let $s_{1}$ and $s_{2}$ be two integers such that
$\left[  s_{1}\right]  _{n}=\left[  s_{2}\right]  _{n}$.

Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $s_{1}$ and
$s_{2}$ instead of $a$ and $b$) shows that we have $\left[  s_{1}\right]
_{n}=\left[  s_{2}\right]  _{n}$ if and only if $s_{1}\equiv s_{2}%
\operatorname{mod}n$. Thus, we have $s_{1}\equiv s_{2}\operatorname{mod}n$
(since $\left[  s_{1}\right]  _{n}=\left[  s_{2}\right]  _{n}$). But Exercise
\ref{exe.ent.quo-rem.mod=rem} (applied to $u=s_{1}$ and $v=s_{2}$) shows that
$s_{1}\equiv s_{2}\operatorname{mod}n$ if and only if $s_{1}\%n=s_{2}\%n$.
Hence, we have $s_{1}\%n=s_{2}\%n$. This proves Claim 1.]

Claim 1 shows that if $s$ is an integer, then $s\%n$ depends only on the
\textbf{residue class} $\left[  s\right]  _{n}$, but not on the actual integer
$s$. Thus, if we have a residue class $\sigma\in\mathbb{Z}/n$, then we can
write $\sigma$ in the form $\sigma=\left[  s\right]  _{n}$ for some integer
$s$ (since every residue class in $\mathbb{Z}/n$ can be written in this form),
and then the integer $s\%n$ will depend only on the class $\sigma$ and not on
the specific choice of this integer $s$. Hence, the map $R$ is well-defined.

Now we have two maps%
\begin{align*}
P:\left\{  0,1,\ldots,n-1\right\}   &  \rightarrow\mathbb{Z}/n,\\
s  &  \mapsto\left[  s\right]  _{n}%
\end{align*}
and%
\begin{align*}
R:\mathbb{Z}/n  &  \rightarrow\left\{  0,1,\ldots,n-1\right\}  ,\\
\left[  s\right]  _{n}  &  \mapsto s\%n.
\end{align*}
We claim that they are mutually inverse. Indeed:

\begin{itemize}
\item We have $P\circ R=\operatorname*{id}$.

[\textit{Proof:} Let $\sigma\in\mathbb{Z}/n$. We shall prove that $\left(
P\circ R\right)  \left(  \sigma\right)  =\operatorname*{id}\left(
\sigma\right)  $.

Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(a)} says that each element of
$\mathbb{Z}/n$ can be written in the form $\left[  s\right]  _{n}$ for some
integer $s$. Hence, $\sigma$ can be written in this form. In other words,
$\sigma=\left[  s\right]  _{n}$ for some integer $s$. Consider this $s$. The
definition of $R$ yields $R\left(  \left[  s\right]  _{n}\right)  =s\%n$.
Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $u=s$) yields
$s\%n\equiv s\operatorname{mod}n$. Now, from $\sigma=\left[  s\right]  _{n}$,
we obtain%
\begin{align*}
\left(  P\circ R\right)  \left(  \sigma\right)   &  =\left(  P\circ R\right)
\left(  \left[  s\right]  _{n}\right)  =P\left(  \underbrace{R\left(  \left[
s\right]  _{n}\right)  }_{=s\%n}\right)  =P\left(  s\%n\right) \\
&  =\left[  s\%n\right]  _{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the
definition of }P\right) \\
&  =\left[  s\right]  _{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }s\%n\equiv
s\operatorname{mod}n\right) \\
&  =\sigma=\operatorname*{id}\left(  \sigma\right)  .
\end{align*}


Now, forget that we fixed $\sigma$. We thus have proven that $\left(  P\circ
R\right)  \left(  \sigma\right)  =\operatorname*{id}\left(  \sigma\right)  $
for each $\sigma\in\mathbb{Z}/n$. In other words, $P\circ R=\operatorname*{id}%
$.]

\item We have $R\circ P=\operatorname*{id}$.

[\textit{Proof:} Let $s\in\left\{  0,1,\ldots,n-1\right\}  $. Thus, Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $u=s$ and $c=s$) yields
$s=s\%n$ (since $s\equiv s\operatorname{mod}n$). But the definition of $P$
yields $P\left(  s\right)  =\left[  s\right]  _{n}$. Hence,%
\begin{align*}
\left(  R\circ P\right)  \left(  s\right)   &  =R\left(  \underbrace{P\left(
s\right)  }_{=\left[  s\right]  _{n}}\right)  =R\left(  \left[  s\right]
_{n}\right)  =s\%n\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}R\right) \\
&  =s=\operatorname*{id}\left(  s\right)  .
\end{align*}


Now, forget that we fixed $s$. We thus have proven that $\left(  R\circ
P\right)  \left(  s\right)  =\operatorname*{id}\left(  s\right)  $ for each
$s\in\left\{  0,1,\ldots,n-1\right\}  $. In other words, $R\circ
P=\operatorname*{id}$.]
\end{itemize}

Combining $P\circ R=\operatorname*{id}$ and $R\circ P=\operatorname*{id}$, we
conclude that the maps $P$ and $R$ are mutually inverse. Thus, the map $P$ is
invertible, i.e., bijective. Hence, $P$ is surjective and injective. Since $P$
is injective, we see that $P$ must send the distinct elements $0,1,\ldots,n-1$
of its domain to distinct elements. In other words, the $n$ elements $P\left(
0\right)  ,P\left(  1\right)  ,\ldots,P\left(  n-1\right)  $ of $\mathbb{Z}/n$
must be distinct.

But recall that $P\left(  s\right)  =\left[  s\right]  _{n}$ for each
$s\in\left\{  0,1,\ldots,n-1\right\}  $ (by the definition of $P$). Thus, the
$n$ elements $P\left(  0\right)  ,P\left(  1\right)  ,\ldots,P\left(
n-1\right)  $ can be rewritten as $\left[  0\right]  _{n},\left[  1\right]
_{n},\ldots,\left[  n-1\right]  _{n}$. Hence, the $n$ elements $\left[
0\right]  _{n},\left[  1\right]  _{n},\ldots,\left[  n-1\right]  _{n}$ are
distinct (since the $n$ elements $P\left(  0\right)  ,P\left(  1\right)
,\ldots,P\left(  n-1\right)  $ are distinct).

Moreover, $P$ is surjective. Thus,%
\begin{align*}
\mathbb{Z}/n  &  =P\left(  \left\{  0,1,\ldots,n-1\right\}  \right) \\
&  =\left\{  P\left(  0\right)  ,P\left(  1\right)  ,\ldots,P\left(
n-1\right)  \right\} \\
&  =\left\{  \left[  0\right]  _{n},\left[  1\right]  _{n},\ldots,\left[
n-1\right]  _{n}\right\}
\end{align*}
(since $P\left(  s\right)  =\left[  s\right]  _{n}$ for each $s\in\left\{
0,1,\ldots,n-1\right\}  $). In other words, the elements of $\mathbb{Z}/n$ are
exactly the $n$ elements $\left[  0\right]  _{n},\left[  1\right]  _{n}%
,\ldots,\left[  n-1\right]  _{n}$. These $n$ elements are distinct (as we have
previously shown). Hence, the set $\mathbb{Z}/n$ has exactly $n$ elements,
namely $\left[  0\right]  _{n},\left[  1\right]  _{n},\ldots,\left[
n-1\right]  _{n}$. This proves Theorem \ref{thm.eqrel.Z/n.explicit}.
\end{proof}

Let us summarize some of the facts we have shown in the above proof as a
separate proposition:

\begin{proposition}
\label{prop.eqrel.Z/n.PR}Let $n$ be a positive integer.

\textbf{(a)} The two maps%
\begin{align*}
P:\left\{  0,1,\ldots,n-1\right\}   &  \rightarrow\mathbb{Z}/n,\\
s  &  \mapsto\left[  s\right]  _{n}%
\end{align*}
and%
\begin{align*}
R:\mathbb{Z}/n  &  \rightarrow\left\{  0,1,\ldots,n-1\right\}  ,\\
\left[  s\right]  _{n}  &  \mapsto s\%n
\end{align*}
are well-defined and mutually inverse, and thus are bijections.

\textbf{(b)} Let $\alpha\in\mathbb{Z}/n$. Then, there exists a unique
$a\in\left\{  0,1,\ldots,n-1\right\}  $ satisfying $\alpha=\left[  a\right]
_{n}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.Z/n.PR}.]\textbf{(a)} During the proof
of Theorem \ref{thm.eqrel.Z/n.explicit} above, we have shown that the maps $P$
and $R$ are well-defined and mutually inverse. Hence, these maps $P$ and $R$
are invertible, i.e., are bijective. In other words, the maps $P$ and $R$ are
bijections. Thus, Proposition \ref{prop.eqrel.Z/n.PR} \textbf{(a)} is proven.

\textbf{(b)} Consider the maps $P$ and $R$ from Proposition
\ref{prop.eqrel.Z/n.PR} \textbf{(a)}. Then, Proposition
\ref{prop.eqrel.Z/n.PR} \textbf{(a)} shows that these two maps $P$ and $R$ are
well-defined and mutually inverse, and thus are bijections.

We have $P\circ R=\operatorname*{id}$ (since $P$ and $R$ are mutually
inverse). Hence, $\left(  P\circ R\right)  \left(  \alpha\right)
=\operatorname*{id}\left(  \alpha\right)  =\alpha$. Hence, $\alpha=\left(
P\circ R\right)  \left(  \alpha\right)  =P\left(  R\left(  \alpha\right)
\right)  =\left[  R\left(  \alpha\right)  \right]  _{n}$ (by the definition of
$P$). Thus, there exists \textbf{at least one} $a\in\left\{  0,1,\ldots
,n-1\right\}  $ satisfying $\alpha=\left[  a\right]  _{n}$ (namely,
$a=R\left(  \alpha\right)  $). (Indeed, $R\left(  \alpha\right)  \in\left\{
0,1,\ldots,n-1\right\}  $ follows from the fact that $R$ is a map from
$\mathbb{Z}/n$ to $\left\{  0,1,\ldots,n-1\right\}  $.)

On the other hand, let $a\in\left\{  0,1,\ldots,n-1\right\}  $ be such that
$\alpha=\left[  a\right]  _{n}$. We shall prove that $a=R\left(
\alpha\right)  $. Indeed, the definition of $P$ yields $P\left(  a\right)
=\left[  a\right]  _{n}=\alpha$; hence, $a=P^{-1}\left(  \alpha\right)  $
(since the map $P$ is invertible). But $P^{-1}=R$ (since $P$ and $R$ are
mutually inverse). Thus, $a=\underbrace{P^{-1}}_{=R}\left(  \alpha\right)
=R\left(  \alpha\right)  $.

Now, forget that we fixed $a$. We thus have shown that every $a\in\left\{
0,1,\ldots,n-1\right\}  $ satisfying $\alpha=\left[  a\right]  _{n}$ must
satisfy $a=R\left(  \alpha\right)  $. In other words, every $a\in\left\{
0,1,\ldots,n-1\right\}  $ satisfying $\alpha=\left[  a\right]  _{n}$ must be
equal to $R\left(  \alpha\right)  $. Hence, there exists \textbf{at most one}
such $a$.

Now, we conclude that there exists \textbf{a unique }$a\in\left\{
0,1,\ldots,n-1\right\}  $ satisfying $\alpha=\left[  a\right]  _{n}$ (because
we have shown that there exists \textbf{at least one} such $a$, and we have
shown that there exists \textbf{at most one} such $a$). This proves
Proposition \ref{prop.eqrel.Z/n.PR} \textbf{(b)}.
\end{proof}

Proposition \ref{prop.eqrel.Z/n.PR} \textbf{(b)} can be restated as follows:
Each residue class $\alpha\in\mathbb{Z}/n$ has a unique representative in the
set $\left\{  0,1,\ldots,n-1\right\}  $.

\subsubsection{Making choices that don't matter: The universal property of
quotient sets}

\begin{teachingnote}
I haven't taught this subsection in class.
\end{teachingnote}

In the above proof of Theorem \ref{thm.eqrel.Z/n.explicit}, we have witnessed
an important issue in dealing with quotient sets: If you want to define a map
$f$ going \textbf{out} of a quotient set $S/\sim$\ \ \ \ \footnote{In our
case, the quotient set was $\mathbb{Z}/\underset{n}{\equiv}$ (also known as
$\mathbb{Z}/n$), and the map we wanted to define was $R$.}, then the easiest
way to do so is often to specify $f\left(  \left[  s\right]  _{\sim}\right)  $
for each $s\in S$; but in order to ensure that this definition is well-defined
(i.e., that our map $f$ actually exists), we need to verify that the value of
$f\left(  \left[  s\right]  _{\sim}\right)  $ we are specifying depends
\textbf{only on the equivalence class }$\left[  s\right]  _{\sim}$ but not on
the representative $s$. In other words, we need to verify that if $s_{1}$ and
$s_{2}$ are two elements of $S$ such that $\left[  s_{1}\right]  _{\sim
}=\left[  s_{2}\right]  _{\sim}$, then our definition of $f$ assigns the same
value to $f\left(  \left[  s_{1}\right]  _{\sim}\right)  $ as it does to
$f\left(  \left[  s_{2}\right]  _{\sim}\right)  $. This verification (which we
did in our above proof by proving Claim 1) is often quite easy, but it is necessary.

Let us restate this strategy for defining maps out of a quotient set more rigorously:

\begin{remark}
\label{rmk.eqrel.quot.uniprop-as-method}Let $S$ and $T$ be two sets, and let
$\sim$ be an equivalence relation on $S$. Assume that we want to define a map%
\begin{align*}
f:\left.  S/\sim\right.   &  \rightarrow T,\\
\left[  s\right]  _{\sim}  &  \mapsto F\left(  s\right)  ,
\end{align*}
where $F\left(  s\right)  $ is some element of $T$ for each $s\in S$. (That
is, we want to define a map $f:S\rightarrow T$ such that every $s\in S$
satisfies $f\left(  \left[  s\right]  _{\sim}\right)  =F\left(  s\right)  $.)

In order to ensure that this $f$ is well-defined, we need to verify that if
$s_{1}$ and $s_{2}$ are two elements of $S$ such that $\left[  s_{1}\right]
_{\sim}=\left[  s_{2}\right]  _{\sim}$, then $F\left(  s_{1}\right)  =F\left(
s_{2}\right)  $. If this verification has been done, the map $f$ is well-defined.
\end{remark}

Further examples of maps out of quotient sets defined in this way can be found
in \cite{Conrad-Well}\footnote{When reading \cite[Example 1.1]{Conrad-Well},
keep in mind that rational numbers are defined as equivalence classes of
elements of $\mathbb{Z}\times\left(  \mathbb{Z}\setminus\left\{  0\right\}
\right)  $, as we have seen in Example \ref{exa.eqrel.eqcl.rat}. Thus,
$\mathbb{Q}$ is actually a quotient set: namely, $\mathbb{Q}=S/\underset{\ast
}{\sim}$ using the notations of Example \ref{exa.eqrel.eqcl.rat}.}.

\begin{fineprint}
Let us illustrate this method of defining maps on a few more examples:

\begin{example}
Let $A$ be a set, and let $k\in\mathbb{N}$. Fix some $c\in A$. We can then
define a map%
\begin{align*}
\operatorname*{mult}\nolimits_{c}:A^{k}  &  \rightarrow\mathbb{N},\\
\left(  a_{1},a_{2},\ldots,a_{k}\right)   &  \mapsto\left(  \text{the number
of }i\in\left\{  1,2,\ldots,k\right\}  \text{ such that }a_{i}=c\right)  .
\end{align*}
This map $\operatorname*{mult}\nolimits_{c}$ simply sends each $k$-tuple to
the number of times that $c$ appears in this $k$-tuple. For example,
$\operatorname*{mult}\nolimits_{5}\left(  1,5,2,4,7,5,5,6\right)  =3$, since
$5$ appears exactly $3$ times in the $8$-tuple $\left(
1,5,2,4,7,5,5,6\right)  $ (assuming that $k=8$ and $A=\mathbb{Z}$). It is
clear that this map $\operatorname*{mult}\nolimits_{c}$ is well-defined. (The
number $\operatorname*{mult}\nolimits_{c}\mathbf{a}$ for a $k$-tuple
$\mathbf{a}$ is called the \textit{multiplicity of }$c$ \textit{in
}$\mathbf{a}$. Therefore the notation \textquotedblleft$\operatorname*{mult}%
\nolimits_{c}$\textquotedblright.)

Now, it stands to reason that the same can be done with \textbf{unordered}
$k$-tuples: After all, the number of times that $c$ appears in a $k$-tuple
should not depend on the order of the entries of the tuple. To formalize this,
however, we need to deal with quotient sets. Indeed, recall that the
\textquotedblleft unordered $k$-tuples of elements of $A$\textquotedblright%
\ were defined (in Definition \ref{def.eqrel.eqcl.perm.unord-tup}) as
equivalence classes of the relation $\underset{\operatorname*{perm}}{\sim}$ on
the set $A^{k}$. So $A^{k}/\underset{\operatorname*{perm}}{\sim}$ is the set
of all unordered $k$-tuples of elements of $A$. The map that counts how often
$c$ appears in an unordered $k$-tuple should thus have the form%
\begin{align*}
\operatorname*{mult}\nolimits_{c}^{\prime}:\left.  A^{k}%
/\underset{\operatorname*{perm}}{\sim}\right.   &  \rightarrow\mathbb{N},\\
\left[  \left(  a_{1},a_{2},\ldots,a_{k}\right)  \right]
_{\underset{\operatorname*{perm}}{\sim}}  &  \mapsto\left(  \text{the number
of }i\in\left\{  1,2,\ldots,k\right\}  \text{ such that }a_{i}=c\right)  .
\end{align*}
Or, to put it more compactly (making use of the map $\operatorname*{mult}%
\nolimits_{c}$ for \textbf{ordered} $k$-tuples defined above), it should have
the form%
\begin{align*}
\operatorname*{mult}\nolimits_{c}^{\prime}:\left.  A^{k}%
/\underset{\operatorname*{perm}}{\sim}\right.   &  \rightarrow\mathbb{N},\\
\left[  \mathbf{a}\right]  _{\underset{\operatorname*{perm}}{\sim}}  &
\mapsto\operatorname*{mult}\nolimits_{c}\mathbf{a}.
\end{align*}
The question is: Why is this map $\operatorname*{mult}\nolimits_{c}^{\prime}$ well-defined?

Remark \ref{rmk.eqrel.quot.uniprop-as-method} (applied to $A^{k}$,
$\mathbb{N}$ and $\underset{\operatorname*{perm}}{\sim}$ instead of $S$, $T$
and $\sim$) shows that in order to ensure that this map $\operatorname*{mult}%
\nolimits_{c}^{\prime}$ is well-defined, we need to verify that if
$\mathbf{a}_{1}$ and $\mathbf{a}_{2}$ are two elements of $A^{k}$ (that is,
two ordered $k$-tuples) such that $\left[  \mathbf{a}_{1}\right]
_{\underset{\operatorname*{perm}}{\sim}}=\left[  \mathbf{a}_{2}\right]
_{\underset{\operatorname*{perm}}{\sim}}$, then $\operatorname*{mult}%
\nolimits_{c}\left(  \mathbf{a}_{1}\right)  =\operatorname*{mult}%
\nolimits_{c}\left(  \mathbf{a}_{2}\right)  $. Let us do this: Let
$\mathbf{a}_{1}$ and $\mathbf{a}_{2}$ be two elements of $A^{k}$ (that is, two
ordered $k$-tuples) such that $\left[  \mathbf{a}_{1}\right]
_{\underset{\operatorname*{perm}}{\sim}}=\left[  \mathbf{a}_{2}\right]
_{\underset{\operatorname*{perm}}{\sim}}$. Now, $\left[  \mathbf{a}%
_{1}\right]  _{\underset{\operatorname*{perm}}{\sim}}=\left[  \mathbf{a}%
_{2}\right]  _{\underset{\operatorname*{perm}}{\sim}}$ entails $\mathbf{a}%
_{1}\underset{\operatorname*{perm}}{\sim}\mathbf{a}_{2}$ (indeed, Theorem
\ref{thm.eqrel.eqcl.disj} \textbf{(e)} shows that we have $\mathbf{a}%
_{1}\underset{\operatorname*{perm}}{\sim}\mathbf{a}_{2}$ if and only if
$\left[  \mathbf{a}_{1}\right]  _{\underset{\operatorname*{perm}}{\sim}%
}=\left[  \mathbf{a}_{2}\right]  _{\underset{\operatorname*{perm}}{\sim}}$).
In other words, $\mathbf{a}_{1}$ is a permutation of $\mathbf{a}_{2}$ (by the
definition of $\underset{\operatorname*{perm}}{\sim}$). In other words, the
tuples $\mathbf{a}_{1}$ and $\mathbf{a}_{2}$ differ only in the order of their
entries. Hence, Lemma \ref{lem.comb.tuples.mult=perm.conv} (applied to $A$,
$\mathbf{a}_{1}$, $\mathbf{a}_{2}$ and $c$ instead of $P$, $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $, $\left(  b_{1},b_{2},\ldots,b_{\ell
}\right)  $ and $p$) yields that%
\[
\left(  \text{the number of times }c\text{ appears in }\mathbf{a}_{1}\right)
=\left(  \text{the number of times }c\text{ appears in }\mathbf{a}_{2}\right)
.
\]
This rewrites as $\operatorname*{mult}\nolimits_{c}\left(  \mathbf{a}%
_{1}\right)  =\operatorname*{mult}\nolimits_{c}\left(  \mathbf{a}_{2}\right)
$ (since $\left(  \text{the number of times }c\text{ appears in }%
\mathbf{a}_{1}\right)  =\operatorname*{mult}\nolimits_{c}\left(
\mathbf{a}_{1}\right)  $ and $\left(  \text{the number of times }c\text{
appears in }\mathbf{a}_{2}\right)  =\operatorname*{mult}\nolimits_{c}\left(
\mathbf{a}_{2}\right)  $). This is what we needed to prove. Thus, we have
shown that $\operatorname*{mult}\nolimits_{c}^{\prime}$ is well-defined.

On the other hand, if we tried to define a map%
\begin{align*}
\operatorname*{first}:\left.  A^{k}/\underset{\operatorname*{perm}}{\sim
}\right.   &  \rightarrow\mathbb{N},\\
\left[  \mathbf{a}\right]  _{\underset{\operatorname*{perm}}{\sim}}  &
\mapsto\left(  \text{the first entry of }\mathbf{a}\right)
\end{align*}
(assuming that $k>0$, so that an ordered $k$-tuple does indeed have a first
entry), then we would run into troubles, because it is \textbf{not} true that
if $\mathbf{a}_{1}$ and $\mathbf{a}_{2}$ are two elements of $A^{k}$ such that
$\left[  \mathbf{a}_{1}\right]  _{\underset{\operatorname*{perm}}{\sim}%
}=\left[  \mathbf{a}_{2}\right]  _{\underset{\operatorname*{perm}}{\sim}}$,
then $\left(  \text{the first entry of }\mathbf{a}_{1}\right)  =\left(
\text{the first entry of }\mathbf{a}_{2}\right)  $. And this is no surprise:
There is no such thing as \textquotedblleft the first entry\textquotedblright%
\ of an unordered $k$-tuple. The first entry of a $k$-tuple is sensitive to
reordering of its entries.
\end{example}
\end{fineprint}

We can restate this method of defining maps as a rigorous theorem:

\begin{theorem}
\label{thm.eqrel.quot.uniprop.1}Let $S$ and $T$ be two sets, and let $\sim$ be
an equivalence relation on $S$. For each $s\in S$, let $F\left(  s\right)  $
be an element of $T$. (In other words, let $F$ be a map from $S$ to $T$.)
Assume that the following assumption holds:

\begin{statement}
\textit{Assumption 1:} If $s_{1}$ and $s_{2}$ are two elements of $S$
satisfying $s_{1}\sim s_{2}$, then $F\left(  s_{1}\right)  =F\left(
s_{2}\right)  $.
\end{statement}

Then, there exists a unique map $f:\left.  S/\sim\right.  \rightarrow T$ such
that every $s\in S$ satisfies $f\left(  \left[  s\right]  _{\sim}\right)
=F\left(  s\right)  $.
\end{theorem}

Theorem \ref{thm.eqrel.quot.uniprop.1} says that (under the assumption that
Assumption 1 holds) we can define a map%
\begin{align*}
f:\left.  S/\sim\right.   &  \rightarrow T,\\
\left[  s\right]  _{\sim}  &  \mapsto F\left(  s\right)  .
\end{align*}
For example, the map $R$ defined in our proof of Theorem
\ref{thm.eqrel.Z/n.explicit} was defined in this way (with $\mathbb{Z}$,
$\mathbb{Z}$, $\underset{n}{\equiv}$ and $s\%n$ playing the roles of $S$, $T$,
$\sim$ and $F\left(  s\right)  $), and our proof of Claim 1 was essentially us
verifying that Assumption 1 of Theorem \ref{thm.eqrel.quot.uniprop.1} is satisfied.

\begin{fineprint}
For the sake of completeness, let us give a formal proof for Theorem
\ref{thm.eqrel.quot.uniprop.1} as well:

\begin{proof}
[Proof of Theorem \ref{thm.eqrel.quot.uniprop.1}.]We need to prove the
following two statements:

\begin{statement}
\textit{Statement 1:} There exists \textbf{at least one} map $f:\left.
S/\sim\right.  \rightarrow T$ such that every $s\in S$ satisfies $f\left(
\left[  s\right]  _{\sim}\right)  =F\left(  s\right)  $.
\end{statement}

\begin{statement}
\textit{Statement 2:} There exists \textbf{at most one} map $f:\left.
S/\sim\right.  \rightarrow T$ such that every $s\in S$ satisfies $f\left(
\left[  s\right]  _{\sim}\right)  =F\left(  s\right)  $.
\end{statement}

[\textit{Proof of Statement 1:} We define a map $\varphi$ as follows:

Let $\sigma\in\left.  S/\sim\right.  $. Thus, $\sigma$ is an equivalence class
of $\sim$ (by the definition of $S/\sim$). In other words, $\sigma=\left[
s\right]  _{\sim}$ for some element $s\in S$. In other words, there exists
some element $s\in S$ such that $\sigma=\left[  s\right]  _{\sim}$. If $s_{1}$
and $s_{2}$ are two such elements $s$, then $F\left(  s_{1}\right)  =F\left(
s_{2}\right)  $\ \ \ \ \footnote{\textit{Proof.} Let $s_{1}$ and $s_{2}$ be
two such elements $s$. Then, $\sigma=\left[  s_{1}\right]  _{\sim}$ (since
$s_{1}$ is an element $s\in S$ such that $\sigma=\left[  s\right]  _{\sim}$)
and $\sigma=\left[  s_{2}\right]  _{\sim}$ (for similar reasons). Hence,
$\left[  s_{1}\right]  _{\sim}=\sigma=\left[  s_{2}\right]  _{\sim}$. But
Theorem \ref{thm.eqrel.eqcl.disj} \textbf{(e)} (applied to $x=s_{1}$ and
$y=s_{2}$) yields that we have $s_{1}\sim s_{2}$ if and only if $\left[
s_{1}\right]  _{\sim}=\left[  s_{2}\right]  _{\sim}$. Hence, we have
$s_{1}\sim s_{2}$ (since $\left[  s_{1}\right]  _{\sim}=\left[  s_{2}\right]
_{\sim}$). Thus, Assumption 1 shows that $F\left(  s_{1}\right)  =F\left(
s_{2}\right)  $, qed.}. Thus, the element $F\left(  s\right)  \in T$ obtained
from such an element $s$ does not depend on the choice of $s$ (as long as
$\sigma$ is fixed). Hence, we can define $\varphi\left(  \sigma\right)  $ by
setting
\begin{equation}
\varphi\left(  \sigma\right)  =F\left(  s\right)  ,
\label{pf.thm.eqrel.quot.uniprop.1.s1.pf.3}%
\end{equation}
where $s$ is any element of $S$ satisfying $\sigma=\left[  s\right]  _{\sim}$.

Define $\varphi\left(  \sigma\right)  $ this way. Thus, we have defined an
element $\varphi\left(  \sigma\right)  $ of $T$ for each $\sigma\in\left.
S/\sim\right.  $. Hence, we have defined a map $\varphi:\left.  S/\sim\right.
\rightarrow T$. Moreover, this map has the property that every $s\in S$
satisfies $\varphi\left(  \left[  s\right]  _{\sim}\right)  =F\left(
s\right)  $. (Indeed, this follows from
(\ref{pf.thm.eqrel.quot.uniprop.1.s1.pf.3}) (applied to $\sigma=\left[
s\right]  _{\sim}$), since obviously $\left[  s\right]  _{\sim}=\left[
s\right]  _{\sim}$.)

Hence, there exists \textbf{at least one} map $f:\left.  S/\sim\right.
\rightarrow T$ such that every $s\in S$ satisfies $f\left(  \left[  s\right]
_{\sim}\right)  =F\left(  s\right)  $ (namely, the map $\varphi$). This proves
Statement 1.]

[\textit{Proof of Statement 2:} Let $f_{1}$ and $f_{2}$ be two maps $f:\left.
S/\sim\right.  \rightarrow T$ such that every $s\in S$ satisfies $f\left(
\left[  s\right]  _{\sim}\right)  =F\left(  s\right)  $. We shall show that
$f_{1}=f_{2}$.

We know that $f_{1}$ is a map $f:\left.  S/\sim\right.  \rightarrow T$ such
that every $s\in S$ satisfies $f\left(  \left[  s\right]  _{\sim}\right)
=F\left(  s\right)  $. In other words, $f_{1}$ is a map from $\left.
S/\sim\right.  $ to $T$ and has the property that
\begin{equation}
\text{every }s\in S\text{ satisfies }f_{1}\left(  \left[  s\right]  _{\sim
}\right)  =F\left(  s\right)  . \label{pf.thm.eqrel.quot.uniprop.1.s2.pf.1}%
\end{equation}
Likewise, $f_{2}$ is a map from $\left.  S/\sim\right.  $ to $T$ and has the
property that
\begin{equation}
\text{every }s\in S\text{ satisfies }f_{2}\left(  \left[  s\right]  _{\sim
}\right)  =F\left(  s\right)  . \label{pf.thm.eqrel.quot.uniprop.1.s2.pf.2}%
\end{equation}


Now, let $\sigma\in\left.  S/\sim\right.  $ be arbitrary. Thus, $\sigma$ is an
equivalence class of $\sim$ (by the definition of $S/\sim$). In other words,
$\sigma=\left[  s\right]  _{\sim}$ for some element $s\in S$. Consider this
$s$. Then, from $\sigma=\left[  s\right]  _{\sim}$, we obtain $f_{1}\left(
\sigma\right)  =f_{1}\left(  \left[  s\right]  _{\sim}\right)  =F\left(
s\right)  $ (by (\ref{pf.thm.eqrel.quot.uniprop.1.s2.pf.1})). Similarly,
$f_{2}\left(  \sigma\right)  =F\left(  s\right)  $. Comparing these two
equalities, we find $f_{1}\left(  \sigma\right)  =f_{2}\left(  \sigma\right)
$.

Forget that we fixed $\sigma$. We thus have proven that $f_{1}\left(
\sigma\right)  =f_{2}\left(  \sigma\right)  $ for each $\sigma\in\left.
S/\sim\right.  $. In other words, $f_{1}=f_{2}$.

Forget that we fixed $f_{1}$ and $f_{2}$. We thus have proven that if $f_{1}$
and $f_{2}$ are two maps $f:\left.  S/\sim\right.  \rightarrow T$ such that
every $s\in S$ satisfies $f\left(  \left[  s\right]  _{\sim}\right)  =F\left(
s\right)  $, then $f_{1}=f_{2}$. In other words, there exists \textbf{at most
one} such map $f$. This proves Statement 2.]

Now, we conclude that there exists a unique map $f:\left.  S/\sim\right.
\rightarrow T$ such that every $s\in S$ satisfies $f\left(  \left[  s\right]
_{\sim}\right)  =F\left(  s\right)  $ (because Statement 1 shows that there
exists \textbf{at least one} such map, while Statement 2 shows that there
exists \textbf{at most one} such map). This proves Theorem
\ref{thm.eqrel.quot.uniprop.1}.
\end{proof}
\end{fineprint}

Theorem \ref{thm.eqrel.quot.uniprop.1} is known as the \textit{universal
property of the quotient set}.

\subsubsection{Projecting from $\mathbb{Z}/n$ to $\mathbb{Z}/d$}

As another example of a map from a quotient set, let us define certain maps
from $\mathbb{Z}/n$ to $\mathbb{Z}/d$ that exist whenever two integers $n$ and
$d$ satisfy $d\mid n$:

\begin{proposition}
\label{prop.eqrel.Z/n.pind.wd}Let $n$ be an integer. Let $d$ be a divisor of
$n$. Then, there is a map%
\begin{align*}
\pi_{n,d}:\mathbb{Z}/n  &  \rightarrow\mathbb{Z}/d,\\
\left[  s\right]  _{n}  &  \mapsto\left[  s\right]  _{d}.
\end{align*}

\end{proposition}

\begin{example}
\label{exa.eqrel.Z/n.pind.wd}\textbf{(a)} For example, for $n=6$ and $d=2$,
Proposition \ref{prop.eqrel.Z/n.pind.wd} says that there is a map
\begin{align*}
\pi_{6,2}:\mathbb{Z}/6  &  \rightarrow\mathbb{Z}/2,\\
\left[  s\right]  _{6}  &  \mapsto\left[  s\right]  _{2}.
\end{align*}
This map sends the residue classes
\begin{align*}
&  \left[  0\right]  _{6},\left[  1\right]  _{6},\left[  2\right]
_{6},\left[  3\right]  _{6},\left[  4\right]  _{6},\left[  5\right]  _{6}\\
\text{to }  &  \left[  0\right]  _{2},\left[  1\right]  _{2},\left[  2\right]
_{2},\left[  3\right]  _{2},\left[  4\right]  _{2},\left[  5\right]
_{2}\text{, respectively.}%
\end{align*}
In other words, it sends the residue classes%
\begin{align*}
&  \left[  0\right]  _{6},\left[  1\right]  _{6},\left[  2\right]
_{6},\left[  3\right]  _{6},\left[  4\right]  _{6},\left[  5\right]  _{6}\\
\text{to }  &  \left[  0\right]  _{2},\left[  1\right]  _{2},\left[  0\right]
_{2},\left[  1\right]  _{2},\left[  0\right]  _{2},\left[  1\right]
_{2}\text{, respectively}%
\end{align*}
(since $\left[  2\right]  _{2}=\left[  0\right]  _{2}$ and $\left[  3\right]
_{2}=\left[  1\right]  _{2}$ and $\left[  4\right]  _{2}=\left[  0\right]
_{2}$ and $\left[  5\right]  _{2}=\left[  1\right]  _{2}$). More generally,
for arbitrary positive integers $n$ and $d$ satisfying $d\mid n$, the map
$\pi_{n,d}$ sends the $n$ residue classes $\left[  0\right]  _{n},\left[
1\right]  _{n},\ldots,\left[  n-1\right]  _{n}$ to
\[
\left[  0\right]  _{d},\left[  1\right]  _{d},\ldots,\left[  d-1\right]
_{d},\left[  0\right]  _{d},\left[  1\right]  _{d},\ldots,\left[  d-1\right]
_{d},\ldots,\left[  0\right]  _{d},\left[  1\right]  _{d},\ldots,\left[
d-1\right]  _{d}%
\]
(that is, $\left[  0\right]  _{d},\left[  1\right]  _{d},\ldots,\left[
d-1\right]  _{d}$ in this order, repeated $\dfrac{n}{d}$ many times), respectively.

\textbf{(b)} For a non-example, set $n=3$ and $d=2$. Then, Proposition
\ref{prop.eqrel.Z/n.pind.wd} does not apply, since $2$ is not a divisor of
$3$. And for good reason: There is no map%
\begin{align*}
\pi_{3,2}:\mathbb{Z}/3  &  \rightarrow\mathbb{Z}/2,\\
\left[  s\right]  _{3}  &  \mapsto\left[  s\right]  _{2}.
\end{align*}
Indeed, this map would have to send $\left[  0\right]  _{3}$ and $\left[
3\right]  _{3}$ to $\left[  0\right]  _{2}$ and $\left[  3\right]  _{2}$,
respectively; but this means sending two equal inputs to different outputs
(since $\left[  0\right]  _{3}=\left[  3\right]  _{3}$ but $\left[  0\right]
_{2}\neq\left[  3\right]  _{2}$), which is impossible. More generally, if a
positive integer $d$ is \textbf{not} a divisor of a positive integer $n$, then
there is no map%
\begin{align*}
\pi_{n,d}:\mathbb{Z}/n  &  \rightarrow\mathbb{Z}/d,\\
\left[  s\right]  _{n}  &  \mapsto\left[  s\right]  _{d}.
\end{align*}

\end{example}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.Z/n.pind.wd}.]We must prove that, for an
integer $s\in\mathbb{Z}$, the class $\left[  s\right]  _{d}\in\mathbb{Z}/d$
depends only on the residue class $\left[  s\right]  _{n}$ but not on the
integer $s$ itself. In other words, we need to prove the following claim:

\begin{statement}
\textit{Claim 1:} If $s_{1}$ and $s_{2}$ are two integers such that $\left[
s_{1}\right]  _{n}=\left[  s_{2}\right]  _{n}$, then $\left[  s_{1}\right]
_{d}=\left[  s_{2}\right]  _{d}$.
\end{statement}

[\textit{Proof of Claim 1:} Let $s_{1}$ and $s_{2}$ be two integers such that
$\left[  s_{1}\right]  _{n}=\left[  s_{2}\right]  _{n}$.

Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $a=s_{1}$ and
$b=s_{2}$) shows that we have $\left[  s_{1}\right]  _{n}=\left[
s_{2}\right]  _{n}$ if and only if $s_{1}\equiv s_{2}\operatorname{mod}n$.
Thus, we have $s_{1}\equiv s_{2}\operatorname{mod}n$ (since $\left[
s_{1}\right]  _{n}=\left[  s_{2}\right]  _{n}$). Hence, Proposition
\ref{prop.ent.mod.basics} \textbf{(e)} (applied to $s_{1}$, $s_{2}$ and $d$
instead of $a$, $b$ and $m$) yields $s_{1}\equiv s_{2}\operatorname{mod}d$
(since $d\mid n$).

But Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $d$, $s_{1}$
and $s_{2}$ instead of $n$, $a$ and $b$) shows that we have $\left[
s_{1}\right]  _{d}=\left[  s_{2}\right]  _{d}$ if and only if $s_{1}\equiv
s_{2}\operatorname{mod}d$. Thus, we have $\left[  s_{1}\right]  _{d}=\left[
s_{2}\right]  _{d}$ (since $s_{1}\equiv s_{2}\operatorname{mod}d$). This
proves Claim 1.]

Having proven Claim 1, we can now conclude that the map%
\begin{align*}
\pi_{n,d}:\mathbb{Z}/n  &  \rightarrow\mathbb{Z}/d,\\
\left[  s\right]  _{n}  &  \mapsto\left[  s\right]  _{d}%
\end{align*}
is well-defined. (This can be regarded as a consequence of applying Theorem
\ref{thm.eqrel.quot.uniprop.1} to $\mathbb{Z}$, $\mathbb{Z}/d$,
$\underset{n}{\equiv}$ and $\left[  s\right]  _{d}$ instead of $S$, $T$,
$\sim$ and $F\left(  s\right)  $. The Claim 1 that we proved above guarantees
that Assumption 1 of Theorem \ref{thm.eqrel.quot.uniprop.1} is satisfied.)
Hence, Proposition \ref{prop.eqrel.Z/n.pind.wd} is proven.
\end{proof}

The next exercise is unrelated to $\mathbb{Z}/n$, but has been placed in this
section because it relies on the same sort of \textquotedblleft
well-definedness\textquotedblright\ argument that we have seen in our proofs above:

\begin{exercise}
\label{exe.eqrel.quot.wp}Fix a prime $p$. For each nonzero rational number
$r$, define an integer $w_{p}\left(  r\right)  $ (called the \textit{extended
$p$-adic valuation} of $r$) as follows: We write $r$ in the form $r=a/b$ for
two nonzero integers $a$ and $b$, and we set $w_{p}\left(  r\right)
=v_{p}\left(  a\right)  -v_{p}\left(  b\right)  $. (It also makes sense to set
$w_{p}\left(  0\right)  =\infty$, but we shall not concern ourselves with this
border case in this exercise.)

\textbf{(a)} Prove that this is well-defined -- i.e., that $w_{p}\left(
r\right)  $ does not depend on the precise choice of $a$ and $b$ satisfying
$r=a/b$.

\textbf{(b)} Prove that $w_{p}\left(  n\right)  =v_{p}\left(  n\right)  $ for
each nonzero integer $n$.

\textbf{(c)} Prove that $w_{p}\left(  ab\right)  =w_{p}\left(  a\right)
+w_{p}\left(  b\right)  $ for any two nonzero rational numbers $a$ and $b$.

\textbf{(d)} Prove that $w_{p}\left(  a+b\right)  \geq\min\left\{
w_{p}\left(  a\right)  ,w_{p}\left(  b\right)  \right\}  $ for any two nonzero
rational numbers $a$ and $b$ if $a+b\neq0$.
\end{exercise}

\begin{exercise}
\label{exe.eqrel.quot.wp-glob}Let $r$ be a nonzero rational number. In
Exercise \ref{exe.eqrel.quot.wp}, we have defined an integer $w_{p}\left(
r\right)  $ for each prime $p$. Prove the following:

\textbf{(a)} All but finitely many primes $p$ satisfy $w_{p}\left(  r\right)
=0$.

\textbf{(b)} We have $\left\vert r\right\vert =\prod_{p\text{ prime}}%
p^{w_{p}\left(  r\right)  }$ (and in particular, the product $\prod_{p\text{
prime}}p^{w_{p}\left(  r\right)  }$ is well-defined, i.e., has only finitely
many factors different from $1$).

\textbf{(c)} We have $r\in\mathbb{Z}$ if and only if each prime $p$ satisfies
$w_{p}\left(  r\right)  \geq0$.

\textbf{(d)} We have the logical equivalence%
\begin{align*}
&  \ \left(  \text{there exists a }k\in\mathbb{N}\text{ satisfying }m^{k}%
r\in\mathbb{Z}\right) \\
&  \Longleftrightarrow\ \left(  \text{every prime }p\text{ satisfying }%
w_{p}\left(  r\right)  <0\text{ satisfies }p\mid m\right)  .
\end{align*}

\end{exercise}

Note that Exercise \ref{exe.eqrel.quot.wp-glob} \textbf{(b)} can be regarded
as a canonical factorization for rational numbers. (Unlike the canonical
factorization for integers, it allows negative exponents on the primes.)

\subsubsection{Addition, subtraction and multiplication in $\mathbb{Z}/n$}

Let us recall the concept of a binary operation (defined in Definition
\ref{def.intro.binop}). We shall now define several such operations on the set
$\mathbb{Z}/n$\ \ \ \ \footnote{We will check afterwards that these operations
are indeed well-defined.}:

\begin{definition}
\label{def.eqrel.Z/n.op}\textbf{(a)} We define a binary operation $+$ on
$\mathbb{Z}/n$ (called \textit{addition}) by setting%
\[
\left[  a\right]  _{n}+\left[  b\right]  _{n}=\left[  a+b\right]
_{n}\ \ \ \ \ \ \ \ \ \ \text{for any integers }a\text{ and }b.
\]
(In other words, we define a binary operation $+$ on $\mathbb{Z}/n$ as
follows: For any $\alpha,\beta\in\mathbb{Z}/n$, we let $\alpha+\beta=\left[
a+b\right]  _{n}$, where $a$ and $b$ are two integers satisfying
$\alpha=\left[  a\right]  _{n}$ and $\beta=\left[  b\right]  _{n}$.)

\textbf{(b)} We define a binary operation $-$ on $\mathbb{Z}/n$ (called
\textit{subtraction}) by setting%
\[
\left[  a\right]  _{n}-\left[  b\right]  _{n}=\left[  a-b\right]
_{n}\ \ \ \ \ \ \ \ \ \ \text{for any integers }a\text{ and }b.
\]


\textbf{(c)} We define a binary operation $\cdot$ on $\mathbb{Z}/n$ (called
\textit{multiplication}) by setting%
\[
\left[  a\right]  _{n}\cdot\left[  b\right]  _{n}=\left[  a\cdot b\right]
_{n}\ \ \ \ \ \ \ \ \ \ \text{for any integers }a\text{ and }b.
\]
We also write $\left[  a\right]  _{n}\left[  b\right]  _{n}$ for $\left[
a\right]  _{n}\cdot\left[  b\right]  _{n}$.
\end{definition}

\begin{theorem}
\label{thm.eqrel.Z/n.op.wd}Everything defined in Definition
\ref{def.eqrel.Z/n.op} is well-defined.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.eqrel.Z/n.op.wd}.]\textbf{(a)} Let us first prove
that the binary operation $+$ in Definition \ref{def.eqrel.Z/n.op}
\textbf{(a)} is well-defined.

Indeed, here we are in the same situation in which we were when defining the
map $R$ in the proof of Theorem \ref{thm.eqrel.Z/n.explicit}: We are trying to
define a map (in the current case, the binary operation $+$, which should be a
map from $\left(  \mathbb{Z}/n\right)  \times\left(  \mathbb{Z}/n\right)  $ to
$\mathbb{Z}/n$) by specifying how it acts on inputs of the form $\left[
a\right]  _{n}$, but our definition refers to the integer $a$. (Actually, it
is a little bit more complicated: We have two inputs $\left[  a\right]  _{n}$
and $\left[  b\right]  _{n}$ and thus two integers $a$ and $b$. But the
problem we are facing is the same.) We want to prove that this map is
well-defined. This requires checking that the output (that is, $\left[
a+b\right]  _{n}$) depends only on the two classes $\left[  a\right]  _{n}$
and $\left[  b\right]  _{n}$, but not on the integers $a$ and $b$.

So we have to prove the following:

\begin{statement}
\textit{Claim 1:} Let $a_{1}$ and $a_{2}$ be two integers such that $\left[
a_{1}\right]  _{n}=\left[  a_{2}\right]  _{n}$. Let $b_{1}$ and $b_{2}$ be two
integers such that $\left[  b_{1}\right]  _{n}=\left[  b_{2}\right]  _{n}$.
Then,%
\[
\left[  a_{1}+b_{1}\right]  _{n}=\left[  a_{2}+b_{2}\right]  _{n}.
\]

\end{statement}

[\textit{Proof of Claim 1:} Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)}
(applied to $a_{1}$ and $a_{2}$ instead of $a$ and $b$) shows that we have
$\left[  a_{1}\right]  _{n}=\left[  a_{2}\right]  _{n}$ if and only if
$a_{1}\equiv a_{2}\operatorname{mod}n$. Thus, we have $a_{1}\equiv
a_{2}\operatorname{mod}n$ (since $\left[  a_{1}\right]  _{n}=\left[
a_{2}\right]  _{n}$). Similarly, $b_{1}\equiv b_{2}\operatorname{mod}n$ (since
$\left[  b_{1}\right]  _{n}=\left[  b_{2}\right]  _{n}$). Adding these two
congruences together, we obtain $a_{1}+b_{1}\equiv a_{2}+b_{2}%
\operatorname{mod}n$.

But Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $a_{1}+b_{1}$
and $a_{2}+b_{2}$ instead of $a$ and $b$) shows that we have $\left[
a_{1}+b_{1}\right]  _{n}=\left[  a_{2}+b_{2}\right]  _{n}$ if and only if
$a_{1}+b_{1}\equiv a_{2}+b_{2}\operatorname{mod}n$. Thus, we have $\left[
a_{1}+b_{1}\right]  _{n}=\left[  a_{2}+b_{2}\right]  _{n}$ (since $a_{1}%
+b_{1}\equiv a_{2}+b_{2}\operatorname{mod}n$). This proves Claim 1.]

Claim 1 shows that in Definition \ref{def.eqrel.Z/n.op} \textbf{(a)}, the
residue class $\left[  a+b\right]  _{n}$ depends only on the two classes
$\left[  a\right]  _{n}$ and $\left[  b\right]  _{n}$, but not on the integers
$a$ and $b$. Thus, the binary operation $+$ in Definition
\ref{def.eqrel.Z/n.op} \textbf{(a)} is indeed well-defined.

\textbf{(b)} The binary operation $-$ in Definition \ref{def.eqrel.Z/n.op}
\textbf{(b)} is well-defined. This can be proven in the same way as we just
proved that the binary operation $+$ in Definition \ref{def.eqrel.Z/n.op}
\textbf{(a)} is well-defined; the only difference is that we now have to
subtract the congruences $a_{1}\equiv a_{2}\operatorname{mod}n$ and
$b_{1}\equiv b_{2}\operatorname{mod}n$ instead of adding them together.

\textbf{(c)} The binary operation $\cdot$ in Definition \ref{def.eqrel.Z/n.op}
\textbf{(c)} is well-defined. This can be proven in the same way as we just
proved that the binary operation $+$ in Definition \ref{def.eqrel.Z/n.op}
\textbf{(a)} is well-defined; the only difference is that we now have to
multiply the congruences $a_{1}\equiv a_{2}\operatorname{mod}n$ and
$b_{1}\equiv b_{2}\operatorname{mod}n$ instead of adding them together.

Thus, we have proven that all three operations $+$, $-$ and $\cdot$ in
Definition \ref{def.eqrel.Z/n.op} are well-defined. This proves Theorem
\ref{thm.eqrel.Z/n.op.wd}.
\end{proof}

Recall that $\mathbb{Z}/n$ is a finite set (of size $n$) whenever $n$ is a
positive integer. Hence, for each given positive integer $n$, we can tabulate
all the values of the operations $+$, $-$ and $\cdot$; the resulting tables
are called \textit{addition tables}, \textit{subtraction tables} and
\textit{multiplication tables} (like in high school, except that we are
working with residue classes now).

\begin{example}
\textbf{(a)} If $n=3$, then the addition, subtraction and multiplication
tables for $\mathbb{Z}/n=\mathbb{Z}/3$ are
\[%
\begin{tabular}
[c]{|c|ccc|}\hline
$+$ & $\left[  0\right]  _{3}$ & $\left[  1\right]  _{3}$ & $\left[  2\right]
_{3}$\\\hline
$\left[  0\right]  _{3}$ & $\left[  0\right]  _{3}$ & $\left[  1\right]  _{3}$
& $\left[  2\right]  _{3}$\\
$\left[  1\right]  _{3}$ & $\left[  1\right]  _{3}$ & $\left[  2\right]  _{3}$
& $\left[  0\right]  _{3}$\\
$\left[  2\right]  _{3}$ & $\left[  2\right]  _{3}$ & $\left[  0\right]  _{3}$
& $\left[  1\right]  _{3}$\\\hline
\end{tabular}
\ \ \ ,\ \ \ \ \ \ \ \
\begin{tabular}
[c]{|c|ccc|}\hline
$-$ & $\left[  0\right]  _{3}$ & $\left[  1\right]  _{3}$ & $\left[  2\right]
_{3}$\\\hline
$\left[  0\right]  _{3}$ & $\left[  0\right]  _{3}$ & $\left[  2\right]  _{3}$
& $\left[  1\right]  _{3}$\\
$\left[  1\right]  _{3}$ & $\left[  1\right]  _{3}$ & $\left[  0\right]  _{3}$
& $\left[  2\right]  _{3}$\\
$\left[  2\right]  _{3}$ & $\left[  2\right]  _{3}$ & $\left[  1\right]  _{3}$
& $\left[  0\right]  _{3}$\\\hline
\end{tabular}
\ \ \ ,\ \ \ \ \ \ \ \
\begin{tabular}
[c]{|c|ccc|}\hline
$\cdot$ & $\left[  0\right]  _{3}$ & $\left[  1\right]  _{3}$ & $\left[
2\right]  _{3}$\\\hline
$\left[  0\right]  _{3}$ & $\left[  0\right]  _{3}$ & $\left[  0\right]  _{3}$
& $\left[  0\right]  _{3}$\\
$\left[  1\right]  _{3}$ & $\left[  0\right]  _{3}$ & $\left[  1\right]  _{3}$
& $\left[  2\right]  _{3}$\\
$\left[  2\right]  _{3}$ & $\left[  0\right]  _{3}$ & $\left[  2\right]  _{3}$
& $\left[  1\right]  _{3}$\\\hline
\end{tabular}
\ .
\]
(Here, the entry in the row corresponding to $\alpha$ and the column
corresponding to $\beta$ is $\alpha+\beta$, $\alpha-\beta$ and $\alpha
\cdot\beta$, respectively.)

\textbf{(b)} If $n=2$, then the addition, subtraction and multiplication
tables for $\mathbb{Z}/n=\mathbb{Z}/2$ are
\[%
\begin{tabular}
[c]{|c|cc|}\hline
$+$ & $\left[  0\right]  _{2}$ & $\left[  1\right]  _{2}$\\\hline
$\left[  0\right]  _{2}$ & $\left[  0\right]  _{2}$ & $\left[  1\right]  _{2}%
$\\
$\left[  1\right]  _{2}$ & $\left[  1\right]  _{2}$ & $\left[  0\right]  _{2}%
$\\\hline
\end{tabular}
\ \ \ ,\ \ \ \ \ \ \ \ \ \
\begin{tabular}
[c]{|c|cc|}\hline
$-$ & $\left[  0\right]  _{2}$ & $\left[  1\right]  _{2}$\\\hline
$\left[  0\right]  _{2}$ & $\left[  0\right]  _{2}$ & $\left[  1\right]  _{2}%
$\\
$\left[  1\right]  _{2}$ & $\left[  1\right]  _{2}$ & $\left[  0\right]  _{2}%
$\\\hline
\end{tabular}
\ \ \ ,\ \ \ \ \ \ \ \ \ \
\begin{tabular}
[c]{|c|cc|}\hline
$\cdot$ & $\left[  0\right]  _{2}$ & $\left[  1\right]  _{2}$\\\hline
$\left[  0\right]  _{2}$ & $\left[  0\right]  _{2}$ & $\left[  0\right]  _{2}%
$\\
$\left[  1\right]  _{2}$ & $\left[  0\right]  _{2}$ & $\left[  1\right]  _{2}%
$\\\hline
\end{tabular}
\ .
\]
(In particular, the addition table is the same as the subtraction table,
because any $\alpha,\beta\in\mathbb{Z}/2$ satisfy $\alpha+\beta=\alpha-\beta$.
This follows from Exercise \ref{exe.ent.mod.a+b=a-b}.)
\end{example}

\begin{remark}
We \textbf{cannot} define a division operation on $\mathbb{Z}/n$ by setting%
\[
\left[  a\right]  _{n}/\left[  b\right]  _{n}:=\left[  a/b\right]
_{n}\ \ \ \ \ \ \ \ \ \ \text{for any integers }a\text{ and }b.
\]
Indeed, leaving aside the issues that $b$ could be $0$ or $a/b$ could be
non-integer, this would still not be well-defined, because the class $\left[
a/b\right]  _{n}$ depends not just on $\left[  a\right]  _{n}$ and $\left[
b\right]  _{n}$ but also on the concrete choices of $a$ and $b$. For example,
for $n=4$, this ostensible \textquotedblleft division
operation\textquotedblright\ would have to satisfy
\[
\text{\textquotedblleft}\left[  6\right]  _{4}/\left[  2\right]
_{4}\text{\textquotedblright}=\left[  6/2\right]  _{4}=\left[  3\right]  _{4}%
\]
and%
\[
\text{\textquotedblleft}\left[  2\right]  _{4}/\left[  2\right]
_{4}\text{\textquotedblright}=\left[  2/2\right]  _{4}=\left[  1\right]
_{4},
\]
but this is impossible (since $\left[  6\right]  _{4}=\left[  2\right]  _{4}$
but $\left[  3\right]  _{4}\neq\left[  1\right]  _{4}$).

For similar reasons, we cannot define $\left(  \left[  a\right]  _{n}\right)
^{\left[  b\right]  _{n}}$.
\end{remark}

For the outputs of our binary operations $+$, $-$ and $\cdot$ on
$\mathbb{Z}/n$, we shall use the same terminology as with integers:

\begin{definition}
\label{def.eqrel.Z/n.sum-diff-prod}\textbf{(a)} If $\alpha$ and $\beta$ are
two elements of $\mathbb{Z}/n$, then we shall refer to $\alpha+\beta$ as the
\textit{sum} of $\alpha$ and $\beta$.

\textbf{(b)} If $\alpha$ and $\beta$ are two elements of $\mathbb{Z}/n$, then
we shall refer to $\alpha-\beta$ as the \textit{difference} of $\alpha$ and
$\beta$.

\textbf{(c)} If $\alpha$ and $\beta$ are two elements of $\mathbb{Z}/n$, then
we shall refer to $\alpha\cdot\beta$ (also known as $\alpha\beta$) as the
\textit{product} of $\alpha$ and $\beta$.

\textbf{(d)} If $\alpha$ is an element of $\mathbb{Z}/n$, then the difference
$\left[  0\right]  _{n}-\alpha$ shall be denoted by $-\alpha$.
\end{definition}

Caution: While the remainder $i\%n$ and the residue class $\left[  i\right]
_{n}$ encode the same information about an integer $i$ (for a fixed positive
integer $n$), they are not the same thing! For example, any two integers $u$
and $v$ satisfy $\left[  u\right]  _{n}+\left[  v\right]  _{n}=\left[
u+v\right]  _{n}$ but don't always satisfy $u\%n+v\%n=\left(  u+v\right)
\%n$\ \ \ \ \footnote{Here is a specific example:%
\begin{align*}
\left[  2\right]  _{5}+\left[  3\right]  _{5}  &  =\left[  2+3\right]
_{5}=\left[  5\right]  _{5}=\left[  0\right]  _{5}%
,\ \ \ \ \ \ \ \ \ \ \text{but}\\
2\%5+3\%5  &  =2+3=5\neq0\%5;
\end{align*}
\par
Exercise \ref{exe.ent.quo-rem.u+v} \textbf{(a)} addresses how $u\%n+v\%n$
differs from $\left(  u+v\right)  \%n$.}. Thus, it is important to distinguish
between $i\%n$ and $\left[  i\right]  _{n}$.

\begin{remark}
We can view the residue classes modulo $24$ (that is, the elements of
$\mathbb{Z}/24$) as the hours of the day. For example, the time
\textquotedblleft2 AM\textquotedblright\ can be viewed as the residue class
$\left[  2\right]  _{24}$, whereas the time \textquotedblleft3
PM\textquotedblright\ can be viewed as the residue class $\left[  15\right]
_{24}$. From this point of view, addition of residue classes is a rather
familiar operation: For example, the statement that \textquotedblleft10 hours
from 3 PM is 1 AM\textquotedblright\ is saying $\left[  15\right]
_{24}+\left[  10\right]  _{24}=\left[  1\right]  _{24}$.
\end{remark}

\subsubsection{Scaling by $r\in\mathbb{Z}$}

Let us define another operation -- not binary this time -- on $\mathbb{Z}/n$:

\begin{definition}
\label{def.eqrel.Z/n.scaling}Fix $r\in\mathbb{Z}$.

For any $\alpha\in\mathbb{Z}/n$, we define a residue class $r\alpha
\in\mathbb{Z}/n$ by setting
\[
\left(  r\left[  a\right]  _{n}=\left[  ra\right]  _{n}%
\ \ \ \ \ \ \ \ \ \ \text{for any }a\in\mathbb{Z}\right)  .
\]
(In other words, for any $\alpha\in\mathbb{Z}/n$, we let $r\alpha=\left[
ra\right]  _{n}$, where $a$ is an integer satisfying $\alpha=\left[  a\right]
_{n}$.) This is well-defined, because of Proposition
\ref{prop.eqrel.Z/n.scaling.wd} \textbf{(a)} below.

We also write $r\cdot\left[  a\right]  _{n}$ for $r\left[  a\right]  _{n}$.
\end{definition}

\begin{proposition}
\label{prop.eqrel.Z/n.scaling.wd}Fix $r\in\mathbb{Z}$.

\textbf{(a)} For any $\alpha\in\mathbb{Z}/n$, the residue class $r\alpha
\in\mathbb{Z}/n$ in Definition \ref{def.eqrel.Z/n.scaling} is well-defined.

\textbf{(b)} For any $\alpha\in\mathbb{Z}/n$, we have $r\alpha=\left[
r\right]  _{n}\cdot\alpha$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.Z/n.scaling.wd}.]\textbf{(a)} We are
again in the same situation in which we were when defining the map $R$ in the
proof of Theorem \ref{thm.eqrel.Z/n.explicit}: We are trying to define a map
(in this case, the map%
\begin{align*}
\mathbb{Z}/n  &  \rightarrow\mathbb{Z}/n,\\
\alpha &  \mapsto r\alpha
\end{align*}
) by specifying how it acts on inputs of the form $\left[  a\right]  _{n}$,
but our definition refers to the integer $a$. We want to prove that this map
is well-defined. This requires checking that the output (that is, $\left[
ra\right]  _{n}$) depends only on the class $\left[  a\right]  _{n}$, but not
on the integer $a$. So we have to prove the following:

\begin{statement}
\textit{Claim 1:} Let $a_{1}$ and $a_{2}$ be two integers such that $\left[
a_{1}\right]  _{n}=\left[  a_{2}\right]  _{n}$. Then, $\left[  ra_{1}\right]
_{n}=\left[  ra_{2}\right]  _{n}$.
\end{statement}

[\textit{Proof of Claim 1:} Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)}
(applied to $a_{1}$ and $a_{2}$ instead of $a$ and $b$) shows that we have
$\left[  a_{1}\right]  _{n}=\left[  a_{2}\right]  _{n}$ if and only if
$a_{1}\equiv a_{2}\operatorname{mod}n$. Thus, we have $a_{1}\equiv
a_{2}\operatorname{mod}n$ (since $\left[  a_{1}\right]  _{n}=\left[
a_{2}\right]  _{n}$). On the other hand, we have the (obvious) congruence
$r\equiv r\operatorname{mod}n$. Multiplying this congruence by the congruence
$a_{1}\equiv a_{2}\operatorname{mod}n$, we obtain $ra_{1}\equiv ra_{2}%
\operatorname{mod}n$.

But Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $ra_{1}$ and
$ra_{2}$ instead of $a$ and $b$) shows that we have $\left[  ra_{1}\right]
_{n}=\left[  ra_{2}\right]  _{n}$ if and only if $ra_{1}\equiv ra_{2}%
\operatorname{mod}n$. Thus, we have $\left[  ra_{1}\right]  _{n}=\left[
ra_{2}\right]  _{n}$ (since $ra_{1}\equiv ra_{2}\operatorname{mod}n$). This
proves Claim 1.]

Claim 1 shows that in Definition \ref{def.eqrel.Z/n.scaling}, the residue
class $\left[  ra\right]  _{n}$ depends only on the class $\left[  a\right]
_{n}$, but not on the integer $a$. Thus, the residue class $r\alpha$ is indeed
well-defined for each $\alpha\in\mathbb{Z}/n$. This proves Proposition
\ref{prop.eqrel.Z/n.scaling.wd} \textbf{(a)}.

\textbf{(b)} Let $\alpha\in\mathbb{Z}/n$. Proposition \ref{prop.eqrel.Z/n.ab}
\textbf{(a)} shows that each element of $\mathbb{Z}/n$ can be written in the
form $\left[  s\right]  _{n}$ for some integer $s$. Thus, $\alpha\in
\mathbb{Z}/n$ can be written in this form. In other words, $\alpha=\left[
a\right]  _{n}$ for some integer $a$. Consider this $a$. Comparing%
\[
r\underbrace{\alpha}_{=\left[  a\right]  _{n}}=r\left[  a\right]  _{n}=\left[
ra\right]  _{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition
\ref{def.eqrel.Z/n.scaling}}\right)
\]
with%
\begin{align*}
\left[  r\right]  _{n}\cdot\underbrace{\alpha}_{=\left[  a\right]  _{n}}  &
=\left[  r\right]  _{n}\cdot\left[  a\right]  _{n}=\left[  r\cdot a\right]
_{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition \ref{def.eqrel.Z/n.op}
\textbf{(c)}}\right) \\
&  =\left[  ra\right]  _{n},
\end{align*}
we obtain $r\alpha=\left[  r\right]  _{n}\cdot\alpha$. This proves Proposition
\ref{prop.eqrel.Z/n.scaling.wd} \textbf{(b)}.
\end{proof}

For a fixed $r\in\mathbb{Z}$, we shall refer to the map
\begin{align*}
\mathbb{Z}/n  &  \rightarrow\mathbb{Z}/n,\\
\alpha &  \mapsto r\alpha
\end{align*}
as \textit{scaling by }$r$. This map is actually the same as multiplication by
the residue class $\left[  r\right]  _{n}$ (by Proposition
\ref{prop.eqrel.Z/n.scaling.wd} \textbf{(b)}). So why did we define it
\textquotedblleft from scratch\textquotedblright\ rather than piggybacking on
the already established definition of multiplication in $\mathbb{Z}/n$
(Definition \ref{def.eqrel.Z/n.op} \textbf{(c)})? The reason is that scaling
operations appear much more frequently in algebra than multiplication
operations. (For example, every vector space has a scaling operation, but
usually there is no way of multiplying two vectors.) Thus, it is useful to
have seen a scaling operation constructed independently.

\subsubsection{$k$-th powers for $k\in\mathbb{N}$}

Similarly to Definition \ref{def.eqrel.Z/n.scaling}, we can define what it
means to take the $k$-th power of a residue class in $\mathbb{Z}/n$, when $k$
is a nonnegative integer.

\begin{definition}
\label{def.eqrel.Z/n.kpower}Fix $k\in\mathbb{N}$.

For any $\alpha\in\mathbb{Z}/n$, we define a residue class $\alpha^{k}%
\in\mathbb{Z}/n$ by setting
\[
\left(  \left(  \left[  a\right]  _{n}\right)  ^{k}=\left[  a^{k}\right]
_{n}\ \ \ \ \ \ \ \ \ \ \text{for any }a\in\mathbb{Z}\right)  .
\]
(In other words, for any $\alpha\in\mathbb{Z}/n$, we let $\alpha^{k}=\left[
a^{k}\right]  _{n}$, where $a$ is an integer satisfying $\alpha=\left[
a\right]  _{n}$.) This is well-defined, because of Proposition
\ref{prop.eqrel.Z/n.kpower.wd} below.

If $\alpha\in\mathbb{Z}/n$, then we shall refer to $\alpha^{k}$ as the
$k$\textit{-th power} of $\alpha$.
\end{definition}

\begin{proposition}
\label{prop.eqrel.Z/n.kpower.wd}Fix $k\in\mathbb{N}$. For any $\alpha
\in\mathbb{Z}/n$, the residue class $\alpha^{k}\in\mathbb{Z}/n$ in Definition
\ref{def.eqrel.Z/n.kpower} is well-defined.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.Z/n.kpower.wd}.]This proof is analogous
to the above proof of Proposition \ref{prop.eqrel.Z/n.scaling.wd}
\textbf{(a)}; but instead of multiplying the two congruences $r\equiv
r\operatorname{mod}n$ and $a_{1}\equiv a_{2}\operatorname{mod}n$, we now need
to take the $k$-th power of the congruence $a_{1}\equiv a_{2}%
\operatorname{mod}n$. (Exercise \ref{exe.ent.mod.basics.k-power} allows us to
do that.)
\end{proof}

\begin{teachingnote}
\textbf{2019-02-25 lecture}
\end{teachingnote}

\subsubsection{Rules and properties for the operations}

\begin{convention}
We shall follow \href{https://en.wikipedia.org/wiki/Order_of_operations}{the
usual \textquotedblleft PEMDAS\textquotedblright\ rules for the order of
operations} when interpreting expressions involving the operations defined in
Definition \ref{def.eqrel.Z/n.op}, Definition \ref{def.eqrel.Z/n.scaling} and
Definition \ref{def.eqrel.Z/n.kpower}\footnote{The scaling operation (defined
in Definition \ref{def.eqrel.Z/n.scaling}) is treated exactly like
multiplication.}. Thus, for example, the expression \textquotedblleft%
$\alpha\cdot\beta+\gamma\cdot\delta$\textquotedblright\ means $\left(
\alpha\cdot\beta\right)  +\left(  \gamma\cdot\delta\right)  $ and not
$\alpha\cdot\left(  \beta+\gamma\right)  \cdot\delta$. Likewise, the
expression \textquotedblleft$\alpha\beta^{k}+r\gamma$\textquotedblright\ (with
$r\in\mathbb{Z}$) should be understood as \textquotedblleft$\left(
\alpha\left(  \beta^{k}\right)  \right)  +\left(  r\gamma\right)
$\textquotedblright\ and not in any other way.
\end{convention}

We shall now study some properties of the many \textquotedblleft
arithmetical\textquotedblright\ operations we have defined on $\mathbb{Z}/n$.

\begin{theorem}
\label{thm.eqrel.Z/n.rules}The following rules for addition, subtraction,
multiplication and scaling in $\mathbb{Z}/n$ hold:

\textbf{(a)} We have $\alpha+\beta=\beta+\alpha$ for any $\alpha,\beta
\in\mathbb{Z}/n$.

\textbf{(b)} We have $\alpha+\left(  \beta+\gamma\right)  =\left(
\alpha+\beta\right)  +\gamma$ for any $\alpha,\beta,\gamma\in\mathbb{Z}/n$.

\textbf{(c)} We have $\alpha+\left[  0\right]  _{n}=\left[  0\right]
_{n}+\alpha=\alpha$ for any $\alpha\in\mathbb{Z}/n$.

\textbf{(d)} We have $\alpha\cdot\left[  1\right]  _{n}=\left[  1\right]
_{n}\cdot\alpha=\alpha$ for any $\alpha\in\mathbb{Z}/n$.

\textbf{(e)} We have $\alpha\cdot\beta=\beta\cdot\alpha$ for any $\alpha
,\beta\in\mathbb{Z}/n$.

\textbf{(f)} We have $\alpha\cdot\left(  \beta\cdot\gamma\right)  =\left(
\alpha\cdot\beta\right)  \cdot\gamma$ for any $\alpha,\beta,\gamma
\in\mathbb{Z}/n$.

\textbf{(g)} We have $\alpha\cdot\left(  \beta+\gamma\right)  =\alpha
\beta+\alpha\gamma$ and $\left(  \alpha+\beta\right)  \cdot\gamma=\alpha
\gamma+\beta\gamma$ for any $\alpha,\beta,\gamma\in\mathbb{Z}/n$.

\textbf{(h)} We have $\alpha\cdot\left[  0\right]  _{n}=\left[  0\right]
_{n}\cdot\alpha=\left[  0\right]  _{n}$ for any $\alpha\in\mathbb{Z}/n$.

\textbf{(i)} If $\alpha,\beta,\gamma\in\mathbb{Z}/n$, then we have the
equivalence $\left(  \alpha-\beta=\gamma\right)  \Longleftrightarrow\left(
\alpha=\beta+\gamma\right)  $.

\textbf{(j)} We have $r\left(  \alpha+\beta\right)  =r\alpha+r\beta$ for any
$r\in\mathbb{Z}$ and $\alpha,\beta\in\mathbb{Z}/n$.

\textbf{(k)} We have $\left(  r+s\right)  \alpha=r\alpha+s\alpha$ for any
$r,s\in\mathbb{Z}$ and $\alpha\in\mathbb{Z}/n$.

\textbf{(l)} We have $r\left(  s\alpha\right)  =\left(  rs\right)  \alpha$ for
any $r,s\in\mathbb{Z}$ and $\alpha\in\mathbb{Z}/n$.

\textbf{(m)} We have $r\left(  \alpha\beta\right)  =\left(  r\alpha\right)
\beta=\alpha\left(  r\beta\right)  $ for any $r\in\mathbb{Z}$ and
$\alpha,\beta\in\mathbb{Z}/n$.

\textbf{(n)} We have $-\left(  r\alpha\right)  =\left(  -r\right)
\alpha=r\left(  -\alpha\right)  $ for any $r\in\mathbb{Z}$ and $\alpha
\in\mathbb{Z}/n$.

\textbf{(o)} We have $1\alpha=\alpha$ for any $\alpha\in\mathbb{Z}/n$.

\textbf{(p)} We have $\left(  -1\right)  \alpha=-\alpha$ for any $\alpha
\in\mathbb{Z}/n$.

\textbf{(q)} We have $-\left(  \alpha+\beta\right)  =\left(  -\alpha\right)
+\left(  -\beta\right)  $ for any $\alpha,\beta\in\mathbb{Z}/n$.

\textbf{(r)} We have $-\left[  0\right]  _{n}=\left[  0\right]  _{n}$.

\textbf{(s)} We have $-\left(  -\alpha\right)  =\alpha$ for any $\alpha
\in\mathbb{Z}/n$.

\textbf{(t)} We have $-\left(  \alpha\beta\right)  =\left(  -\alpha\right)
\beta=\alpha\left(  -\beta\right)  $ for any $\alpha,\beta\in\mathbb{Z}/n$.

\textbf{(u)} We have $\alpha-\beta-\gamma=\alpha-\left(  \beta+\gamma\right)
$ for any $\alpha,\beta,\gamma\in\mathbb{Z}/n$. (Here and in the following,
\textquotedblleft$\alpha-\beta-\gamma$\textquotedblright\ should be read as
\textquotedblleft$\left(  \alpha-\beta\right)  -\gamma$\textquotedblright.)
\end{theorem}

These properties should all look familiar, as they mirror the classical
properties of the arithmetic operations on integers, rational numbers and real
numbers (with the caveat that the residue classes $\left[  0\right]  _{n}$ and
$\left[  1\right]  _{n}$ take on the roles of the numbers $0$ and $1$). For
example, Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(g)} corresponds to the
laws of distributivity for numbers. Parts \textbf{(a)}, \textbf{(b)},
\textbf{(c)}, \textbf{(i)}, \textbf{(j)}, \textbf{(k)}, \textbf{(l)} and
\textbf{(o)} of Theorem \ref{thm.eqrel.Z/n.rules} furthermore are reminiscent
of the axioms for a vector space (with the caveat that scaling by $r$ is only
defined for integers $r$ here, so $\mathbb{Z}/n$ is not precisely a vector space).

\begin{proof}
[Proof of Theorem \ref{thm.eqrel.Z/n.rules}.]Let us first prove Theorem
\ref{thm.eqrel.Z/n.rules} \textbf{(f)}:

\textbf{(f)} Let $\alpha,\beta,\gamma\in\mathbb{Z}/n$. Proposition
\ref{prop.eqrel.Z/n.ab} \textbf{(a)} shows that each element of $\mathbb{Z}/n$
can be written in the form $\left[  s\right]  _{n}$ for some integer $s$.
Thus, in particular, the element $\alpha$ can be written in this form. In
other words, there exists an integer $a$ such that $\alpha=\left[  a\right]
_{n}$. Similarly, there exists an integer $b$ such that $\beta=\left[
b\right]  _{n}$. Similarly, there exists an integer $c$ such that
$\gamma=\left[  c\right]  _{n}$. Consider these integers $a,b,c$.

Now,%
\begin{align}
\underbrace{\alpha}_{=\left[  a\right]  _{n}}\cdot\left(  \underbrace{\beta
}_{=\left[  b\right]  _{n}}\cdot\underbrace{\gamma}_{=\left[  c\right]  _{n}%
}\right)   &  =\left[  a\right]  _{n}\cdot\underbrace{\left(  \left[
b\right]  _{n}\cdot\left[  c\right]  _{n}\right)  }_{\substack{=\left[  b\cdot
c\right]  _{n}\\\text{(by Definition \ref{def.eqrel.Z/n.op} \textbf{(c)})}%
}}=\left[  a\right]  _{n}\cdot\left[  b\cdot c\right]  _{n}\nonumber\\
&  =\left[  a\cdot\left(  b\cdot c\right)  \right]  _{n}
\label{pf.thm.eqrel.Z/n.rules.f.1}%
\end{align}
(by Definition \ref{def.eqrel.Z/n.op} \textbf{(c)}) and%
\begin{align}
\left(  \underbrace{\alpha}_{=\left[  a\right]  _{n}}\cdot\underbrace{\beta
}_{=\left[  b\right]  _{n}}\right)  \cdot\underbrace{\gamma}_{=\left[
c\right]  _{n}}  &  =\underbrace{\left(  \left[  a\right]  _{n}\cdot\left[
b\right]  _{n}\right)  }_{\substack{=\left[  a\cdot b\right]  _{n}\\\text{(by
Definition \ref{def.eqrel.Z/n.op} \textbf{(c)})}}}\cdot\left[  c\right]
_{n}=\left[  a\cdot b\right]  _{n}\cdot\left[  c\right]  _{n}\nonumber\\
&  =\left[  \left(  a\cdot b\right)  \cdot c\right]  _{n}
\label{pf.thm.eqrel.Z/n.rules.f.2}%
\end{align}
(by Definition \ref{def.eqrel.Z/n.op} \textbf{(c)}).

But it is well-known that multiplication of integers is associative. Thus,
$a\cdot\left(  b\cdot c\right)  =\left(  a\cdot b\right)  \cdot c$. Hence,
$\left[  a\cdot\left(  b\cdot c\right)  \right]  _{n}=\left[  \left(  a\cdot
b\right)  \cdot c\right]  _{n}$. In other words, the right hand sides of the
equalities (\ref{pf.thm.eqrel.Z/n.rules.f.1}) and
(\ref{pf.thm.eqrel.Z/n.rules.f.2}) are equal. Hence, the left hand sides of
these equalities must also be equal. In other words, $\alpha\cdot\left(
\beta\cdot\gamma\right)  =\left(  \alpha\cdot\beta\right)  \cdot\gamma$. This
proves Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(f)}.

The idea of the above proof of Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(f)}
was simple: We fixed a representative for each residue class involved (namely,
we fixed representatives $a,b,c$ for the residue classes $\alpha,\beta,\gamma
$), and rewrote each of the two sides of the alleged equality (which, in our
case, was $\alpha\cdot\left(  \beta\cdot\gamma\right)  =\left(  \alpha
\cdot\beta\right)  \cdot\gamma$) in terms of these representatives (obtaining
$\left[  a\cdot\left(  b\cdot c\right)  \right]  _{n}$ for the left hand side,
and $\left[  \left(  a\cdot b\right)  \cdot c\right]  _{n}$ for the right hand
side). Thus, the equality that we had to prove followed from the analogous
equality for integers (in our case, $a\cdot\left(  b\cdot c\right)  =\left(
a\cdot b\right)  \cdot c$), which was well-known. In short, we have realized
that the equality $\alpha\cdot\left(  \beta\cdot\gamma\right)  =\left(
\alpha\cdot\beta\right)  \cdot\gamma$ for $\alpha,\beta,\gamma\in\mathbb{Z}/n$
is \textquotedblleft inherited from $\mathbb{Z}$\textquotedblright\ (in the
sense that it follows straightforwardly from the corresponding property
$a\cdot\left(  b\cdot c\right)  =\left(  a\cdot b\right)  \cdot c$ of integers
$a,b,c\in\mathbb{Z}$). This strategy proves all the other parts of Theorem
\ref{thm.eqrel.Z/n.rules} in the same way, except for part \textbf{(i)}%
.\footnote{The reason why this works is that the operations $+,-,\cdot$ on
$\mathbb{Z}/n$ as well as scaling by integers are defined by picking a
representative of each residue class and doing the analogous operation
\textbf{with the representatives} (and then taking the residue class again).}
Part \textbf{(i)} does not lend itself to such a proof, since it claims not an
equality but rather an equivalence between two equalities. So let us prove
part \textbf{(i)} separately:

\textbf{(i)} Let $\alpha,\beta,\gamma\in\mathbb{Z}/n$. Proposition
\ref{prop.eqrel.Z/n.ab} \textbf{(a)} shows that each element of $\mathbb{Z}/n$
can be written in the form $\left[  s\right]  _{n}$ for some integer $s$.
Thus, in particular, the element $\alpha$ can be written in this form. In
other words, there exists an integer $a$ such that $\alpha=\left[  a\right]
_{n}$. Similarly, there exists an integer $b$ such that $\beta=\left[
b\right]  _{n}$. Similarly, there exists an integer $c$ such that
$\gamma=\left[  c\right]  _{n}$. Consider these integers $a,b,c$.

We have $\underbrace{\alpha}_{=\left[  a\right]  _{n}}-\underbrace{\beta
}_{=\left[  b\right]  _{n}}=\left[  a\right]  _{n}-\left[  b\right]
_{n}=\left[  a-b\right]  _{n}$ (by Definition \ref{def.eqrel.Z/n.op}
\textbf{(b)}) and $\underbrace{\beta}_{=\left[  b\right]  _{n}}%
+\underbrace{\gamma}_{=\left[  c\right]  _{n}}=\left[  b\right]  _{n}+\left[
c\right]  _{n}=\left[  b+c\right]  _{n}$ (by Definition \ref{def.eqrel.Z/n.op}
\textbf{(a)}). Now, we have the following chain of logical equivalences:%
\begin{align}
\left(  \alpha-\beta=\gamma\right)  \  &  \Longleftrightarrow\ \left(  \left[
a-b\right]  _{n}=\left[  c\right]  _{n}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }\alpha-\beta=\left[  a-b\right]  _{n}\text{ and }\gamma=\left[
c\right]  _{n}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  a-b\equiv c\operatorname{mod}n\right)
\label{pf.thm.eqrel.Z/n.rules.i.1}%
\end{align}
(since Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $a-b$ and
$c$ instead of $a$ and $b$) shows that we have $\left[  a-b\right]
_{n}=\left[  c\right]  _{n}$ if and only if $a-b\equiv c\operatorname{mod}n$).
Also, we have the following chain of logical equivalences:%
\begin{align}
\left(  \alpha=\beta+\gamma\right)  \  &  \Longleftrightarrow\ \left(  \left[
a\right]  _{n}=\left[  b+c\right]  _{n}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }\alpha=\left[  a\right]  _{n}\text{ and }\beta+\gamma=\left[
b+c\right]  _{n}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  a\equiv b+c\operatorname{mod}n\right)
\label{pf.thm.eqrel.Z/n.rules.i.2}%
\end{align}
(since Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $b+c$
instead of $b$) shows that we have $\left[  a\right]  _{n}=\left[  b+c\right]
_{n}$ if and only if $a\equiv b+c\operatorname{mod}n$). Finally, Exercise
\ref{exe.ent.mod.diff} shows that we have $a-b\equiv c\operatorname{mod}n$ if
and only if $a\equiv b+c\operatorname{mod}n$; thus, we have the equivalence
$\left(  a-b\equiv c\operatorname{mod}n\right)  \ \Longleftrightarrow\ \left(
a\equiv b+c\operatorname{mod}n\right)  $.

Now, we have the following chain of logical equivalences:%
\begin{align*}
\left(  \alpha-\beta=\gamma\right)  \  &  \Longleftrightarrow\ \left(
a-b\equiv c\operatorname{mod}n\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.eqrel.Z/n.rules.i.1})}\right) \\
&  \Longleftrightarrow\ \left(  a\equiv b+c\operatorname{mod}n\right)
\ \Longleftrightarrow\ \left(  \alpha=\beta+\gamma\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.eqrel.Z/n.rules.i.2}%
)}\right)  .
\end{align*}
This proves Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(i)}.
\end{proof}

Recall the concept of a finite sum of integers (i.e., a sum of the form
$\sum_{i\in I}a_{i}$, where $I$ is a finite set and $a_{i}$ is an integer for
each $i\in I$), and the analogous concept of a finite product of integers
(i.e., a product of the form $\prod_{i\in I}a_{i}$). These concepts are
defined recursively\footnote{See \cite[\S 1.4.1 and \S 1.4.3]{detnotes} for
their definitions, and \cite[\S 2.14]{detnotes} for a proof that these are
well-defined.} and satisfy various rules\footnote{such as $\sum_{i\in
I}\left(  a_{i}+b_{i}\right)  =\sum_{i\in I}a_{i}+\sum_{i\in I}b_{i}$ (where
$a_{i}$ and $b_{i}$ are two integers for each $i\in I$) or $\sum_{i\in I}%
a_{i}=\sum_{i\in J}a_{i}+\sum_{i\in I\setminus J}a_{i}$ (where $J$ is a subset
of $I$)}. See \cite[\S 1.4]{detnotes} for a comprehensive list of these rules
and \cite[\S 2.14]{detnotes} for their proofs.

\begin{definition}
\label{def.eqrel.Z/n.sums}In the same vein, we define the concept of a finite
sum of residue classes in $\mathbb{Z}/n$ (i.e., a sum of the form $\sum_{i\in
I}\alpha_{i}$, where $I$ is a finite set and $\alpha_{i}\in\mathbb{Z}/n$ for
each $i\in I$), and the analogous concept of a finite product of residue
classes in $\mathbb{Z}/n$ (i.e., a product of the form $\prod_{i\in I}%
\alpha_{i}$, where $I$ is a finite set and $\alpha_{i}\in\mathbb{Z}/n$ for
each $i\in I$).

More precisely, the concept of a finite sum $\sum_{i\in I}\alpha_{i}$ (with
$I$ being a finite set, and with $\alpha_{i}\in\mathbb{Z}/n$ for each $i\in
I$) is defined recursively as follows:

\begin{itemize}
\item If the set $I$ is empty (that is, $\left\vert I\right\vert =0$), then
$\sum_{i\in I}\alpha_{i}$ is defined to be $\left[  0\right]  _{n}%
\in\mathbb{Z}/n$ (and called an empty sum).

\item Otherwise, we pick an arbitrary element $t\in I$, and set%
\[
\sum_{i\in I}\alpha_{i}=\alpha_{t}+\sum_{i\in I\setminus\left\{  t\right\}
}\alpha_{i}.
\]
(The sum $\sum_{i\in I\setminus\left\{  t\right\}  }\alpha_{i}$ on the right
hand side is a sum over a smaller set than $I$, whence we can assume it to
already be defined in this recursive definition.)
\end{itemize}

This definition is well-defined (i.e., the choice of element $t$ does not
influence the final value of the sum), by Proposition
\ref{prop.eqrel.Z/n.sums.wd} \textbf{(a)} below.

The concept of a finite product $\prod_{i\in I}\alpha_{i}$ is defined
similarly, except that we use multiplication instead of addition (and we
define the empty product to be $\left[  1\right]  _{n}$ instead of $\left[
0\right]  _{n}$).
\end{definition}

We will use the usual shorthands for special kinds of finite sums and
products. For example, if $I$ is an interval $\left\{  p,p+1,\ldots,q\right\}
$ of integers (and if $\alpha_{i}\in\mathbb{Z}/n$ for each $i\in I$), then the
sum $\sum_{i\in I}\alpha_{i}$ will also be denoted by $\sum_{i=p}^{q}%
\alpha_{i}$ or $\alpha_{p}+\alpha_{p+1}+\cdots+\alpha_{q}$. Likewise for
products. Thus, for example, $\alpha_{1}+\alpha_{2}+\cdots+\alpha_{k}$ and
$\alpha_{1}\alpha_{2}\cdots\alpha_{k}$ are well-defined whenever $\alpha
_{1},\alpha_{2},\ldots,\alpha_{k}\in\mathbb{Z}/n$.

\begin{proposition}
\label{prop.eqrel.Z/n.sums.wd}\textbf{(a)} Definition \ref{def.eqrel.Z/n.sums}
is well-defined.

\textbf{(b)} Finite sums ($\sum_{i\in I}\alpha_{i}$) and finite products
($\prod_{i\in I}\alpha_{i}$) of elements $\alpha_{i}\in\mathbb{Z}/n$ satisfy
the same rules that finite sums and finite products of integers satisfy.

\textbf{(c)} If $a_{1},a_{2},\ldots,a_{k}$ are $k$ integers, then
\begin{align*}
\left[  a_{1}\right]  _{n}+\left[  a_{2}\right]  _{n}+\cdots+\left[
a_{k}\right]  _{n}  &  =\left[  a_{1}+a_{2}+\cdots+a_{k}\right]
_{n}\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left[  a_{1}\right]  _{n}\cdot\left[  a_{2}\right]  _{n}\cdot\cdots
\cdot\left[  a_{k}\right]  _{n}  &  =\left[  a_{1}a_{2}\cdots a_{k}\right]
_{n}.
\end{align*}

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.eqrel.Z/n.sums.wd}.]\textbf{(a)} In
\cite[Theorem 2.118 \textbf{(a)}]{detnotes}, it is proven that finite sums of
integers are well-defined. The same argument (but relying on Theorem
\ref{thm.eqrel.Z/n.rules} instead of the usual rules of commutativity,
associativity etc. for integers) shows that finite sums of elements
$\alpha_{i}\in\mathbb{Z}/n$ are well-defined. The analogous fact for products
is proven in the same way, except that we need to replace $\left[  0\right]
_{n}$ by $\left[  1\right]  _{n}$ and properties of addition by corresponding
properties of multiplication.

\textbf{(b)} The proofs of the properties of finite sums and finite products
of elements of $\mathbb{Z}/n$ are identical to the analogous proofs for
integers, but (again) rely on Theorem \ref{thm.eqrel.Z/n.rules} instead of the
usual rules of commutativity, associativity etc. for integers.

\textbf{(c)} This can be proven by a straightforward induction on $k$.
\end{proof}

Also, the standard rules for exponents apply to residue classes:

\begin{theorem}
\label{thm.eqrel.Z/n.rules-exp}\textbf{(a)} We have $\alpha^{0}=\left[
1\right]  _{n}$ for any $\alpha\in\mathbb{Z}/n$.

\textbf{(b)} We have $\alpha^{1}=\alpha$ for any $\alpha\in\mathbb{Z}/n$.

\textbf{(c)} We have $\alpha^{k}=\underbrace{\alpha\alpha\cdots\alpha
}_{k\text{ times}}$ for any $\alpha\in\mathbb{Z}/n$ and $k\in\mathbb{N}$.

\textbf{(d)} We have $\alpha^{u+v}=\alpha^{u}\alpha^{v}$ for any $\alpha
\in\mathbb{Z}/n$ and any $u,v\in\mathbb{N}$.

\textbf{(e)} We have $\left(  \alpha\beta\right)  ^{k}=\alpha^{k}\beta^{k}$
for any $\alpha,\beta\in\mathbb{Z}/n$ and $k\in\mathbb{N}$.

\textbf{(f)} We have $\left(  \alpha^{u}\right)  ^{v}=\alpha^{uv}$ for any
$\alpha\in\mathbb{Z}/n$ and any $u,v\in\mathbb{N}$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.eqrel.Z/n.rules-exp}.]Each part of Theorem
\ref{thm.eqrel.Z/n.rules-exp} follows from the analogous property of integers,
in the same way as we derived Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(f)}
from the associativity of multiplication for integers. (Note that Proposition
\ref{prop.eqrel.Z/n.sums.wd} \textbf{(c)} has to be used in proving Theorem
\ref{thm.eqrel.Z/n.rules-exp} \textbf{(c)}.)
\end{proof}

Also, the binomial formula holds for residue classes:

\begin{theorem}
\label{thm.eqrel.Z/n.binf}Let $\alpha,\beta\in\mathbb{Z}/n$ and $m\in
\mathbb{N}$. Then,%
\[
\left(  \alpha+\beta\right)  ^{m}=\sum_{k=0}^{m}\dbinom{m}{k}\alpha^{k}%
\beta^{m-k}.
\]

\end{theorem}

\begin{proof}
This follows from Theorem \ref{thm.binom.binf}, in the same way as we derived
Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(f)} from the associativity of
multiplication for integers.
\end{proof}

\subsection{\label{sect.equiv.modinv}Modular inverses revisited}

\begin{convention}
For the whole Section \ref{sect.equiv.modinv}, we fix a positive integer $n$.
\end{convention}

In this section, we will see how modular inverses become actual inverses when
we consider residue classes instead of numbers.

Recall that if $a$ is an integer, then an \textit{inverse of }$a$\textit{ in
}$\mathbb{Z}$ means an integer $a^{\prime}\in\mathbb{Z}$ satisfying
$aa^{\prime}=1$. The only two integers that have an inverse in $\mathbb{Z}$
are $1$ and $-1$. The integer $1$ has only one inverse (namely, itself). The
integer $-1$ has only one inverse (namely, itself). Thus, \textquotedblleft
inverse in $\mathbb{Z}$\textquotedblright\ is not a very interesting notion.

Let us now define an analogous notion for $\mathbb{Z}/n$:

\begin{definition}
\label{def.equiv.modinv.inverse}Let $\alpha\in\mathbb{Z}/n$. An
\textit{inverse} of $\alpha$ means an $\alpha^{\prime}\in\mathbb{Z}/n$ such
that $\alpha\cdot\alpha^{\prime}=\left[  1\right]  _{n}$.
\end{definition}

For example, $\left[  2\right]  _{5}$ is an inverse of $\left[  3\right]
_{5}$ for $n=5$, since $\left[  3\right]  _{5}\cdot\left[  2\right]
_{5}=\left[  3\cdot2\right]  _{5}=\left[  6\right]  _{5}=\left[  1\right]
_{5}$.

It turns out that inverses of residue classes $\alpha\in\mathbb{Z}/n$ exist
much more frequently than inverses of integers in $\mathbb{Z}$:

\begin{proposition}
\label{prop.equiv.modinv.exiuni}Let $a\in\mathbb{Z}$.

\textbf{(a)} If $\left[  a\right]  _{n}\in\mathbb{Z}/n$ has an inverse, then
$a\perp n$.

\textbf{(b)} If $a\perp n$, then $\left[  a\right]  _{n}\in\mathbb{Z}/n$ has a
unique inverse.
\end{proposition}

As we will see in the proof of this proposition, the inverse of a residue
class $\left[  a\right]  _{n}$ is simply the residue class $\left[  a^{\prime
}\right]  _{n}$ of a modular inverse $a^{\prime}$ of $a$ modulo $n$; thus, the
existence part of Proposition \ref{prop.equiv.modinv.exiuni} \textbf{(b)}
(i.e., the claim that $\left[  a\right]  _{n}$ has an inverse) is just Theorem
\ref{thm.ent.coprime.modinv} \textbf{(b)} in disguise. However, before we
start proving Proposition \ref{prop.equiv.modinv.exiuni}, let us state the
uniqueness part (i.e., the claim that the inverse of $\left[  a\right]  _{n}$
is unique) as a separate fact:

\begin{proposition}
\label{prop.equiv.modinv.uni}Let $\alpha\in\mathbb{Z}/n$. Then, $\alpha$ has
\textbf{at most one} inverse.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.equiv.modinv.uni}.]Let $\beta$ and $\gamma$ be
two inverses of $\alpha$. We shall show that $\beta=\gamma$.

We have $\alpha\cdot\beta=\left[  1\right]  _{n}$ (since $\beta$ is an inverse
of $\alpha$) and $\alpha\cdot\gamma=\left[  1\right]  _{n}$ (since $\gamma$ is
an inverse of $\alpha$). Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(e)}
(applied to $\gamma$ and $\alpha$ instead of $\alpha$ and $\beta$) yields
$\gamma\cdot\alpha=\alpha\cdot\gamma=\left[  1\right]  _{n}$.

Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(d)} (applied to $\gamma$ instead of
$\alpha$) yields $\gamma\cdot\left[  1\right]  _{n}=\left[  1\right]
_{n}\cdot\gamma=\gamma$. Also, Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(d)}
(applied to $\beta$ instead of $\alpha$) yields $\beta\cdot\left[  1\right]
_{n}=\left[  1\right]  _{n}\cdot\beta=\beta$.

Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(f)} (applied to $\gamma$, $\alpha$
and $\beta$ instead of $\alpha$, $\beta$ and $\gamma$) shows that $\gamma
\cdot\left(  \alpha\cdot\beta\right)  =\left(  \gamma\cdot\alpha\right)
\cdot\beta$. Now, comparing
\[
\gamma\cdot\left(  \underbrace{\alpha\cdot\beta}_{=\left[  1\right]  _{n}%
}\right)  =\gamma\cdot\left[  1\right]  _{n}=\gamma
\]
with%
\[
\gamma\cdot\left(  \alpha\cdot\beta\right)  =\left(  \underbrace{\gamma
\cdot\alpha}_{=\left[  1\right]  _{n}}\right)  \cdot\beta=\left[  1\right]
_{n}\cdot\beta=\beta,
\]
we obtain $\beta=\gamma$.

Now, forget that we fixed $\beta$ and $\gamma$. We thus have proven that if
$\beta$ and $\gamma$ are two inverses of $\alpha$, then $\beta=\gamma$. In
other words, any two inverses of $\alpha$ must be equal. In other words,
$\alpha$ has at most one inverse. This proves Proposition
\ref{prop.equiv.modinv.uni}.
\end{proof}

Note that in the above proof of Proposition \ref{prop.equiv.modinv.uni}, we
have never had to pick a representative of the residue class $\alpha$ (nor of
any other class). This is because this proof is actually an instance of a much
more general argument. And indeed, you might recall that a very similar
argument is used to prove the classical facts that

\begin{itemize}
\item a map has at most one inverse;

\item a matrix has at most one inverse.
\end{itemize}

\noindent To be more precise, the proofs of these two facts differ slightly
from our proof of Proposition \ref{prop.equiv.modinv.uni}, because the
definitions of an inverse of a map and of an inverse of a matrix differ from
Definition \ref{def.equiv.modinv.inverse}. Indeed, in Definition
\ref{def.equiv.modinv.inverse}, we have only required the inverse
$\alpha^{\prime}$ of $\alpha\in\mathbb{Z}/n$ to satisfy the \textbf{single}
equation $\alpha\cdot\alpha^{\prime}=\left[  1\right]  _{n}$, whereas an
inverse $g$ of a map $f$ is required to satisfy the \textbf{two} equations
$f\circ g=\operatorname*{id}$ and $g\circ f=\operatorname*{id}$ (and likewise,
an inverse $B$ of a matrix $A$ is required to satisfy the \textbf{two}
equations $AB=I$ and $BA=I$ for the appropriate identity matrices $I$). But
this difference is not substantial: The multiplication of residue classes in
$\mathbb{Z}/n$ is commutative (by Theorem \ref{thm.eqrel.Z/n.rules}
\textbf{(e)}) (unlike the composition of maps or the multiplication of
matrices); thus, the single equation $\alpha\cdot\alpha^{\prime}=\left[
1\right]  _{n}$ automatically implies $\alpha^{\prime}\cdot\alpha=\left[
1\right]  _{n}$. Hence, we could have as well required $\alpha^{\prime}$ to
satisfy both equations $\alpha\cdot\alpha^{\prime}=\left[  1\right]  _{n}$ and
$\alpha^{\prime}\cdot\alpha=\left[  1\right]  _{n}$ in Definition
\ref{def.equiv.modinv.inverse}, and nothing would change.

Let us now prove Proposition \ref{prop.equiv.modinv.exiuni}:

\begin{proof}
[Proof of Proposition \ref{prop.equiv.modinv.exiuni}.]\textbf{(a)} Assume that
$\left[  a\right]  _{n}\in\mathbb{Z}/n$ has an inverse. Let $\beta$ be this
inverse. Write the residue class $\beta\in\mathbb{Z}/n$ in the form $\left[
b\right]  _{n}$ for some integer $b$. Now, $\beta$ is an inverse of $\left[
a\right]  _{n}$. In other words, $\left[  a\right]  _{n}\cdot\beta=\left[
1\right]  _{n}$ (by the definition of \textquotedblleft
inverse\textquotedblright). But $\left[  a\right]  _{n}\cdot\underbrace{\beta
}_{=\left[  b\right]  _{n}}=\left[  a\right]  _{n}\cdot\left[  b\right]
_{n}=\left[  a\cdot b\right]  _{n}$ (by the definition of multiplication on
$\mathbb{Z}/n$). Comparing this with $\left[  a\right]  _{n}\cdot\beta=\left[
1\right]  _{n}$, we obtain $\left[  a\cdot b\right]  _{n}=\left[  1\right]
_{n}$. By Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $a\cdot
b$ and $1$ instead of $a$ and $b$), this yields $a\cdot b\equiv
1\operatorname{mod}n$. Hence, there exists an $a^{\prime}\in\mathbb{Z}$ such
that $aa^{\prime}\equiv1\operatorname{mod}n$ (namely, $a^{\prime}=b$). Thus,
Theorem \ref{thm.ent.coprime.modinv} \textbf{(c)} yields $a\perp n$. This
proves Proposition \ref{prop.equiv.modinv.exiuni} \textbf{(a)}.

\textbf{(b)} Assume that $a\perp n$. Hence, Theorem
\ref{thm.ent.coprime.modinv} \textbf{(b)} yields that there exists an
$a^{\prime}\in\mathbb{Z}$ such that $aa^{\prime}\equiv1\operatorname{mod}n$.
Consider this $a^{\prime}$. From $aa^{\prime}\equiv1\operatorname{mod}n$, we
obtain $\left[  aa^{\prime}\right]  _{n}=\left[  1\right]  _{n}$ (by
Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)}, applied to $aa^{\prime}$ and
$1$ instead of $a$ and $b$). But the definition of multiplication on
$\mathbb{Z}/n$ yields $\left[  a\right]  _{n}\cdot\left[  a^{\prime}\right]
_{n}=\left[  a\cdot a^{\prime}\right]  _{n}=\left[  aa^{\prime}\right]
_{n}=\left[  1\right]  _{n}$. In other words, $\left[  a^{\prime}\right]
_{n}$ is an inverse of $\left[  a\right]  _{n}$. Hence, $\left[  a\right]
_{n}$ has \textbf{at least }one inverse (namely, $\left[  a^{\prime}\right]
_{n}$).

But Proposition \ref{prop.equiv.modinv.uni} (applied to $\alpha=\left[
a\right]  _{n}$) shows that $\left[  a\right]  _{n}$ has \textbf{at most }one inverse.

Thus, we conclude that $\left[  a\right]  _{n}$ has a unique inverse (since we
already know that $\left[  a\right]  _{n}$ has \textbf{at least }one inverse
and has \textbf{at most }one inverse). This proves Proposition
\ref{prop.equiv.modinv.exiuni}.
\end{proof}

\begin{corollary}
\label{cor.equiv.modinv.Unphi}Let $U_{n}$ be the set of all residue classes
$\alpha\in\mathbb{Z}/n$ that have an inverse. Then:

\textbf{(a)} For an integer $a$, we have the logical equivalence $\left(
\left[  a\right]  _{n}\in U_{n}\right)  \Longleftrightarrow\left(  a\perp
n\right)  $.

\textbf{(b)} We have $\left\vert U_{n}\right\vert =\phi\left(  n\right)  $.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.equiv.modinv.Unphi}.]\textbf{(a)} Let $a$ be an
integer. Proposition \ref{prop.equiv.modinv.exiuni} \textbf{(a)} yields the
logical implication
\begin{equation}
\left(  \left[  a\right]  _{n}\text{ has an inverse}\right)  \ \Longrightarrow
\ \left(  a\perp n\right)  . \label{pf.cor.equiv.modinv.Unphi.a.1}%
\end{equation}
But Proposition \ref{prop.equiv.modinv.exiuni} \textbf{(b)} yields the logical
implication
\begin{equation}
\left(  a\perp n\right)  \ \Longrightarrow\ \left(  \left[  a\right]
_{n}\text{ has a unique inverse}\right)  \ \Longrightarrow\ \left(  \left[
a\right]  _{n}\text{ has an inverse}\right)  .
\label{pf.cor.equiv.modinv.Unphi.a.2}%
\end{equation}
Combining the two implications (\ref{pf.cor.equiv.modinv.Unphi.a.1}) and
(\ref{pf.cor.equiv.modinv.Unphi.a.2}), we obtain the equivalence%
\begin{equation}
\left(  \left[  a\right]  _{n}\text{ has an inverse}\right)
\ \Longleftrightarrow\ \left(  a\perp n\right)  .
\label{pf.cor.equiv.modinv.Unphi.a.3}%
\end{equation}
But $U_{n}$ was defined as the set of all residue classes $\alpha\in
\mathbb{Z}/n$ that have an inverse. Hence, we have the following chain of
equivalences:%
\[
\left(  \left[  a\right]  _{n}\in U_{n}\right)  \ \Longleftrightarrow\ \left(
\left[  a\right]  _{n}\text{ has an inverse}\right)  \ \Longleftrightarrow
\ \left(  a\perp n\right)
\]
(by (\ref{pf.cor.equiv.modinv.Unphi.a.3})). This proves Corollary
\ref{cor.equiv.modinv.Unphi} \textbf{(a)}.

\textbf{(b)} Theorem \ref{thm.eqrel.Z/n.explicit} says that the set
$\mathbb{Z}/n$ has exactly $n$ elements, namely \newline$\left[  0\right]
_{n},\left[  1\right]  _{n},\ldots,\left[  n-1\right]  _{n}$ (and in
particular, these $n$ elements are all distinct). Thus, the map%
\begin{align*}
P:\left\{  0,1,\ldots,n-1\right\}   &  \rightarrow\mathbb{Z}/n,\\
s  &  \mapsto\left[  s\right]  _{n}%
\end{align*}
is bijective\footnote{We also have explicitly proven this fact during our
proof of Theorem \ref{thm.eqrel.Z/n.explicit}.}. Consider this map $P$. For
each integer $a$, we have the logical equivalence%
\begin{equation}
\left(  \underbrace{P\left(  a\right)  }_{\substack{=\left[  a\right]
_{n}\\\text{(by the definition of }P\text{)}}}\in U_{n}\right)
\ \Longleftrightarrow\ \left(  \left[  a\right]  _{n}\in U_{n}\right)
\ \Longleftrightarrow\ \left(  a\perp n\right)
\label{pf.cor.equiv.modinv.Unphi.b.equiv}%
\end{equation}
(by Corollary \ref{cor.equiv.modinv.Unphi} \textbf{(a)}).

But the map $P$ is bijective. Hence, we can substitute $P\left(  a\right)  $
for $\alpha$ when counting the number of $\alpha\in U_{n}$. We thus obtain%
\begin{align*}
&  \left(  \text{the number of }\alpha\in U_{n}\right) \\
&  =\left(  \text{the number of }a\in\left\{  0,1,\ldots,n-1\right\}  \text{
such that }P\left(  a\right)  \in U_{n}\right) \\
&  =\left(  \text{the number of }a\in\left\{  0,1,\ldots,n-1\right\}  \text{
such that }a\perp n\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{because for each }a\in\left\{  0,1,\ldots,n-1\right\}  \text{, we have
the logical}\\
\text{equivalence }\left(  P\left(  a\right)  \in U_{n}\right)
\ \Longleftrightarrow\ \left(  a\perp n\right)  \text{ (by
(\ref{pf.cor.equiv.modinv.Unphi.b.equiv}))}%
\end{array}
\right) \\
&  =\left\vert \left\{  a\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ a\perp
n\right\}  \right\vert \\
&  =\left\vert \left\{  i\in\left\{  0,1,\ldots,n-1\right\}  \ \mid\ i\perp
n\right\}  \right\vert \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed
the index }a\text{ as }i\right) \\
&  =\phi\left(  n\right)
\end{align*}
(by Lemma \ref{lem.ent.euler.phi0}). This proves Corollary
\ref{cor.equiv.modinv.Unphi} \textbf{(b)}.
\end{proof}

\begin{definition}
\label{def.equiv.Zn.inverse} Let $\alpha\in\mathbb{Z}/n$ be a residue class
that has an inverse. Then, Proposition \ref{prop.equiv.modinv.uni} shows that
$\alpha$ has \textbf{a unique} inverse. This inverse can thus be called
\textquotedblleft\textbf{the}\textit{ inverse}\textquotedblright\ of $\alpha$;
it will be denoted by $\alpha^{-1}$.
\end{definition}

For example, $\left(  \left[  3\right]  _{5}\right)  ^{-1}=\left[  2\right]
_{5}$ for $n=5$, since $\left[  2\right]  _{5}$ is an inverse (and thus
\textbf{the} inverse) of $\left[  3\right]  _{5}$.

Let us state a couple properties of inverses in $\mathbb{Z}/n$:

\begin{exercise}
\label{exe.equiv.modinv.ab}\textbf{(a)} Let $\alpha\in\mathbb{Z}/n$ be a
residue class that has an inverse. Prove that its inverse $\alpha^{-1}$ has an
inverse as well, and this inverse is $\left(  \alpha^{-1}\right)  ^{-1}%
=\alpha$.

\textbf{(b)} Let $\alpha,\beta\in\mathbb{Z}/n$ be two residue classes that
have inverses. Prove that their product $\alpha\beta$ has an inverse as well,
and this inverse is $\left(  \alpha\beta\right)  ^{-1}=\alpha^{-1}\beta^{-1}$.
\end{exercise}

The concept of inverses in $\mathbb{Z}/n$ lets us prove Theorem
\ref{thm.ent.wilson} (Wilson's theorem) again -- or, rather, restate our
previous proof of Theorem \ref{thm.ent.wilson} in more natural terms:

\begin{proof}
[Second proof of Theorem \ref{thm.ent.wilson} (sketched).]Theorem
\ref{thm.eqrel.Z/n.explicit} (applied to $n=p$) shows that the set
$\mathbb{Z}/p$ has exactly $p$ elements, namely $\left[  0\right]
_{p},\left[  1\right]  _{p},\ldots,\left[  p-1\right]  _{p}$. In particular,
these elements $\left[  0\right]  _{p},\left[  1\right]  _{p},\ldots,\left[
p-1\right]  _{p}$ are distinct.

If $p=2$, then the claim of Theorem \ref{thm.ent.wilson} is easy to check (as
we have done in our First proof above). Thus, we WLOG assume that $p\neq2$ for
the rest of this proof. Thus, $p-1\neq1$; in other words, the numbers $1$ and
$p-1$ are distinct. But $p$ is a prime; thus, $p>1$, so that the elements $1$
and $p-1$ belong to the set $\left\{  0,1,\ldots,p-1\right\}  $. Thus, the two
residue classes $\left[  1\right]  _{p}$ and $\left[  p-1\right]  _{p}$ are
distinct\footnote{\textit{Proof.} Recall that the elements $\left[  0\right]
_{p},\left[  1\right]  _{p},\ldots,\left[  p-1\right]  _{p}$ are distinct. In
other words, if $i$ and $j$ are two distinct elements of $\left\{
0,1,\ldots,p-1\right\}  $, then $\left[  i\right]  _{p}\neq\left[  j\right]
_{p}$. We can apply this to $i=1$ and $j=p-1$, since $1$ and $p-1$ are
distinct. Thus, we obtain $\left[  1\right]  _{p}\neq\left[  p-1\right]  _{p}%
$. In other words, the two residue classes $\left[  1\right]  _{p}$ and
$\left[  p-1\right]  _{p}$ are distinct.}.

Recall that%
\[
\left(  p-1\right)  !=1\cdot2\cdot\cdots\cdot\left(  p-1\right)  .
\]
Thus,%
\[
\left[  \left(  p-1\right)  !\right]  _{p}=\left[  1\cdot2\cdot\cdots
\cdot\left(  p-1\right)  \right]  _{p}=\left[  1\right]  _{p}\cdot\left[
2\right]  _{p}\cdot\cdots\cdot\left[  p-1\right]  _{p}%
\]
(by Proposition \ref{prop.eqrel.Z/n.sums.wd} \textbf{(c)}).

Let $U_{p}$ be the set of all residue classes $\alpha\in\mathbb{Z}/p$ that
have an inverse. Then, $\left[  0\right]  _{p}\notin U_{p}$%
\ \ \ \ \footnote{\textit{Proof.} We have $p>1$; thus, we don't have
$\left\vert p\right\vert =1$. But Exercise \ref{exe.ent.coprime.01}
\textbf{(b)} (applied to $a=p$) shows that we have $0\perp p$ if and only if
$\left\vert p\right\vert =1$. Thus, we don't have $0\perp p$ (since we don't
have $\left\vert p\right\vert =1$).
\par
Corollary \ref{cor.equiv.modinv.Unphi} \textbf{(a)} (applied to $n=p$ and
$a=0$) shows that we have the logical equivalence $\left(  \left[  0\right]
_{p}\in U_{p}\right)  \Longleftrightarrow\left(  0\perp p\right)  $. Since we
don't have $0\perp p$, we thus conclude that we don't have $\left[  0\right]
_{p}\in U_{p}$. In other words, we have $\left[  0\right]  _{p}\notin U_{p}$%
.}. On the other hand, the $p-1$ residue classes $\left[  1\right]
_{p},\left[  2\right]  _{p},\ldots,\left[  p-1\right]  _{p}$ all belong to
$U_{p}$\ \ \ \ \footnote{\textit{Proof.} We must show that $\left[  i\right]
_{p}\in U_{p}$ for each $i\in\left\{  1,2,\ldots,p-1\right\}  $.
\par
So let $i\in\left\{  1,2,\ldots,p-1\right\}  $. Then, Proposition
\ref{prop.ent.prime.each-i-coprime} shows that $i$ is coprime to $p$. In other
words, $i\perp p$.
\par
But Corollary \ref{cor.equiv.modinv.Unphi} \textbf{(a)} (applied to $n=p$ and
$a=i$) yields the equivalence $\left(  \left[  i\right]  _{p}\in U_{p}\right)
\Longleftrightarrow\left(  i\perp p\right)  $. Hence, we have $\left[
i\right]  _{p}\in U_{p}$ (since $i\perp p$). Qed.}. Combining these two
sentences, we conclude that the $p-1$ residue classes $\left[  1\right]
_{p},\left[  2\right]  _{p},\ldots,\left[  p-1\right]  _{p}$ are precisely the
elements of $U_{p}$ (since the set $\mathbb{Z}/p$ has exactly $p$ elements,
namely $\left[  0\right]  _{p},\left[  1\right]  _{p},\ldots,\left[
p-1\right]  _{p}$). Thus, these $p-1$ residue classes have inverses (because
belonging to $U_{p}$ means having an inverse), and their inverses in turn have
inverses (by Exercise \ref{exe.equiv.modinv.ab} \textbf{(a)}) and thus belong
to $U_{p}$ (because belonging to $U_{p}$ means having an inverse). Thus, the
map%
\begin{align*}
J:U_{p}  &  \rightarrow U_{p},\\
\alpha &  \mapsto\alpha^{-1}%
\end{align*}
(sending each of the $p-1$ residue classes $\left[  1\right]  _{p},\left[
2\right]  _{p},\ldots,\left[  p-1\right]  _{p}$ to its inverse) is
well-defined. Moreover, each $\alpha\in U_{p}$ satisfies $\left(  \alpha
^{-1}\right)  ^{-1}=\alpha$; in other words, each $\alpha\in U_{p}$ satisfies
$J\left(  J\left(  \alpha\right)  \right)  =\alpha$. In other words, $J\circ
J=\operatorname*{id}$. Hence, the map $J$ is inverse to itself. In particular,
this shows that $J$ is invertible, i.e., bijective.

\begin{fineprint}
(Note that this map $J$ is similar to the map $J$ constructed back in our
first proof of Theorem \ref{thm.ent.wilson} above, but unlike the latter, it
acts on residue classes, not on actual numbers.)
\end{fineprint}

Note that
\[
\left[  1\right]  _{p}\cdot\left[  2\right]  _{p}\cdot\cdots\cdot\left[
p-1\right]  _{p}=\prod_{\alpha\in U_{p}}\alpha,
\]
since the $p-1$ residue classes $\left[  1\right]  _{p},\left[  2\right]
_{p},\ldots,\left[  p-1\right]  _{p}$ are precisely the elements of $U_{p}$
(and are distinct).

Now, we shall complete the proof using the same \textquotedblleft
pairing\textquotedblright\ that we used in our first proof of Theorem
\ref{thm.ent.wilson}, except that we will now be pairing up residue classes
rather than numbers. Namely, we will use the map $J$ to establish a pairing
between the factors of the product $\left[  1\right]  _{p}\cdot\left[
2\right]  _{p}\cdot\cdots\cdot\left[  p-1\right]  _{p}=\prod_{\alpha\in U_{p}%
}\alpha$ (pairing up each factor $\alpha$ with the factor $J\left(
\alpha\right)  =\alpha^{-1}$), which will pair up almost all of them -- more
precisely, all of them except for the very first and very last factors (since
these two factors would have to pair up with themselves)\footnote{The reason
\textbf{why} it is precisely these two factors that will not be paired up is
the following:
\par
Clearly, the factors $\left[  a\right]  _{p}$ that cannot be paired up are
exactly the factors $\left[  a\right]  _{p}$ that satisfy $J\left(  \left[
a\right]  _{p}\right)  =\left[  a\right]  _{p}$ -- i.e., the ones that are
their own inverses. So we must prove that a residue class $\left[  a\right]
_{p}$ with $a\in\left\{  1,2,\ldots,p-1\right\}  $ is its own inverse if and
only if $a$ is either $1$ or $p-1$. But this follows from the following chain
of equivalences:%
\begin{align*}
&  \ \left(  \text{the residue class }\left[  a\right]  _{p}\text{ is its own
inverse}\right) \\
&  \Longleftrightarrow\ \left(  \left[  a\right]  _{p}\cdot\left[  a\right]
_{p}=\left[  1\right]  _{p}\right)  \ \Longleftrightarrow\ \left(  \left[
a^{2}\right]  _{p}=\left[  1\right]  _{p}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }\left[  a\right]  _{p}\cdot\left[  a\right]  _{p}=\left[  a\cdot
a\right]  _{p}=\left[  a^{2}\right]  _{p}\right) \\
&  \Longleftrightarrow\ \left(  a^{2}\equiv1\operatorname{mod}p\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.eqrel.Z/n.ab}
\textbf{(b)}}\right) \\
&  \Longleftrightarrow\ \left(  a\equiv1\operatorname{mod}p\text{ or }%
a\equiv-1\operatorname{mod}p\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{indeed, Exercise \ref{exe.ent.prime.aa-1} yields the}\\
\text{implication }\left(  a^{2}\equiv1\operatorname{mod}p\right)
\ \Longrightarrow\ \left(  a\equiv1\operatorname{mod}p\text{ or }%
a\equiv-1\operatorname{mod}p\right)  \text{;}\\
\text{but the converse implication is easy to check}%
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  \left[  a\right]  _{p}=\left[  1\right]
_{p}\text{ or }\left[  a\right]  _{p}=\left[  -1\right]  _{p}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.eqrel.Z/n.ab}
\textbf{(b)}}\right) \\
&  \Longleftrightarrow\ \left(  \left[  a\right]  _{p}=\left[  1\right]
_{p}\text{ or }\left[  a\right]  _{p}=\left[  p-1\right]  _{p}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left[  -1\right]  _{p}=\left[
p-1\right]  _{p}\text{ (because }-1\equiv p-1\operatorname{mod}p\text{)}%
\right) \\
&  \Longleftrightarrow\ \left(  a=1\text{ or }a=p-1\right)
\end{align*}
(since the elements $\left[  0\right]  _{p},\left[  1\right]  _{p}%
,\ldots,\left[  p-1\right]  _{p}$ are distinct).}. For example, if $p=11$,
then we have the following table of values of $J$:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|c|c|c|c||}\hline
$\alpha$ & $\left[  1\right]  _{11}$ & $\left[  2\right]  _{11}$ & $\left[
3\right]  _{11}$ & $\left[  4\right]  _{11}$ & $\left[  5\right]  _{11}$ &
$\left[  6\right]  _{11}$ & $\left[  7\right]  _{11}$ & $\left[  8\right]
_{11}$ & $\left[  9\right]  _{11}$ & $\left[  10\right]  _{11}$\\\hline
$J\left(  \alpha\right)  $ & $\left[  1\right]  _{11}$ & $\left[  6\right]
_{11}$ & $\left[  4\right]  _{11}$ & $\left[  3\right]  _{11}$ & $\left[
9\right]  _{11}$ & $\left[  2\right]  _{11}$ & $\left[  8\right]  _{11}$ &
$\left[  7\right]  _{11}$ & $\left[  5\right]  _{11}$ & $\left[  10\right]
_{11}$\\\hline
\end{tabular}
\]
(since, for example, $J\left(  \left[  2\right]  _{11}\right)  =\left(
\left[  2\right]  _{11}\right)  ^{-1}=\left[  6\right]  _{11}$), and thus we
pair up the factors of the product $\left[  1\right]  _{p}\cdot\left[
2\right]  _{p}\cdot\cdots\cdot\left[  p-1\right]  _{p}$ as follows:%
\begin{align}
&  \left[  1\right]  _{p}\cdot\left[  2\right]  _{p}\cdot\cdots\cdot\left[
p-1\right]  _{p}\nonumber\\
&  =\left[  1\right]  _{11}\cdot\left[  2\right]  _{11}\cdot\left[  3\right]
_{11}\cdot\left[  4\right]  _{11}\cdot\left[  5\right]  _{11}\cdot\left[
6\right]  _{11}\cdot\left[  7\right]  _{11}\cdot\left[  8\right]  _{11}%
\cdot\left[  9\right]  _{11}\cdot\left[  10\right]  _{11}\nonumber\\
&  =\left[  1\right]  _{11}\cdot\left(  \left[  2\right]  _{11}\cdot\left[
6\right]  _{11}\right)  \cdot\left(  \left[  3\right]  _{11}\cdot\left[
4\right]  _{11}\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \cdot\left(  \left[  5\right]  _{11}\cdot\left[
9\right]  _{11}\right)  \cdot\left(  \left[  7\right]  _{11}\cdot\left[
8\right]  _{11}\right)  \cdot\left[  10\right]  _{11}.
\label{pf.thm.ent.wilson.2nd.11-1}%
\end{align}
By the definition of the map $J$, each pair has the form $\left(
\alpha,J\left(  \alpha\right)  \right)  =\left(  \alpha,\alpha^{-1}\right)  $
for some $\alpha\in U_{p}$, and thus the product of any two different factors
paired up with each other is $\left[  1\right]  _{p}$ (since $\alpha
\alpha^{-1}=\left[  1\right]  _{p}$). For example, if $p=11$, then we have%
\begin{align*}
&  \left[  1\right]  _{p}\cdot\left[  2\right]  _{p}\cdot\cdots\cdot\left[
p-1\right]  _{p}\\
&  =\left[  1\right]  _{11}\cdot\underbrace{\left(  \left[  2\right]
_{11}\cdot\left[  6\right]  _{11}\right)  }_{=\left[  1\right]  _{11}}%
\cdot\underbrace{\left(  \left[  3\right]  _{11}\cdot\left[  4\right]
_{11}\right)  }_{=\left[  1\right]  _{11}}\cdot\underbrace{\left(  \left[
5\right]  _{11}\cdot\left[  9\right]  _{11}\right)  }_{=\left[  1\right]
_{11}}\cdot\underbrace{\left(  \left[  7\right]  _{11}\cdot\left[  8\right]
_{11}\right)  }_{=\left[  1\right]  _{11}}\cdot\left[  10\right]  _{11}\\
&  =\left[  1\right]  _{11}\cdot\left[  10\right]  _{11}.
\end{align*}
Thus, any two different factors paired up with each other \textquotedblleft
neutralize\textquotedblright\ each other when being multiplied. Hence, the
product of all the $p-1$ factors will reduce to the product of the two factors
that have not been paired up, which will be $\left[  1\right]  _{p}%
\cdot\left[  p-1\right]  _{p}=\left[  p-1\right]  _{p}$. Since this product
was $\left[  \left(  p-1\right)  !\right]  _{p}$, we thus obtain
\begin{equation}
\left[  \left(  p-1\right)  !\right]  _{p}=\left[  p-1\right]  _{p}.
\label{pf.thm.ent.wilson.2nd.main-arg}%
\end{equation}
In other words, $\left(  p-1\right)  !\equiv p-1\equiv-1\operatorname{mod}p$.
Hence, Theorem \ref{thm.ent.wilson} is proven again.

\begin{fineprint}
Once again, if you like your proofs rigorous and formal, you may be wondering
how this \textquotedblleft pairing up\textquotedblright\ argument can be
formalized. Here is one way to do so: We proceed similarly to how we
formalized our first proof of Theorem \ref{thm.ent.wilson} above, but with a
minor complication. We want to call an element $\alpha$ of $U_{p}$

\begin{itemize}
\item \textit{small} if $\alpha<J\left(  \alpha\right)  $;

\item \textit{medium} if $\alpha=J\left(  \alpha\right)  $;

\item \textit{large} if $\alpha>J\left(  \alpha\right)  $.
\end{itemize}

\noindent However, in order for this definition to make sense, we need to
define two relations $<$ and $>$ on the set $\mathbb{Z}/p$; otherwise, it is
not clear what \textquotedblleft$\alpha<J\left(  \alpha\right)  $%
\textquotedblright\ and \textquotedblleft$\alpha>J\left(  \alpha\right)
$\textquotedblright\ should mean. Fortunately, this is easy: For example, we can

\begin{itemize}
\item consider the bijection $R:\mathbb{Z}/p\rightarrow\left\{  0,1,\ldots
,p-1\right\}  $ defined in Proposition \ref{prop.eqrel.Z/n.PR} \textbf{(a)}
(applied to $n=p$);

\item define the binary relation $<$ on the set $\mathbb{Z}/p$ by setting
\[
\left(  \alpha<\beta\right)  \ \Longleftrightarrow\ \left(  R\left(
\alpha\right)  <R\left(  \beta\right)  \right)  \ \ \ \ \ \ \ \ \ \ \text{for
any }\alpha,\beta\in\mathbb{Z}/p;
\]


\item define the binary relation $>$ on the set $\mathbb{Z}/p$ by setting
\[
\left(  \alpha>\beta\right)  \ \Longleftrightarrow\ \left(  R\left(
\alpha\right)  >R\left(  \beta\right)  \right)  \ \ \ \ \ \ \ \ \ \ \text{for
any }\alpha,\beta\in\mathbb{Z}/p.
\]

\end{itemize}

\noindent The two relations we have just defined have the property that each
$\alpha,\beta\in\mathbb{Z}/p$ satisfy either $\alpha<\beta$ or $\alpha=\beta$
or $\alpha>\beta$ but never two or more of these three statements
simultaneously (indeed, this follows easily from the fact that $R$ is a
bijection). Thus, each element of $U_{p}$ is either small or medium or large
(and there is no overlap between these three classes of elements). Hence, the
argument that we used to prove (\ref{pf.thm.ent.wilson.8}) in our first proof
of Theorem \ref{thm.ent.wilson}\footnote{viz., by splitting up the product
into a product over small elements, a product over medium elements, and a
product over large elements} can be adapted in order to prove $\left[  \left(
p-1\right)  !\right]  _{p}=\left[  -1\right]  _{p}$, except that we have to
use residue classes in $U_{p}$ instead of elements of $A$. (We could have just
as well used any other bijection from $\mathbb{Z}/p$ to $\left\{
0,1,\ldots,p-1\right\}  $ instead of $R$ here.) Of course, $\left[  \left(
p-1\right)  !\right]  _{p}=\left[  -1\right]  _{p}$ immediately yields
$\left(  p-1\right)  !\equiv-1\operatorname{mod}p$ (by an application of
Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)}), and thus the proof of
Theorem \ref{thm.ent.wilson} is complete.

\begin{noncompile}
(The following is an unfinished stub of a second formalization of the proof of
(\ref{pf.thm.ent.wilson.2nd.main-arg}).)

\textit{Second formalization of the proof of
(\ref{pf.thm.ent.wilson.2nd.main-arg}):} Let us show another way to formalize
the \textquotedblleft pairing up\textquotedblright\ argument, which avoids a
choice of order relations $<$ and $>$ on $\mathbb{Z}/p$ and even avoids using
the map $J$ (at least explicitly). This second formalization foreshadows some
constructions we shall perform later when studying group actions.

We define a binary relation $\sim$ on the set $U_{p}$ by%
\begin{align*}
\left(  \alpha\sim\beta\right)  \  &  \Longleftrightarrow\ \left(
\alpha=\beta\text{ or }\alpha\beta=\left[  1\right]  _{p}\right) \\
\  &  \Longleftrightarrow\ \left(  \text{the residue classes }\alpha\text{ and
}\beta\text{ are equal or mutually inverse}\right)  .
\end{align*}
(Note that this relation $\sim$ is defined on a set of equivalence classes of
another relation. This may appear somewhat incestuous, but is completely legitimate.)

It is easy to see that this relation $\sim$ is reflexive (since $\alpha
=\alpha$ for any $\alpha\in U_{p}$) and symmetric (since $\alpha\beta
=\beta\alpha$ for any two residue classes $\alpha$ and $\beta$) and
transitive\footnote{\textit{Proof.} Let $\alpha,\beta,\gamma\in U_{p}$ be such
that $\alpha\sim\beta$ and $\beta\sim\gamma$. We must prove that $\alpha
\sim\gamma$.
\par
If $\alpha=\beta$, then this follows trivially from $\beta\sim\gamma$. Hence,
for the rest of this proof, we WLOG assume that $\alpha\neq\beta$. But from
$\alpha\sim\beta$, we conclude that either $\alpha=\beta$ or $\alpha
\beta=\left[  1\right]  _{p}$ (by the definition of the relation $\sim$).
Thus, $\alpha\beta=\left[  1\right]  _{p}$ (since $\alpha\neq\beta$). Hence,
$\beta\alpha=\alpha\beta=\left[  1\right]  _{p}$. In other words, $\alpha$ is
an inverse of $\beta$.
\par
We must prove that $\alpha\sim\gamma$. If $\beta=\gamma$, then this follows
trivially from $\alpha\sim\beta$. Hence, for the rest of this proof, we WLOG
assume that $\beta\neq\gamma$. But from $\beta\sim\gamma$, we conclude that
either $\beta=\gamma$ or $\beta\gamma=\left[  1\right]  _{p}$ (by the
definition of the relation $\sim$). Thus, $\beta\gamma=\left[  1\right]  _{p}$
(since $\beta\neq\gamma$). In other words, $\gamma$ is an inverse of $\beta$.
\par
Proposition \ref{prop.equiv.modinv.uni} (applied to $\beta$ instead of
$\alpha$) shows that $\beta\in\mathbb{Z}/n$ has at most one inverse. Since
both $\alpha$ and $\gamma$ are inverses of $\beta$, we thus obtain
$\alpha=\gamma$. Hence, $\alpha\sim\gamma$ (since the relation $\sim$ is
reflexive). Qed.}. Hence, $\sim$ is an equivalence relation. Consider its
equivalence classes (which, of course, are sets whose elements are equivalence
classes of integers). These classes belong to the set $U_{p}/\sim$. Each
$\alpha\in U_{p}$ has its residue class $\left[  \alpha\right]  _{\sim}\in
U_{p}$. Thus, the product $\prod_{\alpha\in U_{p}}\alpha$ can be split up as
follows:%
\begin{equation}
\prod_{\alpha\in U_{p}}\alpha=\prod_{C\in U_{p}/\sim}\prod_{\substack{\alpha
\in U_{p};\\\left[  \alpha\right]  _{\sim}=C}}\alpha.
\label{pf.thm.ent.wilson.2nd.main-arg.f2.1}%
\end{equation}
(What we have done here is simply breaking up the product into smaller
sub-products, each of which covers one specific equivalence class of $\sim$.
This is the general version of the splitting that we did in
(\ref{pf.thm.ent.wilson.2nd.11-1}) in the case $p=11$.)

Now, we shall discuss the sub-products $\prod_{\alpha\in C}\alpha$ on the
right hand side of (\ref{pf.thm.ent.wilson.2nd.main-arg.f2.1}). First, let us
take a closer look at the equivalence classes, starting with the ones whose
size is $\neq1$:

\begin{statement}
\textit{Claim 1:} Let $C\in U_{p}/\sim$ be an equivalence class such that
$\left\vert C\right\vert \neq1$. Then, $\prod_{\substack{\alpha\in
U_{p};\\\left[  \alpha\right]  _{\sim}=C}}\alpha=\left[  1\right]  _{p}$.
\end{statement}

[\textit{Proof of Claim 1:} We know that $C\in U_{p}/\sim$. In other words,
$C$ is an equivalence class of the relation $\sim$. In other words, $C=\left[
\beta\right]  _{\sim}$ for some $\beta\in U_{p}$. Consider this $\beta$.
Proposition \ref{prop.eqrel.eqcl.aina} (applied to $S=U_{p}$ and $a=\beta$)
yields $\beta\in\left[  \beta\right]  _{\sim}=C$. Hence, $\left\vert
C\setminus\left\{  \beta\right\}  \right\vert =\left\vert C\right\vert
-1\neq0$ (since $\left\vert C\right\vert \neq1$), so that $C\setminus\left\{
\beta\right\}  \neq\varnothing$.

On the other hand, the residue class $\beta$ is an element of $U_{p}$, and
thus has an inverse $\beta^{-1}$ (by the definition of $U_{p}$). Each element
of $C\setminus\left\{  \beta\right\}  $ must equal this inverse $\beta^{-1}%
$\ \ \ \ \footnote{\textit{Proof.} Let $\gamma$ be an element of
$C\setminus\left\{  \beta\right\}  $. We must show that $\gamma=\beta^{-1}$.
\par
We have $\gamma\in C\setminus\left\{  \beta\right\}  $. In other words,
$\gamma\in C$ and $\gamma\neq\beta$. From $\gamma\in C=\left[  \beta\right]
_{\sim}$, we obtain $\gamma\sim\beta$ (because Theorem
\ref{thm.eqrel.eqcl.disj} \textbf{(c)} (applied to $S=U_{p}$, $x=\gamma$ and
$y=\beta$) shows that we have $\gamma\sim\beta$ if and only if $\gamma
\in\left[  \beta\right]  _{\sim}$). In other words, $\gamma=\beta$ or
$\gamma\beta=1$ (by the definition of $\sim$). Since $\gamma\neq\beta$, we
thus obtain $\gamma\beta=1$. Hence, $\beta\gamma=\gamma\beta=1$, so that
$\gamma$ is an inverse of $\beta$. In other words, $\gamma=\beta^{-1}$ (since
$\beta^{-1}$ is the only inverse of $\beta$). Qed.}. Thus, $C\setminus\left\{
\beta\right\}  \subseteq\left\{  \beta^{-1}\right\}  $. Hence, the set
$C\setminus\left\{  \beta\right\}  $ is either $\varnothing$ or $\left\{
\beta^{-1}\right\}  $. Since $C\setminus\left\{  \beta\right\}  \neq
\varnothing$, we thus obtain $C\setminus\left\{  \beta\right\}  =\left\{
\beta^{-1}\right\}  $. Hence, the set $C$ has exactly two elements, namely
$\beta$ and $\beta^{-1}$ (and these two elements are distinct).

If $\alpha\in U_{p}$, then we have the following chain of logical
equivalences:%
\begin{align*}
\left(  \left[  \alpha\right]  _{\sim}=\underbrace{C}_{=\left[  \beta\right]
_{\sim}}\right)  \  &  \Longleftrightarrow\ \left(  \left[  \alpha\right]
_{\sim}=\left[  \beta\right]  _{\sim}\right)  \ \Longleftrightarrow\ \left(
\alpha\sim\beta\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.eqrel.eqcl.disj}
\textbf{(e)}, applied to }S=U_{p}\text{, }x=\alpha\text{ and }y=\beta\right)
\\
&  \Longleftrightarrow\ \left(  \alpha\in\underbrace{\left[  \beta\right]
_{\sim}}_{=C}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.eqrel.eqcl.disj}
\textbf{(c)}, applied to }S=U_{p}\text{, }x=\alpha\text{ and }y=\beta\right)
\\
&  \Longleftrightarrow\ \left(  \alpha\in C\right)  .
\end{align*}
Hence, we have the following equality between product signs:\footnote{An
equality between two product signs should be interpreted as saying that
whatever we put after these product signs, the results will be equal.}%
\[
\prod_{\substack{\alpha\in U_{p};\\\left[  \alpha\right]  _{\sim}=C}%
}=\prod_{\substack{\alpha\in U_{p};\\\alpha\in C}}=\prod_{\alpha\in
C}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }C\subseteq U_{p}\right)  .
\]
Thus,%
\begin{align*}
\prod_{\substack{\alpha\in U_{p};\\\left[  \alpha\right]  _{\sim}=C}}\alpha &
=\prod_{\alpha\in C}\alpha=\beta\beta^{-1}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the set }C\text{ has exactly two elements,}\\
\text{namely }\beta\text{ and }\beta^{-1}\text{ (and these two elements}\\
\text{are distinct)}%
\end{array}
\right) \\
&  =\left[  1\right]  _{p}.
\end{align*}
This proves Claim 1.]

Next, we classify the equivalence classes of size $1$ (which correspond to the
unpaired factors in the computation (\ref{pf.thm.ent.wilson.2nd.11-1})):

\begin{statement}
\textit{Claim 2:} Let $\alpha\in U_{p}$. Then, $\left\vert \left[
\alpha\right]  _{\sim}\right\vert =1$ holds if and only if $\alpha$ is either
$\left[  1\right]  _{p}$ or $\left[  p-1\right]  _{p}$.
\end{statement}

[\textit{Proof of Claim 2:} Let $C\in U_{p}/\sim$ be an equivalence class. Our
plan is to understand when $\left\vert C\right\vert =1$ holds.

We know that $C$ is an equivalence class of the relation $\sim$. In other
words, $C=\left[  \beta\right]  _{\sim}$ for some $\beta\in U_{p}$. Consider
this $\beta$. Just as in the proof of Claim 1, we can show that $\beta\in C$
and $\left\vert C\setminus\left\{  \beta\right\}  \right\vert =\left\vert
C\right\vert -1$ and $C\setminus\left\{  \beta\right\}  \subseteq\left\{
\beta^{-1}\right\}  $.

Moreover, $\beta^{-1}\beta=\left[  1\right]  _{p}$ and therefore $\beta
^{-1}\sim\beta$ (by the definition of the relation $\sim$). Hence, $\beta
^{-1}\in\left[  \beta\right]  _{\sim}$ (because Theorem
\ref{thm.eqrel.eqcl.disj} \textbf{(c)} (applied to $S=U_{p}$, $x=\beta^{-1}$
and $y=\beta$) shows that we have $\beta^{-1}\sim\beta$ if and only if
$\beta^{-1}\in\left[  \beta\right]  _{\sim}$). Thus, $\beta^{-1}\in\left[
\beta\right]  _{\sim}=C$. From this and $C\setminus\left\{  \beta\right\}
\subseteq\left\{  \beta^{-1}\right\}  $, we can easily obtain $C\setminus
\left\{  \beta\right\}  =\left\{  \beta^{-1}\right\}  \setminus\left\{
\beta\right\}  $\ \ \ \ \footnote{\textit{Proof.} We have $\beta^{-1}\in C$,
thus $\left\{  \beta^{-1}\right\}  \subseteq C$, so that $\underbrace{\left\{
\beta^{-1}\right\}  }_{\subseteq C}\setminus\left\{  \beta\right\}  \subseteq
C\setminus\left\{  \beta\right\}  $. But from $C\setminus\left\{
\beta\right\}  \subseteq\left\{  \beta^{-1}\right\}  $, we obtain
$\underbrace{\left(  C\setminus\left\{  \beta\right\}  \right)  }%
_{\subseteq\left\{  \beta^{-1}\right\}  }\setminus\left\{  \beta\right\}
\subseteq\left\{  \beta^{-1}\right\}  \setminus\left\{  \beta\right\}  $. In
view of $\left(  C\setminus\left\{  \beta\right\}  \right)  \setminus\left\{
\beta\right\}  =C\setminus\left\{  \beta\right\}  $, this rewrites as
$C\setminus\left\{  \beta\right\}  \subseteq\left\{  \beta^{-1}\right\}
\setminus\left\{  \beta\right\}  $. Combining this with $\left\{  \beta
^{-1}\right\}  \setminus\left\{  \beta\right\}  \subseteq C\setminus\left\{
\beta\right\}  $, we find $C\setminus\left\{  \beta\right\}  =\left\{
\beta^{-1}\right\}  \setminus\left\{  \beta\right\}  $.}.

We have $\beta\in U_{p}=\left\{  \left[  1\right]  _{p},\left[  2\right]
_{p},\ldots,\left[  p-1\right]  _{p}\right\}  $ (since the $p-1$ residue
classes $\left[  1\right]  _{p},\left[  2\right]  _{p},\ldots,\left[
p-1\right]  _{p}$ are precisely the elements of $U_{p}$). In other words,
$\beta=\left[  b\right]  _{p}$ for some $b\in\left\{  1,2,\ldots,p-1\right\}
$. Consider this $b$.

Now, we have the following chain of logical equivalences:%
\begin{align*}
\left(  \left\vert C\right\vert =1\right)  \  &  \Longleftrightarrow\ \left(
\underbrace{\left\vert C\right\vert -1}_{=\left\vert C\setminus\left\{
\beta\right\}  \right\vert }=0\right)  \ \Longleftrightarrow\ \left(
\left\vert C\setminus\left\{  \beta\right\}  \right\vert =0\right)
\ \Longleftrightarrow\ \left(  \underbrace{C\setminus\left\{  \beta\right\}
}_{=\left\{  \beta^{-1}\right\}  \setminus\left\{  \beta\right\}
}=\varnothing\right) \\
&  \Longleftrightarrow\ \left(  \left\{  \beta^{-1}\right\}  \setminus\left\{
\beta\right\}  =\varnothing\right)  \ \Longleftrightarrow\ \left(  \left\{
\beta^{-1}\right\}  \subseteq\left\{  \beta\right\}  \right)
\ \Longleftrightarrow\ \left(  \beta^{-1}\in\left\{  \beta\right\}  \right)
\ \Longleftrightarrow\ \left(  \beta^{-1}=\beta\right) \\
&  \Longleftrightarrow\ \left(  \beta\text{ is an inverse of }\beta\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since the only inverse of }\beta\text{ is
}\beta^{-1}\right) \\
&  \Longleftrightarrow\ \left(  \beta\beta=\left[  1\right]  _{p}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of \textquotedblleft
inverse\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \left[  b^{2}\right]  _{p}=\left[  1\right]
_{p}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\underbrace{\beta
}_{=\left[  b\right]  _{p}}\underbrace{\beta}_{=\left[  b\right]  _{p}%
}=\left[  b\right]  _{p}\left[  b\right]  _{p}=\left[  b^{2}\right]
_{p}\right) \\
&  \Longleftrightarrow\ \left(  b^{2}\equiv1\operatorname{mod}p\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by an application of Proposition
\ref{prop.eqrel.Z/n.ab} \textbf{(b)}}\right) \\
&  \Longleftrightarrow\ \left(  b\equiv1\operatorname{mod}p\text{ or }%
b\equiv-1\operatorname{mod}p\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{indeed, Exercise \ref{exe.ent.prime.aa-1} (applied to }a=b\text{) yields
the}\\
\text{implication }\left(  b^{2}\equiv1\operatorname{mod}p\right)
\ \Longrightarrow\ \left(  b\equiv1\operatorname{mod}p\text{ or }%
b\equiv-1\operatorname{mod}p\right)  \text{;}\\
\text{but the converse implication is easy to check}%
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  \underbrace{\left[  b\right]  _{p}}_{=\beta
}=\left[  1\right]  _{p}\text{ or }\underbrace{\left[  b\right]  _{p}}%
_{=\beta}=\left[  -1\right]  _{p}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)}}\right) \\
&  \Longleftrightarrow\ \left(  \beta=\left[  1\right]  _{p}\text{ or }%
\beta=\left[  -1\right]  _{p}\right) \\
&  \Longleftrightarrow\ \left(  \beta=\left[  1\right]  _{p}\text{ or }%
\beta=\left[  p-1\right]  _{p}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left[  -1\right]  _{p}=\left[  p-1\right]  _{p}\text{ (because }-1\equiv
p-1\operatorname{mod}p\text{)}\right)  .
\end{align*}
Thus, $\left\vert C\right\vert =1$ holds if and only if $\beta$ is either
$\left[  1\right]  _{p}$ or $\left[  p-1\right]  _{p}$. From this, we can
easily conclude that the equivalence classes $C\in U_{p}/\sim$ such that
$\left\vert C\right\vert =1$ are precisely the two classes $\left[  \left[
1\right]  _{p}\right]  _{\sim}=\left\{  \left[  1\right]  _{p}\right\}  $ and
$\left[  \left[  p-1\right]  _{p}\right]  _{\sim}=\left\{  \left[  p-1\right]
_{p}\right\}  $. This proves Claim 2.]

Finish this!
\end{noncompile}
\end{fineprint}
\end{proof}

\subsection{\label{sect.equiv.CRT-bij}The Chinese Remainder Theorem as a
bijection between residue classes}

\begin{definition}
\label{def.eqrel.Z/n.pind}Let $n$ be a positive integer. Let $d$ be a positive
divisor of $n$. Then, define the map%
\begin{align*}
\pi_{n,d}:\mathbb{Z}/n  &  \rightarrow\mathbb{Z}/d,\\
\left[  s\right]  _{n}  &  \mapsto\left[  s\right]  _{d}.
\end{align*}
(This is well-defined, according to Proposition \ref{prop.eqrel.Z/n.pind.wd}.)
\end{definition}

See Example \ref{exa.eqrel.Z/n.pind.wd} \textbf{(a)} for what this map looks like.

We can now state another version of the \textquotedblleft Chinese Remainder
Theorem\textquotedblright, which claims the existence of a certain bijection.
We have already seen such a version (Theorem \ref{thm.ent.CRT-bij}), but that
one claimed a bijection between two sets of \textbf{remainders}, whereas the
following version claims a bijection between two sets of \textbf{residue
classes}. Other than that, the two versions are rather similar.

\begin{theorem}
\label{thm.eqrel.CRT2}Let $m$ and $n$ be two coprime positive integers. Then,
the map%
\begin{align*}
S_{m,n}:\mathbb{Z}/\left(  mn\right)   &  \rightarrow\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  ,\\
\alpha &  \mapsto\left(  \pi_{mn,m}\left(  \alpha\right)  ,\pi_{mn,n}\left(
\alpha\right)  \right)
\end{align*}
is well-defined and is a bijection. It sends each $\left[  s\right]  _{mn}$
(with $s\in\mathbb{Z}$) to the pair $\left(  \left[  s\right]  _{m},\left[
s\right]  _{n}\right)  $.
\end{theorem}

\begin{example}
\textbf{(a)} Theorem \ref{thm.eqrel.CRT2} (applied to $m=3$ and $n=2$) says
that the map%
\begin{align*}
S_{3,2}:\mathbb{Z}/6  &  \rightarrow\left(  \mathbb{Z}/3\right)  \times\left(
\mathbb{Z}/2\right)  ,\\
\alpha &  \mapsto\left(  \pi_{6,3}\left(  \alpha\right)  ,\pi_{6,2}\left(
\alpha\right)  \right)
\end{align*}
is a bijection. This map sends%
\[%
\begin{array}
[c]{cccccccc}%
\left[  0\right]  _{6}, & \left[  1\right]  _{6}, & \left[  2\right]  _{6}, &
\left[  3\right]  _{6}, & \left[  4\right]  _{6}, & \left[  5\right]  _{6} &
& \text{to}\\
\left(  \left[  0\right]  _{3},\left[  0\right]  _{2}\right)  , & \left(
\left[  1\right]  _{3},\left[  1\right]  _{2}\right)  , & \left(  \left[
2\right]  _{3},\left[  2\right]  _{2}\right)  , & \left(  \left[  3\right]
_{3},\left[  3\right]  _{2}\right)  , & \left(  \left[  4\right]  _{3},\left[
4\right]  _{2}\right)  , & \left(  \left[  5\right]  _{3},\left[  5\right]
_{2}\right)  , &  &
\end{array}
\]
respectively. In other words, it sends%
\[%
\begin{array}
[c]{cccccccc}%
\left[  0\right]  _{6}, & \left[  1\right]  _{6}, & \left[  2\right]  _{6}, &
\left[  3\right]  _{6}, & \left[  4\right]  _{6}, & \left[  5\right]  _{6} &
& \text{to}\\
\left(  \left[  0\right]  _{3},\left[  0\right]  _{2}\right)  , & \left(
\left[  1\right]  _{3},\left[  1\right]  _{2}\right)  , & \left(  \left[
2\right]  _{3},\left[  0\right]  _{2}\right)  , & \left(  \left[  0\right]
_{3},\left[  1\right]  _{2}\right)  , & \left(  \left[  1\right]  _{3},\left[
0\right]  _{2}\right)  , & \left(  \left[  2\right]  _{3},\left[  1\right]
_{2}\right)  , &  &
\end{array}
\]
respectively (since $\left[  2\right]  _{2}=\left[  0\right]  _{2}$ and
$\left[  3\right]  _{3}=\left[  0\right]  _{3}$ and $\left[  3\right]
_{2}=\left[  1\right]  _{2}$ and so on). This list of values shows that this
map is bijective (since it takes on every possible value in $\left(
\mathbb{Z}/3\right)  \times\left(  \mathbb{Z}/2\right)  $ exactly once).
Theorem \ref{thm.eqrel.CRT2} says that this holds for arbitrary coprime $m$
and $n$.

\textbf{(b)} Let us see how Theorem \ref{thm.eqrel.CRT2} fails when $m$ and
$n$ are \textbf{not} coprime. For example, take $m=6$ and $n=4$. Then, the map%
\begin{align*}
S_{6,4}:\mathbb{Z}/24  &  \rightarrow\left(  \mathbb{Z}/6\right)
\times\left(  \mathbb{Z}/4\right)  ,\\
\alpha &  \mapsto\left(  \pi_{24,6}\left(  \alpha\right)  ,\pi_{24,4}\left(
\alpha\right)  \right)
\end{align*}
is \textbf{not} a bijection. Indeed, it is neither injective (for example, it
sends both $\left[  0\right]  _{24}$ and $\left[  12\right]  _{24}$ to the
same pair $\left(  \left[  0\right]  _{6},\left[  0\right]  _{4}\right)  $)
nor surjective (for example, it never takes the value $\left(  \left[
1\right]  _{6},\left[  2\right]  _{4}\right)  $).
\end{example}

The following proof of Theorem \ref{thm.eqrel.CRT2} has the same structure as
our proof of Theorem \ref{thm.ent.CRT-bij} above, but is shorter since residue
classes are easier to deal with than remainders.

\begin{proof}
[Proof of Theorem \ref{thm.eqrel.CRT2}.]The maps $\pi_{mn,m}$ and $\pi_{mn,n}$
are well-defined, since $m$ and $n$ are positive divisors of $mn$. Thus, the
map%
\begin{align*}
S_{m,n}:\mathbb{Z}/\left(  mn\right)   &  \rightarrow\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  ,\\
\alpha &  \mapsto\left(  \pi_{mn,m}\left(  \alpha\right)  ,\pi_{mn,n}\left(
\alpha\right)  \right)
\end{align*}
is well-defined. Consider this map $S_{m,n}$. Clearly, for each $s\in
\mathbb{Z}$, we have%
\begin{align}
S_{m,n}\left(  \left[  s\right]  _{mn}\right)   &  =\left(  \underbrace{\pi
_{mn,m}\left(  \left[  s\right]  _{mn}\right)  }_{\substack{=\left[  s\right]
_{m}\\\text{(by the definition of }\pi_{mn,m}\text{)}}},\underbrace{\pi
_{mn,n}\left(  \left[  s\right]  _{mn}\right)  }_{\substack{=\left[  s\right]
_{n}\\\text{(by the definition of }\pi_{mn,n}\text{)}}}\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }S_{m,n}\right)
\nonumber\\
&  =\left(  \left[  s\right]  _{m},\left[  s\right]  _{n}\right)  .
\label{pf.thm.eqrel.CRT2.Ss=}%
\end{align}
In other words, the map $S_{m,n}$ sends each $\left[  s\right]  _{mn}$ (with
$s\in\mathbb{Z}$) to the pair $\left(  \left[  s\right]  _{m},\left[
s\right]  _{n}\right)  $.

It thus remains to prove that $S_{m,n}$ is a bijection. To that aim, we shall
prove that $S_{m,n}$ is injective and surjective.

[\textit{Proof that the map }$S_{m,n}$ \textit{is injective:} Let
$\alpha,\beta\in\mathbb{Z}/\left(  mn\right)  $ be such that $S_{m,n}\left(
\alpha\right)  =S_{m,n}\left(  \beta\right)  $. We want to prove $\alpha
=\beta$.

Write the residue classes $\alpha$ and $\beta$ in the forms $\alpha=\left[
a\right]  _{mn}$ and $\beta=\left[  b\right]  _{mn}$ for two integers $a$ and
$b$. (This is possible, because of Proposition \ref{prop.eqrel.Z/n.ab}
\textbf{(a)}.) From $\alpha=\left[  a\right]  _{mn}$, we obtain $S_{m,n}%
\left(  \alpha\right)  =S_{m,n}\left(  \left[  a\right]  _{mn}\right)
=\left(  \left[  a\right]  _{m},\left[  a\right]  _{n}\right)  $ (by
(\ref{pf.thm.eqrel.CRT2.Ss=}), applied to $s=a$). Similarly, $S_{m,n}\left(
\beta\right)  =\left(  \left[  b\right]  _{m},\left[  b\right]  _{n}\right)
$. Thus, the equality $S_{m,n}\left(  \alpha\right)  =S_{m,n}\left(
\beta\right)  $ (which we have assumed to hold) rewrites as $\left(  \left[
a\right]  _{m},\left[  a\right]  _{n}\right)  =\left(  \left[  b\right]
_{m},\left[  b\right]  _{n}\right)  $. In other words, $\left[  a\right]
_{m}=\left[  b\right]  _{m}$ and $\left[  a\right]  _{n}=\left[  b\right]
_{n}$.

Now, we have $\left[  a\right]  _{m}=\left[  b\right]  _{m}$; equivalently,
$a\equiv b\operatorname{mod}m$ (by Proposition \ref{prop.eqrel.Z/n.ab}
\textbf{(b)}); in other words, $m\mid a-b$. Similarly, $n\mid a-b$.

Now, we have $m\perp n$ (since $m$ and $n$ are coprime) and $m\mid a-b$ and
$n\mid a-b$. Hence, Theorem \ref{thm.ent.coprime.combine} (applied to $m$, $n$
and $a-b$ instead of $a$, $b$ and $c$) yields $mn\mid a-b$. In other words,
$a\equiv b\operatorname{mod}mn$. In other words, $\left[  a\right]
_{mn}=\left[  b\right]  _{mn}$ (by Proposition \ref{prop.eqrel.Z/n.ab}
\textbf{(b)}). In other words, $\alpha=\beta$ (since $\alpha=\left[  a\right]
_{mn}$ and $\beta=\left[  b\right]  _{mn}$).

Now, forget that we fixed $\alpha$ and $\beta$. We thus have shown that if
$\alpha,\beta\in\mathbb{Z}/\left(  mn\right)  $ are such that $S_{m,n}\left(
\alpha\right)  =S_{m,n}\left(  \beta\right)  $, then $\alpha=\beta$. In other
words, the map $S_{m,n}$ is injective.]

[\textit{Proof that the map }$S_{m,n}$ \textit{is surjective:} Fix $\left(
\alpha,\beta\right)  \in\left(  \mathbb{Z}/m\right)  \times\left(
\mathbb{Z}/n\right)  $. We want to find a $\gamma\in\mathbb{Z}/\left(
mn\right)  $ such that $S_{m,n}\left(  \gamma\right)  =\left(  \alpha
,\beta\right)  $.

We have $\alpha\in\mathbb{Z}/m$. Thus, we can write the residue class $\alpha$
as $\alpha=\left[  a\right]  _{m}$ for some integer $a$ (because of
Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(a)}). Similarly, we can write the
residue class $\beta$ as $\beta=\left[  b\right]  _{n}$ for some integer $b$.
Consider these two integers $a$ and $b$. Theorem \ref{thm.ent.crt1}
\textbf{(a)} shows that there exists an integer $x\in\mathbb{Z}$ such that%
\[
\left(  x\equiv a\operatorname{mod}m\text{ and }x\equiv b\operatorname{mod}%
n\right)  .
\]
Consider such an $x$. We have $\left[  x\right]  _{m}=\left[  a\right]  _{m}$
(since $x\equiv a\operatorname{mod}m$) and $\left[  x\right]  _{n}=\left[
b\right]  _{n}$ (since $x\equiv b\operatorname{mod}n$). Now,
(\ref{pf.thm.eqrel.CRT2.Ss=}) (applied to $s=x$) yields
\[
S_{m,n}\left(  \left[  x\right]  _{mn}\right)  =\left(  \underbrace{\left[
x\right]  _{m}}_{=\left[  a\right]  _{m}=\alpha},\underbrace{\left[  x\right]
_{n}}_{=\left[  b\right]  _{n}=\beta}\right)  =\left(  \alpha,\beta\right)  .
\]
Thus, there exists a $\gamma\in\mathbb{Z}/\left(  mn\right)  $ such that
$S_{m,n}\left(  \gamma\right)  =\left(  \alpha,\beta\right)  $ (namely,
$\gamma=\left[  x\right]  _{mn}$).

Now, forget that we fixed $\left(  \alpha,\beta\right)  $. We thus have shown
that for any $\left(  \alpha,\beta\right)  \in\left(  \mathbb{Z}/m\right)
\times\left(  \mathbb{Z}/n\right)  $, there exists a $\gamma\in\mathbb{Z}%
/\left(  mn\right)  $ such that $S_{m,n}\left(  \gamma\right)  =\left(
\alpha,\beta\right)  $. In other words, the map $S_{m,n}$ is surjective.]

We have now proven that the map $S_{m,n}$ is both injective and surjective.
Hence, this map $S_{m,n}$ is bijective, i.e., is a bijection. This completes
the proof of Theorem \ref{thm.eqrel.CRT2}.

[\textit{Remark:} As in the proof of Theorem \ref{thm.ent.CRT-bij}, we could
have saved ourselves some of the work by invoking the Pigeonhole Principle.
Indeed, our goal was to show that the map $S_{m,n}$ is bijective. By the
Pigeonhole Principle, it suffices to prove that it is injective \textbf{or}
that it is surjective, since $\mathbb{Z}/\left(  mn\right)  $ and $\left(
\mathbb{Z}/m\right)  \times\left(  \mathbb{Z}/n\right)  $ are finite sets of
the same size. But such a proof would be harder to generalize to certain
settings that we might later want to generalize Theorem \ref{thm.eqrel.CRT2} to.]
\end{proof}

\begin{teachingnote}
\textbf{2019-02-27 lecture}
\end{teachingnote}

We have already proven Theorem \ref{thm.ent.phi.mult} using Theorem
\ref{thm.ent.CRT-bij}. Let us now reprove it using Theorem
\ref{thm.eqrel.CRT2} instead (by a rather similar argument, but using residue
classes instead of remainders):

\begin{proof}
[Second proof of Theorem \ref{thm.ent.phi.mult}.]For every positive integer
$g$, we let $U_{g}$ be the set of all residue classes $\alpha\in\mathbb{Z}/g$
that have an inverse. Then, $U_{n}$ is exactly the set that was called $U_{n}$
in Corollary \ref{cor.equiv.modinv.Unphi}. Hence, Corollary
\ref{cor.equiv.modinv.Unphi} \textbf{(b)} yields $\phi\left(  n\right)
=\left\vert U_{n}\right\vert $. Similarly, $\phi\left(  m\right)  =\left\vert
U_{m}\right\vert $ and $\phi\left(  mn\right)  =\left\vert U_{mn}\right\vert $.

Theorem \ref{thm.eqrel.CRT2} says that the map%
\begin{align*}
S_{m,n}:\mathbb{Z}/\left(  mn\right)   &  \rightarrow\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  ,\\
\alpha &  \mapsto\left(  \pi_{mn,m}\left(  \alpha\right)  ,\pi_{mn,n}\left(
\alpha\right)  \right)
\end{align*}
is well-defined and is a bijection. Consider this map $S_{m,n}$. This map
$S_{m,n}$ is a bijection, i.e., is injective and surjective. Moreover, the
definition of $S_{m,n}$ yields%
\[
S_{m,n}\left(  \left[  1\right]  _{mn}\right)  =\left(  \underbrace{\pi
_{mn,m}\left(  \left[  1\right]  _{mn}\right)  }_{\substack{=\left[  1\right]
_{m}\\\text{(by the definition of }\pi_{mn,m}\text{)}}},\underbrace{\pi
_{mn,n}\left(  \left[  1\right]  _{mn}\right)  }_{\substack{=\left[  1\right]
_{n}\\\text{(by the definition of }\pi_{mn,n}\text{)}}}\right)  =\left(
\left[  1\right]  _{m},\left[  1\right]  _{n}\right)  .
\]


Let us first prove a trivial fact:

\begin{statement}
\textit{Claim 1:} Let $\alpha,\beta\in\mathbb{Z}/\left(  mn\right)  $. Then,
$\pi_{mn,m}\left(  \alpha\beta\right)  =\pi_{mn,m}\left(  \alpha\right)
\cdot\pi_{mn,m}\left(  \beta\right)  $.
\end{statement}

[\textit{Proof of Claim 1:} Write the residue classes $\alpha$ and $\beta$ as
$\alpha=\left[  a\right]  _{mn}$ and $\beta=\left[  b\right]  _{mn}$ for some
integers $a$ and $b$. (This can be done because of Proposition
\ref{prop.eqrel.Z/n.ab} \textbf{(a)}.) Now, $\underbrace{\alpha}_{=\left[
a\right]  _{mn}}\cdot\underbrace{\beta}_{=\left[  b\right]  _{mn}}=\left[
a\right]  _{mn}\cdot\left[  b\right]  _{mn}=\left[  ab\right]  _{mn}$ (by the
definition of multiplication on $\mathbb{Z}/\left(  mn\right)  $). Hence,
\[
\pi_{mn,m}\left(  \underbrace{\alpha\beta}_{=\left[  ab\right]  _{mn}}\right)
=\pi_{mn,m}\left(  \left[  ab\right]  _{mn}\right)  =\left[  ab\right]
_{m}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\pi_{mn,m}\right)
.
\]


On the other hand, from $\alpha=\left[  a\right]  _{mn}$, we obtain
$\pi_{mn,m}\left(  \alpha\right)  =\pi_{mn,m}\left(  \left[  a\right]
_{mn}\right)  =\left[  a\right]  _{m}$ (by the definition of $\pi_{mn,m}$).
Similarly, $\pi_{mn,m}\left(  \beta\right)  =\left[  b\right]  _{m}$. Hence,%
\[
\underbrace{\pi_{mn,m}\left(  \alpha\right)  }_{=\left[  a\right]  _{m}}%
\cdot\underbrace{\pi_{mn,m}\left(  \beta\right)  }_{=\left[  b\right]  _{m}%
}=\left[  a\right]  _{m}\cdot\left[  b\right]  _{m}=\left[  ab\right]  _{m}%
\]
(by the definition of multiplication on $\mathbb{Z}/m$). Comparing this with
$\pi_{mn,m}\left(  \alpha\beta\right)  =\left[  ab\right]  _{m}$, we obtain
$\pi_{mn,m}\left(  \alpha\right)  \cdot\pi_{mn,m}\left(  \beta\right)  $. This
proves Claim 1.]

Also, from $U_{m}\subseteq\mathbb{Z}/m$ and $U_{n}\subseteq\mathbb{Z}/n$, we
obtain $U_{m}\times U_{n}\subseteq\left(  \mathbb{Z}/m\right)  \times\left(
\mathbb{Z}/n\right)  $.

Now, we claim that%
\begin{equation}
S_{m,n}\left(  U_{mn}\right)  \subseteq U_{m}\times U_{n}.
\label{pf.thm.ent.phi.mult.2nd.1}%
\end{equation}


[\textit{Proof of (\ref{pf.thm.ent.phi.mult.2nd.1}):} Let $\zeta\in
S_{m,n}\left(  U_{mn}\right)  $. Thus, $\zeta=S_{m,n}\left(  \alpha\right)  $
for some $\alpha\in U_{mn}$. Consider this $\alpha$.

We have $\alpha\in U_{mn}$. In other words, $\alpha$ is a residue class in
$\mathbb{Z}/\left(  mn\right)  $ that has an inverse (since $U_{mn}$ was
defined as the set of all residue classes in $\mathbb{Z}/\left(  mn\right)  $
that have an inverse). Thus, $\alpha$ is a residue class in $\mathbb{Z}%
/\left(  mn\right)  $ and has an inverse $\beta\in\mathbb{Z}/\left(
mn\right)  $. Consider this $\beta$. We know that $\beta$ is an inverse of
$\alpha$; in other words, $\alpha\beta=\left[  1\right]  _{mn}$ (by the
definition of \textquotedblleft inverse\textquotedblright).

Now, Claim 1 yields $\pi_{mn,m}\left(  \alpha\beta\right)  =\pi_{mn,m}\left(
\alpha\right)  \cdot\pi_{mn,m}\left(  \beta\right)  $, and thus%
\[
\pi_{mn,m}\left(  \alpha\right)  \cdot\pi_{mn,m}\left(  \beta\right)
=\pi_{mn,m}\left(  \underbrace{\alpha\beta}_{=\left[  1\right]  _{mn}}\right)
=\pi_{mn,m}\left(  \left[  1\right]  _{mn}\right)  =\left[  1\right]  _{m}%
\]
(by the definition of $\pi_{mn,m}$). Thus, $\pi_{mn,m}\left(  \beta\right)  $
is an inverse of $\pi_{mn,m}\left(  \alpha\right)  $ in $\mathbb{Z}/m$ (by the
definition of \textquotedblleft inverse\textquotedblright). Hence, $\pi
_{mn,m}\left(  \alpha\right)  $ is a residue class in $\mathbb{Z}/m$ that has
an inverse (namely, $\pi_{mn,m}\left(  \beta\right)  $). In other words,
$\pi_{mn,m}\left(  \alpha\right)  \in U_{m}$ (since $U_{m}$ was defined as the
set of all residue classes in $\mathbb{Z}/m$ that have an inverse). Similarly,
$\pi_{mn,n}\left(  \alpha\right)  \in U_{n}$. Now,
\begin{align*}
\zeta &  =S_{m,n}\left(  \alpha\right)  =\left(  \underbrace{\pi_{mn,m}\left(
\alpha\right)  }_{\in U_{m}},\underbrace{\pi_{mn,n}\left(  \alpha\right)
}_{\in U_{n}}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}S_{m,n}\right) \\
&  \in U_{m}\times U_{n}.
\end{align*}


Now, forget that we fixed $\zeta$. We thus have proven that $\zeta\in
U_{m}\times U_{n}$ for each $\zeta\in S_{m,n}\left(  U_{mn}\right)  $. In
other words, $S_{m,n}\left(  U_{mn}\right)  \subseteq U_{m}\times U_{n}$. This
proves (\ref{pf.thm.ent.phi.mult.2nd.1}).]

Next, we claim that%
\begin{equation}
U_{m}\times U_{n}\subseteq S_{m,n}\left(  U_{mn}\right)  .
\label{pf.thm.ent.phi.mult.2nd.2}%
\end{equation}


[\textit{Proof of (\ref{pf.thm.ent.phi.mult.2nd.2}):} Let $\theta\in
U_{m}\times U_{n}$. We shall prove that $\theta\in S_{m,n}\left(
U_{mn}\right)  $.

We have $\theta\in U_{m}\times U_{n}\subseteq\left(  \mathbb{Z}/m\right)
\times\left(  \mathbb{Z}/n\right)  =S_{m,n}\left(  \mathbb{Z}/\left(
mn\right)  \right)  $ (since the map $S_{m,n}$ is a bijection). In other
words, there exists some $\alpha\in\mathbb{Z}/\left(  mn\right)  $ such that
$\theta=S_{m,n}\left(  \alpha\right)  $. Consider this $\alpha$. The
definition of $S_{m,n}$ yields $S_{m,n}\left(  \alpha\right)  =\left(
\pi_{mn,m}\left(  \alpha\right)  ,\pi_{mn,n}\left(  \alpha\right)  \right)  $.
Hence,%
\[
\left(  \pi_{mn,m}\left(  \alpha\right)  ,\pi_{mn,n}\left(  \alpha\right)
\right)  =S_{m,n}\left(  \alpha\right)  =\theta\in U_{m}\times U_{n}.
\]
In other words, $\pi_{mn,m}\left(  \alpha\right)  \in U_{m}$ and $\pi
_{mn,n}\left(  \alpha\right)  \in U_{n}$.

We have $\pi_{mn,m}\left(  \alpha\right)  \in U_{m}$. In other words,
$\pi_{mn,m}\left(  \alpha\right)  $ is a residue class in $\mathbb{Z}/m$ that
has an inverse (since $U_{m}$ was defined as the set of all residue classes in
$\mathbb{Z}/m$ that have an inverse). In other words, $\pi_{mn,m}\left(
\alpha\right)  $ is a residue class in $\mathbb{Z}/m$ and has an inverse
$\gamma\in\mathbb{Z}/m$. Likewise, $\pi_{mn,n}\left(  \alpha\right)  $ is a
residue class in $\mathbb{Z}/n$ and has an inverse $\delta\in\mathbb{Z}/n$.
Consider these $\gamma$ and $\delta$.

We have $\left(  \gamma,\delta\right)  \in\left(  \mathbb{Z}/m\right)
\times\left(  \mathbb{Z}/n\right)  $. Since the map $S_{m,n}$ is surjective,
we can thus find a $\beta\in\mathbb{Z}/\left(  mn\right)  $ such that
$S_{m,n}\left(  \beta\right)  =\left(  \gamma,\delta\right)  $. Consider this
$\beta$. We have%
\[
\left(  \gamma,\delta\right)  =S_{m,n}\left(  \beta\right)  =\left(
\pi_{mn,m}\left(  \beta\right)  ,\pi_{mn,n}\left(  \beta\right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }S_{m,n}\right)  .
\]
In other words, $\gamma=\pi_{mn,m}\left(  \beta\right)  $ and $\delta
=\pi_{mn,n}\left(  \beta\right)  $.

Now, we want to prove that $\beta$ is an inverse of $\alpha$ (in
$\mathbb{Z}/\left(  mn\right)  $).

Indeed,
\begin{align*}
\pi_{mn,m}\left(  \alpha\beta\right)   &  =\pi_{mn,m}\left(  \alpha\right)
\cdot\underbrace{\pi_{mn,m}\left(  \beta\right)  }_{=\gamma}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Claim 1}\right) \\
&  =\pi_{mn,m}\left(  \alpha\right)  \cdot\gamma=\left[  1\right]
_{m}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\gamma\text{ is an inverse of
}\pi_{mn,m}\left(  \alpha\right)  \right)
\end{align*}
and similarly $\pi_{mn,n}\left(  \alpha\beta\right)  =\left[  1\right]  _{n}$.
Now, the definition of $S_{m,n}$ yields%
\[
S_{m,n}\left(  \alpha\beta\right)  =\left(  \underbrace{\pi_{mn,m}\left(
\alpha\beta\right)  }_{=\left[  1\right]  _{m}},\underbrace{\pi_{mn,n}\left(
\alpha\beta\right)  }_{=\left[  1\right]  _{n}}\right)  =\left(  \left[
1\right]  _{m},\left[  1\right]  _{n}\right)  .
\]
Comparing this with $S_{m,n}\left(  \left[  1\right]  _{mn}\right)  =\left(
\left[  1\right]  _{m},\left[  1\right]  _{n}\right)  $, we obtain
$S_{m,n}\left(  \alpha\beta\right)  =S_{m,n}\left(  \left[  1\right]
_{mn}\right)  $. Since the map $S_{m,n}$ is injective, we thus conclude that
$\alpha\beta=\left[  1\right]  _{mn}$. In other words, $\beta$ is an inverse
of $\alpha$ (by the definition of \textquotedblleft inverse\textquotedblright%
). Hence, $\alpha$ is a residue class in $\mathbb{Z}/\left(  mn\right)  $ that
has an inverse (namely, $\beta$). In other words, $\alpha\in U_{mn}$ (since
$U_{mn}$ was defined as the set of all residue classes in $\mathbb{Z}/\left(
mn\right)  $ that have an inverse). Now, $\theta=S_{m,n}\left(
\underbrace{\alpha}_{\in U_{mn}}\right)  \in S_{m,n}\left(  U_{mn}\right)  $.

Now, forget that we fixed $\theta$. We thus have shown that $\theta\in
S_{m,n}\left(  U_{mn}\right)  $ for each $\theta\in U_{m}\times U_{n}$. In
other words, $U_{m}\times U_{n}\subseteq S_{m,n}\left(  U_{mn}\right)  $. This
proves (\ref{pf.thm.ent.phi.mult.2nd.2}).]

Combining (\ref{pf.thm.ent.phi.mult.2nd.1}) with
(\ref{pf.thm.ent.phi.mult.2nd.2}), we obtain
\begin{equation}
S_{m,n}\left(  U_{mn}\right)  =U_{m}\times U_{n}.
\label{pf.thm.ent.phi.mult.2nd.1+2}%
\end{equation}


It is well-known that any two finite sets $A$ and $B$ satisfy $\left\vert
A\times B\right\vert =\left\vert A\right\vert \cdot\left\vert B\right\vert
$\ \ \ \ \footnote{This is the so-called \textit{product rule} in its simplest
form (see, e.g., \cite[1.5]{Loehr-BC} or \cite[\S 15.2.1]{LeLeMe}).}. Applying
this to $A=U_{m}$ and $B=U_{n}$, we obtain%
\[
\left\vert U_{m}\times U_{n}\right\vert =\underbrace{\left\vert U_{m}%
\right\vert }_{=\phi\left(  m\right)  }\cdot\underbrace{\left\vert
U_{n}\right\vert }_{=\phi\left(  n\right)  }=\phi\left(  m\right)  \cdot
\phi\left(  n\right)  .
\]


Note that $U_{mn}$ is a subset of $\mathbb{Z}/\left(  mn\right)  $ (by its definition).

Recall that the map $S_{m,n}$ is injective. Hence, $\left\vert S_{m,n}\left(
T\right)  \right\vert =\left\vert T\right\vert $ for each subset $T$ of
$\mathbb{Z}/\left(  mn\right)  $\ \ \ \ \footnote{This follows from the
following general principle: If $f:X\rightarrow Y$ is an injective map between
two finite sets $X$ and $Y$, then $\left\vert f\left(  T\right)  \right\vert
=\left\vert T\right\vert $ for each subset $T$ of $X$.}. Applying this to
$T=U_{mn}$, we obtain $\left\vert S_{m,n}\left(  U_{mn}\right)  \right\vert
=\left\vert U_{mn}\right\vert $. Thus,%
\[
\left\vert U_{mn}\right\vert =\left\vert \underbrace{S_{m,n}\left(
U_{mn}\right)  }_{\substack{=U_{m}\times U_{n}\\\text{(by
(\ref{pf.thm.ent.phi.mult.2nd.1+2}))}}}\right\vert =\left\vert U_{m}\times
U_{n}\right\vert =\phi\left(  m\right)  \cdot\phi\left(  n\right)  .
\]
Hence, $\phi\left(  mn\right)  =\left\vert U_{mn}\right\vert =\phi\left(
m\right)  \cdot\phi\left(  n\right)  $. So Theorem \ref{thm.ent.phi.mult} is
proven again.
\end{proof}

\subsection{Substitutivity and chains of congruences revisited}

Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} can be stated as follows:
Given an integer $n$, two integers $a$ and $b$ are congruent to each other
modulo $n$ if and only if their residue classes $\left[  a\right]  _{n}$ and
$\left[  b\right]  _{n}$ are equal. This lets us see congruences modulo $n$ in
a new light (namely, as equalities). In particular, some previous results
about congruences now become trivial. For example, we can obtain a very short
proof of Proposition \ref{prop.mod.chain} using residue classes:

\begin{proof}
[Proof of Proposition \ref{prop.mod.chain}.]We have the chain of congruences
$a_{1}\equiv a_{2}\equiv\cdots\equiv a_{k}\operatorname{mod}n$. In other
words,%
\[
a_{i}\equiv a_{i+1}\operatorname{mod}n\text{ holds for each }i\in\left\{
1,2,\ldots,k-1\right\}
\]
(by Definition \ref{def.mod.chain}). Thus, for each $i\in\left\{
1,2,\ldots,k-1\right\}  $, we have $a_{i}\equiv a_{i+1}\operatorname{mod}n$
and therefore $\left[  a_{i}\right]  _{n}=\left[  a_{i+1}\right]  _{n}$ (by
Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)}, applied to $a=a_{i}$ and
$b=a_{i+1}$). In other words, we have the chain of equalities $\left[
a_{1}\right]  _{n}=\left[  a_{2}\right]  _{n}=\cdots=\left[  a_{k}\right]
_{n}$. From this chain, we immediately obtain $\left[  a_{u}\right]
_{n}=\left[  a_{v}\right]  _{n}$ (by Proposition \ref{prop.mod.chain-eq},
applied to $\left[  a_{i}\right]  _{n}$ instead of $a_{i}$). Hence,
Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $a=a_{u}$ and
$b=a_{v}$) shows that $a_{u}\equiv a_{v}\operatorname{mod}n$. This proves
Proposition \ref{prop.mod.chain}.
\end{proof}

We can also prove the Principle of substitutivity of congruences (which we
informally stated in Section \ref{sect.ent.subst-mod}, and abbreviated as
\textquotedblleft PSC\textquotedblright):

\begin{proof}
[Proof of the PSC (informal).]We have $x\equiv x^{\prime}\operatorname{mod}n$.
Hence, Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $a=x$ and
$b=x^{\prime}$) yields $\left[  x\right]  _{n}=\left[  x^{\prime}\right]
_{n}$.

Now, let $\alpha$ be the expression $A$, except that each integer appearing in
it has been replaced by its residue class modulo $n$. (For example, if $A$ is
the expression \textquotedblleft$3-2\cdot7+6$\textquotedblright, then $\alpha$
will be \textquotedblleft$\left[  3\right]  _{n}-\left[  2\right]  _{n}%
\cdot\left[  7\right]  _{n}+\left[  6\right]  _{n}$\textquotedblright.)

Likewise, let $\alpha^{\prime}$ be the expression $A^{\prime}$, except that
each integer appearing in it has been replaced by its residue class modulo $n$.

The expression $A^{\prime}$ differs from $A$ only in that some appearance of
$x$ in it has been replaced by $x^{\prime}$. Thus, the expression
$\alpha^{\prime}$ differs from $\alpha$ only in that some appearance of
$\left[  x\right]  _{n}$ in it has been replaced by $\left[  x^{\prime
}\right]  _{n}$. This replacement does not change the value of the expression,
since $\left[  x\right]  _{n}=\left[  x^{\prime}\right]  _{n}$. Thus,
\[
\left(  \text{the value of }\alpha^{\prime}\right)  =\left(  \text{the value
of }\alpha\right)  .
\]


We have defined $\alpha$ to be the expression $A$, except that each integer
appearing in it has been replaced by its residue class modulo $n$. Thus, the
value of $\alpha$ is the residue class of the value of $A$ modulo $n$. (For
example, if $A$ is \textquotedblleft$3-2\cdot7+6$\textquotedblright, then
$\alpha$ will be \textquotedblleft$\left[  3\right]  _{n}-\left[  2\right]
_{n}\cdot\left[  7\right]  _{n}+\left[  6\right]  _{n}$\textquotedblright, and
thus%
\begin{align*}
\left(  \text{the value of }\alpha\right)   &  =\left[  3\right]
_{n}-\underbrace{\left[  2\right]  _{n}\cdot\left[  7\right]  _{n}%
}_{\substack{=\left[  2\cdot7\right]  _{n}\\\text{(by Definition
\ref{def.eqrel.Z/n.op} \textbf{(c)})}}}+\left[  6\right]  _{n}%
=\underbrace{\left[  3\right]  _{n}-\left[  2\cdot7\right]  _{n}%
}_{\substack{=\left[  3-2\cdot7\right]  _{n}\\\text{(by Definition
\ref{def.eqrel.Z/n.op} \textbf{(b)})}}}+\left[  6\right]  _{n}\\
&  =\left[  3-2\cdot7\right]  _{n}+\left[  6\right]  _{n}=\left[
3-2\cdot7+6\right]  _{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition
\ref{def.eqrel.Z/n.op} \textbf{(a)}}\right)  ,
\end{align*}
which is precisely the residue class of the value of $A$ modulo $n$.) In other
words, we have%
\[
\left(  \text{the value of }\alpha\right)  =\left[  \text{the value of
}A\right]  _{n}.
\]
Similarly,%
\[
\left(  \text{the value of }\alpha^{\prime}\right)  =\left[  \text{the value
of }A^{\prime}\right]  _{n}.
\]
Hence,%
\[
\left[  \text{the value of }A^{\prime}\right]  _{n}=\left(  \text{the value of
}\alpha^{\prime}\right)  =\left(  \text{the value of }\alpha\right)  =\left[
\text{the value of }A\right]  _{n}.
\]
Hence, Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(b)} (applied to $a=\left(
\text{the value of }A^{\prime}\right)  $ and $b=\left(  \text{the value of
}A\right)  $) yields $\left(  \text{the value of }A^{\prime}\right)
\equiv\left(  \text{the value of }A\right)  \operatorname{mod}n$. In other
words, the value of the expression $A^{\prime}$ is congruent to the value of
$A$ modulo $n$. This proves the PSC.
\end{proof}

\subsection{\label{sect.equiv.apps}A couple of applications of elementary
number theory}

In the following short section, we shall see two practical applications of the
above number-theoretical studies. The first is a method for encrypting
information (the RSA cryptosystem); the second is a trick by which
computations with large integers can be split up into more manageable pieces
(and distributed across several computers, or parallelized across several
cores). We shall be brief, since applications are not a focus of these notes;
for further details, see \cite{Gallier-RSA} and the MathOverflow answer
\url{https://mathoverflow.net/a/10022/} . If you are interested in further
applications, you may also want to consult the other answers to
\url{https://mathoverflow.net/questions/10014} (for a list of uses of the
Chinese Remainder Theorem -- mostly, but not entirely, inside mathematics), as
well as \cite[Appendix to Chapter VII]{Uspensky-Heaslet} (for applications of
modular arithmetic to calendar computations), and
\href{https://en.wikipedia.org/wiki/Universal_hashing}{the Wikipedia page on
\textquotedblleft Universal hashing\textquotedblright} (for an application of
residue classes modulo primes).

\subsubsection{\label{subsect.equiv.apps.RSA}The RSA cryptosystem}

Let us present \href{https://en.wikipedia.org/wiki/RSA_(cryptosystem)}{the
\textit{RSA cryptosystem}}. This is one of the first modern methods for
encrypting data. (The name \textquotedblleft RSA\textquotedblright\ stands for
the initials of its three authors: Rivest, Shamir and Adleman.)

This cryptosystem addresses a fairly standard situation: Albert and Julia are
communicating over a channel (e.g., the Internet), but the channel may have
eavesdroppers. Julia wants to send a secret message to Albert over this
channel -- i.e., a message that eavesdroppers should not be able to
understand\footnote{We assume that Julia is merely trying to keep the
\textbf{content} of her message secret from the eavesdroppers; the
eavesdroppers can still see \textbf{that she is sending something to Albert}.
If Albert and Julia want to keep even this fact secret, they need a different
branch of science -- \textit{steganography}, not cryptography. (For reasons
that become obvious after a bit of thought, steganography is much less of an
exact science than cryptography, and depends heavily on the real-life
situation.)}. But Albert and Julia have not exchanged any keys with each other
in advance; they can start exchanging keys now, but the eavesdropper will know
all the keys they are sending each other. How can Albert and Julia start
secretly communicating without giving eavesdroppers all the information they
want to give each other?

The RSA cryptosystem allows Albert and Julia to solve this problem as follows:

\bigskip

\textbf{Setup:}

\begin{itemize}
\item Julia tells Albert (openly, over the channel) that she wants to
communicate and thus he should start creating keys for that purpose.

\item Albert generates two distinct large and sufficiently random primes $p$
and $q$. (This involves a lot of technicalities like actually finding large
primes. See Keith Conrad's note \textit{The Solovay-Strassen test}
\cite{Conrad*} for an algorithm for generating large primes\footnote{More
precisely, the Solovay-Strassen test is an algorithm for checking (not with
100\% surety, but with high probability, which suffices in practice) whether a
given integer is prime. To make this into an algorithm for generating large
primes, you can simply keep randomly picking large numbers until you hit one
that is prime (which you can check using the Solovay--Strassen test). This
doesn't take \textbf{too} long, because
\href{https://en.wikipedia.org/wiki/Prime_number_theorem}{the prime number
theorem} says that (very roughly speaking!) the probability for a $k$-digit
number to be prime is $\approx1/k$. (A precise statement of this result would
require us to introduce notions that have nothing to do with algebra; it is
commonly done in courses on \textit{analytic number theory}. Needless to say,
it is perfectly possible to profit from this result in practice without
proving it.)}, and \cite{Gallier-RSA} for a more comprehensive treatment. A
brief discussion is also found in Garrett's slides \cite{Garret03}. As to what
\textquotedblleft large\textquotedblright\ means, we refer to
\href{https://en.wikipedia.org/wiki/Key_size}{the Wikipedia article on
\textquotedblleft key size\textquotedblright}.)

\item Albert computes the positive integer $m=pq$. This number $m$ (called the
\textit{modulus}) he makes public (i.e., sends to Julia over the channel).
(Note that factoring a number into a product of primes is computationally a
lot harder than multiplying a bunch of primes\footnote{See
\href{https://en.wikipedia.org/wiki/Integer_factorization}{the Wikipedia page
on \textquotedblleft Integer factorization\textquotedblright} for details on
what this means. Note that this is not a proven theorem; any day, someone
could come up with a quick algorithm for factoring integers into products of
primes. You would hear about it in the news, though.}. Thus, eavesdroppers
will not (likely) be able to reconstruct the primes $p$ and $q$ from their
(public) product $m$.)

\item Albert computes the positive integer $\ell=\left(  p-1\right)  \left(
q-1\right)  $, but keeps this number private.

\item Albert randomly picks an $e\in\left\{  2,3,\ldots,\ell-1\right\}  $ such
that $e\perp\ell$. (Again, we omit the details of how to pick such an $e$
randomly\footnote{The rough idea is \textquotedblleft pick $e\in\left\{
2,3,\ldots,\ell-1\right\}  $ randomly; check (using the Euclidean algorithm)
whether $e\perp\ell$; if not, then pick another $e$, and keep repeating this
until you hit an $e$ such that $e\perp\ell$\textquotedblright. In theory, you
could be unlucky and keep picking bad $e$'s forever; but in reality, you will
soon hit an $e$ that satisfies $e\perp\ell$.}.) This number $e$ will be called
the \textit{encryption key}, and Albert keeps it private.

\item Albert computes a positive modular inverse $d$ of $e$ modulo $\ell$
(that is, a positive integer $d$ such that $ed\equiv1\operatorname{mod}\ell$).
This number $d$ exists by Theorem \ref{thm.ent.coprime.modinv} \textbf{(b)};
it will be called the \textit{decryption key}.

\item Albert publishes the pair $\left(  e,m\right)  $ as his \textit{public
key}.

\item We assume that the message that Julia wants to send to Albert is an
element of $\left\{  0,1,\ldots,m-1\right\}  $. This assumption is perfectly
reasonable, because this message originally exists in \textbf{some} digital
form (e.g., as a bitstring), and it is easy to translate it from this form
into an element of $\left\{  0,1,\ldots,m-1\right\}  $ by some universally
agreed rule (e.g., if a bitstring $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $
is short enough, then the integer $a_{1}2^{k-1}+a_{2}2^{k-2}+\cdots
+a_{k}2^{k-k}$ will belong to $\left\{  0,1,\ldots,m-1\right\}  $, and thus we
can translate this bitstring into this latter integer; otherwise, we break it
up into shorter chunks and send those as separate messages).
\end{itemize}

\textbf{Encrypting a message:}

If Julia wants to send a message $a\in\left\{  0,1,\ldots,m-1\right\}  $ to
Albert, then she does the following:

\begin{itemize}
\item She computes the residue class $\alpha:=\left[  a\right]  _{m}%
\in\mathbb{Z}/m$.

\item She computes $\alpha^{e}$ in $\mathbb{Z}/m$. (This can be computed
quickly using
\textit{\href{https://en.wikipedia.org/wiki/Exponentiation_by_squaring}{\textit{binary
exponentiation} (also known as \textit{exponentiation by squaring)}}}: If
$\beta\in\mathbb{Z}/m$, then all powers of $\beta$ can be computed recursively
via the formulas $\beta^{2k}=\left(  \beta^{k}\right)  ^{2}$ and $\beta
^{2k+1}=\left(  \beta^{k}\right)  ^{2}\beta$. Note that we are working with
residue classes in $\mathbb{Z}/m$ here, not with integers, so that the powers
$\beta^{k}$ of $\beta$ will not grow forever as $k$ gets large; they stay in
the finite set $\mathbb{Z}/m$.)

\item She sends the residue class $\alpha^{e}$ (or, more precisely, its unique
representative in the set $\left\{  0,1,\ldots,m-1\right\}  $%
\ \ \ \ \footnote{This unique representative exists by Proposition
\ref{prop.eqrel.Z/n.PR} \textbf{(b)} (and can be computed by picking an
arbitrary representative $b$ first, and then taking its remainder $b\%m$).})
to Albert.
\end{itemize}

\textbf{Decrypting a message:}

Albert receives the residue class $\beta=\alpha^{e}$ (or, more precisely, a
representative thereof, which he can easily turn into the residue class), and
recovers the original message $a$ as follows:

\begin{itemize}
\item He sets $\gamma=\beta^{d}$. This $\gamma$ is the same $\alpha$ that
Julia computed, as we shall see below.

\item He recovers the original message $a\in\left\{  0,1,\ldots,m-1\right\}  $
as the unique representative of the residue class $\gamma=\alpha$ in $\left\{
0,1,\ldots,m-1\right\}  $ (since Julia defined $\alpha$ as the residue class
of $a$).
\end{itemize}

This way, Julia can send a message to Albert that no eavesdropper can read --
unless said eavesdropper knows $d$, or possesses an algorithm hitherto unknown
to the world, or has an incredibly fast computer, or Albert's randomly picked
numbers were not random enough\footnote{Computers cannot generate
\textquotedblleft truly\textquotedblright\ random numbers (whatever this would
even mean!); thus, you have to get by with number generators which try their
best at being unpredictable. Lots of creativity has gone into finding ways to
\href{https://en.wikipedia.org/wiki/Random_number_generation}{come up with
numbers that are \textquotedblleft as random as possible\textquotedblright}.
Software alone is, per se, deterministic and thus can at most come up with
numbers that \textquotedblleft look random\textquotedblright%
\ (\href{https://en.wikipedia.org/wiki/Pseudorandom_number_generator}{\textquotedblleft
pseudorandom number generators\textquotedblright}). Nondeterministic input
must come from the outside world. This is why certain programs that generate
keys ask you to move your mouse around the screen -- they are, in fact, using
your mouse movements as a source of randomness. Better randomness comes from
\href{https://en.wikipedia.org/wiki/Hardware_random_number_generator}{hardware
random number generators}, such as Geiger counters or
\href{https://www.popularmechanics.com/technology/security/news/a28921/lava-lamp-security-cloudflare/}{lava
lamps}.
\par
What happens if your randomly picked prime numbers are not random enough? In
the worst case, you never find two distinct primes to begin with. In a more
realistic case, your distinct primes will all belong to a small and
predictable set, and an eavesdropper can easily find them simply by checking
all possibilities. In less obvious cases, different keys you generate for
different purposes will occasionally have some primes in common, in which case
an easy application of the Chinese Remainder Theorem will allow an
eavesdropper to reconstruct them and decrypt your messages. See
\url{https://factorable.net} for a study of RSA keys in the wild, which found
a lot of common primes.}, or one of myriad other practical mistakes has been
made. The proper implementation of the RSA cryptosystem, and the real-life
considerations needed to prevent \textquotedblleft leakage\textquotedblright%
\ of sensitive data such as the decryption key $d$, are a subject in its own
right, which we shall not discuss here.

Albert's method for recovering Julia's message relies on the following fact
(which we shall prove a bit later):

\begin{lemma}
\label{lem.ent.rsa.rsa-lem}Let $p$ and $q$ be two distinct primes. Let $N$ be
a positive integer such that $N\equiv1\operatorname{mod}\left(  p-1\right)
\left(  q-1\right)  $. Then:

\textbf{(a)} Each $a\in\mathbb{Z}$ satisfies $a^{N}\equiv a\operatorname{mod}%
pq$.

\textbf{(b)} Each $\alpha\in\mathbb{Z}/\left(  pq\right)  $ satisfies
$\alpha^{N}=\alpha$.
\end{lemma}

Now, when Albert receives $\beta=\alpha^{e}$ from Julia, we have%
\[
\beta^{d}=\left(  \alpha^{e}\right)  ^{d}=\alpha^{ed}.
\]
But $d$ was a modular inverse of $e$ modulo $\ell$; thus, $ed\equiv
1\operatorname{mod}\ell$. Since $\ell=\left(  p-1\right)  \left(  q-1\right)
$, we thus have $ed\equiv1\operatorname{mod}\left(  p-1\right)  \left(
q-1\right)  $. Hence, Lemma \ref{lem.ent.rsa.rsa-lem} \textbf{(b)} (applied to
$N=ed$) yields $\alpha^{ed}=\alpha$ (since $\alpha\in\mathbb{Z}/\underbrace{m}%
_{=pq}=\mathbb{Z}/\left(  pq\right)  $). Thus, $\beta^{d}=\alpha^{ed}=\alpha$.
Thus, the residue class $\gamma=\beta^{d}$ that Albert computes is exactly
Julia's $\alpha$; hence, Albert correctly recovers the message.

\begin{proof}
[Proof of Lemma \ref{lem.ent.rsa.rsa-lem} (sketched).]\textbf{(a)} Let
$a\in\mathbb{Z}$. We need to show that $a^{N}\equiv a\operatorname{mod}pq$. In
other words, we need to show that $pq\mid a^{N}-a$. Since $p\perp q$, it
suffices to prove that $p\mid a^{N}-a$ and $q\mid a^{N}-a$ (because then,
Theorem \ref{thm.ent.coprime.combine} will yield $pq\mid a^{N}-a$).

Let us prove that $p\mid a^{N}-a$ first. Two cases are possible:

\textit{Case 1:} We have $p\mid a$.

\textit{Case 2:} We have $p\nmid a$.

Let us first consider Case 1. In this case, we have $p\mid a$. Thus,
$a\equiv0\operatorname{mod}p$. Hence, $a^{N}\equiv0^{N}=0\operatorname{mod}p$
(since $N$ is positive). Thus, $\underbrace{a^{N}}_{\equiv0\operatorname{mod}%
p}-\underbrace{a}_{\equiv0\operatorname{mod}p}\equiv0-0=0\operatorname{mod}p$,
so that $p\mid a^{N}-a$. Thus, we have proven $p\mid a^{N}-a$ in Case 1.

Now, let us consider Case 2. In this case, we have $p\nmid a$. But we have
$p-1\mid\left(  p-1\right)  \left(  q-1\right)  $ and $N\equiv
1\operatorname{mod}\left(  p-1\right)  \left(  q-1\right)  $; hence,
Proposition \ref{prop.ent.mod.basics} \textbf{(e)} (applied to $\left(
p-1\right)  \left(  q-1\right)  $, $p-1$, $N$ and $1$ instead of $n$, $m$, $a$
and $b$) yields $N\equiv1\operatorname{mod}p-1$. Hence, Exercise
\ref{exe.ent.fermat.uv} (applied to $u=N$ and $v=1$) yields $a^{N}\equiv
a^{1}=a\operatorname{mod}p$. In other words, $p\mid a^{N}-a$. Thus, we have
proven $p\mid a^{N}-a$ in Case 2.

So we have proven $p\mid a^{N}-a$ in both Cases. Hence, $p\mid a^{N}-a$ always
holds. Similarly, we can prove $q\mid a^{N}-a$. This completes our proof of
Lemma \ref{lem.ent.rsa.rsa-lem} \textbf{(a)}.

\textbf{(b)} Let $\alpha\in\mathbb{Z}/\left(  pq\right)  $. Then, we can write
$\alpha$ in the form $\alpha=\left[  a\right]  _{pq}$ for some $a\in
\mathbb{Z}$ (by Proposition \ref{prop.eqrel.Z/n.ab} \textbf{(a)}). Consider
this $a$. From $\alpha=\left[  a\right]  _{pq}$, we obtain $\alpha^{N}=\left(
\left[  a\right]  _{pq}\right)  ^{N}=\left[  a^{N}\right]  _{pq}=\left[
a\right]  _{pq}$ (since Lemma \ref{lem.ent.rsa.rsa-lem} \textbf{(a)} yields
$a^{N}\equiv a\operatorname{mod}pq$). Hence, $\alpha^{N}=\left[  a\right]
_{pq}=\alpha$. This proves Lemma \ref{lem.ent.rsa.rsa-lem} \textbf{(b)}.
\end{proof}

The RSA cryptosystem, as presented above, is more versatile than it may seem
at first. Once Albert has generated his $p$, $q$, $\ell$, $m$, $d$ and $e$ and
sent $\left(  e,m\right)  $ to Julia, Julia can send not just one but multiple
messages to Albert using these keys. Albert can confidentially respond to
these messages as well, by having Julia switch roles with him (i.e., Julia
generates keys, Albert encrypts and Julia decrypts). Thus, a secure channel
for communication can be established. Moreover, and less obviously, RSA can be
used to digitally sign messages (i.e., convince the recipient that they really
come from you -- or at least from someone who possesses your private key);
see, e.g., \cite{Dummit16} or the
\href{https://en.wikipedia.org/wiki/RSA_(cryptosystem)#Signing_messages}{Wikipedia}%
.

\subsubsection{\label{subsect.equiv.apps.CRT}Computing using the Chinese
Remainder Theorem}

Next, let us outline a simple yet unexpected application of the Chinese
Remainder Theorem.

Assume that you have an expression $a$ that is made of integers, addition,
subtraction and multiplication. For example, say%
\begin{equation}
a=400\cdot405\cdot409\cdot413-401\cdot404\cdot408\cdot414.
\label{eq.eqrel.app.crt.1}%
\end{equation}


Assume that computing $a$ directly is too hard, because the intermediate
results will be forbiddingly huge numbers, but you know (e.g., from some
estimates) that the final result will be a fairly small number. Let's say (for
simplicity) that you know that $0\leq a<500\ 000$.

How can you use this information to compute $a$ quickly?

One simple trick is to work with residue classes modulo $500\ 000$ instead of
working with integer. Thus, instead of computing the number $a$ directly
through the equality (\ref{eq.eqrel.app.crt.1}), we can instead compute its
residue class%
\begin{align*}
\left[  a\right]  _{500\ 000}  &  =\left[  400\cdot405\cdot409\cdot
413-401\cdot404\cdot408\cdot414\right]  _{500\ 000}\\
&  =\left[  400\right]  _{500\ 000}\cdot\left[  405\right]  _{500\ 000}%
\cdot\left[  409\right]  _{500\ 000}\cdot\left[  413\right]  _{500\ 000}\\
&  \ \ \ \ \ \ \ \ \ \ -\left[  401\right]  _{500\ 000}\cdot\left[
404\right]  _{500\ 000}\cdot\left[  408\right]  _{500\ 000}\cdot\left[
414\right]  _{500\ 000}%
\end{align*}
(which is an easier task, because we can always reduce our intermediate
results using the fact that every integer $a$ satisfies $\left[  a\right]
_{500\ 000}=\left[  a\ \%\ 500\ 000\right]  _{500\ 000}$), and then recover
$a$ by observing that $a$ must be the unique representative of its residue
class $\left[  a\right]  _{500\ 000}$ that belongs to $\left\{  0,1,\ldots
,499\ 999\right\}  $ (since $0\leq a<500\ 000$). This is actually how integer
arithmetic works in most low-level programming languages; for example, the
most popular integer type of the C++ language is \textquotedblleft%
\texttt{int}\textquotedblright, which stands not for integers but rather for
residue classes modulo $2^{64}$ (when working on a 64-bit system). (This is
where integer overflow comes from.)

Computing $\left[  a\right]  _{500\ 000}$ instead of computing $a$ is already
an improvement, but in practice, the \textquotedblleft$500\ 000$%
\textquotedblright\ might actually be a significantly bigger number. Assume,
for example, that instead of $0\leq a<500\ 000$, you merely know that $0\leq
a<N$ for some fixed number $N$ which is small enough that computing in
$\mathbb{Z}/N$ is possible, but large enough that doing the \textbf{whole}
computation of $\left[  a\right]  _{N}$ in $\mathbb{Z}/N$ is unviable. What
can we do then?

One thing we can do is to compute the residue classes $\left[  a\right]  _{n}$
for several coprime \textquotedblleft small\textquotedblright\ integers $n$.
For example, we can compute $\left[  a\right]  _{2}$ (by performing the whole
computation of $a$ using residue classes modulo $2$ instead of integers) and
similarly $\left[  a\right]  _{3}$ and $\left[  a\right]  _{5}$ and $\left[
a\right]  _{7}$ etc.. (We are using prime numbers for $n$ here, which has
certain advantages, but is not strictly necessary; all we need is that the
values of $n$ we are using are coprime.\footnote{Note that the computations of
$\left[  a\right]  _{n}$ for different values of $n$ are independent of each
other, which comes handy if you have several processors.})

The Chinese Remainder Theorem (in the form of Theorem \ref{thm.eqrel.CRT2})
shows that if $m$ and $n$ are two coprime positive integers, then the map
$S_{m,n}$ from Theorem \ref{thm.eqrel.CRT2} (sending each $\left[  s\right]
_{mn}$ to the pair $\left(  \left[  s\right]  _{m},\left[  s\right]
_{n}\right)  $) is a bijection. In our proof of Theorem \ref{thm.eqrel.CRT2}
(when proving the surjectivity of $S_{m,n}$), we gave an explicit way of
constructing preimages under this map $S_{m,n}$ (using Bezout's theorem, which
has a fast algorithm underlying it --
\href{https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm}{the Extended
Euclidean algorithm}). Thus, we have an explicit way of recovering the residue
class $\left[  s\right]  _{mn}$ from the pair $\left(  \left[  s\right]
_{m},\left[  s\right]  _{n}\right)  $ whenever $s$ is an (unknown) integer
(and $m$ and $n$ are two coprime positive integers). We shall now refer to
this way as the \textquotedblleft patching procedure\textquotedblright\ (since
it lets us \textquotedblleft patch\textquotedblright\ two residue classes
$\left[  s\right]  _{m}$ and $\left[  s\right]  _{n}$ together to a residue
class $\left[  s\right]  _{mn}$).

Now, having computed a bunch of residue classes $\left[  a\right]
_{2},\left[  a\right]  _{3},\left[  a\right]  _{5},\left[  a\right]  _{7}$ of
our unknown integer $a$ modulo coprime small integers, we can
\textquotedblleft patch\textquotedblright\ these classes together:

\begin{itemize}
\item From $\left[  a\right]  _{2}$ and $\left[  a\right]  _{3}$, we get
$\left[  a\right]  _{2\cdot3}$ by the \textquotedblleft patching
procedure\textquotedblright.

\item From $\left[  a\right]  _{2\cdot3}$ and $\left[  a\right]  _{5}$, we get
$\left[  a\right]  _{2\cdot3\cdot5}$ by the \textquotedblleft patching
procedure\textquotedblright.

\item From $\left[  a\right]  _{2\cdot3\cdot5}$ and $\left[  a\right]  _{7}$,
we get $\left[  a\right]  _{2\cdot3\cdot5\cdot7}$ by the \textquotedblleft
patching procedure\textquotedblright.

\item and so on.
\end{itemize}

\noindent We keep \textquotedblleft patching\textquotedblright\ until the
product $2\cdot3\cdot5\cdot7\cdot\cdots$ becomes larger than our $N$ (which
will happen fairly soon, since this product grows super-exponentially with the
number of \textquotedblleft patching\textquotedblright\ steps). At that point,
we have found the residue class $\left[  a\right]  _{m}$ of our unknown
integer $a$ modulo some integer $m>N$. Since $0\leq a<N<m$, we can thus
recover $a$ itself (as the unique representative of the class $\left[
a\right]  _{m}$ that lies in the set $\left\{  0,1,\ldots,m-1\right\}  $).

This technique is known as \textit{Chinese Remaindering} (in its simplest
form) and has been used a lot (for an example, see \cite[pp. 1031--1033]%
{Vogan07}). See \cite[\S 4.3.2]{TAoCP2} for more details.

\begin{noncompile}
I think computer algebra software uses a slightly more complicated version of
this technique, e.g., for factoring integer polynomials. (Not sure -- maybe
they're just using one prime.)
\end{noncompile}

\begin{teachingnote}
\textbf{2019-03-01 lecture}
\end{teachingnote}

\subsection{\label{sect.eqrel.primroot1}Primitive roots: an introduction}

\subsubsection{\label{subsect.eqrel.primroot1.def}Definition and examples}

Let us finally discuss a kind of residue classes that come very useful when
they exist: the \textit{primitive roots} (modulo a positive integer $n$). We
are not yet able to ascertain when they exist and when they don't (this will
require some more abstract algebra); but we can already see some examples of them:

\begin{convention}
For the whole Subsection \ref{subsect.eqrel.primroot1.def}, we fix a positive
integer $n$.
\end{convention}

\begin{definition}
\label{def.eqrel.primroot1.def.primroot}Let $\alpha\in\mathbb{Z}/n$ be a
residue class.

\textbf{(a)} We say that $\alpha$ is \textit{invertible} if $\alpha$ has an inverse.

\textbf{(b)} A \textit{power of }$\alpha$ means a residue class of the form
$\alpha^{m}$ for some $m\in\mathbb{N}$.

\textbf{(c)} Assume that $\alpha$ is invertible. Then, $\alpha$ is said to be
a \textit{primitive root modulo }$n$ if every invertible residue class
$\beta\in\mathbb{Z}/n$ is a power of $\alpha$.
\end{definition}

\begin{example}
\label{exa.eqrel.primroot1.def.primroot9}Let $n=9$. The invertible residue
classes in $\mathbb{Z}/9$ are $\left[  1\right]  _{9},\left[  2\right]
_{9},\left[  4\right]  _{9},\left[  5\right]  _{9},\left[  7\right]
_{9},\left[  8\right]  _{9}$.

Clearly, the residue class $\left[  1\right]  _{9}$ is not a primitive root
modulo $9$, since all its powers equal $\left[  1\right]  _{9}$.

The powers of $\left[  2\right]  _{9}$ are
\begin{align*}
\left(  \left[  2\right]  _{9}\right)  ^{0}  &  =\left[  1\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{1}  &  =\left[  2\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{2}  &  =\left[  4\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{3}  &  =\left[  8\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{4}  &  =\left[  7\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{5}  &  =\left[  5\right]  _{9},\\
&  \ldots.
\end{align*}
\footnotemark\ Thus, they cover all the six invertible residue classes
$\left[  1\right]  _{9},\left[  2\right]  _{9},\left[  4\right]  _{9},\left[
5\right]  _{9},\left[  7\right]  _{9},\left[  8\right]  _{9}$. Hence, $\left[
2\right]  _{9}$ is a primitive root modulo $9$.

It is easy to see that $\left[  5\right]  _{9}$ also is a primitive root
modulo $9$, and these two primitive roots are the only ones.
\end{example}

\footnotetext{Here is a fast way to compute these powers:%
\begin{align*}
\left(  \left[  2\right]  _{9}\right)  ^{0}  &  =\left[  1\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{1}  &  =\left[  2\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{2}  &  =\left[  \underbrace{2^{2}%
}_{=4}\right]  _{9}=\left[  4\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{3}  &  =\left[  \underbrace{2^{3}%
}_{=8}\right]  _{9}=\left[  8\right]  _{9},\\
\left(  \left[  2\right]  _{9}\right)  ^{4}  &  =\left[  \underbrace{2^{4}%
}_{=16}\right]  _{9}=\left[  16\right]  _{9}=\left[  7\right]  _{9}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }16\equiv7\operatorname{mod}9\right)
,\\
\left(  \left[  2\right]  _{9}\right)  ^{5}  &  =\left[  2\right]  _{9}%
\cdot\underbrace{\left(  \left[  2\right]  _{9}\right)  ^{4}}_{=\left[
7\right]  _{9}}=\left[  2\right]  _{9}\cdot\left[  7\right]  _{9}=\left[
\underbrace{2\cdot7}_{=14}\right]  _{9}=\left[  14\right]  _{9}=\left[
5\right]  _{9}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }14\equiv
5\operatorname{mod}9\right)  ,\\
&  \ldots.
\end{align*}
}Note that Corollary \ref{cor.equiv.modinv.Unphi} \textbf{(b)} shows that
there are exactly $\phi\left(  n\right)  $ invertible residue classes in
$\mathbb{Z}/n$. It is easy to see that any power of an invertible residue
class is again invertible.

Euler's theorem (Theorem \ref{thm.ent.euler}) yields that if $\alpha
\in\mathbb{Z}/n$ is an invertible residue class, then $\alpha^{\phi\left(
n\right)  }=\left[  1\right]  _{n}$ (because Corollary
\ref{cor.equiv.modinv.Unphi} \textbf{(a)} shows that $\alpha$ can be written
in the form $\alpha=\left[  a\right]  _{n}$ for some integer $a$ satisfying
$a\perp n$). Thus, it is easy to see that an invertible residue class
$\alpha\in\mathbb{Z}/n$ has at most $\phi\left(  n\right)  $ distinct powers.
When an invertible residue class $\alpha\in\mathbb{Z}/n$ has \textbf{exactly}
$\phi\left(  n\right)  $ distinct powers, it is a primitive root (since there
are exactly $\phi\left(  n\right)  $ invertible residue classes in
$\mathbb{Z}/n$).

\begin{example}
\label{exa.eqrel.primroot1.def.primroot8}Let $n=8$. The invertible residue
classes in $\mathbb{Z}/8$ are $\left[  1\right]  _{8},\left[  3\right]
_{8},\left[  5\right]  _{8},\left[  7\right]  _{8}$.

Again, $\left[  1\right]  _{8}$ is certainly not a primitive root.

The powers of $\left[  3\right]  _{8}$ are
\begin{align*}
\left(  \left[  3\right]  _{8}\right)  ^{0}  &  =\left[  1\right]  _{8},\\
\left(  \left[  3\right]  _{8}\right)  ^{1}  &  =\left[  3\right]  _{8},\\
\left(  \left[  3\right]  _{8}\right)  ^{2}  &  =\left[  9\right]
_{8}=\left[  1\right]  _{8},\\
&  \ldots
\end{align*}
(so the even powers are $\left[  1\right]  _{8}$ and the odd powers are
$\left[  3\right]  _{8}$). So $\left[  3\right]  _{8}$ is not a primitive root.

The same behavior prevents $\left[  5\right]  _{8}$ and $\left[  7\right]
_{8}$ from being primitive roots.

Thus, we see that there are no primitive roots modulo $8$.
\end{example}

Examples \ref{exa.eqrel.primroot1.def.primroot8} and
\ref{exa.eqrel.primroot1.def.primroot9} suggest the following questions: For
what $n$ does a primitive root modulo $n$ exist, and when it does, how many of
them are there? The following theorem -- a result proven in 1801 by Gauss --
answers both of these questions:

\begin{theorem}
\label{thm.eqrel.primroot.gauss}\textbf{(a)} A primitive root modulo $n$
exists if and only if $n$ is

\begin{itemize}
\item either $1$,

\item or a prime $p$,

\item or a power $p^{k}$ of an odd prime\footnotemark$\ p$ (with $k$ being a
positive integer),

\item or $4$,

\item or $2p^{k}$ for an odd prime $p$ (with $k$ being a positive integer).
\end{itemize}

\textbf{(b)} If a primitive root modulo $n$ exists, then there are precisely
$\phi\left(  \phi\left(  n\right)  \right)  $ many of them.
\end{theorem}

\noindent\footnotetext{Recall: Odd primes are the same as primes $\neq2$.}
This theorem would be fairly difficult to prove at this point, but will be
doable with some abstract algebra (at least in the case $n=p$). See
\cite[Chapter 4]{Gallier-RSA} for a proof.

\section{\label{chp.CC}Complex numbers and Gaussian integers}

\subsection{\label{sect.CC.CC}Complex numbers}

\subsubsection{An informal introduction}

We now leave (at least for the time being) the study of integers and proceed
to consider a much larger \textquotedblleft number system\textquotedblright:
\href{https://en.wikipedia.org/wiki/Complex_number}{the \textit{complex
numbers}}.

Before we define these numbers rigorously, let me sketch the idea behind their
construction. Please suspend your disbelief about the not-quite-kosher
reasoning that will follow; we will return to rigorous mathematics in
Definition \ref{def.CC.CC} below.

We know that the number $-1$ (like any other negative number) has no square
root in $\mathbb{R}$ (because the square of any real number is $\geq0$). But
let us audaciously pretend that it does have a square root somewhere else. In
other words, let us pretend that there exists a mythical \textquotedblleft
number\textquotedblright\ $i$ such that $i^{2}=-1$. Of course, such a
\textquotedblleft number\textquotedblright\ $i$ will not be a real number, but
let us assume (without real justification, for now) that it behaves like a
usual number would (to some extent). In particular, let us assume that it can
be added, subtracted and multiplied like the numbers that we know and love.

So we have extended the set $\mathbb{R}$ of real numbers by a new number $i$.
Now, by applying addition, subtraction and multiplication to this new number
(and our old numbers), we get a bunch of further new numbers -- namely, all
numbers of the form $a_{0}+a_{1}i+a_{2}i^{2}+\cdots+a_{k}i^{k}$, where
$k\in\mathbb{N}$ and where $a_{0},a_{1},\ldots,a_{k}$ are real numbers. (These
can be described as the polynomials in $i$ with real coefficients.) However,
some of these numbers will be equal; in fact, any number of this form can be
reduced to a number of the form $a+bi$ (with $a,b\in\mathbb{R}$),
because\footnote{Of course, we are assuming that the standard rules -- such as
associativity of multiplication -- apply to our \textquotedblleft
new\textquotedblright\ numbers.}
\begin{align*}
i^{2}  &  =-1,\ \ \ \ \ \ \ \ \ \ i^{3}=i\underbrace{i^{2}}_{=-1}%
=-i,\ \ \ \ \ \ \ \ \ \ i^{4}=i\underbrace{i^{3}}_{=-i}=-\underbrace{i^{2}%
}_{=-1}=-\left(  -1\right)  =1,\\
i^{5}  &  =i\underbrace{i^{4}}_{=1}=i,\ \ \ \ \ \ \ \ \ \ \text{etc..}%
\end{align*}
For example, the number $3+5i+9i^{2}+7i^{3}$ equals $3+5i+9\left(  -1\right)
+7\left(  -i\right)  =\left(  3-9\right)  +\left(  5-7\right)  i=-6-2i$.

So all our new numbers have the form $a+bi$ for two reals $a$ and $b$. We call
them \textquotedblleft complex numbers\textquotedblright. (As we have said, we
will give a rigorous definition later.) Since we are assuming that the
standard rules of arithmetic still hold for our new numbers, we can easily
find formulas for computing the sum, the difference, the product and the
quotient of two complex numbers written in the form $a+bi$: Namely, for any
two complex numbers $a+bi$ and $c+di$ (with $a,b,c,d\in\mathbb{R}$), we have%
\begin{align}
\left(  a+bi\right)  +\left(  c+di\right)   &  =\left(  a+c\right)  +\left(
b+d\right)  i;\label{eq.CC.motivate.+}\\
\left(  a+bi\right)  -\left(  c+di\right)   &  =\left(  a-c\right)  +\left(
b-d\right)  i;\label{eq.CC.motivate.-}\\
\left(  a+bi\right)  \left(  c+di\right)   &  =ac+adi+bci+bd\underbrace{i^{2}%
}_{=-1}=ac+adi+bci-bd\nonumber\\
&  =\left(  ac-bd\right)  +\left(  ad+bc\right)  i;\label{eq.CC.motivate.*}\\
\dfrac{a+bi}{c+di}  &  =\dfrac{\left(  a+bi\right)  \left(  c-di\right)
}{\left(  c+di\right)  \left(  c-di\right)  }=\dfrac{ac-adi+bci+bdi^{2}%
}{cc-cdi+dci-ddi^{2}}=\dfrac{ac-adi+bci+bd\left(  -1\right)  }%
{cc-cdi+dci-dd\left(  -1\right)  }\nonumber\\
&  =\dfrac{\left(  ac+bd\right)  +\left(  bc-ad\right)  i}{c^{2}+d^{2}%
}\ \ \ \ \ \ \ \ \ \ \left(  \text{if }c,d\text{ are not both }0\right)  .
\label{eq.CC.motivate./}%
\end{align}
(Note that the latter formula is an analogue of the standard procedure for
rationalizing denominators that involve square roots:%
\[
\dfrac{a+b\sqrt{2}}{c+d\sqrt{2}}=\dfrac{\left(  a+b\sqrt{2}\right)  \left(
c-d\sqrt{2}\right)  }{\left(  c+d\sqrt{2}\right)  \left(  c-d\sqrt{2}\right)
}=\dfrac{\left(  ac-2bd\right)  +\left(  bc-ad\right)  \sqrt{2}}{c^{2}-2d^{2}%
},
\]
except that the square root that we are trying to exorcise from the
denominator is not $\sqrt{2}$ but $\sqrt{-1}=i$ now.)

However, not all features of real numbers carry over to complex numbers:
Inequalities do not make sense for complex numbers. Indeed, if they would make
sense, then we would get a contradiction as follows:

\begin{itemize}
\item If $i\geq0$, then $i^{2}\geq0$, contradicting $i^{2}=-1<0$.

\item If $i<0$, then $i^{2}=\left(  -i\right)  ^{2}>0$ (since $i<0$ yields
$-i>0$), contradicting $i^{2}=-1<0$.
\end{itemize}

Here, we have assumed two things about our relations: First, we have assumed
that $i$ is either $\geq0$ or $<0$; and second, we have assumed that the
square of a nonnegative complex number is nonnegative. Sure, we could avoid
the contradiction by forfeiting one of these assumptions; but then, the $\geq$
and $<$ relations would not be worth their names any more.

So we appear to be able to extend the four operations $+,-,\cdot,/$ to our
weird new numbers, but not the relations $<,\leq,>,\geq$ (at least not in any
meaningful way). But how can we be sure that the four operations $+,-,\cdot,/$
don't already lead to some contradictions?

To answer this question, let us forget our daring postulation of the existence
of $i$, and instead give a formal definition of complex numbers:

\subsubsection{Rigorous definition of the complex numbers}

\begin{definition}
\label{def.CC.CC}\textbf{(a)} A \textit{complex number} is defined as a pair
$\left(  a,b\right)  $ of two real numbers.

\textbf{(b)} We let $\mathbb{C}$ be the set of all complex numbers.

\textbf{(c)} For each real number $r$, we denote the complex number $\left(
r,0\right)  $ by $r_{\mathbb{C}}$.

\textbf{(d)} We let $i$ be the complex number $\left(  0,1\right)  $. When the
notation \textquotedblleft$i$\textquotedblright\ is ambiguous, I will be
calling it \textquotedblleft$i_{\mathbb{C}}$\textquotedblright\ instead. (Some
authors call it $j$ or $\iota$ or $\sqrt{-1}$.)

\textbf{(e)} We define three binary operations $+$, $-$ and $\cdot$ on
$\mathbb{C}$ by setting%
\begin{align*}
\left(  a,b\right)  +\left(  c,d\right)   &  =\left(  a+c,b+d\right)  ,\\
\left(  a,b\right)  -\left(  c,d\right)   &  =\left(  a-c,b-d\right)
,\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  a,b\right)  \cdot\left(  c,d\right)   &  =\left(  ac-bd,ad+bc\right)
\end{align*}
for all $\left(  a,b\right)  \in\mathbb{C}$ and $\left(  c,d\right)
\in\mathbb{C}$.

\textbf{(f)} If $\alpha$ and $\beta$ are two complex numbers, then we write
$\alpha\beta$ for $\alpha\cdot\beta$.

\textbf{(g)} If $\alpha$ is a complex number, then the complex number
$0_{\mathbb{C}}-\alpha$ shall be denoted by $-\alpha$.
\end{definition}

For example, the definition of the operation $\cdot$ on $\mathbb{C}$ yields%
\[
\underbrace{i}_{=\left(  0,1\right)  }\underbrace{i}_{=\left(  0,1\right)
}=\left(  0,1\right)  \left(  0,1\right)  =\left(  \underbrace{0\cdot
0-1\cdot1}_{=-1},\underbrace{0\cdot1+1\cdot0}_{=0}\right)  =\left(
-1,0\right)  =\left(  -1\right)  _{\mathbb{C}}.
\]
We will later\footnote{in Convention \ref{conv.CC.RRtoCC.embed}} equate the
complex number $\left(  -1\right)  _{\mathbb{C}}$ with the real number $-1$;
thus, this equation will simplify to $ii=-1$. So $i$ \textquotedblleft behaves
like a square root of $-1$\textquotedblright. But we also have $\left(
-i\right)  \left(  -i\right)  =\left(  -1\right)  _{\mathbb{C}}$, so $-i$ fits
the same bill. Thus, we didn't have to postulate the existence of a mythical
number $i$ satisfying $i^{2}=1$; we simply found such a number in the set
$\mathbb{C}$.

The definitions of the operations $+$, $-$ and $\cdot$ in Definition
\ref{def.CC.CC} are not chosen by accident. We shall later identify each
complex number $\left(  a,b\right)  $ with $a+bi$; then, these definitions
will become exactly the equalities (\ref{eq.CC.motivate.+}),
(\ref{eq.CC.motivate.-}) and (\ref{eq.CC.motivate.*}) that we derived unrigorously.

We are leaving division of complex numbers undefined so far, because we will
later get it more or less for free.

We shall follow \href{https://en.wikipedia.org/wiki/Order_of_operations}{the
usual \textquotedblleft PEMDAS\textquotedblright\ rules for the order of
operations} when interpreting expressions involving the operations $+$, $-$
and $\cdot$ on $\mathbb{C}$. Thus, for example, the expression
\textquotedblleft$\alpha+\beta\cdot\gamma$\textquotedblright\ shall mean
$\alpha+\left(  \beta\cdot\gamma\right)  $ and not $\left(  \alpha
+\beta\right)  \cdot\gamma$.

\subsubsection{Rules for $+$, $-$ and $\cdot$}

So we have defined complex numbers as pairs of real numbers, and we have
defined three operations on them which we called $+$, $-$ and $\cdot$. But do
these operations really deserve these names? Do they still behave as nicely as
the corresponding operations on real numbers? Do they, in particular, satisfy
the standard rules of arithmetic such as commutativity, associativity and
distributivity? The next theorem shows that they indeed do:

\begin{theorem}
\label{thm.CC.CC.rules}The following rules for addition, subtraction and
multiplication in $\mathbb{C}$ hold:

\textbf{(a)} We have $\alpha+\beta=\beta+\alpha$ for any $\alpha,\beta
\in\mathbb{C}$.

\textbf{(b)} We have $\alpha+\left(  \beta+\gamma\right)  =\left(
\alpha+\beta\right)  +\gamma$ for any $\alpha,\beta,\gamma\in\mathbb{C}$.

\textbf{(c)} We have $\alpha+0_{\mathbb{C}}=0_{\mathbb{C}}+\alpha=\alpha$ for
any $\alpha\in\mathbb{C}$.

\textbf{(d)} We have $\alpha\cdot1_{\mathbb{C}}=1_{\mathbb{C}}\cdot
\alpha=\alpha$ for any $\alpha\in\mathbb{C}$.

\textbf{(e)} We have $\alpha\cdot\beta=\beta\cdot\alpha$ for any $\alpha
,\beta\in\mathbb{C}$.

\textbf{(f)} We have $\alpha\cdot\left(  \beta\cdot\gamma\right)  =\left(
\alpha\cdot\beta\right)  \cdot\gamma$ for any $\alpha,\beta,\gamma
\in\mathbb{C}$.

\textbf{(g)} We have $\alpha\cdot\left(  \beta+\gamma\right)  =\alpha
\beta+\alpha\gamma$ and $\left(  \alpha+\beta\right)  \cdot\gamma=\alpha
\gamma+\beta\gamma$ for any $\alpha,\beta,\gamma\in\mathbb{C}$.

\textbf{(h)} We have $\alpha\cdot0_{\mathbb{C}}=0_{\mathbb{C}}\cdot
\alpha=0_{\mathbb{C}}$ for any $\alpha\in\mathbb{C}$.

\textbf{(i)} If $\alpha,\beta,\gamma\in\mathbb{C}$, then we have the
equivalence $\left(  \alpha-\beta=\gamma\right)  \Longleftrightarrow\left(
\alpha=\beta+\gamma\right)  $.

\textbf{(j)} We have $-\left(  \alpha+\beta\right)  =\left(  -\alpha\right)
+\left(  -\beta\right)  $ for any $\alpha,\beta\in\mathbb{C}$.

\textbf{(k)} We have $-0_{\mathbb{C}}=0_{\mathbb{C}}$.

\textbf{(l)} We have $-\left(  -\alpha\right)  =\alpha$ for any $\alpha
\in\mathbb{C}$.

\textbf{(m)} We have $-\left(  \alpha\beta\right)  =\left(  -\alpha\right)
\beta=\alpha\left(  -\beta\right)  $ for any $\alpha,\beta\in\mathbb{C}$.

\textbf{(n)} We have $\alpha-\beta-\gamma=\alpha-\left(  \beta+\gamma\right)
$ for any $\alpha,\beta,\gamma\in\mathbb{C}$. (Here and in the following,
\textquotedblleft$\alpha-\beta-\gamma$\textquotedblright\ should be read as
\textquotedblleft$\left(  \alpha-\beta\right)  -\gamma$\textquotedblright.)
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.CC.CC.rules}.]All parts of this theorem are
straightforward. I will only prove the two parts \textbf{(f)} and \textbf{(i)}.

\textbf{(f)} Let $\alpha,\beta,\gamma\in\mathbb{C}$. Thus, $\alpha$ is a
complex number; in other words, $\alpha$ is a pair of two real numbers (by the
definition of complex numbers). Hence, we can write $\alpha$ in the form
$\alpha=\left(  a,a^{\prime}\right)  $ for two real numbers $a,a^{\prime}$.
Similarly, we can write $\beta$ and $\gamma$ in the forms $\beta=\left(
b,b^{\prime}\right)  $ and $\gamma=\left(  c,c^{\prime}\right)  $ for four
real numbers $b,b^{\prime},c,c^{\prime}$. Consider these six real numbers
$a,a^{\prime},b,b^{\prime},c,c^{\prime}$. Now, from the equalities
$\alpha=\left(  a,a^{\prime}\right)  $, $\beta=\left(  b,b^{\prime}\right)  $
and $\gamma=\left(  c,c^{\prime}\right)  $, we obtain%
\begin{align*}
\alpha\cdot\left(  \beta\cdot\gamma\right)   &  =\left(  a,a^{\prime}\right)
\cdot\underbrace{\left(  \left(  b,b^{\prime}\right)  \cdot\left(
c,c^{\prime}\right)  \right)  }_{\substack{=\left(  bc-b^{\prime}c^{\prime
},bc^{\prime}+b^{\prime}c\right)  \\\text{(by the definition of}\\\text{the
operation }\cdot\text{ on }\mathbb{C}\text{)}}}\\
&  =\left(  a,a^{\prime}\right)  \cdot\left(  bc-b^{\prime}c^{\prime
},bc^{\prime}+b^{\prime}c\right) \\
&  =\left(  \underbrace{a\left(  bc-b^{\prime}c^{\prime}\right)  -a^{\prime
}\left(  bc^{\prime}+b^{\prime}c\right)  }_{=abc-ab^{\prime}c^{\prime
}-a^{\prime}bc^{\prime}-a^{\prime}b^{\prime}c},\underbrace{a\left(
bc^{\prime}+b^{\prime}c\right)  +a^{\prime}\left(  bc-b^{\prime}c^{\prime
}\right)  }_{=abc^{\prime}+ab^{\prime}c+a^{\prime}bc-a^{\prime}b^{\prime
}c^{\prime}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the operation }%
\cdot\text{ on }\mathbb{C}\right) \\
&  =\left(  abc-ab^{\prime}c^{\prime}-a^{\prime}bc^{\prime}-a^{\prime
}b^{\prime}c,abc^{\prime}+ab^{\prime}c+a^{\prime}bc-a^{\prime}b^{\prime
}c^{\prime}\right)
\end{align*}
\newline and%
\begin{align*}
\left(  \alpha\cdot\beta\right)  \cdot\gamma &  =\underbrace{\left(  \left(
a,a^{\prime}\right)  \cdot\left(  b,b^{\prime}\right)  \right)  }%
_{\substack{=\left(  ab-a^{\prime}b^{\prime},ab^{\prime}+a^{\prime}b\right)
\\\text{(by the definition of}\\\text{the operation }\cdot\text{ on
}\mathbb{C}\text{)}}}\cdot\left(  c,c^{\prime}\right) \\
&  =\left(  ab-a^{\prime}b^{\prime},ab^{\prime}+a^{\prime}b\right)
\cdot\left(  c,c^{\prime}\right) \\
&  =\left(  \underbrace{\left(  ab-a^{\prime}b^{\prime}\right)  c-\left(
ab^{\prime}+a^{\prime}b\right)  c^{\prime}}_{=abc-ab^{\prime}c^{\prime
}-a^{\prime}bc^{\prime}-a^{\prime}b^{\prime}c},\underbrace{\left(
ab-a^{\prime}b^{\prime}\right)  c^{\prime}+\left(  ab^{\prime}+a^{\prime
}b\right)  c}_{=abc^{\prime}+ab^{\prime}c+a^{\prime}bc-a^{\prime}b^{\prime
}c^{\prime}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the operation }%
\cdot\text{ on }\mathbb{C}\right) \\
&  =\left(  abc-ab^{\prime}c^{\prime}-a^{\prime}bc^{\prime}-a^{\prime
}b^{\prime}c,abc^{\prime}+ab^{\prime}c+a^{\prime}bc-a^{\prime}b^{\prime
}c^{\prime}\right)  .
\end{align*}
Comparing these two equalities, we see that $\alpha\cdot\left(  \beta
\cdot\gamma\right)  =\left(  \alpha\cdot\beta\right)  \cdot\gamma$. So Theorem
\ref{thm.CC.CC.rules} \textbf{(f)} is proven.

\textbf{(i)} Let $\alpha,\beta,\gamma\in\mathbb{C}$. Thus, $\alpha$ is a
complex number; in other words, $\alpha$ is a pair of two real numbers (by the
definition of complex numbers). Hence, we can write $\alpha$ in the form
$\alpha=\left(  a,a^{\prime}\right)  $ for two real numbers $a,a^{\prime}$.
Similarly, we can write $\beta$ and $\gamma$ in the forms $\beta=\left(
b,b^{\prime}\right)  $ and $\gamma=\left(  c,c^{\prime}\right)  $ for four
real numbers $b,b^{\prime},c,c^{\prime}$. Consider these six real numbers
$a,a^{\prime},b,b^{\prime},c,c^{\prime}$. Now, we have the following chain of
logical equivalences:%
\begin{align*}
&  \ \left(  \underbrace{\alpha}_{=\left(  a,a^{\prime}\right)  }%
-\underbrace{\beta}_{=\left(  b,b^{\prime}\right)  }=\underbrace{\gamma
}_{=\left(  c,c^{\prime}\right)  }\right) \\
&  \Longleftrightarrow\ \left(  \underbrace{\left(  a,a^{\prime}\right)
-\left(  b,b^{\prime}\right)  }_{\substack{=\left(  a-b,a^{\prime}-b^{\prime
}\right)  \\\text{(by the definition of the}\\\text{operation }-\text{ on
}\mathbb{C}\text{)}}}=\left(  c,c^{\prime}\right)  \right) \\
&  \Longleftrightarrow\ \left(  \left(  a-b,a^{\prime}-b^{\prime}\right)
=\left(  c,c^{\prime}\right)  \right)  \ \Longleftrightarrow\ \left(
\underbrace{a-b=c}_{\Longleftrightarrow\ \left(  a=b+c\right)  }\text{ and
}\underbrace{a^{\prime}-b^{\prime}=c^{\prime}}_{\Longleftrightarrow\ \left(
a^{\prime}=b^{\prime}+c^{\prime}\right)  }\right) \\
&  \Longleftrightarrow\ \left(  a=b+c\text{ and }a^{\prime}=b^{\prime
}+c^{\prime}\right)  \ \Longleftrightarrow\ \left(  \left(  a,a^{\prime
}\right)  =\left(  b+c,b^{\prime}+c^{\prime}\right)  \right) \\
&  \Longleftrightarrow\ \left(  \underbrace{\left(  a,a^{\prime}\right)
}_{=\alpha}=\underbrace{\left(  b,b^{\prime}\right)  }_{=\beta}%
+\underbrace{\left(  c,c^{\prime}\right)  }_{=\gamma}\right)
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }\left(  b+c,b^{\prime}+c^{\prime}\right)  =\left(  b,b^{\prime
}\right)  +\left(  c,c^{\prime}\right) \\
\text{(by the definition of the}\\
\text{operation }+\text{ on }\mathbb{C}\text{)}%
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  \alpha=\beta+\gamma\right)  .
\end{align*}
This proves Theorem \ref{thm.CC.CC.rules} \textbf{(i)}.

All the other parts of Theorem \ref{thm.CC.CC.rules} can be proven by direct
computations, just as we proved Theorem \ref{thm.CC.CC.rules} \textbf{(f)}.
\end{proof}

\subsubsection{Finite sums and finite products}

Recall the concept of a finite sum of real numbers (i.e., a sum of the form
$\sum_{i\in I}a_{i}$, where $I$ is a finite set and $a_{i}$ is a real number
for each $i\in I$), and the analogous concept of a finite product of real
numbers (i.e., a product of the form $\prod_{i\in I}a_{i}$).

\begin{definition}
\label{def.CC.CC.sums}In the same vein, we define the concept of a finite sum
of complex numbers (i.e., a sum of the form $\sum_{i\in I}\alpha_{i}$, where
$I$ is a finite set and $\alpha_{i}\in\mathbb{C}$ for each $i\in I$), and the
analogous concept of a finite product of complex numbers (i.e., a product of
the form $\prod_{i\in I}\alpha_{i}$, where $I$ is a finite set and $\alpha
_{i}\in\mathbb{C}$ for each $i\in I$).

These concepts are well-defined, by Proposition \ref{prop.CC.CC.sums.wd}
\textbf{(a)} below.
\end{definition}

We will use the usual shorthands for special kinds of finite sums and
products. For example, if $I$ is an interval $\left\{  p,p+1,\ldots,q\right\}
$ of integers (and if $\alpha_{i}\in\mathbb{C}$ for each $i\in I$), then the
sum $\sum_{i\in I}\alpha_{i}$ will also be denoted by $\sum_{i=p}^{q}%
\alpha_{i}$ or $\alpha_{p}+\alpha_{p+1}+\cdots+\alpha_{q}$. Likewise for
products. Thus, for example, $\alpha_{1}+\alpha_{2}+\cdots+\alpha_{k}$ and
$\alpha_{1}\alpha_{2}\cdots\alpha_{k}$ are well-defined whenever $\alpha
_{1},\alpha_{2},\ldots,\alpha_{k}\in\mathbb{C}$.

\begin{proposition}
\label{prop.CC.CC.sums.wd}\textbf{(a)} Definition \ref{def.CC.CC.sums} is well-defined.

\textbf{(b)} Finite sums ($\sum_{i\in I}\alpha_{i}$) and finite products
($\prod_{i\in I}\alpha_{i}$) of complex numbers $\alpha_{i}\in\mathbb{C}$
satisfy the same rules that finite sums and finite products of real numbers satisfy.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.CC.CC.sums.wd}.]\textbf{(a)} In \cite[Theorem
2.118 \textbf{(a)}]{detnotes}, it is proven that finite sums of real numbers
are well-defined. The same argument (but relying on Theorem
\ref{thm.CC.CC.rules} instead of the usual rules of commutativity,
associativity etc. for real numbers) shows that finite sums of complex numbers
$\alpha_{i}\in\mathbb{C}$ are well-defined. The analogous fact for products is
proven in the same way, except that we need to replace $0$ by $1$ and
properties of addition by corresponding properties of multiplication.

\textbf{(b)} The proofs of the properties of finite sums and finite products
of elements of $\mathbb{C}$ are identical to the analogous proofs for real
numbers, but (again) rely on Theorem \ref{thm.CC.CC.rules} instead of the
usual rules of commutativity, associativity etc. for real numbers.
\end{proof}

\subsubsection{Embedding $\mathbb{R}$ into $\mathbb{C}$}

\begin{theorem}
\label{thm.CC.RRtoCC.hom}For any real numbers $a$ and $b$, we have%
\begin{align}
\left(  a+b\right)  _{\mathbb{C}}  &  =a_{\mathbb{C}}+b_{\mathbb{C}%
}\ \ \ \ \ \ \ \ \ \ \text{and}\label{eq.thm.CC.RRtoCC.hom.1}\\
\left(  a-b\right)  _{\mathbb{C}}  &  =a_{\mathbb{C}}-b_{\mathbb{C}%
}\ \ \ \ \ \ \ \ \ \ \text{and}\label{eq.thm.CC.RRtoCC.hom.2}\\
\left(  ab\right)  _{\mathbb{C}}  &  =a_{\mathbb{C}}b_{\mathbb{C}}.
\label{eq.thm.CC.RRtoCC.hom.3}%
\end{align}

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.CC.RRtoCC.hom}.]Let $a$ and $b$ be two real
numbers. Then, the definitions of $a_{\mathbb{C}}$, $b_{\mathbb{C}}$ and
$\left(  ab\right)  _{\mathbb{C}}$ yield $a_{\mathbb{C}}=\left(  a,0\right)  $
and $b_{\mathbb{C}}=\left(  b,0\right)  $ and $\left(  ab\right)
_{\mathbb{C}}=\left(  ab,0\right)  $. Now, (\ref{eq.thm.CC.RRtoCC.hom.3})
follows from%
\begin{align*}
\underbrace{a_{\mathbb{C}}}_{=\left(  a,0\right)  }\underbrace{b_{\mathbb{C}}%
}_{=\left(  b,0\right)  }  &  =\left(  a,0\right)  \left(  b,0\right)
=\left(  a,0\right)  \cdot\left(  b,0\right)  =\left(  \underbrace{ab-0\cdot
0}_{=ab},\underbrace{a\cdot0+0\cdot b}_{=0}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the operation }%
\cdot\text{ on }\mathbb{C}\right) \\
&  =\left(  ab,0\right)  =\left(  ab\right)  _{\mathbb{C}}.
\end{align*}
Similar straightforward computations prove the equalities
(\ref{eq.thm.CC.RRtoCC.hom.1}) and (\ref{eq.thm.CC.RRtoCC.hom.2}). Thus,
Theorem \ref{thm.CC.RRtoCC.hom} is proven.
\end{proof}

\begin{remark}
\label{rmk.CC.RRtoCC.homk}If $a_{1},a_{2},\ldots,a_{k}$ are $k$ reals, then
\begin{align*}
\left(  a_{1}\right)  _{\mathbb{C}}+\left(  a_{2}\right)  _{\mathbb{C}}%
+\cdots+\left(  a_{k}\right)  _{\mathbb{C}}  &  =\left(  a_{1}+a_{2}%
+\cdots+a_{k}\right)  _{\mathbb{C}}\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  a_{1}\right)  _{\mathbb{C}}\cdot\left(  a_{2}\right)  _{\mathbb{C}%
}\cdot\cdots\cdot\left(  a_{k}\right)  _{\mathbb{C}}  &  =\left(  a_{1}%
a_{2}\cdots a_{k}\right)  _{\mathbb{C}}.
\end{align*}

\end{remark}

\begin{proof}
[Proof of Remark \ref{rmk.CC.RRtoCC.homk}.]This can be proven by a
straightforward induction on $k$.
\end{proof}

\begin{convention}
\label{conv.CC.RRtoCC.embed}From now on, for each real number $r$, we shall
identify the real number $r$ with the complex number $r_{\mathbb{C}}=\left(
r,0\right)  $.
\end{convention}

Identifying different things is always risky in mathematics; for example, we
have seen above why it would be a bad idea to identify residue classes
$\left[  a\right]  _{n}$ of integers modulo a positive integer $n$ with the
corresponding remainders $a\%n$ (even though there is a 1-to-1 correspondence
between the former and the latter). Nevertheless, the identification made in
Convention \ref{conv.CC.RRtoCC.embed} is harmless, due to Theorem
\ref{thm.CC.RRtoCC.hom}\footnote{Why does Theorem \ref{thm.CC.RRtoCC.hom}
matter here? Well, let us assume for a moment that Theorem
\ref{thm.CC.RRtoCC.hom} was false; specifically, let us assume that there are
two real numbers $a$ and $b$ such that $\left(  ab\right)  _{\mathbb{C}}\neq
a_{\mathbb{C}}b_{\mathbb{C}}$. Consider these $a$ and $b$. Now, Convention
\ref{conv.CC.RRtoCC.embed} lets us identify the real numbers $a$, $b$ and $ab$
with the complex numbers $a_{\mathbb{C}}$, $b_{\mathbb{C}}$ and $\left(
ab\right)  _{\mathbb{C}}$. Thus, $ab=\left(  ab\right)  _{\mathbb{C}}%
\neq\underbrace{a_{\mathbb{C}}}_{=a}\underbrace{b_{\mathbb{C}}}_{=b}=ab$,
which is nonsense. To make sure that Convention \ref{conv.CC.RRtoCC.embed}
cannot spawn such absurdities, we had to prove Theorem \ref{thm.CC.RRtoCC.hom}%
.} and because the map
\[
\mathbb{R}\rightarrow\mathbb{C},\ \ \ \ \ \ \ \ \ \ r\mapsto r_{\mathbb{C}}%
\]
is injective (so we are not identifying two different real numbers with one
and the same complex numbers).

So we have identified each real number with a complex number. Thus, the
complex numbers can be seen as an extension of the real numbers:
$\mathbb{R}\subseteq\mathbb{C}$. (Of course, this is not \textbf{literally}
true, since formally speaking $r_{\mathbb{C}}$ is a pair while $r$ is a single
real number. Nevertheless, we will work as if this was true, and hope that the
reader can insert \textquotedblleft$_{\mathbb{C}}$\textquotedblright%
\ subscripts wherever necessary in order to make our computations literally true.)

When we defined complex numbers as pairs of real numbers in Definition
\ref{def.CC.CC}, we were intending that the pair $\left(  a,b\right)  $ would
correspond to the complex number $a+bi$ in our previous informal construction
of the complex numbers. Convention \ref{conv.CC.RRtoCC.embed} makes this
actually hold:

\begin{proposition}
\label{prop.CC.RRtoCC.a+bi}For any $\left(  a,b\right)  \in\mathbb{C}$, we
have $\left(  a,b\right)  =a+bi$.
\end{proposition}

\begin{proof}
Let $\left(  a,b\right)  \in\mathbb{C}$. Thus, $a$ and $b$ are real numbers.
By Convention \ref{conv.CC.RRtoCC.embed}, we identify these real numbers $a$
and $b$ with the complex numbers $a_{\mathbb{C}}=\left(  a,0\right)  $ and
$b_{\mathbb{C}}=\left(  b,0\right)  $, respectively. Thus, $a=a_{\mathbb{C}%
}=\left(  a,0\right)  $ and $b=b_{\mathbb{C}}=\left(  b,0\right)  $. Hence,%
\begin{align*}
\underbrace{a}_{=\left(  a,0\right)  }+\underbrace{b}_{=\left(  b,0\right)
}\underbrace{i}_{=\left(  0,1\right)  }  &  =\left(  a,0\right)
+\underbrace{\left(  b,0\right)  \left(  0,1\right)  }_{\substack{=\left(
b\cdot0-0\cdot1,b\cdot1+0\cdot0\right)  \\\text{(by the definition
of}\\\text{the operation }\cdot\text{ on }\mathbb{C}\text{)}}}=\left(
a,0\right)  +\left(  \underbrace{b\cdot0-0\cdot1}_{=0},\underbrace{b\cdot
1+0\cdot0}_{=b}\right) \\
&  =\left(  a,0\right)  +\left(  0,b\right)  =\left(  \underbrace{a+0}%
_{=a},\underbrace{0+b}_{=b}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the operation
}+\text{ on }\mathbb{C}\right) \\
&  =\left(  a,b\right)  .
\end{align*}
This proves Proposition \ref{prop.CC.RRtoCC.a+bi}.
\end{proof}

The next proposition shows that if we multiply a complex number $\left(
b,c\right)  $ with a \textbf{real} number $a$ (of course, understanding this
real number $a$ as the complex number $a_{\mathbb{C}}=\left(  a,0\right)  $),
then the result will simply be $\left(  ab,ac\right)  $ (that is, multiplying
a complex number by $a$ merely multiplies both of its entries by $a$):

\begin{proposition}
\label{prop.CC.CC.a(b,c)}For any $a\in\mathbb{R}$ and $\left(  b,c\right)
\in\mathbb{C}$, we have $a\left(  b,c\right)  =\left(  ab,ac\right)  $. (Here,
of course, \textquotedblleft$a\left(  b,c\right)  $\textquotedblright\ means
the product $a_{\mathbb{C}}\left(  b,c\right)  $.)
\end{proposition}

\begin{proof}
This is straightforward: Let $a\in\mathbb{R}$ and $\left(  b,c\right)
\in\mathbb{C}$. By Convention \ref{conv.CC.RRtoCC.embed}, we identify the real
number $a$ with the complex number $a_{\mathbb{C}}=\left(  a,0\right)  $.
Hence, $a=a_{\mathbb{C}}=\left(  a,0\right)  $. Now,%
\begin{align*}
\underbrace{a}_{=\left(  a,0\right)  }\left(  b,c\right)   &  =\left(
a,0\right)  \cdot\left(  b,c\right)  =\left(  \underbrace{ab-0c}%
_{=ab},\underbrace{ac+0b}_{=ac}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the operation }%
\cdot\text{ on }\mathbb{C}\right) \\
&  =\left(  ab,ac\right)  .
\end{align*}
This proves Proposition \ref{prop.CC.CC.a(b,c)}.
\end{proof}

\subsubsection{Inverses and division of complex numbers}

\begin{definition}
A complex number $\alpha$ is said to be \textit{nonzero} if and only if it is
distinct from the complex number $0_{\mathbb{C}}=\left(  0,0\right)  $.
\end{definition}

In other words, a complex number $\alpha$ is nonzero if and only if it is
distinct from $0$ (since we are identifying the real number $0$ with
$0_{\mathbb{C}}$). Equivalently, a complex number $\alpha=\left(  a,b\right)
$ is nonzero if and only if $\left(  a,b\right)  \neq\left(  0,0\right)  $ as
pairs (i.e., if and only if at least one of the real numbers $a$ and $b$ are nonzero).

We have so far been adding, subtracting and multiplying complex numbers, but
never dividing them (except briefly, before we formally defined them). We
could define division in the same way as we defined addition, subtraction and
multiplication -- namely, by an explicit formula for $\dfrac{\left(
a,b\right)  }{\left(  c,d\right)  }$ whenever $\left(  c,d\right)  $ is
nonzero\footnote{This formula would be
\[
\dfrac{\left(  a,b\right)  }{\left(  c,d\right)  }=\left(  \dfrac{ac+bd}%
{c^{2}+d^{2}},\dfrac{bc-ad}{c^{2}+d^{2}}\right)  .
\]
}. However, it is more instructive to proceed differently, and construct the
division from the multiplication that was already defined. After all, if our
division is to deserve its name, it should undo multiplication; and this
determines it uniquely. We will not define division right away; instead, we
start out by defining an \textit{inverse} of a complex number:

\begin{definition}
\label{def.CC.CC.inverse.inverse}Let $\alpha$ be a complex number. An
\textit{inverse} of $\alpha$ means a complex number $\beta$ such that
$\alpha\beta=1$. (Recall that $1=1_{\mathbb{C}}$ by Convention
\ref{conv.CC.RRtoCC.embed}.)
\end{definition}

The complex number $0$ has no inverse (because $0\beta=0\neq1$, no matter what
$\beta$ is). But it turns out that all the other complex numbers have one:

\begin{theorem}
\label{thm.CC.CC.inverse.unique}Let $\alpha$ be a nonzero complex number.
Then, $\alpha$ has a unique inverse.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.CC.CC.inverse.unique}.]We shall separately prove
the existence and the uniqueness of an inverse of $\alpha$.

\textit{Proof of the existence of the inverse:} Write the complex number
$\alpha$ as $\alpha=\left(  c,d\right)  $ for two real numbers $c$ and $d$.
Then, $\left(  c,d\right)  =\alpha\neq0$ (since $\alpha$ is nonzero). Thus,
$\left(  c,d\right)  \neq0=\left(  0,0\right)  $. In other words, at least one
of the two real numbers $c$ and $d$ is nonzero. Hence, at least one of the two
real numbers $c^{2}$ and $d^{2}$ is positive\footnote{since the square of a
nonzero real number is always positive}. The other among these two numbers
must, of course, be nonnegative\footnote{since the square of a real number is
always nonnegative}. Hence, $c^{2}+d^{2}$ is the sum of a positive real number
with a nonnegative real number. Therefore, $c^{2}+d^{2}$ itself is positive.
Thus, $c^{2}+d^{2}$ is a nonzero real number; hence, we can divide by
$c^{2}+d^{2}$. In particular, we can define a complex number $\beta$ by%
\[
\beta=\left(  \dfrac{c}{c^{2}+d^{2}},\dfrac{-d}{c^{2}+d^{2}}\right)  .
\]
Consider this $\beta$. Multiplying the equalities $\alpha=\left(  c,d\right)
$ and $\beta=\left(  \dfrac{c}{c^{2}+d^{2}},\dfrac{-d}{c^{2}+d^{2}}\right)  $,
we find
\begin{align*}
\alpha\beta &  =\left(  c,d\right)  \left(  \dfrac{c}{c^{2}+d^{2}},\dfrac
{-d}{c^{2}+d^{2}}\right) \\
&  =\left(  \underbrace{c\cdot\dfrac{c}{c^{2}+d^{2}}-d\cdot\dfrac{-d}%
{c^{2}+d^{2}}}_{=1},\underbrace{c\cdot\dfrac{-d}{c^{2}+d^{2}}+d\cdot\dfrac
{c}{c^{2}+d^{2}}}_{=0}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the operation }%
\cdot\text{ on }\mathbb{C}\right) \\
&  =\left(  1,0\right)  =1_{\mathbb{C}}.
\end{align*}
Thus, $\beta$ is an inverse of $\alpha$ (by the definition of an inverse of
$\alpha$). Hence, $\alpha$ has \textbf{at least one} inverse (namely, $\beta$).

\textit{Proof of the uniqueness of the inverse:} We must prove that $\alpha$
has at most one inverse. This is exactly the statement of Proposition
\ref{prop.equiv.modinv.uni}, except that our $\alpha$ is an element of
$\mathbb{C}$ rather than of $\mathbb{Z}/n$. But the same argument that we used
to prove Proposition \ref{prop.equiv.modinv.uni} can be applied to $\alpha
\in\mathbb{C}$ instead of $\alpha\in\mathbb{Z}/n$\ \ \ \ \footnote{Of course,
we need to make some obvious modifications, such as replacing every appearance
of \textquotedblleft$\left[  1\right]  _{n}$\textquotedblright\ by
\textquotedblleft$1$\textquotedblright, and replacing every reference to
Theorem \ref{thm.eqrel.Z/n.rules} with a reference to Theorem
\ref{thm.CC.CC.rules}.}. Hence, we obtain that $\alpha$ has \textbf{at most
one} inverse.

We have now shown that $\alpha$ has at least one inverse, and we have shown
that $\alpha$ has at most one inverse. Combining these two results, we
conclude that $\alpha$ has a unique inverse. This proves Theorem
\ref{thm.CC.CC.inverse.unique}.
\end{proof}

\begin{definition}
\label{def.CC.CC.inverse.notations} Let $\alpha$ be a nonzero complex number.
Theorem \ref{thm.CC.CC.inverse.unique} shows that $\alpha$ has a unique
inverse. This inverse is called $\alpha^{-1}$, and will be referred to as
\textit{the inverse} of $\alpha$.
\end{definition}

\begin{definition}
\label{def.CC.CC.division.notations} \textbf{(a)} Let $\alpha$ and $\beta$ be
two complex numbers such that $\beta\neq0$. Then, the quotient $\dfrac{\alpha
}{\beta}$ is defined to be the complex number $\alpha\cdot\beta^{-1}$. It is
sometimes also denoted by $\alpha/\beta$.

\textbf{(b)} The operation that transforms a pair $\left(  \alpha
,\beta\right)  $ of two complex numbers (with $\beta$ nonzero) into
$\alpha/\beta$ is called \textit{division}.
\end{definition}

It is easy to see that division undoes multiplication:

\begin{proposition}
\label{prop.CC.CC.inverse.undo}Let $\alpha,\beta,\gamma$ be three complex
numbers with $\beta\neq0$. Then, we have the equivalence%
\[
\left(  \gamma=\dfrac{\alpha}{\beta}\right)  \ \Longleftrightarrow\ \left(
\alpha=\beta\gamma\right)  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.CC.CC.inverse.undo}.]We have $\beta\neq0$.
Thus, $\beta$ has a well-defined inverse $\beta^{-1}$. The definition of this
inverse yields $\beta\beta^{-1}=1$; now, Theorem \ref{thm.CC.CC.rules}
\textbf{(e)} yields $\beta^{-1}\beta=\beta\beta^{-1}=1$. Also, Theorem
\ref{thm.CC.CC.rules} \textbf{(e)} yields $\gamma\beta=\beta\gamma$ and
$\beta^{-1}\alpha=\alpha\beta^{-1}$. The definition of $\dfrac{\alpha}{\beta}$
yields $\dfrac{\alpha}{\beta}=\alpha\cdot\beta^{-1}=\alpha\beta^{-1}$.

We have to prove the equivalence $\left(  \gamma=\dfrac{\alpha}{\beta}\right)
\ \Longleftrightarrow\ \left(  \alpha=\beta\gamma\right)  $. Let us prove the
\textquotedblleft$\Longrightarrow$\textquotedblright\ and \textquotedblleft%
$\Longleftarrow$\textquotedblright\ directions of this equivalence separately:

$\Longrightarrow:$ Assume that $\gamma=\dfrac{\alpha}{\beta}$. We shall show
that $\alpha=\beta\gamma$.

We have $\gamma=\dfrac{\alpha}{\beta}=\alpha\beta^{-1}$. Multiplying both
sides of this equality with $\beta$, we obtain
\[
\gamma\beta=\alpha\underbrace{\beta^{-1}\beta}_{=1}=\alpha\cdot1=\alpha.
\]
Hence, $\alpha=\gamma\beta=\beta\gamma$. This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of the equivalence $\left(
\gamma=\dfrac{\alpha}{\beta}\right)  \ \Longleftrightarrow\ \left(
\alpha=\beta\gamma\right)  $.

$\Longleftarrow:$ Assume that $\alpha=\beta\gamma$. We shall show that
$\gamma=\dfrac{\alpha}{\beta}$.

We have $\beta^{-1}\underbrace{\alpha}_{=\beta\gamma}=\underbrace{\beta
^{-1}\beta}_{=1}\gamma=1\gamma=\gamma1=\gamma$, so that $\gamma=\beta
^{-1}\alpha=\alpha\beta^{-1}=\dfrac{\alpha}{\beta}$. This proves the
\textquotedblleft$\Longleftarrow$\textquotedblright\ direction of the
equivalence $\left(  \gamma=\dfrac{\alpha}{\beta}\right)
\ \Longleftrightarrow\ \left(  \alpha=\beta\gamma\right)  $.

Thus, the equivalence $\left(  \gamma=\dfrac{\alpha}{\beta}\right)
\ \Longleftrightarrow\ \left(  \alpha=\beta\gamma\right)  $ holds (since we
have proven both of its directions). That is, we have proven Proposition
\ref{prop.CC.CC.inverse.undo}.
\end{proof}

Inverses also have the following properties:

\begin{proposition}
\label{prop.CC.CC.inverse.ab}\textbf{(a)} Let $\alpha\in\mathbb{C}$ be a
complex number that has an inverse (i.e., is nonzero). Then, its inverse
$\alpha^{-1}$ has an inverse as well, and this inverse is $\left(  \alpha
^{-1}\right)  ^{-1}=\alpha$.

\textbf{(b)} Let $\alpha,\beta\in\mathbb{C}$ be two complex numbers that have
inverses (i.e., are nonzero). Then, their product $\alpha\beta$ has an inverse
as well, and this inverse is $\left(  \alpha\beta\right)  ^{-1}=\alpha
^{-1}\beta^{-1}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.CC.CC.inverse.ab}.]This proof is completely
analogous to the solution to Exercise \ref{exe.equiv.modinv.ab}. (Just replace
$\mathbb{Z}/n$ by $\mathbb{C}$.)
\end{proof}

\begin{corollary}
\label{cor.CC.CC.intdom}Let $\alpha,\beta\in\mathbb{C}$ be two nonzero complex
numbers. Then, the complex number $\alpha\beta$ is nonzero as well.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.CC.CC.intdom} (sketched).]The complex numbers
$\alpha$ and $\beta$ are nonzero, and thus have inverses (by Theorem
\ref{thm.CC.CC.inverse.unique}). Hence, Proposition
\ref{prop.CC.CC.inverse.ab} \textbf{(b)} shows that their product $\alpha
\beta$ has an inverse as well. Thus, $\alpha\beta\neq0$ (since $0$ has no
inverse). This proves Corollary \ref{cor.CC.CC.intdom}.
\end{proof}

\subsubsection{Powers of complex numbers}

Let us now define powers of complex numbers, where the exponent is a
nonnegative integer.

\begin{definition}
\label{def.CC.CC.power}Let $\alpha\in\mathbb{C}$ and $n\in\mathbb{N}$. We
define a complex number $\alpha^{n}$ (called the $n$\textit{-th power of
}$\alpha$) by setting $\alpha^{n}=\underbrace{\alpha\alpha\cdots\alpha
}_{n\text{ times}}$.
\end{definition}

Definition \ref{def.CC.CC.power} yields%
\[
i^{2}=ii=\left(  -1\right)  _{\mathbb{C}}=-1.
\]
Moreover, Definition \ref{def.CC.CC.power} yields
\begin{align*}
\alpha^{0}  &  =\underbrace{\alpha\alpha\cdots\alpha}_{0\text{ times}}=\left(
\text{empty product}\right)  =1\ \ \ \ \ \ \ \ \ \ \text{and}\\
\alpha^{1}  &  =\underbrace{\alpha\alpha\cdots\alpha}_{1\text{ times}}=\alpha
\end{align*}
for each $\alpha\in\mathbb{C}$.

For another example, Definition \ref{def.CC.CC.power} yields%
\[
\left(  1+i\right)  ^{2}=\left(  1+i\right)  \left(  1+i\right)
=1+i+i+\underbrace{ii}_{=-1}=1+i+i+\left(  -1\right)  =i+i=2i
\]
and%
\[
\left(  1+i\right)  ^{4}=\underbrace{\left(  1+i\right)  \left(  1+i\right)
}_{=2i}\underbrace{\left(  1+i\right)  \left(  1+i\right)  }_{=2i}%
=2i\cdot2i=4\underbrace{ii}_{=-1}=4\left(  -1\right)  =-4.
\]


We shall use the PEMDAS convention for the order of operations when powers are
involved. For example, the expression \textquotedblleft$\alpha\beta^{k}%
+\gamma$\textquotedblright\ means $\left(  \alpha\left(  \beta^{k}\right)
\right)  +\gamma$ rather than (say) $\left(  \alpha\beta\right)  ^{k}+\gamma$.

Recall that any nonzero complex number $\alpha$ has an inverse $\alpha^{-1}$
(by Definition \ref{def.CC.CC.inverse.notations}). This allows us to extend
our definition of $\alpha^{n}$ to \textbf{negative} $n$ as well:

\begin{definition}
\label{def.CC.CC.power-}Let $\alpha\in\mathbb{C}$ be nonzero. For any negative
$n\in\mathbb{Z}$, we define a complex number $\alpha^{n}$ (called the
$n$\textit{-th power of }$\alpha$) by $\alpha^{n}=\left(  \alpha^{-1}\right)
^{-n}$. (This is well-defined, since $\left(  \alpha^{-1}\right)  ^{-n}$ is
already defined by Definition \ref{def.CC.CC.power} (because $n$ is negative
and thus $-n\in\mathbb{N}$).)
\end{definition}

The attentive reader will have noticed that Definition \ref{def.CC.CC.power-}
redefines $\alpha^{-1}$ when $\alpha$ is nonzero (indeed, $-1$ is a negative
integer, and thus can be substituted for $n$ in Definition
\ref{def.CC.CC.power-}). Fortunately, this new definition of $\alpha^{-1}$
does not clash with the original definition (Definition
\ref{def.CC.CC.inverse.notations}), because if we set $n=-1$ in Definition
\ref{def.CC.CC.power-}, then we get $\alpha^{-1}=\left(  \alpha^{-1}\right)
^{1}=\alpha^{-1}$ (where the \textquotedblleft$\alpha^{-1}$\textquotedblright%
\ on the left hand side is the new meaning defined in Definition
\ref{def.CC.CC.power-}, whereas the \textquotedblleft$\alpha^{-1}%
$\textquotedblright\ on the right hand side is the old meaning defined in
Definition \ref{def.CC.CC.inverse.notations}).

If $\alpha=0$ and if $n\in\mathbb{Z}$ is negative, then we leave $\alpha^{n}$ undefined.

Powers of complex numbers satisfy the usual rules for exponents:

\begin{proposition}
\label{prop.CC.CC.power-rules}\textbf{(a)} We have $\alpha^{n+1}=\alpha
\alpha^{n}$ for all $\alpha\in\mathbb{C}$ and $n\in\mathbb{N}$.

\textbf{(b)} We have $\alpha^{n+m}=\alpha^{n}\alpha^{m}$ for all $\alpha
\in\mathbb{C}$ and $n,m\in\mathbb{N}$.

\textbf{(c)} We have $\left(  \alpha\beta\right)  ^{n}=\alpha^{n}\beta^{n}$
for all $\alpha,\beta\in\mathbb{C}$ and $n\in\mathbb{N}$.

\textbf{(d)} We have $\left(  \alpha^{n}\right)  ^{m}=\alpha^{nm}$ for all
$\alpha\in\mathbb{C}$ and $n,m\in\mathbb{N}$.

\textbf{(e)} We have $1^{n}=1$ for all $n\in\mathbb{N}$.

\textbf{(f)} We have $\alpha^{n+1}=\alpha\alpha^{n}$ for all nonzero
$\alpha\in\mathbb{C}$ and all $n\in\mathbb{Z}$.

\textbf{(g)} We have $\alpha^{-n}=\left(  \alpha^{-1}\right)  ^{n}$ for all
nonzero $\alpha\in\mathbb{C}$ and all $n\in\mathbb{Z}$.

\textbf{(h)} We have $\alpha^{n+m}=\alpha^{n}\alpha^{m}$ for all nonzero
$\alpha\in\mathbb{C}$ and all $n,m\in\mathbb{Z}$.

\textbf{(i)} We have $\left(  \alpha\beta\right)  ^{n}=\alpha^{n}\beta^{n}$
for all nonzero $\alpha,\beta\in\mathbb{C}$ and all $n\in\mathbb{Z}$.

\textbf{(j)} We have $1^{n}=1$ for all $n\in\mathbb{Z}$.

\textbf{(k)} We have $\left(  \alpha^{n}\right)  ^{-1}=\alpha^{-n}$ for all
nonzero $\alpha\in\mathbb{C}$ and all $n\in\mathbb{Z}$. (In particular,
$\alpha^{n}$ is nonzero, so that $\left(  \alpha^{n}\right)  ^{-1}$ is well-defined.)

\textbf{(l)} We have $\left(  \alpha^{n}\right)  ^{m}=\alpha^{nm}$ for all
nonzero $\alpha\in\mathbb{C}$ and all $n,m\in\mathbb{Z}$. (In particular,
$\alpha^{n}$ is nonzero, so that $\left(  \alpha^{n}\right)  ^{m}$ is
well-defined for all $m\in\mathbb{Z}$.)

\textbf{(m)} Complex numbers satisfy the binomial formula: That is, if
$\alpha,\beta\in\mathbb{C}$, then%
\[
\left(  \alpha+\beta\right)  ^{n}=\sum_{k=0}^{n}\dbinom{n}{k}\alpha^{k}%
\beta^{n-k}\ \ \ \ \ \ \ \ \ \ \text{for }n\in\mathbb{N}\text{.}%
\]

\end{proposition}

Proposition \ref{prop.CC.CC.power-rules} can be proven in the same way as the
corresponding claims are proven for real (or rational) numbers:

\begin{exercise}
\label{exe.CC.CC.power-rules}Prove Proposition \ref{prop.CC.CC.power-rules}.
\end{exercise}

It may be tempting to try to extend Definition \ref{def.CC.CC.power-} further
by defining fractional powers (such as $\alpha^{1/2}$). There is a way to do
so, but such a definition would be of questionable use and somewhat fragile
(in the sense that it would fail to satisfy the rules of exponents). For
example, if you wanted to define $\left(  -1\right)  ^{1/2}$, then the only
reasonable choices would be $i$ and $-i$ (since these are the only two complex
numbers whose squares are $-1$); but with either option, the equality $\left(
\alpha\beta\right)  ^{1/2}=\alpha^{1/2}\beta^{1/2}$ would fail if we took
$\alpha=-1$ and $\beta=-1$. Thus, we prefer to leave powers of the form
$\alpha^{n}$ for $n\notin\mathbb{Z}$ undefined.

\subsubsection{\label{subsect.CC.CC.argand}The Argand diagram}

Let us next make a small detour to demonstrate a geometric representation of
the complex numbers which, while not strictly necessary for what we intend to
do with them, is conducive both to understanding them and to applying them.

Recall that a complex number was defined as a pair of real numbers. On the
other hand, a point in the Cartesian plane is also defined as a pair of real
numbers (its x-coordinate and its y-coordinate). Thus, it is natural to
identify each complex number $\left(  a,b\right)  =a+bi$ with the point
$\left(  a,b\right)  \in\mathbb{R}^{2}$ on the Cartesian plane (i.e., the
point with x-coordinate $a$ and y-coordinate $b$). This identification equates
each complex number with a unique point in the Cartesian plane, and vice
versa:%
\[
\begin{tikzpicture}[baseline, scale=2.5]
\draw[step=1cm,gray,very thin] (-0.5, -0.5) grid (2.4,2.4);
\draw[->] (-0.6,0) -- (2.5,0);
\draw[->] (0,-0.6) -- (0,2.5);
\node (p) at (1.3 cm, 1.7 cm) {};
\node (o) at (0 cm, 0 cm) {};
\node (xproj) at (1.3 cm, 0 cm) {};
\fill (p) circle (1pt) node[above right] {$a+bi = \left(a,b\right)$};
\fill (xproj) circle (1pt);
\fill (o) circle (1pt);
\draw[very thick, blue] (p) -- node[right=1pt, fill=white] {$b$} (xproj);
\draw[very thick, red] (xproj) -- node[below=1pt, fill=white] {$a$} (o);
\end{tikzpicture}.
\]
The picture below shows some of the points (specifically, all the $25$ points
$\left(  a,b\right)  \in\left\{  -2,-1,0,1,2\right\}  ^{2}$ whose both
coordinates are integers between $-2$ and $2$) labeled with the corresponding
complex numbers:%
\begin{equation}%
%TCIMACRO{\TeXButton{25 points}{\begin{tikzpicture}[baseline, scale=2.5]
%\draw[step=1cm,gray,very thin] (-2.4,-2.4) grid (2.4,2.4);
%\draw[->] (-2.5,0) -- (2.5,0);
%\draw[->] (0,-2.5) -- (0,2.5);
%\draw(0,0) circle [radius=1cm];
%\foreach\x/\xtext in {-2, -1, 0, 1, 2}
%\fill(\x cm, 0) circle (1pt) node[above left=2pt]{$\xtext$};
%\foreach\x/\xtext in {-2, -1, 1, 2}
%\fill(\x cm, 1 cm) circle (1pt) node[above left=2pt]{$\xtext+ i$};
%\fill(0, 1 cm) circle (1pt) node[above left=2pt] {$i$};
%\foreach\x/\xtext in {-2, -1, 1, 2}
%\fill(\x cm, -1 cm) circle (1pt) node[above left=2pt]{$\xtext- i$};
%\fill(0, -1 cm) circle (1pt) node[above left=2pt] {$-i$};
%\foreach\x/\xtext in {-2, -1, 1, 2}
%\fill(\x cm, 2 cm) circle (1pt) node[above left=2pt]{$\xtext+ 2i$};
%\fill(0, 2 cm) circle (1pt) node[above left=2pt] {$2i$};
%\foreach\x/\xtext in {-2, -1, 1, 2}
%\fill(\x cm, -2 cm) circle (1pt) node[above left=2pt]{$\xtext- 2i$};
%\fill(0, -2 cm) circle (1pt) node[above left=2pt] {$-2i$};
%\end{tikzpicture}}}%
%BeginExpansion
\begin{tikzpicture}[baseline, scale=2.5]
\draw[step=1cm,gray,very thin] (-2.4,-2.4) grid (2.4,2.4);
\draw[->] (-2.5,0) -- (2.5,0);
\draw[->] (0,-2.5) -- (0,2.5);
\draw(0,0) circle [radius=1cm];
\foreach\x/\xtext in {-2, -1, 0, 1, 2}
\fill(\x cm, 0) circle (1pt) node[above left=2pt]{$\xtext$};
\foreach\x/\xtext in {-2, -1, 1, 2}
\fill(\x cm, 1 cm) circle (1pt) node[above left=2pt]{$\xtext+ i$};
\fill(0, 1 cm) circle (1pt) node[above left=2pt] {$i$};
\foreach\x/\xtext in {-2, -1, 1, 2}
\fill(\x cm, -1 cm) circle (1pt) node[above left=2pt]{$\xtext- i$};
\fill(0, -1 cm) circle (1pt) node[above left=2pt] {$-i$};
\foreach\x/\xtext in {-2, -1, 1, 2}
\fill(\x cm, 2 cm) circle (1pt) node[above left=2pt]{$\xtext+ 2i$};
\fill(0, 2 cm) circle (1pt) node[above left=2pt] {$2i$};
\foreach\x/\xtext in {-2, -1, 1, 2}
\fill(\x cm, -2 cm) circle (1pt) node[above left=2pt]{$\xtext- 2i$};
\fill(0, -2 cm) circle (1pt) node[above left=2pt] {$-2i$};
\end{tikzpicture}%
%EndExpansion
\ \ \ \ \ \label{eq.CC.CC.argand.fig2}%
\end{equation}
(as well as the unit circle, which passes through the four points labeled
$1,i,-1,-i$; we will encounter these four points rather often in the following).

This identification of complex numbers with points is called
\href{https://en.wikipedia.org/wiki/Complex_plane}{the \textit{Argand diagram}
or the \textit{complex plane}} (although the latter word has yet another,
different meaning). The complex number $0$ corresponds to the origin $\left(
0,0\right)  $ of the plane.

In Definition \ref{def.CC.CC} \textbf{(e)}, we have introduced three
operations on complex numbers; what do they mean geometrically for the
corresponding points? The two operations $+$ and $-$ are easiest to
understand: They are exactly the usual operations of addition and subtraction
for vectors. Thus, if $\alpha$ and $\beta$ are two complex numbers, then the
points labeled by the four complex numbers $0$, $\alpha$, $\alpha+\beta$ and
$\beta$ form a parallelogram:%
\[
\begin{tikzpicture}[scale=2.5]
\draw[step=1cm,gray,very thin] (-0.5, -0.5) grid (2.4,2.4);
\draw[->] (-0.6,0) -- (2.5,0);
\draw[->] (0,-0.6) -- (0,2.5);
\node (a) at (1.2 cm, 0.6 cm) {};
\node (b) at (0.5 cm, 1.5 cm) {};
\node (ab) at (1.7 cm, 2.1 cm) {};
\node (o) at (0 cm, 0 cm) {};
\fill (a) circle (1pt) node[below right] {$\alpha$};
\fill (b) circle (1pt) node[above left] {$\beta$};
\fill (ab) circle (1pt) node[above left] {$\alpha+\beta$};
\fill (o) circle (1pt) node[above left] {$0$};
\draw[very thick, blue] (a) -- (ab);
\draw[very thick, blue] (o) -- (b);
\draw[very thick, red] (b) -- (ab);
\draw[very thick, red] (o) -- (a);
\end{tikzpicture}
.
\]
Likewise, the points labeled by the four complex numbers $0$, $\alpha$,
$\beta$ and $\beta-\alpha$ form a parallelogram. These parallelograms can be
degenerate; in particular, the point $-\alpha$ is the reflection of the point
$\alpha$ through the origin:\footnote{We no longer say \textquotedblleft the
point labeled by $\alpha$\textquotedblright, but simply equate $\alpha$ with
that point now.}%
\[
\begin{tikzpicture}[scale=2.5]
\draw[step=1cm,gray,very thin] (-1.2, -1.2) grid (1.2, 1.2);
\draw[->] (-1.3,0) -- (1.3,0);
\draw[->] (0,-1.3) -- (0,1.3);
\node (a) at (0.4 cm, 0.6 cm) {};
\node (ma) at (-0.4 cm, -0.6 cm) {};
\node (o) at (0 cm, 0 cm) {};
\fill (a) circle (1pt) node[below right] {$\alpha$};
\fill (ma) circle (1pt) node[above left] {$-\alpha$};
\fill (o) circle (1pt) node[above left] {$0$};
\draw[very thick, blue] (a) -- (o);
\draw[very thick, blue] (o) -- (ma);
\end{tikzpicture}
.
\]


Multiplication is less evident. The easiest case is multiplying by $i$: If
$\alpha$ is a complex number, then the point $i\alpha$ is obtained from the
point $\alpha$ by a $90^{\circ}$ rotation (counterclockwise) around the
origin. Thus, the four points $\alpha$, $i\alpha$, $-\alpha$ and $-i\alpha$
are the vertices of a square centered at the origin:%
\[
\begin{tikzpicture}[scale=2.5]
\draw[step=1cm,gray,very thin] (-1.2, -1.2) grid (1.2, 1.2);
\draw[->] (-1.3,0) -- (1.3,0);
\draw[->] (0,-1.3) -- (0,1.3);
\node (a) at (0.4 cm, 0.6 cm) {};
\node (ma) at (-0.4 cm, -0.6 cm) {};
\node (ia) at (-0.6 cm, 0.4 cm) {};
\node (mia) at (0.6 cm, -0.4 cm) {};
\node (o) at (0 cm, 0 cm) {};
\fill (a) circle (1pt) node[below right] {$\alpha$};
\fill (ma) circle (1pt) node[above left] {$-\alpha$};
\fill (ia) circle (1pt) node[above left] {$i\alpha$};
\fill (mia) circle (1pt) node[above left] {$-i\alpha$};
\fill (o) circle (1pt) node[above left] {$0$};
\draw[very thick, red] (a) -- (ia);
\draw[very thick, red] (ia) -- (ma);
\draw[very thick, red] (ma) -- (mia);
\draw[very thick, red] (mia) -- (a);
\end{tikzpicture}.
\]


More generally, if $\beta$ is a complex number, then multiplication by $\beta$
(that is, the map $\mathbb{C}\rightarrow\mathbb{C},\ \alpha\mapsto\alpha\beta
$) is a similitude transformation (so it preserves angles and ratios of
lengths); more precisely it is a rotation around the origin composed with a
homothety from the origin. Combined with the fact that it sends $1$ to $\beta
$, this uniquely determines it.

This is just the beginning of a rather helpful dictionary between elementary
plane geometry and the algebra of complex numbers. See \cite{AndAnd14} for
many applications of this point of view, particularly to proving results in
plane geometry.

\subsubsection{Norms and conjugates}

Let us now define some further features of complex numbers.

\begin{definition}
\label{def.CC.norm.norm}Let $\alpha=\left(  a,b\right)  $ be a complex number.

The \textit{norm} of $\alpha$ is defined to be the real number $a^{2}+b^{2}%
\in\mathbb{R}$. This norm is called $\operatorname*{N}\left(  \alpha\right)  $.
\end{definition}

\begin{proposition}
\label{prop.CC.norm.basics}Let $\alpha$ be a complex number.

\textbf{(a)} We have $\operatorname*{N}\left(  \alpha\right)  \geq0$.

\textbf{(b)} We have $\operatorname*{N}\left(  \alpha\right)  =0$ if and only
if $\alpha=0$.

\textbf{(c)} If $\alpha\neq0$, then $\operatorname*{N}\left(  \alpha\right)
>0$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.CC.norm.basics}.]Write the complex number
$\alpha$ in the form $\alpha=\left(  a,b\right)  $ for two real numbers $a$
and $b$. Then, $\operatorname*{N}\left(  \alpha\right)  =a^{2}+b^{2}$ (by the
definition of the norm). But $a^{2}$ and $b^{2}$ are squares of real numbers
and thus $\geq0$ (since a square of a real number is always $\geq0$). Hence,
$\operatorname*{N}\left(  \alpha\right)  =\underbrace{a^{2}}_{\geq
0}+\underbrace{b^{2}}_{\geq0}\geq0$. This proves Proposition
\ref{prop.CC.norm.basics} \textbf{(a)}.

\textbf{(b)} We know that $a^{2}$ and $b^{2}$ are $\geq0$. In other words,
$a^{2}$ and $b^{2}$ are two nonnegative reals. But the sum of two nonnegative
reals is $0$ if and only if both of these reals are $0$. Applying this to the
two nonnegative reals $a^{2}$ and $b^{2}$, we conclude that $a^{2}+b^{2}=0$ if
and only if both $a^{2}$ and $b^{2}$ are $0$. In other words, we have the
logical equivalence $\left(  a^{2}+b^{2}=0\right)  \ \Longleftrightarrow
\ \left(  \text{both }a^{2}\text{ and }b^{2}\text{ are }0\right)  $.

Now, we have the following chain of equivalences:%
\begin{align*}
\left(  \operatorname*{N}\left(  \alpha\right)  =0\right)  \  &
\Longleftrightarrow\ \left(  a^{2}+b^{2}=0\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }\operatorname*{N}\left(  \alpha\right)  =a^{2}+b^{2}\right) \\
&  \Longleftrightarrow\ \left(  \text{both }a^{2}\text{ and }b^{2}\text{ are
}0\right) \\
&  \Longleftrightarrow\ \left(  a^{2}=0\text{ and }b^{2}=0\right)
\ \Longleftrightarrow\ \left(  a=0\text{ and }b=0\right) \\
&  \Longleftrightarrow\ \left(  \underbrace{\left(  a,b\right)  }_{=\alpha
}=\underbrace{\left(  0,0\right)  }_{=0_{\mathbb{C}}}\right)
\ \Longleftrightarrow\ \left(  \alpha=0_{\mathbb{C}}\right)
\ \Longleftrightarrow\ \left(  \alpha=0\right)  .
\end{align*}
This proves Proposition \ref{prop.CC.norm.basics} \textbf{(b)}.

\textbf{(c)} Assume that $\alpha\neq0$. But Proposition
\ref{prop.CC.norm.basics} \textbf{(b)} shows that we have $\operatorname*{N}%
\left(  \alpha\right)  =0$ if and only if $\alpha=0$. Hence, we have
$\operatorname*{N}\left(  \alpha\right)  \neq0$ (since $\alpha\neq0$).
Combining this with $\operatorname*{N}\left(  \alpha\right)  \geq0$, we obtain
$\operatorname*{N}\left(  \alpha\right)  >0$. This proves Proposition
\ref{prop.CC.norm.basics} \textbf{(c)}.
\end{proof}

\begin{proposition}
\label{prop.CC.norm.aa}Let $a\in\mathbb{R}$. Then, $\operatorname*{N}\left(
a_{\mathbb{C}}\right)  =a^{2}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.CC.norm.aa}.]We have $a_{\mathbb{C}}=\left(
a,0\right)  $ (by the definition of $a_{\mathbb{C}}$). Hence, the definition
of the norm yields $\operatorname*{N}\left(  a_{\mathbb{C}}\right)
=a^{2}+0^{2}=a^{2}$. This proves Proposition \ref{prop.CC.norm.aa}.
\end{proof}

\begin{definition}
\label{def.CC.conj.conj}Let $\alpha=\left(  a,b\right)  \in\mathbb{C}$.

The \textit{conjugate} $\overline{\alpha}$ of $\alpha$ is defined to be the
complex number $\left(  a,-b\right)  \in\mathbb{C}$.
\end{definition}

From the viewpoint of the Argand diagram, the conjugate $\overline{\alpha}$ of
a complex number $\alpha$ is simply the result of reflecting $\alpha$ (or, to
be pedantic, the point labeled by $\alpha$) across the x-axis:%
\[
\begin{tikzpicture}[scale=2.5]
\draw[step=1cm,gray,very thin] (-1.2, -1.2) grid (1.2, 1.2);
\draw[->] (-1.3,0) -- (1.3,0);
\draw[->] (0,-1.3) -- (0,1.3);
\node (a) at (0.3 cm, 0.6 cm) {};
\node (ca) at (0.3 cm, -0.6 cm) {};
\node (o) at (0 cm, 0 cm) {};
\fill (a) circle (1pt) node[below right] {$\alpha$};
\fill (ca) circle (1pt) node[above right] {$\overline{\alpha}$};
\fill (o) circle (1pt) node[above left] {$0$};
\draw[very thick, blue] (o) -- (a);
\draw[very thick, blue] (o) -- (ca);
\end{tikzpicture}
.
\]
Thus, the following is completely self-evident:

\begin{proposition}
\label{prop.CC.conj.conjconj}Let $\alpha\in\mathbb{C}$.

\textbf{(a)} We have $\alpha=\overline{\alpha}$ if and only if $\alpha
\in\mathbb{R}$. (Keep in mind that we are following Convention
\ref{conv.CC.RRtoCC.embed}, so that the statement \textquotedblleft$\alpha
\in\mathbb{R}$\textquotedblright\ (for a complex number $\alpha$) actually
means \textquotedblleft$\alpha=r_{\mathbb{C}}$ for some $r\in\mathbb{R}%
$\textquotedblright.)

\textbf{(b)} We always have $\overline{\overline{\alpha}}=\alpha$.
\end{proposition}

Since we don't want to depend on geometric reasoning, let us nevertheless
prove this fact algebraically:

\begin{proof}
[Proof of Proposition \ref{prop.CC.conj.conjconj}.]Write the complex number
$\alpha$ in the form $\alpha=\left(  a,b\right)  $ for two real numbers $a$
and $b$. Then, $\overline{\alpha}=\left(  a,-b\right)  $ (by the definition of
$\overline{\alpha}$). Hence, the definition of $\overline{\overline{\alpha}}$
yields $\overline{\overline{\alpha}}=\left(  a,\underbrace{-\left(  -b\right)
}_{=b}\right)  =\left(  a,b\right)  =\alpha$. This proves Proposition
\ref{prop.CC.conj.conjconj} \textbf{(b)}.

\textbf{(a)} $\Longleftarrow:$ Assume that $\alpha\in\mathbb{R}$. We must
prove that $\alpha=\overline{\alpha}$.

We have $\alpha\in\mathbb{R}$. In other words, there exists an $r\in
\mathbb{R}$ such that $\alpha=r_{\mathbb{C}}$. Consider this $r$. We have
$\alpha=r_{\mathbb{C}}=\left(  r,0\right)  $ (by the definition of
$r_{\mathbb{C}}$). Hence, the definition of $\overline{\alpha}$ yields
$\overline{\alpha}=\left(  r,\underbrace{-0}_{=0}\right)  =\left(  r,0\right)
=\alpha$. Thus, $\alpha=\overline{\alpha}$. This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Proposition
\ref{prop.CC.conj.conjconj} \textbf{(a)}.

$\Longrightarrow:$ Assume that $\alpha=\overline{\alpha}$. We must prove that
$\alpha\in\mathbb{R}$.

We have $\alpha=\overline{\alpha}$. Thus, $\left(  a,b\right)  =\alpha
=\overline{\alpha}=\left(  a,-b\right)  $. In other words, $a=a$ and $b=-b$.
From $b=-b$, we obtain $2b=0$, thus $b=0$. Hence, $\alpha=\left(
a,\underbrace{b}_{=0}\right)  =\left(  a,0\right)  =a_{\mathbb{C}}$ (since
$a_{\mathbb{C}}$ is defined to be $\left(  a,0\right)  $). Thus, there exists
an $r\in\mathbb{R}$ such that $\alpha=r_{\mathbb{C}}$ (namely, $r=a$). In
other words, $\alpha\in\mathbb{R}$. This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Proposition
\ref{prop.CC.conj.conjconj} \textbf{(a)}.
\end{proof}

\begin{proposition}
\label{prop.CC.norm.conj}Let $\alpha\in\mathbb{C}$.

\textbf{(a)} We have $\operatorname*{N}\left(  \alpha\right)  =\alpha
\overline{\alpha}$ (or, more formally: $\left(  \operatorname*{N}\left(
\alpha\right)  \right)  _{\mathbb{C}}=\alpha\overline{\alpha}$).

\textbf{(b)} We have $\operatorname*{N}\left(  \overline{\alpha}\right)
=\operatorname*{N}\left(  \alpha\right)  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.CC.norm.conj}.]Write the complex number
$\alpha$ in the form $\alpha=\left(  a,b\right)  $ for two real numbers $a$
and $b$. Then, $\overline{\alpha}=\left(  a,-b\right)  $ (by the definition of
$\overline{\alpha}$) and $\operatorname*{N}\left(  \alpha\right)  =a^{2}%
+b^{2}$ (by the definition of $\operatorname*{N}\left(  \alpha\right)  $).

\textbf{(a)} Multiplying the equalities $\alpha=\left(  a,b\right)  $ and
$\overline{\alpha}=\left(  a,-b\right)  $, we obtain%
\begin{align*}
\alpha\overline{\alpha}  &  =\left(  a,b\right)  \left(  a,-b\right)  =\left(
\underbrace{aa-b\left(  -b\right)  }_{=a^{2}+b^{2}},\underbrace{a\left(
-b\right)  +ba}_{=0}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the operation }%
\cdot\text{ on }\mathbb{C}\right) \\
&  =\left(  \underbrace{a^{2}+b^{2}}_{=\operatorname*{N}\left(  \alpha\right)
},0\right)  =\left(  \operatorname*{N}\left(  \alpha\right)  ,0\right)
=\left(  \operatorname*{N}\left(  \alpha\right)  \right)  _{\mathbb{C}}%
\end{align*}
(since $\operatorname*{N}\left(  \alpha\right)  _{\mathbb{C}}$ is defined to
be $\left(  \operatorname*{N}\left(  \alpha\right)  ,0\right)  $). In other
words, $\left(  \operatorname*{N}\left(  \alpha\right)  \right)  _{\mathbb{C}%
}=\alpha\overline{\alpha}$. According to Convention \ref{conv.CC.RRtoCC.embed}%
, we are equating the real number $\operatorname*{N}\left(  \alpha\right)  $
with the complex number $\left(  \operatorname*{N}\left(  \alpha\right)
\right)  _{\mathbb{C}}$; hence, this equality rewrites as $\operatorname*{N}%
\left(  \alpha\right)  =\alpha\overline{\alpha}$. This proves Proposition
\ref{prop.CC.norm.conj} \textbf{(a)}.

\textbf{(b)} Recall that $\overline{\alpha}=\left(  a,-b\right)  $. Thus, the
definition of $\operatorname*{N}\left(  \overline{\alpha}\right)  $ yields
$\operatorname*{N}\left(  \overline{\alpha}\right)  =a^{2}+\underbrace{\left(
-b\right)  ^{2}}_{=b^{2}}=a^{2}+b^{2}=\operatorname*{N}\left(  \alpha\right)
$. This proves Proposition \ref{prop.CC.norm.conj} \textbf{(b)}.
\end{proof}

\begin{teachingnote}
\textbf{2019-03-04 lecture}
\end{teachingnote}

\begin{proposition}
\label{prop.CC.conj.hom}Let $\alpha$ and $\beta$ be two complex numbers. Then:

\textbf{(a)} We have $\overline{\alpha+\beta}=\overline{\alpha}+\overline
{\beta}$.

\textbf{(b)} We have $\overline{\alpha-\beta}=\overline{\alpha}-\overline
{\beta}$.

\textbf{(c)} We have $\overline{\alpha\cdot\beta}=\overline{\alpha}%
\cdot\overline{\beta}$.

\textbf{(d)} We have $\operatorname*{N}\left(  \alpha\beta\right)
=\operatorname*{N}\left(  \alpha\right)  \cdot\operatorname*{N}\left(
\beta\right)  $.

\textbf{(e)} If $\beta\neq0$, then $\operatorname*{N}\left(  \dfrac{\alpha
}{\beta}\right)  =\dfrac{\operatorname*{N}\left(  \alpha\right)
}{\operatorname*{N}\left(  \beta\right)  }$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.CC.conj.hom}.]Write the complex number
$\alpha$ in the form $\alpha=\left(  a,b\right)  $ for two real numbers $a$
and $b$. Then, $\overline{\alpha}=\left(  a,-b\right)  $ (by the definition of
$\overline{\alpha}$) and $\operatorname*{N}\left(  \alpha\right)  =a^{2}%
+b^{2}$ (by the definition of $\operatorname*{N}\left(  \alpha\right)  $).

Write the complex number $\beta$ in the form $\beta=\left(  c,d\right)  $ for
two real numbers $c$ and $d$. Then, $\overline{\beta}=\left(  c,-d\right)  $
(by the definition of $\overline{\beta}$) and $\operatorname*{N}\left(
\beta\right)  =c^{2}+d^{2}$ (by the definition of $\operatorname*{N}\left(
\beta\right)  $).

\textbf{(c)} Multiplying the equalities $\alpha=\left(  a,b\right)  $ and
$\beta=\left(  c,d\right)  $, we obtain $\alpha\cdot\beta=\left(  a,b\right)
\left(  c,d\right)  =\left(  ac-bd,ad+bc\right)  $ (by the definition of the
operation $\cdot$ on $\mathbb{C}$). Hence, Definition \ref{def.CC.conj.conj}
yields $\overline{\alpha\cdot\beta}=\left(  ac-bd,-\left(  ad+bc\right)
\right)  $.

On the other hand, multiplying the equalities $\overline{\alpha}=\left(
a,-b\right)  $ and $\overline{\beta}=\left(  c,-d\right)  $ yields%
\[
\overline{\alpha}\cdot\overline{\beta}=\left(  \underbrace{ac-\left(
-b\right)  \left(  -d\right)  }_{=ac-bd},\underbrace{a\left(  -d\right)
+b\left(  -c\right)  }_{=-\left(  ad+bc\right)  }\right)  =\left(
ac-bd,-\left(  ad+bc\right)  \right)
\]
(by the definition of the operation $\cdot$ on $\mathbb{C}$). Comparing this
with \newline$\overline{\alpha\cdot\beta}=\left(  ac-bd,-\left(  ad+bc\right)
\right)  $, we obtain $\overline{\alpha\cdot\beta}=\overline{\alpha}%
\cdot\overline{\beta}$. This proves Proposition \ref{prop.CC.conj.hom}
\textbf{(c)}.

Parts \textbf{(a)} and \textbf{(b)} of Proposition \ref{prop.CC.conj.hom}
follow by similar (but easier) computations.

\textbf{(d)} Proposition \ref{prop.CC.norm.conj} \textbf{(a)} yields
$\operatorname*{N}\left(  \alpha\right)  =\alpha\overline{\alpha}$. Similarly,
$\operatorname*{N}\left(  \beta\right)  =\beta\overline{\beta}$ and
$\operatorname*{N}\left(  \alpha\beta\right)  =\alpha\beta\overline
{\alpha\beta}$. Hence,%
\[
\operatorname*{N}\left(  \alpha\beta\right)  =\alpha\beta\underbrace{\overline
{\alpha\beta}}_{\substack{=\overline{\alpha\cdot\beta}=\overline{\alpha}%
\cdot\overline{\beta}\\\text{(by Proposition \ref{prop.CC.conj.hom}
\textbf{(c)})}}}=\alpha\beta\overline{\alpha}\cdot\overline{\beta
}=\underbrace{\left(  \alpha\overline{\alpha}\right)  }_{=\operatorname*{N}%
\left(  \alpha\right)  }\cdot\underbrace{\left(  \beta\overline{\beta}\right)
}_{=\operatorname*{N}\left(  \beta\right)  }=\operatorname*{N}\left(
\alpha\right)  \cdot\operatorname*{N}\left(  \beta\right)  .
\]
This proves Proposition \ref{prop.CC.conj.hom} \textbf{(d)}.

\textbf{(e)} Assume that $\beta\neq0$. Thus, the quotient $\dfrac{\alpha
}{\beta}\in\mathbb{C}$ is defined (by Definition
\ref{def.CC.CC.division.notations} \textbf{(a)}). Proposition
\ref{prop.CC.conj.hom} \textbf{(d)} (applied to $\dfrac{\alpha}{\beta}$
instead of $\alpha$) yields $\operatorname*{N}\left(  \dfrac{\alpha}{\beta
}\cdot\beta\right)  =\operatorname*{N}\left(  \dfrac{\alpha}{\beta}\right)
\cdot\operatorname*{N}\left(  \beta\right)  $. In view of $\dfrac{\alpha
}{\beta}\cdot\beta=\alpha$, this rewrites as
\begin{equation}
\operatorname*{N}\left(  \alpha\right)  =\operatorname*{N}\left(
\dfrac{\alpha}{\beta}\right)  \cdot\operatorname*{N}\left(  \beta\right)  .
\label{pf.prop.CC.conj.hom.e.1}%
\end{equation}
Also, Proposition \ref{prop.CC.norm.basics} \textbf{(c)} (applied to $\beta$
instead of $\alpha$) yields that we have $\operatorname*{N}\left(
\beta\right)  >0$ (since $\beta\neq0$); thus, $\operatorname*{N}\left(
\beta\right)  \neq0$. Thus, we can divide both sides of the equality
(\ref{pf.prop.CC.conj.hom.e.1}) by $\operatorname*{N}\left(  \beta\right)  $.
We thus obtain $\dfrac{\operatorname*{N}\left(  \alpha\right)  }%
{\operatorname*{N}\left(  \beta\right)  }=\operatorname*{N}\left(
\dfrac{\alpha}{\beta}\right)  $. Proposition \ref{prop.CC.conj.hom}
\textbf{(e)} follows.
\end{proof}

The properties of the norm of a complex numbers let us see an old fact in new
light: Remember the Brahmagupta--Fibonacci identity
(\ref{eq.intro.sum-of-2sq.sum*sum}), which said that%
\[
\left(  a^{2}+b^{2}\right)  \left(  c^{2}+d^{2}\right)  =\left(  ad+bc\right)
^{2}+\left(  ac-bd\right)  ^{2}%
\]
for $a,b,c,d\in\mathbb{R}$. This identity is equivalent to the identity%
\[
\operatorname*{N}\left(  \alpha\right)  \cdot\operatorname*{N}\left(
\beta\right)  =\operatorname*{N}\left(  \alpha\beta\right)
\]
for the complex numbers $\alpha=\left(  a,b\right)  =a+bi$ and $\beta=\left(
c,d\right)  =c+di$. Thus, the identity (\ref{eq.intro.sum-of-2sq.sum*sum}) is
just Proposition \ref{prop.CC.conj.hom} \textbf{(d)}, restated without the use
of complex numbers. This answers the question of how you could have come up
with this identity -- at least if you know complex numbers. (Brahmagupta must
have found it in a different way, since complex numbers were not known to him.)

\begin{corollary}
\label{cor.CC.norm.pow}Let $\alpha\in\mathbb{C}$ and $k\in\mathbb{N}$. Then:

\textbf{(a)} We have $\overline{\alpha^{k}}=\overline{\alpha}^{k}$.

\textbf{(b)} We have $\operatorname*{N}\left(  \alpha^{k}\right)  =\left(
\operatorname*{N}\left(  \alpha\right)  \right)  ^{k}$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.CC.norm.pow}.]\textbf{(a)} This follows by
induction on $k$, using Proposition \ref{prop.CC.conj.hom} \textbf{(c)} and
the fact that $\overline{1}=1$.

\textbf{(b)} This follows by induction on $k$, using Proposition
\ref{prop.CC.conj.hom} \textbf{(d)} and the fact that $\operatorname*{N}%
\left(  1\right)  =1$.
\end{proof}

Using the norm of a complex number, we can define a notion of absolute value
of a complex number:

\begin{definition}
\label{def.CC.norm.abs}Let $\alpha=\left(  a,b\right)  $ be a complex number.
The \textit{absolute value} (or \textit{modulus} or \textit{length}) of
$\alpha$ is defined to be $\sqrt{\operatorname*{N}\left(  \alpha\right)
}=\sqrt{a^{2}+b^{2}}\in\mathbb{R}$. (This is well-defined, because Proposition
\ref{prop.CC.norm.basics} \textbf{(a)} shows that $\operatorname*{N}\left(
\alpha\right)  \geq0$.)

The absolute value of $\alpha$ is denoted by $\left\vert \alpha\right\vert $.
(This notation does not conflict with the classical notation $\left\vert
a\right\vert $ for the absolute value of a real number $a$, because if $a$ is
a real number, then Proposition \ref{prop.CC.norm.aa} yields
$\operatorname*{N}\left(  a_{\mathbb{C}}\right)  =a^{2}$ and therefore
$\sqrt{\operatorname*{N}\left(  a_{\mathbb{C}}\right)  }=\sqrt{a^{2}%
}=\left\vert a\right\vert $, where \textquotedblleft$\left\vert a\right\vert
$\textquotedblright\ means the classical concept of absolute value of $a$.)
\end{definition}

In the Argand diagram, the absolute value $\left\vert \alpha\right\vert $ of a
complex number $\alpha$ is simply the distance of $\alpha$ from the origin.
The reason for this is the Pythagorean theorem:%

\[
\begin{tikzpicture}[scale=2.5]
\draw[step=1cm,gray,very thin] (-0.5, -0.5) grid (2.4,2.4);
\draw[->] (-0.6,0) -- (2.5,0);
\draw[->] (0,-0.6) -- (0,2.5);
\node (p) at (1.3 cm, 1.7 cm) {};
\node (o) at (0 cm, 0 cm) {};
\node (xproj) at (1.3 cm, 0 cm) {};
\fill (p) circle (1pt) node[above right] {$\alpha = a+bi$};
\fill (xproj) circle (1pt);
\fill (o) circle (1pt);
\draw[very thick, blue] (p) -- node[right=1pt, fill=white] {$b$} (xproj);
\draw[very thick, red] (xproj) -- node[below=1pt, fill=white] {$a$} (o);
\draw[very thick, green!50!black] (o) --node[above left=1pt, fill=white] {$\left|\alpha\right| = \sqrt{a^2 + b^2}$} (p);
\end{tikzpicture}
.
\]


Good references for the basic properties of complex numbers are
\cite{LaNaSc16} and \cite[\S 3.9--\S 3.12]{Swanso18}. The book \cite{AndAnd14}
is a treasure trove of applications and exercises.

\subsubsection{$\operatorname*{Re}$, $\operatorname*{Im}$ and the $2\times
2$-matrix representation}

We define some more attributes of a complex number.

\begin{definition}
\label{def.CC.ReIm}Let $\alpha=\left(  a,b\right)  $ be a complex number (so
that $a$ and $b$ are real numbers and $\alpha=a+bi$).

Then, $a$ is called the \textit{real part} of $\alpha$ and denoted
$\operatorname*{Re}\alpha$ (or $\mathfrak{R}\alpha$).

Also, $b$ is called the \textit{imaginary part} of $\alpha$ and denoted
$\operatorname*{Im}\alpha$ (or $\mathfrak{I}\alpha$).
\end{definition}

The following proposition assigns a real $2\times2$-matrix to each complex number:

\begin{proposition}
\label{prop.CC.as-matrices.mu}Let $\mathbb{R}^{2\times2}$ be the set of all
$2\times2$-matrices with real entries.

Define a map $\mu:\mathbb{C}\rightarrow\mathbb{R}^{2\times2}$ by setting%
\[
\mu\left(  a,b\right)  =\left(
\begin{array}
[c]{cc}%
a & b\\
-b & a
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{for each }\left(  a,b\right)  \in
\mathbb{C}.
\]


\textbf{(a)} We have $\mu\left(  \alpha+\beta\right)  =\mu\left(
\alpha\right)  +\mu\left(  \beta\right)  $ for all $\alpha,\beta\in\mathbb{C}$.

\textbf{(b)} We have $\mu\left(  \alpha-\beta\right)  =\mu\left(
\alpha\right)  -\mu\left(  \beta\right)  $ for all $\alpha,\beta\in\mathbb{C}$.

\textbf{(c)} We have $\mu\left(  \alpha\cdot\beta\right)  =\mu\left(
\alpha\right)  \cdot\mu\left(  \beta\right)  $ for all $\alpha,\beta
\in\mathbb{C}$.

\textbf{(d)} The map $\mu$ is injective.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.CC.as-matrices.mu}.]\textbf{(c)} This is a
straightforward computation: Let $\alpha,\beta\in\mathbb{C}$. Write the
complex number $\alpha$ in the form $\alpha=\left(  a,b\right)  $ for two real
numbers $a$ and $b$. Write the complex number $\beta$ in the form
$\beta=\left(  c,d\right)  $ for two real numbers $c$ and $d$. Multiplying the
equalities $\alpha=\left(  a,b\right)  $ and $\beta=\left(  c,d\right)  $, we
obtain%
\[
\alpha\cdot\beta=\left(  a,b\right)  \cdot\left(  c,d\right)  =\left(
ac-bd,ad+bc\right)
\]
(by the definition of $\cdot$). Hence,
\begin{equation}
\mu\left(  \alpha\cdot\beta\right)  =\mu\left(  ac-bd,ad+bc\right)  =\left(
\begin{array}
[c]{cc}%
ac-bd & ad+bc\\
-\left(  ad+bc\right)  & ac-bd
\end{array}
\right)  \label{pf.prop.CC.as-matrices.mu.c.1}%
\end{equation}
(by the definition of $\mu$). On the other hand, from $\alpha=\left(
a,b\right)  $, we obtain%
\[
\mu\left(  \alpha\right)  =\mu\left(  a,b\right)  =\left(
\begin{array}
[c]{cc}%
a & b\\
-b & a
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\mu\right)
,
\]
and similarly we can find%
\[
\mu\left(  \beta\right)  =\left(
\begin{array}
[c]{cc}%
c & d\\
-d & c
\end{array}
\right)  .
\]
Multiplying these two equalities together, we find%
\begin{align*}
\mu\left(  \alpha\right)  \cdot\mu\left(  \beta\right)   &  =\left(
\begin{array}
[c]{cc}%
a & b\\
-b & a
\end{array}
\right)  \cdot\left(
\begin{array}
[c]{cc}%
c & d\\
-d & c
\end{array}
\right)  =\left(
\begin{array}
[c]{cc}%
ac+b\left(  -d\right)  & ad+bc\\
\left(  -b\right)  c+a\left(  -d\right)  & \left(  -b\right)  d+ac
\end{array}
\right) \\
&  =\left(
\begin{array}
[c]{cc}%
ac-bd & ad+bc\\
-\left(  ad+bc\right)  & ac-bd
\end{array}
\right)  .
\end{align*}
Comparing this with (\ref{pf.prop.CC.as-matrices.mu.c.1}), we find $\mu\left(
\alpha\cdot\beta\right)  =\mu\left(  \alpha\right)  \cdot\mu\left(
\beta\right)  $. This proves Proposition \ref{prop.CC.as-matrices.mu}
\textbf{(c)}.

Similar (but much simpler) computations prove parts \textbf{(a)} and
\textbf{(b)} of Proposition \ref{prop.CC.as-matrices.mu}.

\textbf{(d)} We need to show that a complex number $\alpha$ can always be
recovered from its image $\mu\left(  \alpha\right)  $.

But this is easy: If $\alpha=\left(  a,b\right)  $ is a complex number, then
$\mu\left(  \alpha\right)  =\mu\left(  a,b\right)  =\left(
\begin{array}
[c]{cc}%
a & b\\
-b & a
\end{array}
\right)  $ (by the definition of $\mu$), and therefore we can recover $a$ and
$b$ from $\mu\left(  \alpha\right)  $ (namely, $a$ and $b$ are the two entries
of the first row of the matrix $\mu\left(  \alpha\right)  $). Hence, we can
recover $\alpha$ from $\mu\left(  \alpha\right)  $. This shows that the map
$\mu$ is injective; this proves Proposition \ref{prop.CC.as-matrices.mu}
\textbf{(d)}.
\end{proof}

Proposition \ref{prop.CC.as-matrices.mu} really says that (instead of
regarding complex numbers as pairs of real numbers) we can regard complex
numbers as a specific kind of $2\times2$-matrices with real entries (by
identifying each complex number $\alpha$ with the matrix $\mu\left(
\alpha\right)  $). This viewpoint has the advantage that multiplication of
complex numbers becomes a particular case of matrix multiplication. (We could
have saved ourselves the trouble of proving the associativity of
multiplication for complex numbers if we had taken this viewpoint.)

\subsubsection{The fundamental theorem of algebra}

Finally, let me mention without proof the so-called \textit{Fundamental
Theorem of Algebra}:

\begin{theorem}
\label{thm.CC.FTA.factor}Let $p\left(  x\right)  $ be a polynomial of degree
$n$ with complex coefficients. Then, there exist complex numbers $\alpha
_{1},\alpha_{2},\ldots,\alpha_{n}$ and $\beta$ such that%
\[
p\left(  x\right)  =\beta\left(  x-\alpha_{1}\right)  \left(  x-\alpha
_{2}\right)  \cdots\left(  x-\alpha_{n}\right)  .
\]

\end{theorem}

In other words, any polynomial with complex coefficients can be factored into
linear factors. This is in contrast to real numbers, where polynomials can at
best be factored into linear and quadratic factors. (For example, the
polynomial $x^{2}+1$ cannot be factored further over the real numbers, but
factors as $\left(  x+i\right)  \left(  x-i\right)  $ over the complex numbers.)

The Fundamental Theorem of Algebra is not actually a theorem of algebra. It
relies heavily on the concepts of real and complex numbers. So it is actually
a theorem of analysis. For a proof, see \cite[Theorem 3.2.2]{LaNaSc16}.

\subsection{Gaussian integers}

Inside the set $\mathbb{C}$ of all complex numbers (an uncountable set) lies a
much smaller (countable) set of numbers, which are much closer to integers
than to real numbers. We shall study them partly for their own sake, partly as
an instructive example of what we will later call a commutative ring, and
partly in order to answer the questions from Section
\ref{sect.intro.sum-of-2sq} (although complex numbers were never mentioned in
that section).

We shall follow Keith Conrad's notes \cite{Conrad-Gauss} for most of this
section (but at the end we will go a bit further in order to answer Question
\ref{quest.intro.sum-of-2sq.2} \textbf{(b)}).

\subsubsection{Definitions and basics}

We shall now define the \textit{Gaussian integers}: a middle ground between
integers and complex numbers.

\begin{definition}
\label{def.Z[i].gauss.gauss}A \textit{Gaussian integer} is a complex number
$\left(  a,b\right)  $ with $a,b\in\mathbb{Z}$.
\end{definition}

For example, $3+5i=\left(  3,5\right)  $ and $3-7i=\left(  3,-7\right)  $ are
Gaussian integers. So are $0=\left(  0,0\right)  $, $1=\left(  1,0\right)  $
and $i=\left(  0,1\right)  $. Every integer is a Gaussian
integer\footnote{This relies on Convention \ref{conv.CC.RRtoCC.embed}, of
course. If we avoid this convention, then we should instead say that for every
integer $r$, the complex number $r_{\mathbb{C}}=\left(  r,0\right)  $ is a
Gaussian integer.}. But $\dfrac{1}{2}+3i=\left(  \dfrac{1}{2},3\right)  $ and
$\sqrt{2}+4i=\left(  \sqrt{2},4\right)  $ are not Gaussian integers.

Recall that in the Argand diagram, complex numbers correspond to points in the
Cartesian plane. The Gaussian integers thus correspond to a special type of
points -- the ones whose both coordinates are integers. These points are
called \textit{lattice points}, as they form the nodes of a square lattice
covering the plane. In the picture (\ref{eq.CC.CC.argand.fig2}), the $25$
marked points are precisely the lattice points (i.e., the Gaussian integers)
that happen to fall inside the region drawn.

\begin{remark}
In Definition \ref{def.Z[i].gauss.gauss}, we have defined Gaussian integers
using complex numbers. This can be viewed as somewhat of an overkill, as the
notion of complex numbers depends on the notion of real numbers, which are
mostly useless for Gaussian integers. Thus, one might ask for a different
definition of Gaussian integers -- one which relies only on integers and not
on real numbers.

Such a definition is easy to make: Just replace every appearance of real
numbers in Definition \ref{def.CC.CC} by integers! Thus, define the Gaussian
integers as pairs of two integers; let $\mathbb{C}_{\mathbb{Z}}$ be the set of
these pairs; denote the Gaussian integer $\left(  r,0\right)  $ by
$r_{\mathbb{C}}$ whenever $r$ is an integer; define the operations $+$, $-$
and $\cdot$ on the set $\mathbb{C}_{\mathbb{Z}}$ by the same formulas as in
Definition \ref{def.CC.CC} \textbf{(e)}; likewise, adapt the rest of
Definition \ref{def.CC.CC} to integers. Most of what we have done in Section
\ref{sect.CC.CC} can be straightforwardly adapted to this notion of Gaussian
integers (by making the obvious changes -- i.e., mostly, replacing real
numbers by integers); the main exceptions are the following:

\begin{itemize}
\item Not every nonzero Gaussian integer has an inverse (in the set of
Gaussian integers). (In fact, as we will soon see, the only Gaussian integers
that have inverses are $1,i,-1,-i$.) Thus, division and negative powers of
Gaussian integers are usually not defined (without leaving the set of Gaussian integers).

\item The absolute value $\left\vert \alpha\right\vert $ of a Gaussian integer
$\alpha$ will usually not be an integer (since it is defined as a square root).
\end{itemize}

This alternative definition of Gaussian integers is equivalent to Definition
\ref{def.Z[i].gauss.gauss}; we are using the latter mainly because it is shorter.

Likewise, we could have defined \textquotedblleft Gaussian
rationals\textquotedblright\ by adapting Definition \ref{def.CC.CC} to
rational (instead of real) numbers. Unlike the Gaussian integers, these
\textquotedblleft Gaussian rationals\textquotedblright\ do have inverses (when
they are nonzero), and thus division and negative powers are well-defined for them.
\end{remark}

\begin{definition}
\label{def.Z[i].gauss.Z[i]}We let $\mathbb{Z}\left[  i\right]  $ be the set of
all Gaussian integers.
\end{definition}

Elementary number theory concerns itself with integers (mostly). Our goal in
this section is to replicate as much as we can of this theory in the setting
of Gaussian integers, and then see how it can be applied back to answer some
questions about the usual integers.

We will try to use Greek letters for Gaussian integers and Roman letters for integers.

\begin{proposition}
\label{prop.Z[i].gauss.ring}\textbf{(a)} If $\alpha$ and $\beta$ are two
Gaussian integers, then $\alpha+\beta$, $\alpha-\beta$ and $\alpha\cdot\beta$
are Gaussian integers.

\textbf{(b)} If $\alpha$ is a Gaussian integer, then $-\alpha$ is a Gaussian integer.

\textbf{(c)} Sums and products of finitely many Gaussian integers are Gaussian integers.
\end{proposition}

\begin{proof}
[Proposition \ref{prop.Z[i].gauss.ring}.]\textbf{(a)} Let $\alpha$ and $\beta$
be two Gaussian integers. Write the complex numbers $\alpha$ and $\beta$ as
$\alpha=\left(  a,b\right)  $ and $\beta=\left(  c,d\right)  $, respectively
(with $a,b,c,d\in\mathbb{R}$). The definition of a Gaussian integer shows that
$a,b\in\mathbb{Z}$ (since $\left(  a,b\right)  =\alpha$ is a Gaussian integer)
and that $c,d\in\mathbb{Z}$ (since $\left(  c,d\right)  =\beta$ is a Gaussian
integer). Now,
\[
\underbrace{\alpha}_{=\left(  a,b\right)  }\cdot\underbrace{\beta}_{=\left(
c,d\right)  }=\left(  a,b\right)  \cdot\left(  c,d\right)  =\left(
ac-bd,ad+bc\right)
\]
(by the definition of the operation $\cdot$ on $\mathbb{C}$). Since
$ac-bd,ad+bc\in\mathbb{Z}$ (because $a,b,c,d\in\mathbb{Z}$), this entails that
$\alpha\cdot\beta$ is a Gaussian integer (by the definition of a Gaussian
integer). Similarly (using the definitions of the operations $+$ and $-$ on
$\mathbb{C}$), we can see that $\alpha+\beta$ and $\alpha-\beta$ are Gaussian
integers. This proves Proposition \ref{prop.Z[i].gauss.ring} \textbf{(a)}.

\textbf{(b)} Let $\alpha$ be a Gaussian integer. Recall that $0$ is a Gaussian
integer. Thus, Proposition \ref{prop.Z[i].gauss.ring} \textbf{(a)} (applied to
$0$ and $\alpha$ instead of $\alpha$ and $\beta$) yields that $0+\alpha$,
$0-\alpha$ and $0\cdot\alpha$ are Gaussian integers. Thus, in particular,
$0-\alpha$ is a Gaussian integer. In other words, $-\alpha$ is a Gaussian
integer (since $0-\alpha=-\alpha$). This proves Proposition
\ref{prop.Z[i].gauss.ring} \textbf{(b)}.

\textbf{(c)} This follows by induction. (The induction base relies on the fact
that $0$ and $1$ are Gaussian integers; the induction step uses Proposition
\ref{prop.Z[i].gauss.ring} \textbf{(a)}.)
\end{proof}

\begin{proposition}
\label{prop.Z[i].gauss.conj}Let $\alpha$ be a Gaussian integer. Then,
$\overline{\alpha}$ is a Gaussian integer.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.conj}.]Write the complex number
$\alpha$ as $\alpha=\left(  a,b\right)  $ with $a,b\in\mathbb{R}$. Then,
$a,b\in\mathbb{Z}$ (since $\alpha$ is a Gaussian integer). Hence,
$a,-b\in\mathbb{Z}$. Now, the definition of $\overline{\alpha}$ yields
$\overline{\alpha}=\left(  a,-b\right)  $. Hence, $\overline{\alpha}$ is a
Gaussian integer (since $a,-b\in\mathbb{Z}$). This proves Proposition
\ref{prop.Z[i].gauss.conj}.
\end{proof}

\begin{proposition}
\label{prop.Z[i].gauss.Norm-N}Let $\alpha\in\mathbb{Z}\left[  i\right]  $.
Then, $\operatorname*{N}\left(  \alpha\right)  \in\mathbb{N}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.Norm-N}.]Write the complex number
$\alpha$ as $\alpha=\left(  a,b\right)  $ with $a,b\in\mathbb{R}$. Then,
$a,b\in\mathbb{Z}$ (since $\alpha$ is a Gaussian integer). In other words, $a$
and $b$ are integers. Hence, $a^{2}$ and $b^{2}$ are nonnegative integers
(since the square of an integer is always a nonnegative integer). In other
words, $a^{2},b^{2}\in\mathbb{N}$. Hence, $a^{2}+b^{2}\in\mathbb{N}$. But the
definition of $\operatorname*{N}\left(  \alpha\right)  $ yields
$\operatorname*{N}\left(  \alpha\right)  =a^{2}+b^{2}\in\mathbb{N}$. This
proves Proposition \ref{prop.Z[i].gauss.Norm-N}.
\end{proof}

\subsubsection{Units and unit-equivalence}

Any nonzero Gaussian integer $\alpha$ has an inverse (by Theorem
\ref{thm.CC.CC.inverse.unique}). But usually, this inverse is not a Gaussian
integer, i.e., does not lie in $\mathbb{Z}\left[  i\right]  $. For example,
$2^{-1} \notin\mathbb{Z}\left[  i\right]  $ and $\left(  1+i\right)  ^{-1} =
\dfrac{1-i}{2} \notin\mathbb{Z}\left[  i\right]  $. The Gaussian integers
whose inverses do lie in $\mathbb{Z}\left[  i\right]  $ have a special name:

\begin{definition}
\label{def.Z[i].gauss.unit}\textbf{(a)} A Gaussian integer $\alpha
\in\mathbb{Z}\left[  i\right]  $ is said to be \textit{invertible in}\textbf{
}$\mathbb{Z}\left[  i\right]  $ if it has an inverse in $\mathbb{Z}\left[
i\right]  $.

A \textit{unit} will mean a Gaussian integer that is invertible in
$\mathbb{Z}\left[  i\right]  $.

\textbf{(b)} We define a relation $\sim$ on $\mathbb{Z}\left[  i\right]  $ by%
\[
\left(  \alpha\sim\beta\right)  \Longleftrightarrow\left(  \alpha=\gamma
\beta\text{ for some unit }\gamma\in\mathbb{Z}\left[  i\right]  \right)  .
\]
This relation will be called \textit{unit-equivalence} (or \textit{equality up
to unit}). We say that two Gaussian integers $\alpha$ and $\beta$ are
\textit{unit-equivalent} if $\alpha\sim\beta$.
\end{definition}

For comparison, let us consider analogous concepts for integers instead of
Gaussian integers. The units of $\mathbb{Z}$ (that is, the integers that are
invertible in $\mathbb{Z}$) are $1$ and $-1$. So if we defined a relation
$\underset{\mathbb{Z}}{\sim}$ on $\mathbb{Z}$ in the same way as we defined
the relation $\sim$ on $\mathbb{Z}\left[  i\right]  $ (but requiring
$\gamma\in\mathbb{Z}$ instead of $\gamma\in\mathbb{Z}\left[  i\right]  $),
then this relation would just be given by%
\begin{align}
\left(  a\underset{\mathbb{Z}}{\sim}b\right)   &  \Longleftrightarrow\left(
a=cb\text{ for some }c\in\left\{  1,-1\right\}  \right) \nonumber\\
&  \Longleftrightarrow\left(  a=b\text{ or }a=-b\right)  \Longleftrightarrow
\left(  \left\vert a\right\vert =\left\vert b\right\vert \right)  .
\label{eq.Z[i].gauss.unit-Z}%
\end{align}
So the relation $\underset{\mathbb{Z}}{\sim}$ is not very exciting: it is
simply \textquotedblleft equality up to sign\textquotedblright.\footnote{In
other words, it is precisely the relation $\underset{\operatorname*{abs}%
}{\equiv}$, where $\operatorname*{abs}:\mathbb{Z}\rightarrow\mathbb{N}$ is the
map sending each integer $n$ to its absolute value $\left\vert n\right\vert $.
(See Example \ref{exa.eqrel.eqrel.eqrelf} for how this relation
$\underset{\operatorname*{abs}}{\equiv}$ is defined.)} But the relation $\sim$
on $\mathbb{Z}\left[  i\right]  $ cannot be described as simply as this: It is
easy to find two Gaussian integers $\alpha$ and $\beta$ such that $\left\vert
\alpha\right\vert =\left\vert \beta\right\vert $ holds but $\alpha\sim\beta$
does not (for example, the Gaussian integers $\alpha=16+63i$ and
$\beta=33+56i$ both have absolute value $65$ but are not unit-equivalent).

\begin{proposition}
\label{prop.Z[i].gauss.uniteq.eqrel}The relation $\sim$ on $\mathbb{Z}\left[
i\right]  $ is an equivalence relation.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.uniteq.eqrel}.]Observe the following:

\begin{itemize}
\item The relation $\sim$ is reflexive.

\begin{fineprint}
[\textit{Proof:} Let $\alpha\in\mathbb{Z}\left[  i\right]  $. Then,
$\alpha=1\alpha$. But $1$ is invertible in $\mathbb{Z}\left[  i\right]  $
(since $1^{-1}=1\in\mathbb{Z}\left[  i\right]  $). In other words, $1$ is a
unit. Hence, $\alpha=\gamma\alpha$ for some unit $\gamma\in\mathbb{Z}\left[
i\right]  $ (namely, $\gamma=1$). In other words, $\alpha\sim\alpha$ (by the
definition of the relation $\sim$).

Now, forget that we fixed $\alpha$. We thus have shown that every $\alpha
\in\mathbb{Z}\left[  i\right]  $ satisfies $\alpha\sim\alpha$. In other words,
the relation $\sim$ is reflexive.]
\end{fineprint}

\item The relation $\sim$ is symmetric.

\begin{fineprint}
[\textit{Proof:} Let $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ be such
that $\alpha\sim\beta$. We shall prove that $\beta\sim\alpha$.

We have $\alpha\sim\beta$. In other words, $\alpha=\delta\beta$ for some unit
$\delta\in\mathbb{Z}\left[  i\right]  $ (by the definition of the relation
$\sim$). Consider this $\delta$. Note that $\delta$ is a unit; in other words,
$\delta$ is a Gaussian integer that has an inverse in $\mathbb{Z}\left[
i\right]  $. Thus, $\delta^{-1}$ is well-defined (since $\delta$ has an
inverse), and $\delta^{-1}\in\mathbb{Z}\left[  i\right]  $ (since $\delta$ has
an inverse in $\mathbb{Z}\left[  i\right]  $). Now, $\delta^{-1}$ is a
Gaussian integer (since $\delta^{-1}\in\mathbb{Z}\left[  i\right]  $) and
itself has an inverse in $\mathbb{Z}\left[  i\right]  $ (since its inverse is
$\left(  \delta^{-1}\right)  ^{-1}=\delta\in\mathbb{Z}\left[  i\right]  $). In
other words, $\delta^{-1}$ is a unit. Furthermore, dividing both sides of the
equality $\alpha=\delta\beta$ by $\delta$, we find $\delta^{-1}\alpha=\beta$,
so that $\beta=\delta^{-1}\alpha$. Thus, $\beta=\gamma\alpha$ for some unit
$\gamma\in\mathbb{Z}\left[  i\right]  $ (namely, for $\gamma=\delta^{-1}$). In
other words, $\beta\sim\alpha$ (by the definition of the relation $\sim$).

Now, forget that we fixed $\alpha$ and $\beta$. We thus have shown that every
$\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ satisfying $\alpha\sim\beta$
satisfy $\beta\sim\alpha$. In other words, the relation $\sim$ is symmetric.]
\end{fineprint}

\item The relation $\sim$ is transitive.

\begin{fineprint}
[\textit{Proof:} Let $\alpha,\beta,\gamma\in\mathbb{Z}\left[  i\right]  $ be
such that $\alpha\sim\beta$ and $\beta\sim\gamma$. We shall prove that
$\alpha\sim\gamma$.

From $\alpha\sim\beta$, we conclude that $\alpha=\delta\beta$ for some unit
$\delta\in\mathbb{Z}\left[  i\right]  $ (by the definition of the relation
$\sim$). From $\beta\sim\gamma$, we conclude that $\beta=\varepsilon\gamma$
for some unit $\varepsilon\in\mathbb{Z}\left[  i\right]  $ (by the definition
of the relation $\sim$). Consider these two units $\delta$ and $\varepsilon$.
Both $\delta$ and $\varepsilon$ are units, and thus have inverses in
$\mathbb{Z}\left[  i\right]  $ (by the definition of \textquotedblleft
unit\textquotedblright). In other words, they have inverses, and these
inverses $\delta^{-1}$ and $\varepsilon^{-1}$ belong to $\mathbb{Z}\left[
i\right]  $. Now, Proposition \ref{prop.CC.CC.inverse.ab} \textbf{(b)}
(applied to $\delta$ and $\varepsilon$ instead of $\alpha$ and $\beta$) yields
that the product $\delta\varepsilon$ has an inverse as well, and this inverse
is $\left(  \delta\varepsilon\right)  ^{-1}=\delta^{-1}\varepsilon^{-1}$.
Hence, $\left(  \delta\varepsilon\right)  ^{-1}=\delta^{-1}\varepsilon^{-1}%
\in\mathbb{Z}\left[  i\right]  $ (since both $\delta^{-1}$ and $\varepsilon
^{-1}$ belong to $\mathbb{Z}\left[  i\right]  $). Thus, $\delta\varepsilon$ is
a Gaussian integer (since $\delta$ and $\varepsilon$ are Gaussian integers)
that has an inverse in $\mathbb{Z}\left[  i\right]  $ (since $\left(
\delta\varepsilon\right)  ^{-1}\in\mathbb{Z}\left[  i\right]  $). In other
words, $\delta\varepsilon$ is a unit (by the definition of a \textquotedblleft
unit\textquotedblright). This unit $\delta\varepsilon$ satisfies
$\alpha=\left(  \delta\varepsilon\right)  \gamma$ (since $\alpha
=\delta\underbrace{\beta}_{=\varepsilon\gamma}=\delta\varepsilon\gamma=\left(
\delta\varepsilon\right)  \gamma$). Hence, $\alpha=\rho\gamma$ for some unit
$\rho\in\mathbb{Z}\left[  i\right]  $ (namely, for $\rho=\delta\varepsilon$).
In other words, $\alpha\sim\gamma$ (by the definition of the relation $\sim$).

Now, forget that we fixed $\alpha,\beta,\gamma$. We thus have shown that every
$\alpha,\beta,\gamma\in\mathbb{Z}\left[  i\right]  $ satisfying $\alpha
\sim\beta$ and $\beta\sim\gamma$ satisfy $\alpha\sim\gamma$. In other words,
the relation $\sim$ is transitive.]
\end{fineprint}
\end{itemize}

\noindent We have now proven that the relation $\sim$ is reflexive, symmetric
and transitive. In other words, $\sim$ is an equivalence relation (by the
definition of \textquotedblleft equivalence relation\textquotedblright). This
proves Proposition \ref{prop.Z[i].gauss.uniteq.eqrel}.
\end{proof}

\begin{proposition}
\label{prop.Z[i].gauss.norm1}Let $\alpha$ be a Gaussian integer.

\textbf{(a)} We have $\operatorname*{N}\left(  \alpha\right)  =0$ if and only
if $\alpha=0$.

\textbf{(b)} We have $\operatorname*{N}\left(  \alpha\right)  =1$ if and only
if $\alpha$ is a unit.

\textbf{(c)} If $\alpha$ is nonzero and not a unit, then $\operatorname*{N}%
\left(  \alpha\right)  >1$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.norm1}.]\textbf{(a)} This is a
particular case of Proposition \ref{prop.CC.norm.basics} \textbf{(b)}.

\textbf{(b)} $\Longrightarrow:$ Assume that $\operatorname*{N}\left(
\alpha\right)  =1$. We must prove that $\alpha$ is a unit.

Proposition \ref{prop.CC.norm.conj} \textbf{(a)} yields $\operatorname*{N}%
\left(  \alpha\right)  =\alpha\overline{\alpha}$.\ Hence, $\alpha
\overline{\alpha}=\operatorname*{N}\left(  \alpha\right)  =1$.

But Proposition \ref{prop.Z[i].gauss.conj} shows that $\overline{\alpha}$ is a
Gaussian integer. In other words, $\overline{\alpha}\in\mathbb{Z}\left[
i\right]  $. This Gaussian integer $\overline{\alpha}\in\mathbb{Z}\left[
i\right]  $ is an inverse of $\alpha$ (since $\alpha\overline{\alpha}=1$).
Thus, $\alpha$ has an inverse in $\mathbb{Z}\left[  i\right]  $ (namely,
$\overline{\alpha}$). In other words, $\alpha$ is a unit (by the definition of
\textquotedblleft unit\textquotedblright). This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Proposition
\ref{prop.Z[i].gauss.norm1} \textbf{(b)}.

$\Longleftarrow:$ Assume that $\alpha$ is a unit. We must prove that
$\operatorname*{N}\left(  \alpha\right)  =1$.

We know that $\alpha$ is a unit. In other words, $\alpha$ is invertible in
$\mathbb{Z}\left[  i\right]  $. In other words, $\alpha$ has an inverse
$\alpha^{-1}\in\mathbb{Z}\left[  i\right]  $.

This inverse $\alpha^{-1}$ satisfies $\alpha\alpha^{-1}=1=1_{\mathbb{C}%
}=\left(  1,0\right)  $, so that
\begin{align*}
\operatorname*{N}\left(  \alpha\alpha^{-1}\right)   &  =\operatorname*{N}%
\left(  \left(  1,0\right)  \right)  =1^{2}+0^{2}\ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of }\operatorname*{N}\left(  \left(  1,0\right)
\right)  \right) \\
&  =1.
\end{align*}
But Proposition \ref{prop.CC.conj.hom} \textbf{(d)} (applied to $\beta
=\alpha^{-1}$) yields $\operatorname*{N}\left(  \alpha\alpha^{-1}\right)
=\operatorname*{N}\left(  \alpha\right)  \cdot\operatorname*{N}\left(
\alpha^{-1}\right)  $. Hence, $\operatorname*{N}\left(  \alpha\right)
\cdot\operatorname*{N}\left(  \alpha^{-1}\right)  =\operatorname*{N}\left(
\alpha\alpha^{-1}\right)  =1$. But Proposition \ref{prop.Z[i].gauss.Norm-N}
yields $\operatorname*{N}\left(  \alpha\right)  \in\mathbb{N}$. The same
argument (applied to $\alpha^{-1}$ instead of $\alpha$) yields
$\operatorname*{N}\left(  \alpha^{-1}\right)  \in\mathbb{N}$ (since
$\alpha^{-1}\in\mathbb{Z}\left[  i\right]  $). Hence, the equality
$\operatorname*{N}\left(  \alpha\right)  \cdot\operatorname*{N}\left(
\alpha^{-1}\right)  =1$ entails that $\operatorname*{N}\left(  \alpha\right)
\mid1$. Consequently, $\operatorname*{N}\left(  \alpha\right)  =1$ (since
$\operatorname*{N}\left(  \alpha\right)  \in\mathbb{N}$). This proves the
\textquotedblleft$\Longleftarrow$\textquotedblright\ direction of Proposition
\ref{prop.Z[i].gauss.norm1} \textbf{(b)}.

\textbf{(c)} Assume that $\alpha$ is nonzero and not a unit. Then, $\alpha
\neq0$ (since $\alpha$ is nonzero). Hence, Proposition
\ref{prop.CC.norm.basics} \textbf{(c)} yields $\operatorname*{N}\left(
\alpha\right)  >0$. But Proposition \ref{prop.Z[i].gauss.Norm-N} yields
$\operatorname*{N}\left(  \alpha\right)  \in\mathbb{N}$. Combining this with
$\operatorname*{N}\left(  \alpha\right)  >0$, we obtain $\operatorname*{N}%
\left(  \alpha\right)  \geq1$. But Proposition \ref{prop.Z[i].gauss.norm1}
\textbf{(b)} shows that we have $\operatorname*{N}\left(  \alpha\right)  =1$
if and only if $\alpha$ is a unit. Hence, we don't have $\operatorname*{N}%
\left(  \alpha\right)  =1$ (since $\alpha$ is not a unit). In other words, we
have $\operatorname*{N}\left(  \alpha\right)  \neq1$. Combining this with
$\operatorname*{N}\left(  \alpha\right)  \geq1$, we find $\operatorname*{N}%
\left(  \alpha\right)  >1$. This proves Proposition
\ref{prop.Z[i].gauss.norm1} \textbf{(c)}.
\end{proof}

\begin{proposition}
\label{prop.Z[i].gauss.units}The units (in $\mathbb{Z}\left[  i\right]  $) are
$1,-1,i,-i$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.units}.]Each of the four Gaussian
integers $1,-1,i,-i$ is a unit\footnote{\textit{Proof.} We have $i\left(
-i\right)  =1$. Hence, the Gaussian integer $i$ has an inverse, namely
$i^{-1}=-i$. Similarly, the Gaussian integer $-i$ has an inverse, namely
$\left(  -i\right)  ^{-1}=i$.
\par
The Gaussian integer $1$ is invertible in $\mathbb{Z}\left[  i\right]  $
(since its inverse is $1^{-1}=1\in\mathbb{Z}\left[  i\right]  $), and thus is
a unit.
\par
The Gaussian integer $-1$ is invertible in $\mathbb{Z}\left[  i\right]  $
(since its inverse is $\left(  -1\right)  ^{-1}=-1\in\mathbb{Z}\left[
i\right]  $), and thus is a unit.
\par
The Gaussian integer $i$ is invertible in $\mathbb{Z}\left[  i\right]  $
(since its inverse is $i^{-1}=-i\in\mathbb{Z}\left[  i\right]  $), and thus is
a unit.
\par
The Gaussian integer $-i$ is invertible in $\mathbb{Z}\left[  i\right]  $
(since its inverse is $\left(  -i\right)  ^{-1}=i\in\mathbb{Z}\left[
i\right]  $), and thus is a unit.
\par
Thus, each of the four Gaussian integers $1,-1,i,-i$ is a unit.}. It remains
to prove that there are no other units.

So let $\alpha\in\mathbb{Z}\left[  i\right]  $ be a unit. We shall prove that
$\alpha$ is either $1$ or $-1$ or $i$ or $-i$.

Proposition \ref{prop.Z[i].gauss.norm1} \textbf{(b)} shows that we have
$\operatorname*{N}\left(  \alpha\right)  =1$ if and only if $\alpha$ is a
unit. Hence, we have $\operatorname*{N}\left(  \alpha\right)  =1$ (since
$\alpha$ is a unit).

Our goal is to prove that $\alpha$ is either $1$ or $-1$ or $i$ or $-i$. If
you don't insist on full rigor, then you can easily read this off from the
Argand diagram: We have $\left\vert \alpha\right\vert =\sqrt{\operatorname*{N}%
\left(  \alpha\right)  }=1$ (since $\operatorname*{N}\left(  \alpha\right)
=1$). Now, the point $\alpha$ is a Gaussian integer, i.e., a lattice point,
and lies on the unit circle (since its distance to the origin is $\left\vert
\alpha\right\vert =1$). But a look at the picture (\ref{eq.CC.CC.argand.fig2})
reveals that the only lattice points lying on the unit circle are $1,-1,i,-i$.
Hence, if you believe this kind of reasoning, you have shown that $\alpha$ is
either $1$ or $-1$ or $i$ or $-i$.

Here is a rigorous argument for this:

Let us write the complex number $\alpha$ as $\alpha=\left(  a,b\right)  $.
Then, $a,b\in\mathbb{Z}$ (since $\alpha\in\mathbb{Z}\left[  i\right]  $).
Furthermore, the definition of $\operatorname*{N}\left(  \alpha\right)  $
yields $\operatorname*{N}\left(  \alpha\right)  =a^{2}+b^{2}$, so that
$a^{2}+b^{2}=\operatorname*{N}\left(  \alpha\right)  =1$. If both integers $a$
and $b$ were nonzero, then both their squares $a^{2}$ and $b^{2}$ would be
$\geq1$ (because the square of any nonzero integer is $\geq1$), and thus the
sum of these squares would be $\underbrace{a^{2}}_{\geq1}+\underbrace{b^{2}%
}_{\geq1}\geq1+1>1$; but this would contradict $a^{2}+b^{2}=1$. Hence, the two
integers $a$ and $b$ cannot both be nonzero. In other words, at least one of
them is $0$. In other words, we have $a=0$ or $b=0$. Thus, we are in one of
the following two cases:

\textit{Case 1:} We have $a=0$.

\textit{Case 2:} We have $b=0$.

(These two cases could theoretically overlap, though it is easy to see that
they don't.)

Let us first consider Case 1. In this case, we have $a=0$. Hence, $a^{2}%
+b^{2}=0^{2}+b^{2}=b^{2}$, so that $b^{2}=a^{2}+b^{2}=1$. Hence, $b$ is either
$1$ or $-1$. Thus, the complex number $\left(  0,b\right)  $ is either
$\left(  0,1\right)  $ or $\left(  0,-1\right)  $. In other words, the complex
number $\alpha$ is either $i$ or $-i$ (since $\alpha=\left(  \underbrace{a}%
_{=0},b\right)  =\left(  0,b\right)  $ and $i=\left(  0,1\right)  $ and
$-\underbrace{i}_{=\left(  0,1\right)  }=-\left(  0,1\right)  =\left(
0,-1\right)  $). Thus, $\alpha$ is either $1$ or $-1$ or $i$ or $-i$. So we
have shown in Case 1 that $\alpha$ is either $1$ or $-1$ or $i$ or $-i$.

Let us next consider Case 2. In this case, we have $b=0$. Hence, $a^{2}%
+b^{2}=a^{2}+0^{2}=a^{2}$, so that $a^{2}=a^{2}+b^{2}=1$. Hence, $a$ is either
$1$ or $-1$. Thus, the complex number $\left(  a,0\right)  $ is either
$\left(  1,0\right)  $ or $\left(  -1,0\right)  $. In other words, the complex
number $\alpha$ is either $1$ or $-1$ (since $\alpha=\left(  a,\underbrace{b}%
_{=0}\right)  =\left(  a,0\right)  $ and $1=\left(  1,0\right)  $ and
$-1=\left(  -1,0\right)  $). Thus, $\alpha$ is either $1$ or $-1$ or $i$ or
$-i$. So we have shown in Case 2 that $\alpha$ is either $1$ or $-1$ or $i$ or
$-i$.

We have now proven in both Cases 1 and 2 that $\alpha$ is either $1$ or $-1$
or $i$ or $-i$. Hence, this always holds.

Now, forget that we fixed $\alpha$. We thus have shown that if $\alpha
\in\mathbb{Z}\left[  i\right]  $ is a unit, then $\alpha$ is either $1$ or
$-1$ or $i$ or $-i$. Thus, $1,-1,i,-i$ are the only possible units. Since we
already know that $1,-1,i,-i$ are units, we thus conclude that the units are
$1,-1,i,-i$. This proves Proposition \ref{prop.Z[i].gauss.units}.
\end{proof}

As a consequence of Proposition \ref{prop.Z[i].gauss.units}, if we are given
two Gaussian integers $\alpha$ and $\beta$, we can easily check whether
$\alpha\sim\beta$ holds:

\begin{proposition}
\label{prop.Z[i].gauss.uniteq}Let $\alpha$ and $\beta$ be two Gaussian
integers. Then, we have $\alpha\sim\beta$ if and only if
\[
\left(  \alpha=\beta\text{ or }\alpha=-\beta\text{ or }\alpha=i\beta\text{ or
}\alpha=-i\beta\right)  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.uniteq}.]Proposition
\ref{prop.Z[i].gauss.units} shows that the units are $1,-1,i,-i$. In other
words,%
\[
\left\{  \text{the units}\right\}  =\left\{  1,-1,i,-i\right\}  .
\]


Now, we have the following chain of logical equivalences:%
\begin{align*}
\left(  \alpha\sim\beta\right)  \  &  \Longleftrightarrow\ \left(
\alpha=\gamma\beta\text{ for some unit }\gamma\in\mathbb{Z}\left[  i\right]
\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the relation }%
\sim\right) \\
&  \Longleftrightarrow\ \left(  \alpha=\gamma\beta\text{ for some }\gamma
\in\underbrace{\left\{  \text{the units}\right\}  }_{=\left\{
1,-1,i,-i\right\}  }\right) \\
&  \Longleftrightarrow\ \left(  \alpha=\gamma\beta\text{ for some }\gamma
\in\left\{  1,-1,i,-i\right\}  \right) \\
&  \Longleftrightarrow\ \left(  \alpha=\underbrace{1\beta}_{=\beta}\text{ or
}\alpha=\underbrace{-1\beta}_{=-\beta}\text{ or }\alpha=i\beta\text{ or
}\alpha=-i\beta\right) \\
&  \Longleftrightarrow\ \left(  \alpha=\beta\text{ or }\alpha=-\beta\text{ or
}\alpha=i\beta\text{ or }\alpha=-i\beta\right)  .
\end{align*}
This proves Proposition \ref{prop.Z[i].gauss.uniteq}.
\end{proof}

\begin{definition}
\label{def.Z[i].gauss.uniteq.cl}We know from Proposition
\ref{prop.Z[i].gauss.uniteq.eqrel} that the relation $\sim$ on $\mathbb{Z}%
\left[  i\right]  $ is an equivalence relation.

The equivalence classes of this relation $\sim$ shall be called the
\textit{unit-equivalence classes}. More specifically, for each $\alpha
\in\mathbb{Z}\left[  i\right]  $, we shall denote the $\sim$-equivalence class
of $\alpha$ as the \textit{unit-equivalence class of }$\alpha$.
\end{definition}

\begin{proposition}
\label{prop.Z[i].gauss.uniteq.cl}\textbf{(a)} For each $\alpha\in
\mathbb{Z}\left[  i\right]  $, we have%
\[
\left(  \text{the unit-equivalence class of }\alpha\right)  =\left\{
\alpha,i\alpha,-\alpha,-i\alpha\right\}  .
\]


\textbf{(b)} The unit-equivalence classes are the sets of the form $\left\{
\alpha,i\alpha,-\alpha,-i\alpha\right\}  $ for some $\alpha\in\mathbb{Z}%
\left[  i\right]  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.uniteq.cl}.]\textbf{(a)} Let
$\alpha\in\mathbb{Z}\left[  i\right]  $. Thus, both $i$ and $\alpha$ belong to
$\mathbb{Z}\left[  i\right]  $. Hence, all four of the complex numbers
$\alpha,-\alpha,i\alpha,-i\alpha$ belong to $\mathbb{Z}\left[  i\right]  $ (by
Proposition \ref{prop.Z[i].gauss.ring} \textbf{(a)} and Proposition
\ref{prop.Z[i].gauss.ring} \textbf{(b)}).

If $b\in\mathbb{Z}\left[  i\right]  $ is any Gaussian integer, then we have
$b\sim\alpha$ if and only if \newline$\left(  b=\alpha\text{ or }%
b=-\alpha\text{ or }b=i\alpha\text{ or }b=-i\alpha\right)  $ (by Proposition
\ref{prop.Z[i].gauss.uniteq}, applied to $b$ and $\alpha$ instead of $\alpha$
and $\beta$). In other words, the logical equivalence%
\begin{equation}
\left(  b\sim\alpha\right)  \ \Longleftrightarrow\ \left(  b=\alpha\text{ or
}b=-\alpha\text{ or }b=i\alpha\text{ or }b=-i\alpha\right)
\label{pf.prop.Z[i].gauss.uniteq.cl.a.equiv}%
\end{equation}
holds for each $b\in\mathbb{Z}\left[  i\right]  $.

Then,%
\begin{align}
&  \left(  \text{the unit-equivalence class of }\alpha\right) \nonumber\\
&  =\left(  \text{the }\sim\text{-equivalence class of }\alpha\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition \ref{def.Z[i].gauss.uniteq.cl}%
}\right) \nonumber\\
&  =\left[  \alpha\right]  _{\sim}=\left\{  b\in\mathbb{Z}\left[  i\right]
\ \mid\ b\sim\alpha\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition
\ref{def.eqrel.eqcl.eqcl} \textbf{(a)}}\right) \nonumber\\
&  =\left\{  b\in\mathbb{Z}\left[  i\right]  \ \mid\ b=\alpha\text{ or
}b=-\alpha\text{ or }b=i\alpha\text{ or }b=-i\alpha\right\} \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since the equivalence
(\ref{pf.prop.Z[i].gauss.uniteq.cl.a.equiv}) holds for each }b\in
\mathbb{Z}\left[  i\right]  \right) \nonumber\\
&  =\left\{  \alpha,-\alpha,i\alpha,-i\alpha\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\alpha,-\alpha,i\alpha,-i\alpha\text{
belong to }\mathbb{Z}\left[  i\right]  \right) \nonumber\\
&  =\left\{  \alpha,i\alpha,-\alpha,-i\alpha\right\}  .
\label{pf.prop.Z[i].gauss.uniteq.cl.5}%
\end{align}
This proves Proposition \ref{prop.Z[i].gauss.uniteq.cl} \textbf{(a)}.

\textbf{(b)} The unit-equivalence classes are the sets of the form
\[
\left(  \text{the unit-equivalence class of }\alpha\right)
\ \ \ \ \ \ \ \ \ \ \text{for some }\alpha\in\mathbb{Z}\left[  i\right]  .
\]
Since each $\alpha\in\mathbb{Z}\left[  i\right]  $ satisfies
(\ref{pf.prop.Z[i].gauss.uniteq.cl.5}), this rewrites as follows: The
unit-equivalence classes are the sets of the form
\[
\left\{  \alpha,i\alpha,-\alpha,-i\alpha\right\}
\ \ \ \ \ \ \ \ \ \ \text{for some }\alpha\in\mathbb{Z}\left[  i\right]  .
\]
This proves Proposition \ref{prop.Z[i].gauss.uniteq.cl} \textbf{(b)}.
\end{proof}

Recall that (as we have seen in Subsection \ref{subsect.CC.CC.argand}) if
$\alpha$ is a complex number, then the four complex numbers $\alpha$,
$i\alpha$, $-\alpha$ and $-i\alpha$ (represented as points in the Argand
diagram) are the vertices of a square centered at the origin. But when
$\alpha$ is a Gaussian integer, these four complex numbers constitute the
unit-equivalence class of $\alpha$ (by Proposition
\ref{prop.Z[i].gauss.uniteq.cl} \textbf{(a)}). Thus, geometrically speaking,
the unit-equivalence class of a Gaussian integer $\alpha$ consists of the four
vertices of a square centered at the origin. (When $\alpha=0$, these four
vertices coincide.)

\begin{proposition}
\label{prop.Z[i].gauss.uniteq.1}Let $\alpha$ be a Gaussian integer. Then,
$\alpha\sim1$ if and only if $\alpha$ is a unit.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.uniteq.1}.]We have the following
chain of logical equivalences:%
\begin{align*}
\left(  \alpha\sim1\right)  \  &  \Longleftrightarrow\ \left(  \alpha
=\underbrace{\gamma\cdot1}_{=\gamma}\text{ for some unit }\gamma\in
\mathbb{Z}\left[  i\right]  \right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the relation }%
\sim\right) \\
&  \Longleftrightarrow\ \left(  \alpha=\gamma\text{ for some unit }\gamma
\in\mathbb{Z}\left[  i\right]  \right) \\
&  \Longleftrightarrow\ \left(  \alpha\text{ is a unit}\right)  .
\end{align*}
This proves Proposition \ref{prop.Z[i].gauss.uniteq.1}.
\end{proof}

\begin{proposition}
\label{prop.Z[i].gauss.uniteq.norm=norm}Let $\alpha$ and $\beta$ be two
unit-equivalent Gaussian integers. Then, $\operatorname*{N}\left(
\alpha\right)  =\operatorname*{N}\left(  \beta\right)  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.uniteq.norm=norm}.]We have
$\alpha\sim\beta$ (since $\alpha$ and $\beta$ are unit-equivalent). In other
words, we have $\alpha=\gamma\beta$ for some unit $\gamma\in\mathbb{Z}\left[
i\right]  $ (by the definition of the relation $\sim$). Consider this $\gamma
$. Since $\gamma$ is a unit, we have $\operatorname*{N}\left(  \gamma\right)
=1$ (by Proposition \ref{prop.Z[i].gauss.norm1} \textbf{(b)}, applied to
$\gamma$ instead of $\alpha$). Now,
\begin{align*}
\operatorname*{N}\left(  \underbrace{\alpha}_{=\gamma\beta}\right)   &
=\operatorname*{N}\left(  \gamma\beta\right)  =\underbrace{\operatorname*{N}%
\left(  \gamma\right)  }_{=1}\operatorname*{N}\left(  \beta\right)
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.CC.conj.hom} \textbf{(d)},}\\
\text{applied to }\gamma\text{ instead of }\alpha
\end{array}
\right) \\
&  =\operatorname*{N}\left(  \beta\right)  .
\end{align*}
This proves Proposition \ref{prop.Z[i].gauss.uniteq.norm=norm}.
\end{proof}

The converse of Proposition \ref{prop.Z[i].gauss.uniteq.norm=norm} does not
hold: There exist Gaussian integers $\alpha$ and $\beta$ satisfying
$\operatorname*{N}\left(  \alpha\right)  =\operatorname*{N}\left(
\beta\right)  $ that are not unit-equivalent.

At this point, let us briefly take a look at a seemingly random question:
Which Gaussian integers $\alpha$ are unit-equivalent to their own conjugates
(i.e., satisfy $\alpha\sim\overline{\alpha}$) ? Besides being an instructive
exercise, answering this question will surprisingly aid us answer Question
\ref{quest.intro.sum-of-2sq.2} later on!

Here are some examples:

\begin{itemize}
\item Every integer $g$ satisfies $g\sim\overline{g}$, since an integer $g$
always satisfies $\overline{g}=g$.

\item Every integer $g$ satisfies $gi\sim\overline{gi}$. Indeed, if $g$ is an
integer, then Proposition \ref{prop.CC.conj.hom} \textbf{(c)} (applied to
$\alpha=g$ and $\beta=i$) yields%
\[
\overline{gi}=\underbrace{\overline{g}}_{\substack{=g\\\text{(since }%
g\in\mathbb{Z}\subseteq\mathbb{R}\text{)}}}\cdot\underbrace{\overline{i}%
}_{=-i}=g\left(  -i\right)  =-gi=\left(  -1\right)  \cdot\left(  gi\right)  ,
\]
and this leads to $\overline{gi}\sim gi$ (since $-1$ is a unit); but this, in
turn, yields $gi\sim\overline{gi}$ (since Proposition
\ref{prop.Z[i].gauss.uniteq.eqrel} shows that $\sim$ is an equivalence relation).

\item Every integer $g$ satisfies $g\left(  1+i\right)  \sim\overline{g\left(
1+i\right)  }$. Indeed, if $g$ is an integer, then Proposition
\ref{prop.CC.conj.hom} \textbf{(c)} (applied to $\alpha=g$ and $\beta=1+i$)
yields%
\[
\overline{g\left(  1+i\right)  }=\underbrace{\overline{g}}%
_{\substack{=g\\\text{(since }g\in\mathbb{Z}\subseteq\mathbb{R}\text{)}}%
}\cdot\underbrace{\overline{\left(  1+i\right)  }}_{\substack{=1-i\\=\left(
-i\right)  \left(  1+i\right)  \\\text{(check this!)}}}=g\left(  -i\right)
\left(  1+i\right)  =\left(  -i\right)  \cdot\left(  g\left(  1+i\right)
\right)  ,
\]
and this leads to $\overline{g\left(  1+i\right)  }\sim g\left(  1+i\right)  $
(since $-i$ is a unit); but this, in turn, yields $g\left(  1+i\right)
\sim\overline{g\left(  1+i\right)  }$ (since Proposition
\ref{prop.Z[i].gauss.uniteq.eqrel} shows that $\sim$ is an equivalence relation).

\item Every integer $g$ satisfies $g\left(  1-i\right)  \sim\overline{g\left(
1-i\right)  }$. This can be checked similarly to how we just checked $g\left(
1+i\right)  \sim\overline{g\left(  1+i\right)  }$.
\end{itemize}

Thus, in total, we have found four families of Gaussian integers $\alpha$
satisfying $\alpha\sim\overline{\alpha}$: namely, those of the form
$g\in\mathbb{Z}$; those of the form $gi$ with $g\in\mathbb{Z}$; those of the
form $g\left(  1+i\right)  $ with $g\in\mathbb{Z}$; and those of the form
$g\left(  1-i\right)  $ with $g\in\mathbb{Z}$. On the Argand diagram, these
are precisely the lattice points on the four bold red lines on the following
picture:%
\[
\begin{tikzpicture}[baseline, scale=2.5]
\draw[step=1cm,gray,very thin] (-2.4,-2.4) grid (2.4,2.4);
\draw[very thick,red,->] (-2.5,0) -- (2.5,0);
\draw[very thick,red,->] (0,-2.5) -- (0,2.5);
\draw[very thick,red] (-2.5, -2.5) -- (2.5, 2.5);
\draw[very thick,red] (2.5, -2.5) -- (-2.5, 2.5);
\foreach \x/\xtext in {-2, -1, 0, 1, 2}
\fill (\x cm, 0) circle (1pt) node[above left=2pt]{$\xtext$};
\foreach \x/\xtext in {-2, -1, 1, 2}
\fill (\x cm, 1 cm) circle (1pt) node[above left=2pt]{$\xtext + i$};
\fill (0, 1 cm) circle (1pt) node[above left=2pt] {$i$};
\foreach \x/\xtext in {-2, -1, 1, 2}
\fill (\x cm, -1 cm) circle (1pt) node[above left=2pt]{$\xtext - i$};
\fill (0, -1 cm) circle (1pt) node[above left=2pt] {$-i$};
\foreach \x/\xtext in {-2, -1, 1, 2}
\fill (\x cm, 2 cm) circle (1pt) node[above left=2pt]{$\xtext + 2i$};
\fill (0, 2 cm) circle (1pt) node[above left=2pt] {$2i$};
\foreach \x/\xtext in {-2, -1, 1, 2}
\fill (\x cm, -2 cm) circle (1pt) node[above left=2pt]{$\xtext - 2i$};
\fill (0, -2 cm) circle (1pt) node[above left=2pt] {$-2i$};
\end{tikzpicture}\ \ \ \ .
\]


Are there any other Gaussian integers $\alpha$ satisfying $\alpha\sim
\overline{\alpha}$ ? As the following exercise (or, rather, its part
\textbf{(a)}) shows, the answer is \textquotedblleft no\textquotedblright; we
have found all such $\alpha$.

\begin{exercise}
\label{exe.Z[i].gauss.uneqcon}Let $\alpha$ be a Gaussian integer satisfying
$\alpha\sim\overline{\alpha}$. Prove the following:

\textbf{(a)} There exist some $g\in\mathbb{Z}$ and $\tau\in\left\{
1,i,1+i,1-i\right\}  $ such that $\alpha=g\tau$.

\textbf{(b)} These $g$ and $\tau$ satisfy $\operatorname*{N}\left(
\alpha\right)  \in\left\{  g^{2},2g^{2}\right\}  $.

\textbf{(c)} The norm $\operatorname*{N}\left(  \alpha\right)  $ cannot be an
odd prime.
\end{exercise}

(Part \textbf{(c)} of this exercise, strange as it sounds, is the one we will
end up using later.)

For the sake of the next subsection, let us state a simple property of integers:

\begin{lemma}
\label{lem.Z[i].gauss.div.no-clobber}Let $a$ and $b$ be two integers. Then, we
have the logical equivalence%
\[
\left(  a\mid b\right)  \ \Longleftrightarrow\ \left(  \text{there exists a
Gaussian integer }\gamma\text{ such that }b=a\gamma\right)  .
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.Z[i].gauss.div.no-clobber}.]$\Longrightarrow:$ Assume
that $a\mid b$. We must prove that there exists a Gaussian integer $\gamma$
such that $b=a\gamma$.

We have $a \mid b$. Thus, there exists an integer $c$ such that $b=ac$ (by
Definition \ref{def.ent.div.div}). Consider this $c$. Then, $c$ is an integer,
and thus is a Gaussian integer. Hence, there$\ $there exists a Gaussian
integer $\gamma$ such that $b=a\gamma$ (namely, $\gamma=c$). Thus, the
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction of Lemma
\ref{lem.Z[i].gauss.div.no-clobber} is proven.

$\Longleftarrow:$ Assume that there exists a Gaussian integer $\gamma$ such
that $b=a\gamma$. We must prove that $a\mid b$.

We have assumed that there exists a Gaussian integer $\gamma$ such that
$b=a\gamma$. Consider this $\gamma$. Write the complex number $\gamma$ as
$\gamma=\left(  c,d\right)  $ with $c,d\in\mathbb{R}$. Then, $c,d\in
\mathbb{Z}$ (since $\gamma$ is a Gaussian integer). In other words, $c$ and
$d$ are integers. Furthermore, $b=a\underbrace{\gamma}_{=\left(  c,d\right)
}=a\left(  c,d\right)  =\left(  ac,ad\right)  $ (by Proposition
\ref{prop.CC.CC.a(b,c)}, applied to $\left(  c,d\right)  $ instead of $\left(
b,c\right)  $). This is an equality between a real number (namely, $b$) and a
complex number (namely, $\left(  ac,ad\right)  $); thus, it means
$b_{\mathbb{C}}=\left(  ac,ad\right)  $ (according to Convention
\ref{conv.CC.RRtoCC.embed}). But $b_{\mathbb{C}}=\left(  b,0\right)  $ (by the
definition of $b_{\mathbb{C}}$). Hence, $\left(  b,0\right)  =b_{\mathbb{C}%
}=\left(  ac,ad\right)  $. In other words, $b=ac$ and $0=ad$. Now, from
$b=ac$, we obtain $a\mid b$ (since $c$ is an integer). This proves the
\textquotedblleft$\Longleftarrow$\textquotedblright\ direction of Lemma
\ref{lem.Z[i].gauss.div.no-clobber}.
\end{proof}

\subsubsection{Divisibility and congruence}

Now, let us begin to do proper number theory with Gaussian integers. The next
definition is the straightforward analogue of Definition \ref{def.ent.div.div}.

\begin{definition}
\label{def.Z[i].gauss.div}Let $\alpha$ and $\beta$ be two Gaussian integers.
We say that $\alpha\mid\beta$ (or \textquotedblleft$\alpha$ \textit{divides}
$\beta$\textquotedblright\ or \textquotedblleft$\beta$ is \textit{divisible by
}$\alpha$\textquotedblright\ or \textquotedblleft$\beta$ is a
\textit{multiple} of $\alpha$\textquotedblright) if there exists a Gaussian
integer $\gamma$ such that $\beta=\alpha\gamma$.

We furthermore say that $\alpha\nmid\beta$ if $\alpha$ does not divide $\beta$.
\end{definition}

When making such a definition, we need to be careful: Potentially, it might
create a clash of notations. In fact, if $a$ and $b$ are integers, then the
statement \textquotedblleft$a\mid b$\textquotedblright\ already has a meaning
(explained in Definition \ref{def.ent.div.div}). Definition
\ref{def.Z[i].gauss.div} gives this statement a new meaning, because we can
consider our integers $a$ and $b$ as Gaussian integers (since every integer is
a Gaussian integer). If these two meanings are not equivalent, then the
statement \textquotedblleft$a\mid b$\textquotedblright\ becomes ambiguous (as
it now has two different meanings) -- so we have laid ourselves a landmine!

Fortunately, these two meanings \textbf{are} equivalent. That is: If $a$ and
$b$ are two integers, then the statement \textquotedblleft$a\mid
b$\textquotedblright\ interpreted according to Definition
\ref{def.ent.div.div} is equivalent to the statement \textquotedblleft$a\mid
b$\textquotedblright\ interpreted according to Definition
\ref{def.Z[i].gauss.div}. Indeed, if $a$ and $b$ are two integers, then we
have the following chain of equivalences:%
\begin{align*}
&  \ \left(  a\mid b\text{ in the sense of Definition \ref{def.ent.div.div}%
}\right) \\
&  \Longleftrightarrow\ \left(  \text{there exists a Gaussian integer }%
\gamma\text{ such that }b=a\gamma\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
Lemma \ref{lem.Z[i].gauss.div.no-clobber}}\right) \\
&  \Longleftrightarrow\ \left(  a\mid b\text{ in the sense of Definition
\ref{def.Z[i].gauss.div}}\right)  .
\end{align*}
Thus, the two possible meanings of \textquotedblleft$a\mid b$%
\textquotedblright\ are equivalent, and so we are spared of any ambiguity.

More generally, the following proposition holds:

\begin{proposition}
\label{prop.Z[i].gauss.div.int|gauss}Let $a\in\mathbb{Z}$ and $\beta=\left(
b,c\right)  \in\mathbb{Z}\left[  i\right]  $. Then, $a\mid\beta$ if and only
if $a$ divides both $b$ and $c$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.div.int|gauss}.]$\Longrightarrow:$
Assume that $a\mid\beta$. We must prove that $a$ divides both $b$ and $c$.

The statement $a\mid\beta$ means that there exists a Gaussian integer $\gamma$
such that $\beta=a\gamma$ (according to Definition \ref{def.Z[i].gauss.div}).
Thus, there exists a Gaussian integer $\gamma$ such that $\beta=a\gamma$
(since $a\mid\beta$). Consider this $\gamma$. Write the complex number
$\gamma$ in the form $\gamma=\left(  u,v\right)  $ for some $u,v\in\mathbb{R}%
$. Then, $u,v\in\mathbb{Z}$ (since $\gamma$ is a Gaussian integer). In other
words, $u$ and $v$ are integers.

Recall that $\beta=\left(  b,c\right)  $. Hence, $\left(  b,c\right)
=\beta=a\underbrace{\gamma}_{=\left(  u,v\right)  }=a\left(  u,v\right)
=\left(  au,av\right)  $ (by Proposition \ref{prop.CC.CC.a(b,c)}, applied to
$\left(  u,v\right)  $ instead of $\left(  b,c\right)  $). In other words,
$b=au$ and $c=av$. From $b=au$, we obtain $a\mid b$ (since $u$ is an integer).
From $c=av$, we obtain $a\mid c$ (since $v$ is an integer). Thus, we have
$a\mid b$ and $a\mid c$. In other words, $a$ divides both $b$ and $c$. This
proves the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction of
Proposition \ref{prop.Z[i].gauss.div.int|gauss}.

$\Longleftarrow:$ Assume that $a$ divides both $b$ and $c$. We must prove that
$a\mid\beta$.

We have assumed that $a$ divides both $b$ and $c$. In other words, $a\mid b$
and $a\mid c$. From $a\mid b$, we conclude that there exists an integer $u$
such that $b=au$ (by the definition of divisibility). Consider this $u$. From
$a\mid c$, we conclude that there exists an integer $v$ such that $c=av$ (by
the definition of divisibility). Consider this $v$. Note that $u$ and $v$ are
integers; in other words, $u,v\in\mathbb{Z}$.

The complex number $\left(  u,v\right)  $ is a Gaussian integer (since
$u,v\in\mathbb{Z}$). Moreover, Proposition \ref{prop.CC.CC.a(b,c)} (applied to
$\left(  u,v\right)  $ instead of $\left(  b,c\right)  $) yields $a\left(
u,v\right)  =\left(  au,av\right)  $. Comparing this with $\beta=\left(
\underbrace{b}_{=au},\underbrace{c}_{=av}\right)  =\left(  au,av\right)  $, we
obtain $\beta=a\left(  u,v\right)  $. Hence, there exists a Gaussian integer
$\gamma$ such that $\beta=a\gamma$ (namely, $\gamma=\left(  u,v\right)  $).

The statement $a\mid\beta$ means that there exists a Gaussian integer $\gamma$
such that $\beta=a\gamma$ (according to Definition \ref{def.Z[i].gauss.div}).
Thus, $a\mid\beta$ (since there exists a Gaussian integer $\gamma$ such that
$\beta=a\gamma$). This proves the \textquotedblleft$\Longleftarrow
$\textquotedblright\ direction of Proposition
\ref{prop.Z[i].gauss.div.int|gauss}.
\end{proof}

The next proposition is a (partial) analogue of Proposition
\ref{prop.ent.div.1}:

\begin{proposition}
\label{prop.Z[i].gauss.div.1}Let $\alpha$ and $\beta$ be two Gaussian integers.

\textbf{(a)} If $\alpha\mid\beta$, then $\operatorname*{N}\left(
\alpha\right)  \mid\operatorname*{N}\left(  \beta\right)  $.

\textbf{(b)} If $\alpha\mid\beta$ and $\beta\neq0$, then $\operatorname*{N}%
\left(  \alpha\right)  \leq\operatorname*{N}\left(  \beta\right)  $.

\textbf{(c)} Assume that $\alpha\neq0$. Then, $\alpha\mid\beta$ if and only if
$\dfrac{\beta}{\alpha}\in\mathbb{Z}\left[  i\right]  $.
\end{proposition}

Note that we are using the norms $\operatorname*{N}\left(  \alpha\right)  $
and $\operatorname*{N}\left(  \beta\right)  $ as analogues of $\left\vert
a\right\vert $ and $\left\vert b\right\vert $ here, since the absolute values
$\left\vert \alpha\right\vert $ and $\left\vert \beta\right\vert $ of Gaussian
integers are often irrational and thus it makes no sense to talk of their
divisibility. (At least, this prevents us from using the absolute values of
$\alpha$ and $\beta$ in Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(a)}.
We could use them in Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(b)}.)

Note that the converse of Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(a)}
does not hold. (That is, $\operatorname*{N}\left(  \alpha\right)
\mid\operatorname*{N}\left(  \beta\right)  $ does not yield $\alpha\mid\beta$.)

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.div.1}.]Proposition
\ref{prop.Z[i].gauss.Norm-N} yields $\operatorname*{N}\left(  \alpha\right)
\in\mathbb{N}$; thus, $\operatorname*{N}\left(  \alpha\right)  $ is an
integer. Similarly, $\operatorname*{N}\left(  \beta\right)  $ is an integer.
Hence, the statement \textquotedblleft$\operatorname*{N}\left(  \alpha\right)
\mid\operatorname*{N}\left(  \beta\right)  $\textquotedblright\ makes sense.

\textbf{(a)} Assume that $\alpha\mid\beta$. Thus, there exists a Gaussian
integer $\gamma$ such that $\beta=\alpha\gamma$ (by Definition
\ref{def.Z[i].gauss.div}). Consider this $\gamma$. We have $\operatorname*{N}%
\left(  \gamma\right)  \in\mathbb{N}$ (by Proposition
\ref{prop.Z[i].gauss.Norm-N}, applied to $\gamma$ instead of $\alpha$). Now,
from $\beta=\alpha\gamma$, we obtain $\operatorname*{N}\left(  \beta\right)
=\operatorname*{N}\left(  \alpha\gamma\right)  =\operatorname*{N}\left(
\alpha\right)  \cdot\operatorname*{N}\left(  \gamma\right)  $ (by Proposition
\ref{prop.CC.conj.hom} \textbf{(d)}, applied to $\gamma$ instead of $\beta$).
Thus, $\operatorname*{N}\left(  \alpha\right)  \mid\operatorname*{N}\left(
\beta\right)  $ (since $\operatorname*{N}\left(  \gamma\right)  \in
\mathbb{N}\subseteq\mathbb{Z}$). This proves Proposition
\ref{prop.Z[i].gauss.div.1} \textbf{(a)}.

\textbf{(b)} Assume that $\alpha\mid\beta$ and $\beta\neq0$. Proposition
\ref{prop.CC.norm.basics} \textbf{(c)} (applied to $\beta$ instead of $\alpha
$) shows that $\operatorname*{N}\left(  \beta\right)  >0$ (since $\beta\neq
0$). Hence, $\operatorname*{N}\left(  \beta\right)  \neq0$. Furthermore,
Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(a)} yields $\operatorname*{N}%
\left(  \alpha\right)  \mid\operatorname*{N}\left(  \beta\right)  $. Thus,
Proposition \ref{prop.ent.div.1} \textbf{(b)} (applied to $a=\operatorname*{N}%
\left(  \alpha\right)  $ and $b=\operatorname*{N}\left(  \beta\right)  $)
yields $\left\vert \operatorname*{N}\left(  \alpha\right)  \right\vert
\leq\left\vert \operatorname*{N}\left(  \beta\right)  \right\vert $.

But recall that $\operatorname*{N}\left(  \alpha\right)  \in\mathbb{N}$, so
that $\operatorname*{N}\left(  \alpha\right)  \geq0$ and therefore $\left\vert
\operatorname*{N}\left(  \alpha\right)  \right\vert =\operatorname*{N}\left(
\alpha\right)  $. Similarly, $\left\vert \operatorname*{N}\left(
\beta\right)  \right\vert =\operatorname*{N}\left(  \beta\right)  $. Hence,
$\operatorname*{N}\left(  \alpha\right)  =\left\vert \operatorname*{N}\left(
\alpha\right)  \right\vert \leq\left\vert \operatorname*{N}\left(
\beta\right)  \right\vert =\operatorname*{N}\left(  \beta\right)  $. This
proves Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(b)}.

\textbf{(c)} The proof of Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(c)}
is analogous to the proof of Proposition \ref{prop.ent.div.1} \textbf{(c)}.
(Of course, we need to replace $a$ and $b$ by $\alpha$ and $\beta$, and
replace integers by Gaussian integers throughout the argument.)
\end{proof}

The next proposition is a straightforward analogue of Proposition
\ref{prop.ent.div.2}:

\begin{proposition}
\label{prop.Z[i].div.2}\textbf{(a)} We have $\alpha\mid\alpha$ for every
$\alpha\in\mathbb{Z}\left[  i\right]  $. (This is called the
\textit{reflexivity of divisibility} for Gaussian integers.)

\textbf{(b)} If $\alpha,\beta,\gamma\in\mathbb{Z}\left[  i\right]  $ satisfy
$\alpha\mid\beta$ and $\beta\mid\gamma$, then $\alpha\mid\gamma$. (This is
called the \textit{transitivity of divisibility} for Gaussian integers.)

\textbf{(c)} If $\alpha_{1},\alpha_{2},\beta_{1},\beta_{2}\in\mathbb{Z}\left[
i\right]  $ satisfy $\alpha_{1}\mid\beta_{1}$ and $\alpha_{2}\mid\beta_{2}$,
then $\alpha_{1}\alpha_{2}\mid\beta_{1}\beta_{2}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].div.2}.]This proof is completely
analogous to the proof of Proposition \ref{prop.ent.div.2}. (The only changes
you need to make are replacing the Roman letters $a,b,c,a_{1},a_{2}%
,b_{1},b_{2}$ by the corresponding Greek letters $\alpha,\beta,\gamma
,\alpha_{1},\alpha_{2},\beta_{1},\beta_{2}$, and replacing integers by
Gaussian integers. Of course, the resulting argument will use Proposition
\ref{prop.Z[i].gauss.ring} \textbf{(a)}, specifically the fact that the
product of two Gaussian integers is a Gaussian integer.)
\end{proof}

The next exercise is a Gaussian-integer analogue of Exercise
\ref{exe.ent.div.abba}:

\begin{exercise}
\label{exe.Z[i].div.abba}Let $\alpha$ and $\beta$ be two Gaussian integers
such that $\alpha\mid\beta$ and $\beta\mid\alpha$. Prove that $\alpha\sim
\beta$.
\end{exercise}

Note that the conclusion \textquotedblleft$\alpha\sim\beta$\textquotedblright%
\ in Exercise \ref{exe.Z[i].div.abba} is the proper Gaussian-integer analogue
of the conclusion \textquotedblleft$\left\vert a\right\vert =\left\vert
b\right\vert $\textquotedblright\ in Exercise \ref{exe.ent.div.abba} (since
(\ref{eq.Z[i].gauss.unit-Z}) shows that unit-equivalence on $\mathbb{Z}\left[
i\right]  $ is an analogue of the \textquotedblleft have the same absolute
value\textquotedblright\ relation on $\mathbb{Z}$). (We could have stated the
weaker conclusion $\left\vert \alpha\right\vert =\left\vert \beta\right\vert $
as well, but it would not be half as useful.)

A converse of Exercise \ref{exe.Z[i].div.abba} holds as well, so we have the
following equivalent description of unit-equivalence:

\begin{exercise}
\label{exe.Z[i].div.abba-conv}Let $\alpha$ and $\beta$ be two Gaussian
integers. Prove that we have the logical equivalence%
\[
\left(  \alpha\sim\beta\right)  \ \Longleftrightarrow\ \left(  \alpha\mid
\beta\text{ and }\beta\mid\alpha\right)  .
\]

\end{exercise}

The next exercise is an analogue of Exercise \ref{exe.ent.div.acbc}:

\begin{exercise}
\label{exe.Z[i].div.acbc}Let $\alpha,\beta,\gamma$ be three Gaussian integers
such that $\gamma\neq0$. Prove that $\alpha\mid\beta$ holds if and only if
$\alpha\gamma\mid\beta\gamma$.
\end{exercise}

The next exercise is an analogue of Exercise \ref{exe.ent.div.powers}:

\begin{exercise}
\label{exe.Z[i].div.powers}Let $\nu\in\mathbb{Z}\left[  i\right]  $. Let
$a,b\in\mathbb{N}$ be such that $a\leq b$. Prove that $\nu^{a}\mid\nu^{b}$.
\end{exercise}

Needless to say, the $a$ and $b$ in this exercise still have to be nonnegative
integers, since Gaussian integers make no sense as exponents.

The next exercise is an analogue of Exercise \ref{exe.ent.div.g|1}:

\begin{exercise}
\label{exe.Z[i].div.g|1}Let $\gamma$ be a Gaussian integer such that
$\gamma\mid1$. Prove that $\gamma\sim1$ (that is, $\gamma$ is a unit, i.e.,
either $1$ or $-1$ or $i$ or $-i$).
\end{exercise}

Next come two more trivial facts:

\begin{exercise}
\label{exe.Z[i].div.conj}Let $\alpha$ and $\beta$ be Gaussian integers such
that $\alpha\mid\beta$. Prove that $\overline{\alpha}\mid\overline{\beta}$.
\end{exercise}

\begin{exercise}
\label{exe.Z[i].div.uneq}Let $\alpha$, $\beta$ and $\gamma$ be three Gaussian
integers. Prove the following:

\textbf{(a)} If $\beta\sim\gamma$, then we have the logical equivalence
$\left(  \alpha\mid\beta\right)  \Longleftrightarrow\left(  \alpha\mid
\gamma\right)  $.

\textbf{(b)} If $\alpha\sim\beta$, then we have the logical equivalence
$\left(  \alpha\mid\gamma\right)  \Longleftrightarrow\left(  \beta\mid
\gamma\right)  $.

\textbf{(c)} Let $\delta$ be a further Gaussian integer. Assume that
$\alpha\sim\beta$ and $\gamma\sim\delta$. Then, we have the logical
equivalence $\left(  \alpha\mid\gamma\right)  \Longleftrightarrow\left(
\beta\mid\delta\right)  $.
\end{exercise}

Another useful and easily proven fact is the following:

\begin{exercise}
\label{exe.Z[i].div.proper}Let $\alpha$ and $\beta$ be Gaussian integers such
that $\alpha\mid\beta$ and $\operatorname*{N}\left(  \alpha\right)
=\operatorname*{N}\left(  \beta\right)  $. Prove that $\alpha\sim\beta$.
\end{exercise}

\begin{teachingnote}
\textbf{2019-03-06 lecture}
\end{teachingnote}

We have defined congruence for integers in Definition \ref{def.ent.cong}. We
can repeat the same definition for Gaussian integers:

\begin{definition}
\label{def.Z[i].cong}Let $\nu,\alpha,\beta\in\mathbb{Z}\left[  i\right]  $. We
say that $\alpha$ \textit{is congruent to }$\beta$ \textit{modulo }$\nu$ if
and only if $\nu\mid\alpha-\beta$. We shall use the notation \textquotedblleft%
$\alpha\equiv\beta\operatorname{mod}\nu$\textquotedblright\ for
\textquotedblleft$\alpha$ is congruent to $\beta$ modulo $\nu$%
\textquotedblright.

We furthermore shall use the notation \textquotedblleft$\alpha\not \equiv
\beta\operatorname{mod}\nu$\textquotedblright\ for \textquotedblleft$\alpha$
is not congruent to $\beta$ modulo $\nu$\textquotedblright.
\end{definition}

Once again, such a definition risks sneaking in ambiguity, but fortunately
this one does not: If $n,a,b\in\mathbb{Z}$, then the statement
\textquotedblleft$a\equiv b\operatorname{mod}n$\textquotedblright\ interpreted
according to Definition \ref{def.ent.cong} is equivalent to the statement
\textquotedblleft$a\equiv b\operatorname{mod}n$\textquotedblright\ interpreted
according to Definition \ref{def.Z[i].cong} (by treating $n,a,b$ as Gaussian
integers). To see why, recall that both statements are defined to mean
\textquotedblleft$n\mid a-b$\textquotedblright, and the meaning of the latter
statement does not depend on whether we interpret $n,a,b$ as integers or as
Gaussian integers\footnote{We have proven this latter fact shortly after
Definition \ref{def.Z[i].gauss.div}.}.

The next proposition is a straightforward analogue of Proposition
\ref{prop.ent.mod.0}:

\begin{proposition}
\label{prop.Z[i].mod.0}Let $\nu\in\mathbb{Z}\left[  i\right]  $ and $\alpha
\in\mathbb{Z}\left[  i\right]  $. Then, $\alpha\equiv0\operatorname{mod}\nu$
if and only if $\nu\mid\alpha$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].mod.0}.]This proof is analogous to the
proof of Proposition \ref{prop.ent.mod.0}.
\end{proof}

The next proposition is a straightforward analogue of Proposition
\ref{prop.ent.mod.basics}:

\begin{proposition}
\label{prop.Z[i].mod.basics}Let $\nu\in\mathbb{Z}\left[  i\right]  $.

\textbf{(a)} We have $\alpha\equiv\alpha\operatorname{mod}\nu$ for every
$\alpha\in\mathbb{Z}\left[  i\right]  $.

\textbf{(b)} If $\alpha,\beta,\gamma\in\mathbb{Z}\left[  i\right]  $ satisfy
$\alpha\equiv\beta\operatorname{mod}\nu$ and $\beta\equiv\gamma
\operatorname{mod}\nu$, then $\alpha\equiv\gamma\operatorname{mod}\nu$.

\textbf{(c)} If $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ satisfy
$\alpha\equiv\beta\operatorname{mod}\nu$, then $\beta\equiv\alpha
\operatorname{mod}\nu$.

\textbf{(d)} If $\alpha_{1},\alpha_{2},\beta_{1},\beta_{2}\in\mathbb{Z}\left[
i\right]  $ satisfy $\alpha_{1}\equiv\beta_{1}\operatorname{mod}\nu$ and
$\alpha_{2}\equiv\beta_{2}\operatorname{mod}\nu$, then%
\begin{align}
\alpha_{1}+\alpha_{2}  &  \equiv\beta_{1}+\beta_{2}\operatorname{mod}%
\nu;\label{eq.prop.Z[i].mod.basics.d.1}\\
\alpha_{1}-\alpha_{2}  &  \equiv\beta_{1}-\beta_{2}\operatorname{mod}%
\nu;\label{eq.prop.Z[i].mod.basics.d.2}\\
\alpha_{1}\alpha_{2}  &  \equiv\beta_{1}\beta_{2}\operatorname{mod}\nu.
\label{eq.prop.Z[i].mod.basics.d.3}%
\end{align}


\textbf{(e)} Let $\mu\in\mathbb{Z}\left[  i\right]  $ be such that $\mu\mid
\nu$. If $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ satisfy $\alpha
\equiv\beta\operatorname{mod}\nu$, then $\alpha\equiv\beta\operatorname{mod}%
\mu$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].mod.basics}.]This proof is analogous to
the proof of Proposition \ref{prop.ent.mod.basics}. (Of course, it relies on
parts \textbf{(a)} and \textbf{(b)} of Proposition \ref{prop.Z[i].gauss.ring},
and it uses Proposition \ref{prop.Z[i].div.2} instead of Proposition
\ref{prop.ent.div.2}.)
\end{proof}

\begin{exercise}
\label{exe.Z[i].modn.split}Let $n$ be an integer. Let $\left(  a,b\right)  $
and $\left(  c,d\right)  $ be two Gaussian integers. Prove that we have the
following logical equivalence:%
\[
\left(  \left(  a,b\right)  \equiv\left(  c,d\right)  \operatorname{mod}%
n\right)  \ \Longleftrightarrow\ \left(  a\equiv c\operatorname{mod}n\text{
and }b\equiv d\operatorname{mod}n\right)  .
\]
(Of course, the statement \textquotedblleft$\left(  a,b\right)  \equiv\left(
c,d\right)  \operatorname{mod}n$\textquotedblright\ is to be understood by
treating the integer $n$ as a Gaussian integer.)
\end{exercise}

\begin{exercise}
\label{exe.Z[i].modn.classes}For any Gaussian integer $\tau$, we let
$\underset{\tau}{\equiv}$ be the binary relation on $\mathbb{Z}\left[
i\right]  $ defined by
\[
\left(  \alpha\underset{\tau}{\equiv}\beta\right)  \ \iff\ \left(
\alpha\equiv\beta\operatorname{mod}\tau\right)  .
\]


\textbf{(a)} Prove that the relation $\underset{\tau}{\equiv}$ is an
equivalence relation whenever $\tau\in\mathbb{Z}\left[  i\right]  $.

We shall refer to the equivalence classes of this relation $\underset{\tau
}{\equiv}$ as the \textit{Gaussian residue classes modulo }$\tau$; let
$\mathbb{Z}\left[  i\right]  /\tau$ be the set of all these classes.

\textbf{(b)} Let $n$ be a positive integer. Thus, a relation
$\underset{n}{\equiv}$ on $\mathbb{Z}\left[  i\right]  $ is defined (by
treating the integer $n$ as a Gaussian integer). Exercise
\ref{exe.Z[i].modn.classes} \textbf{(a)} (applied to $\tau=n$) shows that this
relation $\underset{n}{\equiv}$ is an equivalence relation.

Prove that the equivalence classes of the relation $\underset{n}{\equiv}$ (on
$\mathbb{Z}\left[  i\right]  $) are the $n^{2}$ classes $\left[  a+bi\right]
_{\underset{n}{\equiv}}$ for $\left(  a,b\right)  \in\left\{  0,1,\ldots
,n-1\right\}  ^{2}$, and that these $n^{2}$ classes are all distinct.
\end{exercise}

\begin{example}
For $n=3$, Exercise \ref{exe.Z[i].modn.classes} \textbf{(b)} is saying that
the equivalence classes of the relation $\underset{3}{\equiv}$ (on
$\mathbb{Z}\left[  i\right]  $) are the $3^{2}$ classes%
\begin{align*}
&  \left[  0+0i\right]  _{\underset{3}{\equiv}},\ \ \ \ \ \ \ \ \ \ \left[
0+1i\right]  _{\underset{3}{\equiv}},\ \ \ \ \ \ \ \ \ \ \left[  0+2i\right]
_{\underset{3}{\equiv}},\\
&  \left[  1+0i\right]  _{\underset{3}{\equiv}},\ \ \ \ \ \ \ \ \ \ \left[
1+1i\right]  _{\underset{3}{\equiv}},\ \ \ \ \ \ \ \ \ \ \left[  1+2i\right]
_{\underset{3}{\equiv}},\\
&  \left[  2+0i\right]  _{\underset{3}{\equiv}},\ \ \ \ \ \ \ \ \ \ \left[
2+1i\right]  _{\underset{3}{\equiv}},\ \ \ \ \ \ \ \ \ \ \left[  2+2i\right]
_{\underset{3}{\equiv}},
\end{align*}
and that these $3^{2}$ classes are distinct. In contrast, the equivalence
classes of the analogous relation $\underset{3}{\equiv}$ on $\mathbb{Z}$ are
merely the $3$ classes $\left[  0\right]  _{\underset{3}{\equiv}},\left[
1\right]  _{\underset{3}{\equiv}},\left[  2\right]  _{\underset{3}{\equiv}}$
(by Theorem \ref{thm.eqrel.Z/n.explicit}).
\end{example}

\begin{remark}
Exercise \ref{exe.Z[i].modn.classes} \textbf{(b)} yields $\left\vert
\mathbb{Z}\left[  i\right]  /n\right\vert =n^{2}=\operatorname{N}\left(
n\right)  $ for any positive integer $n$. This is essentially \cite[Lemma
7.15]{Conrad-Gauss}. (Conrad proves this \textquotedblleft by
example\textquotedblright; you can follow the argument but you should write it
up in full generality.)

More generally, $\left\vert \mathbb{Z}\left[  i\right]  /\tau\right\vert
=\operatorname{N}\left(  \tau\right)  $ for any nonzero Gaussian integer
$\tau$. This is proven in \cite[Theorem 7.14]{Conrad-Gauss} (using Exercise
\ref{exe.Z[i].modn.classes} as a stepping stone).
\end{remark}

\subsubsection{Division with remainder}

Now, let us try to make division with remainder work for Gaussian integers.
This turns out to be tricky: There is no straightforward analogue of Theorem
\ref{thm.ent.quorem.full} for Gaussian integers. (In fact, it is not clear
what $\left\{  0,1,\ldots,b-1\right\}  $ would mean if we let $b$ be a
Gaussian integer.) The best thing we can get for Gaussian integers is an
analogue of Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)}:

\begin{theorem}
\label{thm.Z[i].gauss.quorem}Let $\alpha$ and $\beta\neq0$ be Gaussian
integers. There exist Gaussian integers $\gamma$ and $\rho$ such that
$\alpha=\gamma\beta+\rho$ and $\operatorname*{N}\left(  \rho\right)
\leq\operatorname*{N}\left(  \beta\right)  /2$.
\end{theorem}

Note that the pair $\left(  \gamma,\rho\right)  $ in this theorem is not
unique. As we have said, Theorem \ref{thm.Z[i].gauss.quorem} is an analogue of
Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)} (with $\alpha$, $\beta$,
$\gamma$ and $\rho$ taking the roles of $u$, $n$, $q$ and $r$), not an
analogue of Theorem \ref{thm.ent.quorem.full}; nevertheless, it is the closest
we can get to Theorem \ref{thm.ent.quorem.full} in $\mathbb{Z}\left[
i\right]  $, and can often be substituted in places where one would usually
want to apply Theorem \ref{thm.ent.quorem.full} (as long as one does not try
to use uniqueness of quotient and remainder).

Theorem \ref{thm.Z[i].gauss.quorem} can be visualized geometrically (similarly
to the visualizations shown in Remark \ref{rmk.ent.quo-rem.full.geo} and
Remark \ref{rmk.ent.quo-rem.minrem.geo}, but using the Argand diagram). See
\cite[\S 7]{Conrad-Gauss} for the details.

The following proof of Theorem \ref{thm.Z[i].gauss.quorem} follows \cite[proof
of Theorem 3.1]{Conrad-Gauss}.

\begin{proof}
[Proof of Theorem \ref{thm.Z[i].gauss.quorem}.]Let $n=\operatorname*{N}\left(
\beta\right)  $. Then, $n=\operatorname*{N}\left(  \beta\right)  >0$ (by
Proposition \ref{prop.CC.norm.basics} \textbf{(c)}, applied to $\beta$ instead
of $\alpha$), since $\beta\neq0$. Also, Proposition
\ref{prop.Z[i].gauss.Norm-N} (applied to $\beta$ instead of $\alpha$) yields
$\operatorname*{N}\left(  \beta\right)  \in\mathbb{N}$. Thus,
$n=\operatorname*{N}\left(  \beta\right)  \in\mathbb{N}$. Hence, $n$ is a
positive integer (since $n>0$).

Proposition \ref{prop.CC.norm.conj} \textbf{(a)} (applied to $\beta$ instead
of $\alpha$) yields $\operatorname*{N}\left(  \beta\right)  =\beta
\overline{\beta}$. Thus, $\beta\overline{\beta}=\operatorname*{N}\left(
\beta\right)  =n$.

Furthermore, Proposition \ref{prop.CC.norm.conj} \textbf{(b)} (applied to
$\beta$ instead of $\alpha$) yields $\operatorname*{N}\left(  \overline{\beta
}\right)  =\operatorname*{N}\left(  \beta\right)  =n$.

Note that $\overline{\beta}$ is a Gaussian integer\footnote{by Proposition
\ref{prop.Z[i].gauss.conj}, applied to $\beta$ instead of $\alpha$}.
Furthermore, $\beta\overline{\beta}=n\neq0$, so that $\beta\neq0$ and
$\overline{\beta}\neq0$. Hence, we can divide complex numbers by $\beta$ and
by $\overline{\beta}$. Thus,%
\[
\dfrac{\alpha}{\beta}=\dfrac{\alpha\overline{\beta}}{\beta\overline{\beta}%
}=\dfrac{\alpha\overline{\beta}}{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\beta\overline{\beta}=n\right)  .
\]
Note that $\alpha\overline{\beta}$ is a Gaussian integer (since $\alpha$ and
$\overline{\beta}$ are Gaussian integers); thus, we can write it in the form
\[
\alpha\overline{\beta}=\left(  u_{1},u_{2}\right)
\ \ \ \ \ \ \ \ \ \ \text{for some }u_{1},u_{2}\in\mathbb{Z}.
\]
Consider these $u_{1},u_{2}$.

Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)} (applied to $u=u_{1}$)
shows that there exists a pair $\left(  q_{1},r_{1}\right)  \in\mathbb{Z}%
\times\mathbb{Z}$ such that
\[
u_{1}=q_{1}n+r_{1}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left\vert
r_{1}\right\vert \leq n/2.
\]
Consider this pair.

Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)} (applied to $u=u_{2}$)
shows that there exists a pair $\left(  q_{2},r_{2}\right)  \in\mathbb{Z}%
\times\mathbb{Z}$ such that
\[
u_{2}=q_{2}n+r_{2}\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left\vert
r_{2}\right\vert \leq n/2.
\]
Consider this pair.

Squaring the inequality $\left\vert r_{1}\right\vert \leq n/2$, we obtain
$\left\vert r_{1}\right\vert ^{2}\leq\left(  n/2\right)  ^{2}$ (since
$\left\vert r_{1}\right\vert $ and $n/2$ are nonnegative (because $n>0$)). But
$\left\vert r_{1}\right\vert ^{2}=r_{1}^{2}$ (since $\left\vert r\right\vert
^{2}=r^{2}$ for every real $r$). Hence, $r_{1}^{2}=\left\vert r_{1}\right\vert
^{2}\leq\left(  n/2\right)  ^{2}=n^{2}/4$. Similarly, $r_{2}^{2}\leq n^{2}/4$.
Now, the complex number $r_{1}+r_{2}i=\left(  r_{1},r_{2}\right)  $ satisfies%
\begin{align*}
\operatorname*{N}\left(  r_{1}+r_{2}i\right)   &  =\underbrace{r_{1}^{2}%
}_{\leq n^{2}/4}+\underbrace{r_{2}^{2}}_{\leq n^{2}/4}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\operatorname*{N}%
\left(  r_{1}+r_{2}i\right)  \right) \\
&  \leq n^{2}/4+n^{2}/4=n^{2}/2.
\end{align*}
We can divide this inequality by $n$ (since $n>0$); thus, we find%
\begin{equation}
\dfrac{\operatorname*{N}\left(  r_{1}+r_{2}i\right)  }{n}\leq\dfrac{n^{2}%
/2}{n}=n/2=\operatorname*{N}\left(  \beta\right)  /2
\label{pf.thm.Z[i].gauss.quorem.norm-ineq}%
\end{equation}
(since $n=\operatorname*{N}\left(  \beta\right)  $).

But%
\begin{align}
\dfrac{\alpha}{\beta}  &  =\dfrac{\alpha\overline{\beta}}{n}=\dfrac{\left(
q_{1}n+r_{1}\right)  +\left(  q_{2}n+r_{2}\right)  i}{n}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\alpha\overline{\beta}=\left(
u_{1},u_{2}\right)  =\underbrace{u_{1}}_{=q_{1}n+r_{1}}+\underbrace{u_{2}%
}_{=q_{2}n+r_{2}}i=\left(  q_{1}n+r_{1}\right)  +\left(  q_{2}n+r_{2}\right)
i\right) \nonumber\\
&  =\left(  q_{1}+q_{2}i\right)  +\dfrac{r_{1}+r_{2}i}{n}.
\label{pf.thm.Z[i].gauss.quorem.4}%
\end{align}
Set $\gamma=q_{1}+q_{2}i$ and $\rho=\alpha-\gamma\beta$. Note that $\gamma$ is
a Gaussian integer (since $\gamma=q_{1}+q_{2}i=\left(  q_{1},q_{2}\right)  $
with $q_{1},q_{2}\in\mathbb{Z}$). Hence, all of $\alpha,\gamma,\beta$ are
Gaussian integers; thus, $\rho=\alpha-\gamma\beta$ is a Gaussian integer (by
multiple applications of Proposition \ref{prop.Z[i].gauss.ring}).

From $\rho=\alpha-\gamma\beta$, we obtain $\alpha=\gamma\beta+\rho$. Thus, it
remains to prove $\operatorname*{N}\left(  \rho\right)  \leq\operatorname*{N}%
\left(  \beta\right)  /2$.

The equation (\ref{pf.thm.Z[i].gauss.quorem.4}) rewrites as $\dfrac{\alpha
}{\beta}=\gamma+\dfrac{r_{1}+r_{2}i}{n}$ (since $q_{1}+q_{2}i=\gamma$).
Hence,
\[
\dfrac{r_{1}+r_{2}i}{n}=\dfrac{\alpha}{\beta}-\gamma=\dfrac{\alpha-\gamma
\beta}{\beta}=\dfrac{\rho}{\beta}%
\]
(since $\alpha-\gamma\beta=\rho$). Therefore,%
\begin{align*}
\rho &  =\beta\cdot\dfrac{r_{1}+r_{2}i}{n}=\beta\cdot\dfrac{r_{1}+r_{2}%
i}{\beta\overline{\beta}}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }%
n=\beta\overline{\beta}\right) \\
&  =\dfrac{r_{1}+r_{2}i}{\overline{\beta}}%
\end{align*}
and thus%
\begin{align*}
\operatorname*{N}\left(  \rho\right)   &  =\operatorname*{N}\left(
\dfrac{r_{1}+r_{2}i}{\overline{\beta}}\right)  =\dfrac{\operatorname*{N}%
\left(  r_{1}+r_{2}i\right)  }{\operatorname*{N}\left(  \overline{\beta
}\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.CC.conj.hom} \textbf{(e)}, applied to }%
r_{1}+r_{2}i\\
\text{and }\overline{\beta}\text{ instead of }\alpha\text{ and }\beta
\end{array}
\right) \\
&  =\dfrac{\operatorname*{N}\left(  r_{1}+r_{2}i\right)  }{n}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\operatorname*{N}\left(
\overline{\beta}\right)  =n\right) \\
&  \leq\operatorname*{N}\left(  \beta\right)  /2\ \ \ \ \ \ \ \ \ \ \left(
\text{by (\ref{pf.thm.Z[i].gauss.quorem.norm-ineq})}\right)  .
\end{align*}
Thus, we have found two Gaussian integers $\gamma$ and $\rho$ such that
$\alpha=\gamma\beta+\rho$ and $\operatorname*{N}\left(  \rho\right)
\leq\operatorname*{N}\left(  \beta\right)  /2$. This proves Theorem
\ref{thm.Z[i].gauss.quorem}.
\end{proof}

Note that we cannot define $\alpha//\beta$ or $\alpha\%\beta$ for Gaussian
integers $\alpha$ and $\beta$, since there is no uniqueness statement in
Theorem \ref{thm.Z[i].gauss.quorem}.

\subsubsection{Common divisors}

Next, we define the Gaussian divisors of a Gaussian integer (in analogy to
Definition \ref{def.ent.divisors.divisors}):

\begin{definition}
\label{def.Z[i].divisors.divisors}Let $\beta\in\mathbb{Z}\left[  i\right]  $.
The \textit{Gaussian divisors} of $\beta$ are defined as the Gaussian integers
that divide $\beta$.
\end{definition}

Note that we are calling them \textquotedblleft Gaussian
divisors\textquotedblright\ and not \textquotedblleft
divisors\textquotedblright, because when $\beta$ is an actual integer, there
are (usually) Gaussian divisors of $\beta$ that are not divisors of $\beta$
(in the sense of Definition \ref{def.ent.divisors.divisors}). For example,
$1+i$ is a Gaussian divisor of $2$ (since $2=\left(  1+i\right)  \left(
1-i\right)  $), but the only divisors of $2$ (in the sense of Definition
\ref{def.ent.divisors.divisors}) are $-2,-1,1,2$. This is one of those
situations where using the same name for a concept and its Gaussian-integer
analogue would lead to ambiguities.

The following is an analogue of Proposition \ref{prop.ent.divisors.find}:

\begin{proposition}
\label{prop.Z[i].divisors.find}\textbf{(a)} If $\beta\in\mathbb{Z}\left[
i\right]  $, then $1$ and $\beta$ are Gaussian divisors of $\beta$.

\textbf{(b)} The Gaussian divisors of $0$ are all the Gaussian integers.

\textbf{(c)} Let $\beta\in\mathbb{Z}\left[  i\right]  $ be nonzero. Then, all
Gaussian divisors of $\beta$ belong to the set%
\[
\left\{  x+yi\ \mid\ x,y\in\mathbb{Z}\text{ satisfying }x^{2}\leq
\operatorname*{N}\left(  \beta\right)  \text{ and }y^{2}\leq\operatorname*{N}%
\left(  \beta\right)  \right\}  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].divisors.find}.]\textbf{(a)} Let
$\beta\in\mathbb{Z}\left[  i\right]  $. Then, $\beta=1\beta$. Hence,
$1\mid\beta$ (since $\beta$ is a Gaussian integer). In other words, $1$ is a
Gaussian divisor of $\beta$.

Also, $\beta=\beta\cdot1$. Hence, $\beta\mid\beta$ (since $1$ is a Gaussian
integer). In other words, $\beta$ is a Gaussian divisor of $\beta$.

So we have shown that $1$ and $\beta$ are Gaussian divisors of $\beta$. This
proves Proposition \ref{prop.Z[i].divisors.find} \textbf{(a)}.

\textbf{(b)} If $\beta$ is a Gaussian integer, then $0=\beta\cdot0$, and thus
$\beta$ is a Gaussian divisor of $0$ (since $0$ is a Gaussian integer). In
other words, each Gaussian integer is a Gaussian divisor of $0$. Conversely,
each Gaussian divisor of $0$ is a Gaussian integer (by definition). Combining
these two statements, we conclude that the Gaussian divisors of $0$ are all
the Gaussian integers. This proves Proposition \ref{prop.Z[i].divisors.find}
\textbf{(b)}.

\textbf{(c)} Let $\alpha$ be a Gaussian divisor of $\beta$. Write the complex
number $\alpha$ in the form $\alpha=\left(  a,b\right)  $ with $a,b\in
\mathbb{C}$. Then, $a,b\in\mathbb{Z}$ (since $\alpha$ is a Gaussian integer)
and $\operatorname*{N}\left(  \alpha\right)  =a^{2}+b^{2}$ (by the definition
of $\operatorname*{N}\left(  \alpha\right)  $). But $\alpha\mid\beta$ (since
$\alpha$ is a Gaussian divisor of $\beta$) and $\beta\neq0$ (since $\beta$ is
nonzero). Hence, Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(b)} yields
$\operatorname*{N}\left(  \alpha\right)  \leq\operatorname*{N}\left(
\beta\right)  $. But $a,b$ are reals, and thus $a^{2},b^{2}$ are nonnegative
reals (since the square of a real is always a nonnegative real). In other
words, $a^{2}\geq0$ and $b^{2}\geq0$.

Now, $\operatorname*{N}\left(  \alpha\right)  =a^{2}+\underbrace{b^{2}}%
_{\geq0}\geq a^{2}$, so that $a^{2}\leq\operatorname*{N}\left(  \alpha\right)
\leq\operatorname*{N}\left(  \beta\right)  $. Also, $\operatorname*{N}\left(
\alpha\right)  =\underbrace{a^{2}}_{\geq0}+b^{2}\geq b^{2}$, so that
$b^{2}\leq\operatorname*{N}\left(  \alpha\right)  \leq\operatorname*{N}\left(
\beta\right)  $. Also, $\alpha=\left(  a,b\right)  =a+bi$. Hence, we have
$\alpha=x+yi$ for some $x,y\in\mathbb{Z}$ satisfying $x^{2}\leq
\operatorname*{N}\left(  \beta\right)  $ and $y^{2}\leq\operatorname*{N}%
\left(  \beta\right)  $ (namely, for $x=a$ and $y=b$). In other words,%
\[
\alpha\in\left\{  x+yi\ \mid\ x,y\in\mathbb{Z}\text{ satisfying }x^{2}%
\leq\operatorname*{N}\left(  \beta\right)  \text{ and }y^{2}\leq
\operatorname*{N}\left(  \beta\right)  \right\}  .
\]


Now, forget that we fixed $\alpha$. We thus have shown that if $\alpha$ is a
Gaussian divisor of $\beta$, then%
\[
\alpha\in\left\{  x+yi\ \mid\ x,y\in\mathbb{Z}\text{ satisfying }x^{2}%
\leq\operatorname*{N}\left(  \beta\right)  \text{ and }y^{2}\leq
\operatorname*{N}\left(  \beta\right)  \right\}  .
\]
In other words, all Gaussian divisors of $\beta$ belong to the set%
\[
\left\{  x+yi\ \mid\ x,y\in\mathbb{Z}\text{ satisfying }x^{2}\leq
\operatorname*{N}\left(  \beta\right)  \text{ and }y^{2}\leq\operatorname*{N}%
\left(  \beta\right)  \right\}  .
\]
This proves Proposition \ref{prop.Z[i].divisors.find} \textbf{(c)}.
\end{proof}

Thus, again, finding all Gaussian divisors of a Gaussian integer $\beta$ is a
problem solvable in finite time. (Indeed, if $\beta=0$, then Proposition
\ref{prop.Z[i].divisors.find} \textbf{(b)} answers this question; but
otherwise, the set in Proposition \ref{prop.Z[i].divisors.find} \textbf{(c)}
is clearly finite.)

The following is a straightforward analogue of Definition \ref{def.ent.Div}:

\begin{definition}
\label{def.Z[i].Div}Let $\beta_{1},\beta_{2},\ldots,\beta_{k}$ be Gaussian
integers. Then, the \textit{common Gaussian divisors} of $\beta_{1},\beta
_{2},\ldots,\beta_{k}$ are defined to be the Gaussian integers $\alpha$ that
satisfy%
\begin{equation}
\left(  \alpha\mid\beta_{i}\text{ for all }i\in\left\{  1,2,\ldots,k\right\}
\right)  \label{eq.def.Z[i].Div.cond}%
\end{equation}
(in other words, that divide all of the Gaussian integers $\beta_{1},\beta
_{2},\ldots,\beta_{k}$). We let $\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $
denote the set of these common Gaussian divisors.
\end{definition}

The reason why I chose the notation $\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $
rather than the simpler notation $\operatorname*{Div}\left(  \beta_{1}%
,\beta_{2},\ldots,\beta_{k}\right)  $ is that the latter would be ambiguous.
In fact, when $\beta_{1},\beta_{2},\ldots,\beta_{k}$ are integers, the set
$\operatorname*{Div}\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $ of
common divisors of $\beta_{1},\beta_{2},\ldots,\beta_{k}$ is \textbf{not} the
set $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $ of common Gaussian divisors of
$\beta_{1},\beta_{2},\ldots,\beta_{k}$. (For example, the former set does not
contain $i$, while the latter does.)

We cannot directly define a \textquotedblleft greatest common Gaussian divisor
of $\beta_{1},\beta_{2},\ldots,\beta_{k}$\textquotedblright\ to be the
greatest element of $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $, since
\textquotedblleft greatest\textquotedblright\ does not make sense for complex
numbers. (Even if we wanted \textquotedblleft greatest in
norm\textquotedblright, it would not a-priori be obvious that there are no
ties, i.e., that such a greatest common Gaussian divisor is unique.)

However, it turns out that a \textquotedblleft greatest common Gaussian
divisor\textquotedblright\ $\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $ actually can be
defined reasonably (although only up to multiplication by units). Before we
can do so, let us state some basic properties of common Gaussian
divisors:\footnote{Proposition \ref{prop.Z[i].gauss.divrules} is an analogue
of part of Lemma \ref{lem.ent.Div.props1}. Thus, we have chosen to label its
claims in a way that matches the corresponding claims in Lemma
\ref{lem.ent.Div.props1}. This forced us to skip claim \textbf{(e)}, since
there is no analogue of Lemma \ref{lem.ent.Div.props1} \textbf{(e)} for
Gaussian integers (because $\beta\%\alpha$ is not defined when $\beta$ and
$\alpha$ are Gaussian integers).}

\begin{proposition}
\label{prop.Z[i].gauss.divrules}\textbf{(a)} We have $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,0\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha\right)  $ for all $\alpha\in\mathbb{Z}\left[  i\right]  $.

\textbf{(b)} We have $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  =\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \beta,\alpha\right)  $ for all
$\alpha,\beta\in\mathbb{Z}\left[  i\right]  $.

\textbf{(c)} We have $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\eta\alpha+\beta\right)  =\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ for all
$\alpha,\beta,\eta\in\mathbb{Z}\left[  i\right]  $.

\textbf{(d)} If $\alpha,\beta,\gamma\in\mathbb{Z}\left[  i\right]  $ satisfy
$\beta\equiv\gamma\operatorname{mod}\alpha$, then $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\gamma\right)  $.

\textbf{(f)} We have $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  \subseteq\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha\right)  $ and
$\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  \subseteq\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \beta\right)  $ for all $\alpha,\beta\in\mathbb{Z}\left[
i\right]  $.

\textbf{(g)} We have $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \eta\alpha,\beta\right)  =\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ for all
$\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ and every unit $\eta
\in\mathbb{Z}\left[  i\right]  $.

\textbf{(h)} We have $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\eta\beta\right)  =\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ for all
$\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ and every unit $\eta
\in\mathbb{Z}\left[  i\right]  $.

\textbf{(i)} If $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ satisfy
$\alpha\mid\beta$, then $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  =\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha\right)  $.

\textbf{(j)} The common Gaussian divisors of the empty list of Gaussian
integers are $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  {}\right)  =\mathbb{Z}\left[  i\right]  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.divrules}.]Parts \textbf{(a)},
\textbf{(b)}, \textbf{(c)}, \textbf{(d)}, \textbf{(f)}, \textbf{(i)} and
\textbf{(j)} of Proposition \ref{prop.Z[i].gauss.divrules} are analogues of
the corresponding parts of Lemma \ref{lem.ent.Div.props1}. Their proofs also
are straightforward adaptations of the proofs of the latter parts; we trust
the reader to perform the necessary replacements. Thus, it remains to prove
parts \textbf{(g)} and \textbf{(h)} of Proposition
\ref{prop.Z[i].gauss.divrules} (which are similar to parts \textbf{(g)} and
\textbf{(h)} of Lemma \ref{lem.ent.Div.props1}, but perhaps not in a
completely evident way). Let us do this now.

\textbf{(g)} Let $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $. Let $\eta
\in\mathbb{Z}\left[  i\right]  $ be a unit.

Let $\xi$ be a Gaussian integer. We have $\eta\alpha=\gamma\alpha$ for some
unit $\gamma\in\mathbb{Z}\left[  i\right]  $ (namely, for $\gamma=\eta$). In
other words, $\eta\alpha\sim\alpha$ (by the definition of the relation $\sim$
on $\mathbb{Z}\left[  i\right]  $). Hence, Exercise \ref{exe.Z[i].div.uneq}
\textbf{(a)} (applied to $\xi$, $\eta\alpha$ and $\alpha$ instead of $\alpha$,
$\beta$ and $\gamma$) shows that we have the logical equivalence $\left(
\xi\mid\alpha\right)  \Longleftrightarrow\left(  \xi\mid\eta\alpha\right)  $.

But we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  \xi\in\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  \right) \\
&  \Longleftrightarrow\ \left(  \xi\text{ is a common Gaussian divisor of
}\alpha\text{ and }\beta\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  \right)
\\
&  \Longleftrightarrow\ \left(  \underbrace{\xi\mid\alpha}%
_{\Longleftrightarrow\left(  \xi\mid\eta\alpha\right)  }\text{ and }\xi
\mid\beta\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of a \textquotedblleft
common Gaussian divisor\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \xi\mid\eta\alpha\text{ and }\xi\mid
\beta\right) \\
&  \Longleftrightarrow\ \left(  \xi\text{ is a common Gaussian divisor of
}\eta\alpha\text{ and }\beta\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of a \textquotedblleft
common Gaussian divisor\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \xi\in\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \eta\alpha,\beta\right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \eta\alpha,\beta\right)
\right)  .
\end{align*}


Now, forget that we fixed $\xi$. We thus have proved the logical equivalence
\newline$\left(  \xi\in\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  \right)  \ \Longleftrightarrow
\ \left(  \xi\in\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \eta\alpha,\beta\right)  \right)  $ for each Gaussian integer $\xi$.
In other words, a Gaussian integer belongs to $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ if and
only if it belongs to $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \eta\alpha,\beta\right)  $. Thus, $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \eta
\alpha,\beta\right)  $ (since both $\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  $ and $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \eta\alpha,\beta\right)  $ are
sets of Gaussian integers). This proves Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(g)}.

\textbf{(h)} We can prove Proposition \ref{prop.Z[i].gauss.divrules}
\textbf{(h)} in a similar way to Proposition \ref{prop.Z[i].gauss.divrules}
\textbf{(g)}. Alternatively, we can derive it from the already proven parts of
Proposition \ref{prop.Z[i].gauss.divrules} as follows:

Let $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $. Let $\eta\in\mathbb{Z}%
\left[  i\right]  $ be a unit. Then, Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(b)} (applied to $\eta\beta$ instead of
$\beta$) yields%
\begin{align*}
\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha
,\eta\beta\right)   &  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \eta\beta,\alpha\right)  =\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \beta,\alpha\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.Z[i].gauss.divrules} \textbf{(g)}, applied to
}\beta\text{ and }\alpha\\
\text{instead of }\alpha\text{ and }\beta
\end{array}
\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(b)}}\right)  .
\end{align*}
Thus, Proposition \ref{prop.Z[i].gauss.divrules} \textbf{(h)} is proven.
\end{proof}

%

\[%
\begin{tabular}
[c]{||l||}\hline\hline
\textbf{You have reached the end of the finished part.}\\
\textbf{TODO: Write on from here.}\\\hline\hline
\end{tabular}
\]


Recall that Proposition \ref{prop.ent.gcd.props1} gave us a quick way to
compute $\gcd\left(  a,b\right)  $ for two nonnegative integers $a$ and $b$;
this is called the Euclidean algorithm. Likewise, we can use Proposition
\ref{prop.Z[i].gauss.divrules} to compute $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ for two
Gaussian integers $\alpha$ and $\beta$ (or, more precisely, to rewrite
$\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  $ in the form $\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \gamma\right)  $ for a single Gaussian integer
$\gamma$). For example, we can compute $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  32+9i,4+11i\right)  $ as
follows:\footnote{This is \cite[Example 4.4]{Conrad-Gauss}.}%
\begin{align*}
&  \operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
32+9i,4+11i\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
4+11i,\underbrace{32+9i}_{\substack{=\left(  2-2i\right)  \left(
4+11i\right)  +\left(  2-5i\right)  }}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.Z[i].gauss.divrules} \textbf{(b)}}\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
4+11i,\left(  2-2i\right)  \left(  4+11i\right)  +\left(  2-5i\right)  \right)
\\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
4+11i,2-5i\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(c)}}\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
2-5i,\underbrace{4+11i}_{=\left(  -2+i\right)  \left(  2-5i\right)  +\left(
3-i\right)  }\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(b)}}\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
2-5i,\left(  -2+i\right)  \left(  2-5i\right)  +\left(  3-i\right)  \right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
2-5i,3-i\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(c)}}\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
3-i,\underbrace{2-5i}_{=\left(  1-i\right)  \left(  3-i\right)  -i}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(b)}}\right)
\end{align*}%
\begin{align*}
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
3-i,\left(  1-i\right)  \left(  3-i\right)  -i\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
3-i,-i\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(c)}}\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
-i,\underbrace{3-i}_{=\left(  1+3i\right)  \left(  -i\right)  +0}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(b)}}\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
-i,\left(  1+3i\right)  \left(  -i\right)  +0\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
-i,0\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(c)}}\right) \\
&  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
-i\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.Z[i].gauss.divrules} \textbf{(a)}}\right) \\
&  =\left\{  1,i,-1,-i\right\}  .
\end{align*}
In the same way, for \textbf{any} two Gaussian integers $\alpha$ and $\beta$
we can find a Gaussian integer $\gamma$ such that $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\gamma\right)  $. This resulting $\gamma$ will actually be unique up to
multiplication by units (i.e., its unit-equivalence class will be unique).
Better yet, we have the following analogue of Bezout's theorem for Gaussian integers:

\begin{theorem}
\label{thm.Z[i].gauss.bezout}Let $\alpha,\beta\in\mathbb{Z}\left[  i\right]
$. Then:

\textbf{(a)} There exists a $\mathbb{Z}\left[  i\right]  $-linear combination
$\gamma$ of $\alpha$ and $\beta$ that is a common Gaussian divisor of $\alpha$
and $\beta$. (Note: A $\mathbb{Z}\left[  i\right]  $\textit{-linear
combination of }$\alpha$\textit{ and }$\beta$ means a Gaussian integer of the
form $\lambda\alpha+\mu\beta$ with $\lambda,\mu\in\mathbb{Z}\left[  i\right]
$.)

\textbf{(b)} Any such $\gamma$ satisfies $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\gamma\right)  $.

\textbf{(c)} The unit-equivalence class of this $\gamma$ is uniquely determined.
\end{theorem}

This theorem is, in a sense, a generalization of Theorem
\ref{thm.ent.gcd.bezout}, even though (unlike the latter theorem) it does not
rely on an already existing concept of \textquotedblleft greatest common
divisor\textquotedblright\ but rather builds the foundation for such a
concept. With Theorem \ref{thm.Z[i].gauss.bezout} in hand, it makes sense to
call $\gamma$ the \textquotedblleft greatest common Gaussian
divisor\textquotedblright\ of $\alpha$ and $\beta$, but rigorously speaking
this name should be reserved for the unit-equivalence class of $\gamma$ since
$\gamma$ itself is not unique.

\begin{teachingnote}
\textbf{2019-03-08 lecture}
\end{teachingnote}

\begin{proof}
[Proof of Theorem \ref{thm.Z[i].gauss.bezout} (sketched).]\textbf{(a)} This is
somewhat similar to the proof of Lemma \ref{lem.ent.gcd.bezout.++}:

For any $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $, we let
$\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  $ be the set of all $\mathbb{Z}\left[  i\right]  $-linear
combinations of $\alpha$ and $\beta$. (This will be called the $\mathbb{Z}%
\left[  i\right]  $\textit{-linear span of }$\alpha$ \textit{and }$\beta$
later on, in analogy to spans in classical linear algebra.) Now, the claim of
Theorem \ref{thm.Z[i].gauss.bezout} \textbf{(a)} can be restated as follows:%
\begin{equation}
\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  \cap\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  \neq\varnothing
\label{pf.thm.Z[i].gauss.bezout.a.nem}%
\end{equation}
for any $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $.

We shall prove (\ref{pf.thm.Z[i].gauss.bezout.a.nem}) by strong induction on
$\operatorname*{N}\left(  \alpha\right)  +\operatorname*{N}\left(
\beta\right)  $.

So we fix $n\in\mathbb{N}$, and assume as the induction hypothesis that
(\ref{pf.thm.Z[i].gauss.bezout.a.nem}) holds for all $\alpha,\beta
\in\mathbb{Z}\left[  i\right]  $ satisfying $\operatorname*{N}\left(
\alpha\right)  +\operatorname*{N}\left(  \beta\right)  <n$. We must now prove
(\ref{pf.thm.Z[i].gauss.bezout.a.nem}) for all $\alpha,\beta\in\mathbb{Z}%
\left[  i\right]  $ satisfying $\operatorname*{N}\left(  \alpha\right)
+\operatorname*{N}\left(  \beta\right)  =n$.

So let $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ be such that
$\operatorname*{N}\left(  \alpha\right)  +\operatorname*{N}\left(
\beta\right)  =n$. We must prove $\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  \cap\operatorname*{Lin}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
\neq\varnothing$. We can WLOG assume $\operatorname*{N}\left(  \beta\right)
\geq\operatorname*{N}\left(  \alpha\right)  $, since otherwise we can swap
$\alpha$ with $\beta$ without changing any of the sets $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ and
$\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  $. Assume this. Furthermore, we WLOG assume that
$\alpha\neq0$ (since otherwise, the set $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
\cap\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  0,\beta\right)  \cap\operatorname*{Lin}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  0,\beta\right)  $ clearly
contains $\beta$ and thus is $\neq\varnothing$). Hence, $\operatorname*{N}%
\left(  \alpha\right)  >0$. Now, Theorem \ref{thm.Z[i].gauss.quorem} (applied
to $\beta$ and $\alpha$ instead of $\alpha$ and $\beta$) yields that there
exist Gaussian integers $\gamma$ and $\rho$ such that $\beta=\gamma\alpha
+\rho$ and $\operatorname*{N}\left(  \rho\right)  \leq\operatorname*{N}\left(
\alpha\right)  /2$. Consider these $\gamma$ and $\rho$. From $\beta
=\gamma\alpha+\rho$, we obtain $\rho=\beta-\gamma\alpha$ and $\beta
-\rho=\gamma\alpha$. From $\operatorname*{N}\left(  \rho\right)
\leq\operatorname*{N}\left(  \alpha\right)  /2$, we obtain
\[
\operatorname*{N}\left(  \rho\right)  \leq\operatorname*{N}\left(
\alpha\right)  /2<\operatorname*{N}\left(  \alpha\right)  .
\]
(This is the only inequality that we will need concerning $\operatorname*{N}%
\left(  \rho\right)  $. So, in a sense, the inequality $\operatorname*{N}%
\left(  \rho\right)  \leq\operatorname*{N}\left(  \alpha\right)  /2$ in
Theorem \ref{thm.Z[i].gauss.quorem} is better than we need it to be.)

The Gaussian integers $\beta$ and $\rho$ satisfy $\beta\equiv\rho
\operatorname{mod}\alpha$ (since $\alpha\mid\gamma\alpha=\beta-\rho$). Hence,
Proposition \ref{prop.Z[i].gauss.divrules} \textbf{(d)} yields
\begin{equation}
\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\rho\right)  .
\label{pf.thm.Z[i].gauss.bezout.a.Div=Div}%
\end{equation}
Also, it is easy to see that $\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  \subseteq\operatorname*{Lin}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\rho\right)  $ (since
every $\lambda,\mu\in\mathbb{Z}\left[  i\right]  $ satisfy%
\[
\lambda\alpha+\mu\underbrace{\beta}_{=\gamma\alpha+\rho}=\lambda\alpha
+\mu\left(  \gamma\alpha+\rho\right)  =\left(  \lambda+\mu\gamma\right)
\alpha+\mu\rho\in\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\rho\right)
\]
) and $\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\rho\right)  \subseteq\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  $ (since every $\lambda,\mu
\in\mathbb{Z}\left[  i\right]  $ satisfy%
\[
\lambda\alpha+\mu\underbrace{\rho}_{=\beta-\gamma\alpha}=\lambda\alpha
+\mu\left(  \beta-\gamma\alpha\right)  =\left(  \lambda-\mu\gamma\right)
\alpha+\mu\beta\in\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)
\]
). Combining these two relations, we obtain
\begin{equation}
\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  =\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\rho\right)  .
\label{pf.thm.Z[i].gauss.bezout.a.Lin=Lin}%
\end{equation}


Thus,%
\[
\underbrace{\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  }_{=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\rho\right)  }\cap\underbrace{\operatorname*{Lin}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
}_{=\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\rho\right)  }=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\rho\right)  \cap\operatorname*{Lin}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\rho\right)  .
\]
Hence, proving $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  \cap\operatorname*{Lin}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  \neq\varnothing$ boils down to
proving $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\rho\right)  \cap\operatorname*{Lin}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\rho\right)  \neq\varnothing$. But this follows from
the induction hypothesis (applied to $\rho$ instead of $\beta$), since%
\[
\operatorname*{N}\left(  \alpha\right)  +\underbrace{\operatorname*{N}\left(
\rho\right)  }_{<\operatorname*{N}\left(  \alpha\right)  \leq\operatorname*{N}%
\left(  \beta\right)  }<\operatorname*{N}\left(  \alpha\right)
+\operatorname*{N}\left(  \beta\right)  =n.
\]
This completes the induction step. Hence,
(\ref{pf.thm.Z[i].gauss.bezout.a.nem}) (and thus Theorem
\ref{thm.Z[i].gauss.bezout} \textbf{(a)}) follows by strong induction.

\textbf{(b)} We shall prove $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  \subseteq\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \gamma\right)  $ and
$\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  \supseteq\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \gamma\right)  $ separately:

$\subseteq:$ Since $\gamma$ is a $\mathbb{Z}\left[  i\right]  $-linear
combination of $\alpha$ and $\beta$, every common Gaussian divisor of $\alpha$
and $\beta$ must also divide $\gamma$. Thus, $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
\subseteq\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\gamma\right)  $.

$\supseteq:$ Since $\gamma$ is a common Gaussian divisor of $\alpha$ and
$\beta$, every Gaussian divisor of $\gamma$ must be a common Gaussian divisor
of $\alpha$ and $\beta$. Thus, $\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  \supseteq\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \gamma\right)  $.

\textbf{(c)} Let $\gamma_{1}$ and $\gamma_{2}$ be two such $\gamma$'s. We must
prove that $\gamma_{1}\sim\gamma_{2}$.

We have $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \gamma_{1}\right)  $ and $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \gamma
_{2}\right)  $. Comparing these two equalities, we obtain $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \gamma_{1}\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \gamma
_{2}\right)  $. Now, $\gamma_{1}\in\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \gamma_{1}\right)  =\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \gamma_{2}\right)  $, thus
$\gamma_{1}\mid\gamma_{2}$. Similarly, $\gamma_{2}\mid\gamma_{1}$. Combining
these, we obtain $\gamma_{1}\sim\gamma_{2}$ (by Exercise
\ref{exe.Z[i].div.abba}). This proves Theorem \ref{thm.Z[i].gauss.bezout}
\textbf{(c)}.
\end{proof}

\begin{definition}
\label{def.Z[i].gauss.gcd}The \textit{greatest common Gaussian divisor} (or,
short, \textit{gcd}) of two Gaussian integers $\alpha$ and $\beta$ is defined
to be the $\gamma$ from Theorem \ref{thm.Z[i].gauss.bezout} \textbf{(a)}. It
is called $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha
,\beta\right)  $.

So it is a common Gaussian divisor of $\alpha$ and $\beta$ and also a
$\mathbb{Z}\left[  i\right]  $-linear combination of $\alpha$ and $\beta$ and
satisfies
\begin{equation}
\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
\right)  =\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  . \label{eq.def.Z[i].gauss.gcd.Div=Div}%
\end{equation}


However, it is only well-defined up to unit-equivalence. Thus, if you have
$\gamma_{1}=\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha
,\beta\right)  $ and $\gamma_{2}=\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  $, then you cannot conclude that $\gamma
_{1}=\gamma_{2}$ (you can only conclude $\gamma_{1}\sim\gamma_{2}$). So,
strictly speaking, we should have defined $\gcd\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  $ as a unit-equivalence class, not as
a concrete Gaussian integer. But we will allow ourselves this abuse of
notation. We shall not write equality signs like the one in \textquotedblleft%
$\gamma_{1}=\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha
,\beta\right)  $\textquotedblright, however; we instead prefer to write
\textquotedblleft$\gamma_{1}\sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  $\textquotedblright. Generally, whenever you see
$\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ in
a statement, you should be understanding the statement to hold for
\textbf{every} possible choice of $\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  $.
\end{definition}

\begin{proposition}
\label{prop.Z[i].gauss.gcd=gcd}Let $a$ and $b$ be two integers. Then,%
\[
\gcd\left(  a,b\right)  \sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  a,b\right)  .
\]
(Of course, the $\gcd$ on the left hand side is the gcd of the two integers
$a$ and $b$ as defined in Definition \ref{def.ent.gcd.gcd}, whereas the
$\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }$ on the right hand side is the
greatest common Gaussian divisor of the Gaussian integers $a$ and $b$.)
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].gauss.gcd=gcd}.]The integer $\gcd\left(
a,b\right)  $ is a common divisor of $a$ and $b$ and also is a $\mathbb{Z}%
$-linear combination of $a$ and $b$ (by Bezout's theorem). Therefore, it is
also a common Gaussian divisor of the Gaussian integers $a$ and $b$ and also
is a $\mathbb{Z}\left[  i\right]  $-linear combination of $a$ and $b$. But
this yields that it is $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
a,b\right)  $ (due to the definition of $\gcd\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  a,b\right)  $).
\end{proof}

This proposition allows us to write \textquotedblleft$\gcd$\textquotedblright%
\ for both concepts of gcd without having to disambiguate the meaning. (We
shall not do so, however.)

\begin{proposition}
\label{prop.Z[i].gauss.gcd-as-max}Let $\alpha$ and $\beta$ be two Gaussian
integers, not both equal to $0$. Then, the possible values of $\gcd
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ (that
is, strictly speaking, all four elements of the unit-equivalence class
$\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $)
are exactly the elements of $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  $ having the largest norm.
\end{proposition}

\begin{proof}
First of all, $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  $ is a common Gaussian divisor of $\alpha$ and $\beta$,
and thus is $\neq0$ (since $\alpha$ and $\beta$ are not both equal to $0$).
Thus, there are exactly four Gaussian integers unit-equivalent to
$\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $.
In other words, there are exactly four possible values of $\gcd
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $. We
must show that these values are exactly the elements of $\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ having
the largest norm.

In other words, we must show the following two claims:

\begin{statement}
\textit{Claim 1:} We have $\operatorname*{N}\left(  \gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  \right)  >\operatorname*{N}%
\left(  \gamma\right)  $ for each $\gamma\in\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ that
does not satisfy $\gamma\sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  $.
\end{statement}

\begin{statement}
\textit{Claim 2:} We have $\operatorname*{N}\left(  \gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  \right)  =\operatorname*{N}%
\left(  \gamma\right)  $ for each $\gamma\in\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ that
does satisfy $\gamma\sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  $.
\end{statement}

Claim 2 is obvious, since any two unit-equivalent Gaussian integers have the
same norm (by Proposition \ref{prop.Z[i].gauss.uniteq.norm=norm}).

[\textit{Proof of Claim 1:} Let $\gamma\in\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ do not
satisfy $\gamma\sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  $. Now, $\gamma\in\operatorname*{Div}%
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
\right)  $ (by (\ref{eq.def.Z[i].gauss.gcd.Div=Div})). Hence, $\gamma\mid
\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $.

Let us set $\delta=\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  $. So $\gamma\mid\delta$. We have $\delta\neq0$ (because
$\alpha$ and $\beta$ are not both zero) and thus $\gamma\neq0$ (since
$\gamma\mid\delta$). Thus, $\gamma\mid\delta$ yields that $\dfrac{\delta
}{\gamma}$ is a Gaussian integer, which is furthermore nonzero (since
$\delta\neq0$). If this Gaussian integer $\dfrac{\delta}{\gamma}$ was a unit,
then we would have $\gamma\sim\delta=\gcd\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  $, which would contradict the
assumption that $\gamma$ does not satisfy $\gamma\sim\gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  $. So $\dfrac{\delta}{\gamma}$
is a nonzero Gaussian integer that is not a unit. Hence, $\operatorname*{N}%
\left(  \dfrac{\delta}{\gamma}\right)  >1$ (because Proposition
\ref{prop.Z[i].gauss.norm1} yields that every nonzero Gaussian integer that is
not a unit must have norm $>1$). Now,%
\[
\operatorname*{N}\left(  \delta\right)  =\underbrace{\operatorname*{N}\left(
\dfrac{\delta}{\gamma}\right)  }_{>1}\cdot\operatorname*{N}\left(
\gamma\right)  >\operatorname*{N}\left(  \gamma\right)  .
\]
In other words, $\operatorname*{N}\left(  \gcd\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha,\beta\right)  \right)  >\operatorname*{N}\left(
\gamma\right)  $. This proves Claim 1.]
\end{proof}

Proposition \ref{prop.Z[i].gauss.gcd-as-max} shows that $\gcd
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ is
uniquely determined by the set $\operatorname*{Div}\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  $. (Yes, you have to consider
the case $\alpha=\beta=0$ separately in proving this.) Hence, Proposition
\ref{prop.Z[i].gauss.divrules} yields:

\begin{proposition}
\label{prop.Z[i].gauss.gcdrules}\textbf{(a)} We have $\gcd
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,0\right)  \sim
\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha\right)  $ for all
$\alpha\in\mathbb{Z}\left[  i\right]  $.

\textbf{(b)} We have $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  \sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\beta,\alpha\right)  $ for all $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $.

\textbf{(c)} We have $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\eta\alpha+\beta\right)  \sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  $ for all $\alpha,\beta,\eta\in\mathbb{Z}\left[
i\right]  $.

\textbf{(d)} If $\alpha,\beta,\gamma\in\mathbb{Z}\left[  i\right]  $ satisfy
$\beta\equiv\gamma\operatorname{mod}\alpha$, then $\gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\beta\right)  \sim\gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha,\gamma\right)  $.

\textbf{(g)} We have $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\eta\alpha,\beta\right)  \sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  $ for all $\alpha,\beta\in\mathbb{Z}\left[
i\right]  $ and every unit $\eta\in\mathbb{Z}\left[  i\right]  $.

\textbf{(h)} We have $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\eta\beta\right)  \sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \alpha,\beta\right)  $ for all $\alpha,\beta\in\mathbb{Z}\left[
i\right]  $ and every unit $\eta\in\mathbb{Z}\left[  i\right]  $.

\textbf{(i)} If $\alpha,\beta\in\mathbb{Z}\left[  i\right]  $ satisfy
$\alpha\mid\beta$, then $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  \sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha\right)  $.

\textbf{(j)} The greatest common Gaussian divisor of the empty list of
Gaussian integers is $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
{}\right)  =0$.
\end{proposition}

Theorem \ref{thm.ent.gcd.uniprop} still holds for Gaussian integers.

Theorem \ref{thm.ent.gcd.combine} still holds for Gaussian integers.

Theorem \ref{thm.ent.gcd.cancel} still holds for Gaussian integers.

Theorem \ref{thm.ent.gcd.sa,sb} has to be modified as follows:

\begin{corollary}
Let $\sigma,\alpha,\beta\in\mathbb{Z}\left[  i\right]  $. Then,
\[
\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \sigma\alpha,\sigma
\beta\right)  \sim\sigma\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  .
\]

\end{corollary}

Exercise \ref{exe.ent.gcd.div} still holds for Gaussian integers.

Exercise \ref{exe.ent.gcd.abs} becomes the claim that if $\alpha_{1}\sim
\alpha_{2}$ and $\beta_{1}\sim\beta_{2}$, then $\gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha_{1},\beta_{1}\right)  \sim\gcd
\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha_{2},\beta_{2}\right)
$. The solution does not carry over, but you can easily prove this new claim
by hand.

Greatest common Gaussian divisors of $k$ Gaussian integers can also be defined.

The next definition is an analogue of Definition \ref{def.ent.coprime.coprime}:

\begin{definition}
\label{def.Z[i].gauss.coprime}Let $\alpha$ and $\beta$ be two Gaussian
integers. We say that $\alpha$ is \textit{coprime} to $\beta$ if and only if
$\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
\sim1$ (that is, $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\alpha,\beta\right)  $ is a unit).
\end{definition}

Thus, any two coprime integers are also two coprime Gaussian integers (because
of Proposition \ref{prop.Z[i].gauss.gcd=gcd}), and vice versa (for the same
reason). This is why we can afford speaking of \textquotedblleft coprime
Gaussian integers\textquotedblright\ and not just \textquotedblleft
Gaussian-coprime Gaussian integers\textquotedblright.

Everything we said about coprimality of integers still holds for Gaussian
integers. In particular, Proposition \ref{prop.ent.coprime.perp-symm}, Theorem
\ref{thm.ent.coprime.cancel}, Theorem \ref{thm.ent.coprime.combine}, Theorem
\ref{thm.ent.coprime.modinv} and Theorem \ref{thm.ent.coprime.ab-to-c} still
hold if all integers are replaced by Gaussian integers (with the caveat that
the gcd is no longer unique, so for example \textquotedblleft$ab\equiv
\gcd\left(  a,n\right)  \operatorname{mod}n$\textquotedblright\ must be
interpreted as \textquotedblleft$ab$ is congruent to \textbf{some} of the
possible values of $\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
a,n\right)  $ modulo $n$\textquotedblright).

\begin{noncompile}
Let us generalize Theorem \ref{thm.Z[i].gauss.bezout} to $k$ Gaussian integers:

\begin{theorem}
Let $\alpha_{1},\alpha_{2},\ldots,\alpha_{k}\in\mathbb{Z}\left[  i\right]  $. Then:

\textbf{(a)} There exists a $\mathbb{Z}\left[  i\right]  $-linear combination
$\gamma$ of $\alpha_{1},\alpha_{2},\ldots,\alpha_{k}$ that is a common
Gaussian divisor of $\alpha_{1},\alpha_{2},\ldots,\alpha_{k}$. (Note: A
$\mathbb{Z}\left[  i\right]  $\textit{-linear combination of }$\alpha
_{1},\alpha_{2},\ldots,\alpha_{k}$ means a Gaussian integer of the form
$\lambda_{1}\alpha_{1}+\lambda_{2}\alpha_{2}+\cdots+\lambda_{k}\alpha_{k}$
with $\lambda_{1},\lambda_{2},\ldots,\lambda_{k}\in\mathbb{Z}\left[  i\right]
$.)

\textbf{(b)} It satisfies $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{k}\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\gamma\right)  $.

\textbf{(c)} The unit-equivalence class of $\gamma$ is uniquely determined.
\end{theorem}

\begin{proof}
[Proof sketch.]Induction on $k$, similar to the proof of Theorem
\ref{thm.ent.gcd.uniprop-mul}. The details are left to the reader.
\end{proof}

Again, the $\gamma$ from this theorem is called $\gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{k}\right)  $
and is unique up to unit-equivalence.

Theorem \ref{thm.ent.gcd.uniprop-mul} generalizes as follows:

\begin{theorem}
Let $\beta_{1},\beta_{2},\ldots,\beta_{k}$ be integers.

\textbf{(a)} For each $\mu\in\mathbb{Z}\left[  i\right]  $, we have the
following logical equivalence:%
\[
\left(  \mu\mid\beta_{i}\text{ for all }i\in\left\{  1,2,\ldots,k\right\}
\right)  \ \Longleftrightarrow\ \left(  \mu\mid\gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)
\right)  .
\]


\textbf{(b)} The common Gaussian divisors of $\beta_{1},\beta_{2},\ldots
,\beta_{k}$ are precisely the Gaussian divisors of $\gcd\nolimits_{\mathbb{Z}%
\left[  i\right]  }\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $.

\textbf{(c)} We have $\operatorname*{Div}\nolimits_{\mathbb{Z}\left[
i\right]  }\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)
=\operatorname*{Div}\nolimits_{\mathbb{Z}\left[  i\right]  }\left(
\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \beta_{1},\beta_{2}%
,\ldots,\beta_{k}\right)  \right)  $.

\textbf{(d)} If $k>0$, then%
\[
\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \beta_{1},\beta_{2}%
,\ldots,\beta_{k}\right)  \sim\gcd\nolimits_{\mathbb{Z}\left[  i\right]
}\left(  \gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \beta_{1}%
,\beta_{2},\ldots,\beta_{k-1}\right)  ,\beta_{k}\right)  .
\]

\end{theorem}

Theorem \ref{thm.ent.gcd.split} still holds for Gaussian integers, with the
obvious changes (the $=$ sign is replaced by $\sim$).
\end{noncompile}

We could define \textit{Gaussian rationals} (their set is called
$\mathbb{Q}\left[  i\right]  $) as complex numbers $a+bi$ with $a,b\in
\mathbb{Q}$. These are exactly the quotients of Gaussian integers.

Lowest common multiples of Gaussian integers still exist, but their definition
has to be modified. For example, we can define $\operatorname{lcm}%
_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)  $ as the (unique
up to unit-equivalence) Gaussian integer $\gamma$ such that the Gaussian
common multiples of $\alpha$ and $\beta$ are the Gaussian multiples of
$\gamma$. (We would have to prove that it actually is unique and exists.)
Theorem \ref{thm.ent.lcm.gcd*lcm} still holds, in the sense that
$\gcd\nolimits_{\mathbb{Z}\left[  i\right]  }\left(  \alpha,\beta\right)
\cdot\operatorname{lcm}_{\mathbb{Z}\left[  i\right]  }\left(  \alpha
,\beta\right)  \sim\alpha\beta$. Many other properties of lowest common
multiples extend to Gaussian integers.

The Chinese remainder theorem (Theorem \ref{thm.ent.crt1}) still holds for
coprime Gaussian integers $\mu$ and $\nu$. A similar fact holds for $k$
mutually coprime Gaussian integers.

\subsubsection{Gaussian primes}

The next definition is an analogue of Definition \ref{def.ent.prime}:

\begin{definition}
\label{def.Z[i].gauss.prime}Let $\pi$ be a nonzero Gaussian integer that is
not a unit. We say that $\pi$ is a \textit{Gaussian prime} if each Gaussian
divisor of $\pi$ is either a unit or unit-equivalent to $\pi$.
\end{definition}

The letter \textquotedblleft$\pi$\textquotedblright\ in this definition is
unrelated to the irrational number $\pi=3.14159\ldots$. It just happens to be
the Greek letter corresponding to the Roman \textquotedblleft$p$%
\textquotedblright.

The Gaussian primes are \textbf{not} a superset of the primes. For example:

\begin{example}
\label{exa.Z[i].gauss.2notprime}The Gaussian integer $2$ is not a Gaussian prime.
\end{example}

\begin{proof}
We have $2=\left(  1+i\right)  \left(  1-i\right)  $. The factors $1+i$ and
$1-i$ have norms $2$, which means that they are neither units themselves
(since units would have norm $1$) nor unit-equivalent to $2$ (since $2$ has
norm $4$, but unit-equivalent Gaussian integers have equal norms). Thus, $1+i$
is a Gaussian divisor of $2$ that is neither a unit nor is unit-equivalent to
$2$. Hence, $2$ is not a Gaussian prime (by the definition of
\textquotedblleft Gaussian prime\textquotedblright).
\end{proof}

So don't forget the word \textquotedblleft Gaussian\textquotedblright\ when
you mean it!

Let us search for Gaussian primes. So we know that $2$ is not a Gaussian
prime. What about $3$?

\begin{example}
\label{exa.Z[i].gauss.prime.3-not}The Gaussian integer $3$ is a Gaussian prime.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.Z[i].gauss.prime.3-not}.]Assume the contrary. Thus,
there exists a Gaussian divisor $\alpha$ of $3$ that is neither a unit nor
unit-equivalent to $3$ (since $3$ is a nonzero Gaussian integer that is not a
unit). Consider this $\alpha$. Then, $\alpha$ is a Gaussian integer and
satisfies $\alpha\mid3$ (since $\alpha$ is a Gaussian divisor of $3$). Hence,
Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(a)} (applied to $\beta=3$)
yields $\operatorname*{N}\left(  \alpha\right)  \mid\operatorname*{N}\left(
3\right)  =3^{2}+0^{2}=9$. Also, $\operatorname*{N}\left(  \alpha\right)
\in\mathbb{N}$ (by Proposition \ref{prop.Z[i].gauss.Norm-N}). Hence,
$\operatorname*{N}\left(  \alpha\right)  $ is a nonnegative integer. Thus,
$\operatorname*{N}\left(  \alpha\right)  $ is a nonnegative divisor of $9$
(because $\operatorname*{N}\left(  \alpha\right)  \mid9$).

If we had $\operatorname*{N}\left(  \alpha\right)  =\operatorname*{N}\left(
3\right)  $, then we would have $\alpha\sim3$ (by Exercise
\ref{exe.Z[i].div.proper}, applied to $\beta=3$); but this would contradict
the fact that $\alpha$ is not unit-equivalent to $3$. Hence, we cannot have
$\operatorname*{N}\left(  \alpha\right)  =\operatorname*{N}\left(  3\right)
$. Thus, we have $\operatorname*{N}\left(  \alpha\right)  \neq
\operatorname*{N}\left(  3\right)  =9$.

If we had $\operatorname*{N}\left(  \alpha\right)  =1$, then $\alpha$ would be
a unit (by Proposition \ref{prop.Z[i].gauss.norm1} \textbf{(b)}); but this
would contradict the fact that $\alpha$ is not a unit. Hence, we cannot have
$\operatorname*{N}\left(  \alpha\right)  =1$. Thus, we have $\operatorname*{N}%
\left(  \alpha\right)  \neq1$.

But the only nonnegative divisors of $9$ are $1,3,9$. Hence,
$\operatorname*{N}\left(  \alpha\right)  $ must be either $1$ or $3$ or $9$
(since $\operatorname*{N}\left(  \alpha\right)  $ is a nonnegative divisor of
$9$). Since we have shown that $\operatorname*{N}\left(  \alpha\right)  \neq1$
and $\operatorname*{N}\left(  \alpha\right)  \neq9$, we thus conclude that
$\operatorname*{N}\left(  \alpha\right)  =3$.

But let us write the Gaussian integer $\alpha$ as $\left(  a,b\right)  $ for
some $a,b\in\mathbb{Z}$. Thus, $\operatorname*{N}\left(  \alpha\right)
=a^{2}+b^{2}$, so that $a^{2}+b^{2}=\operatorname*{N}\left(  \alpha\right)
=3\equiv3\operatorname{mod}4$. This contradicts Exercise
\ref{exe.ent.even-odd-sumsq} \textbf{(c)}. This contradiction shows that our
assumption was false. So $3$ is a Gaussian prime.
\end{proof}

\begin{teachingnote}
\textbf{2019-03-11 lecture}
\end{teachingnote}

So we know that $3$ is a Gaussian prime, but $2$ is not. Is there a way to
tell which integers are Gaussian primes, without checking all Gaussian divisors?

Let us first state a positive criterion, which generalizes Example
\ref{exa.Z[i].gauss.prime.3-not}:

\begin{lemma}
\label{lem.Z[i].gauss.prime.3mod4}Let $p$ be a prime such that $p\equiv
3\operatorname{mod}4$. Then, $p$ is a Gaussian prime.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.Z[i].gauss.prime.3mod4}.]Assume the contrary. Thus,
there exists a Gaussian divisor $\alpha$ of $p$ that is neither a unit nor
unit-equivalent to $p$ (since $p$ is a nonzero Gaussian integer that is not a
unit\footnote{Why is $p$ not a unit? Because the units are $1,-1,i,-i$, and
none of these numbers is $p$.}). Consider this $\alpha$. Then, $\alpha$ is a
Gaussian integer and satisfies $\alpha\mid p$ (since $\alpha$ is a Gaussian
divisor of $p$). Hence, Proposition \ref{prop.Z[i].gauss.div.1} \textbf{(a)}
(applied to $\beta=p$) yields $\operatorname*{N}\left(  \alpha\right)
\mid\operatorname*{N}\left(  p\right)  =p^{2}+0^{2}=p^{2}$. Also,
$\operatorname*{N}\left(  \alpha\right)  \in\mathbb{N}$ (by Proposition
\ref{prop.Z[i].gauss.Norm-N}). Hence, $\operatorname*{N}\left(  \alpha\right)
$ is a nonnegative integer. Thus, $\operatorname*{N}\left(  \alpha\right)  $
is a nonnegative divisor of $p^{2}$ (because $\operatorname*{N}\left(
\alpha\right)  \mid p^{2}$).

If we had $\operatorname*{N}\left(  \alpha\right)  =\operatorname*{N}\left(
p\right)  $, then we would have $\alpha\sim p$ (by Exercise
\ref{exe.Z[i].div.proper}, applied to $\beta=p$); but this would contradict
the fact that $\alpha$ is not unit-equivalent to $p$. Hence, we cannot have
$\operatorname*{N}\left(  \alpha\right)  =\operatorname*{N}\left(  p\right)
$. Thus, we have $\operatorname*{N}\left(  \alpha\right)  \neq
\operatorname*{N}\left(  p\right)  =p^{2}$.

If we had $\operatorname*{N}\left(  \alpha\right)  =1$, then $\alpha$ would be
a unit (by Proposition \ref{prop.Z[i].gauss.norm1} \textbf{(b)}); but this
would contradict the fact that $\alpha$ is not a unit. Hence, we cannot have
$\operatorname*{N}\left(  \alpha\right)  =1$. Thus, we have $\operatorname*{N}%
\left(  \alpha\right)  \neq1$.

But the only nonnegative divisors of $p^{2}$ are $1,p,p^{2}$ (indeed, this
follows by applying Exercise \ref{exe.ent.prime.pkdivs} to $k=2$). Hence,
$\operatorname*{N}\left(  \alpha\right)  $ must be either $1$ or $p$ or
$p^{2}$ (since $\operatorname*{N}\left(  \alpha\right)  $ is a nonnegative
divisor of $p^{2}$). Since we have shown that $\operatorname*{N}\left(
\alpha\right)  \neq1$ and $\operatorname*{N}\left(  \alpha\right)  \neq p^{2}%
$, we thus conclude that $\operatorname*{N}\left(  \alpha\right)  =p$.

But let us write the Gaussian integer $\alpha$ as $\left(  a,b\right)  $ for
some $a,b\in\mathbb{Z}$. Thus, $\operatorname*{N}\left(  \alpha\right)
=a^{2}+b^{2}$, so that $a^{2}+b^{2}=\operatorname*{N}\left(  \alpha\right)
=p\equiv3\operatorname{mod}4$. This contradicts Exercise
\ref{exe.ent.even-odd-sumsq} \textbf{(c)}. This contradiction shows that our
assumption was false. Thus, Lemma \ref{lem.Z[i].gauss.prime.3mod4} is proven.
\end{proof}

It is clear that no prime is divisible by $4$. Thus, there are three types of primes:

\begin{itemize}
\item \textit{Type 1:} Primes that are $\equiv1\operatorname{mod}4$: these are
$5,13,17,29,\ldots$.

\item \textit{Type 2:} Primes that are even: there is only one of these,
namely $2$.

\item \textit{Type 3:} Primes that are $\equiv3\operatorname{mod}4$: these are
$3,7,11,19,23,\ldots$.
\end{itemize}

(One can show that there are infinitely many primes of Type 1 and infinitely
many primes of Type 3. It can also be shown that there are \textquotedblleft
roughly the same amount\textquotedblright\ of Type-1 primes and of Type-3
primes \textquotedblleft in theory\textquotedblright, but \textquotedblleft in
practice\textquotedblright\ the Type-3 primes are more frequent. For the
concrete meaning of this weird paradoxical claim, google for
\href{https://en.wikipedia.org/wiki/Chebyshev's_bias}{\textquotedblleft
Chebyshev's bias\textquotedblright}.)

Lemma \ref{lem.Z[i].gauss.prime.3mod4} says that all Type-3 primes are
Gaussian primes. What about the other primes -- are they Gaussian primes? We
already know that $2$ is not, since $2=\left(  1+i\right)  \left(  1-i\right)
$. Likewise, $5$ is not, since $5=\left(  1+2i\right)  \left(  1-2i\right)  $.
Likewise, $13$ is not, since $13=\left(  2+3i\right)  \left(  2-3i\right)  $.

This may suggest that primes $p$ satisfying $p=2$ or $p\equiv
1\operatorname{mod}4$ (that is, primes of Type 1 or Type 2) not only factor
nontrivially, but actually factor as%
\[
p=\left(  x+yi\right)  \left(  x-yi\right)  \ \ \ \ \ \ \ \ \ \ \text{for some
integers }x\text{ and }y.
\]
Of course, this equation rewrites as $p=x^{2}+y^{2}$. Thus, we are back to
asking Question~\ref{quest.intro.sum-of-2sq.1}, at least for primes.

We shall now answer this question, and actually prove a bit more:

\begin{theorem}
\label{thm.Z[i].gauss.prime.1mod4}Let $p$ be a prime such that either $p=2$ or
$p\equiv1\operatorname{mod}4$.

\textbf{(a)} There exist integers $x$ and $y$ such that $p=x^{2}+y^{2}$.

\textbf{(b)} If $p\equiv1\operatorname{mod}4$, then there exist exactly $8$
pairs $\left(  x,y\right)  $ of integers such that $p=x^{2}+y^{2}$. (For
example, if $p=5$, then these $8$ pairs are $\left(  1,2\right)  $, $\left(
2,1\right)  $, $\left(  1,-2\right)  $, $\left(  -2,1\right)  $, $\left(
-1,2\right)  $, $\left(  2,-1\right)  $, $\left(  -1,-2\right)  $ and $\left(
-2,-1\right)  $.)

\textbf{(c)} There exists a Gaussian prime $\pi$ such that $p=\pi\overline
{\pi}$.

\textbf{(d)} The Gaussian integer $p$ itself is not a Gaussian prime.

\textbf{(e)} Assume that $p\equiv1\operatorname{mod}4$. Consider the Gaussian
prime $\pi$ from Theorem \ref{thm.Z[i].gauss.prime.1mod4} \textbf{(c)}. Then,
$\overline{\pi}$ is also a Gaussian prime, and we do not have $\pi
\sim\overline{\pi}$.
\end{theorem}

For example, the Type-1 prime $17$ satisfies%
\begin{align*}
17  &  =1^{2}+4^{2}=\left(  1+4i\right)  \left(  1-4i\right)  =\left(
1+4i\right)  \left(  \overline{1+4i}\right) \\
&  =\left(  1-4i\right)  \left(  \overline{1-4i}\right)  =\left(  4+i\right)
\left(  \overline{4+i}\right)  .
\end{align*}


Note that the claim of Theorem \ref{thm.Z[i].gauss.prime.1mod4} \textbf{(a)}
(at least for $p\neq2$) also appears in \cite[Proposition in Chapter
4]{AigZie}, with a very different proof.

Before we can prove Theorem \ref{thm.Z[i].gauss.prime.1mod4}, we will have to
build up the theory of Gaussian primes a bit more. We first state the
Gaussian-integer analogue of Proposition \ref{prop.ent.prime.div-or-coprime}:

\begin{proposition}
\label{prop.Z[i].prime.div-or-coprime}Let $\pi$ be a Gaussian prime. Let
$\alpha\in\mathbb{Z}\left[  i\right]  $. Then, either $\pi\mid\alpha$ or
$\pi\perp\alpha$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].prime.div-or-coprime}.]Analogous to our
proof of Proposition \ref{prop.ent.prime.div-or-coprime} above.
\end{proof}

Next, we state the analogue to Theorem \ref{thm.ent.prime.pab}:

\begin{theorem}
\label{thm.Z[i].prime.pab}Let $\pi$ be a Gaussian prime. Let $\alpha,\beta
\in\mathbb{Z}\left[  i\right]  $ such that $\pi\mid\alpha\beta$. Then,
$\pi\mid\alpha$ or $\pi\mid\beta$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.Z[i].prime.pab}.]Analogous to our proof of Theorem
\ref{thm.ent.prime.pab} above.
\end{proof}

We also need the following simple fact:

\begin{lemma}
\label{lem.Z[i].prime.Nprime}Let $\alpha$ be a Gaussian integer. If
$\operatorname*{N}\left(  \alpha\right)  $ is prime, then $\alpha$ is a
Gaussian prime.
\end{lemma}

This shows, for example, that $1+i$ and $1+2i$ are Gaussian primes. The
converse of Lemma \ref{lem.Z[i].prime.Nprime} does not hold (e.g., since $3$
is a Gaussian prime, but $\operatorname*{N}\left(  3\right)  =9$ is not prime).

\begin{proof}
[Proof of Lemma \ref{lem.Z[i].prime.Nprime}.]Assume that $\operatorname*{N}%
\left(  \alpha\right)  $ is prime. We must prove that $\alpha$ is a Gaussian prime.

Assume the contrary. Thus, $\alpha$ is not a Gaussian prime, but $\alpha$ is
neither zero nor a unit (since $\operatorname*{N}\left(  \alpha\right)  $ is
prime and therefore $>1$). Hence, $\alpha$ has a Gaussian divisor $\delta$
that is neither a unit nor unit-equivalent to $\alpha$. Consider this $\delta$.

Now, $\delta$ is a Gaussian divisor of $\alpha$; in other words, $\delta$ is a
Gaussian integer and satisfies $\delta\mid\alpha$. Hence, Proposition
\ref{prop.Z[i].gauss.div.1} \textbf{(a)} (applied to $\delta$ and $\alpha$
instead of $\alpha$ and $\beta$) yields $\operatorname*{N}\left(
\delta\right)  \mid\operatorname*{N}\left(  \alpha\right)  $. Also,
$\operatorname*{N}\left(  \delta\right)  \in\mathbb{N}$ (by Proposition
\ref{prop.Z[i].gauss.Norm-N}, applied to $\delta$ instead of $\alpha$). Hence,
$\operatorname*{N}\left(  \delta\right)  $ is a nonnegative integer. Thus,
$\operatorname*{N}\left(  \delta\right)  $ is a nonnegative divisor of
$\operatorname*{N}\left(  \alpha\right)  $ (because $\operatorname*{N}\left(
\delta\right)  \mid\operatorname*{N}\left(  \alpha\right)  $). But the only
nonnegative divisors of $\operatorname*{N}\left(  \alpha\right)  $ are $1$ and
$\operatorname*{N}\left(  \alpha\right)  $\ \ \ \ \footnote{\textit{Proof.}
The only positive divisors of $\operatorname*{N}\left(  \alpha\right)  $ are
$1$ and $\operatorname*{N}\left(  \alpha\right)  $ (since $\operatorname*{N}%
\left(  \alpha\right)  $ is prime). Hence, the only nonnegative divisors of
$\operatorname*{N}\left(  \alpha\right)  $ are $1$ and $\operatorname*{N}%
\left(  \alpha\right)  $ and possibly $0$. But since $0$ is not a nonnegative
divisor of $\operatorname*{N}\left(  \alpha\right)  $ (indeed, if it was, then
$\operatorname*{N}\left(  \alpha\right)  $ would be a multiple of $0$ and
therefore equal to $0$, which would contradict the fact that
$\operatorname*{N}\left(  \alpha\right)  $ is prime), this yields that the
only nonnegative divisors of $\operatorname*{N}\left(  \alpha\right)  $ are
$1$ and $\operatorname*{N}\left(  \alpha\right)  $.}. Thus, $\operatorname*{N}%
\left(  \delta\right)  $ equals either $1$ or $\operatorname*{N}\left(
\alpha\right)  $ (since $\operatorname*{N}\left(  \delta\right)  $ is a
nonnegative divisor of $\operatorname*{N}\left(  \alpha\right)  $). But if we
had $\operatorname*{N}\left(  \delta\right)  =1$, then $\delta$ would be a
unit, which is impossible (by the definition of $\delta$). Thus, we cannot
have $\operatorname*{N}\left(  \delta\right)  =1$. Hence, we must have
$\operatorname*{N}\left(  \delta\right)  =\operatorname*{N}\left(
\alpha\right)  $ (since $\operatorname*{N}\left(  \delta\right)  $ equals
either $1$ or $\operatorname*{N}\left(  \alpha\right)  $). Hence, Exercise
\ref{exe.Z[i].div.proper} (applied to $\delta$ and $\alpha$ instead of
$\alpha$ and $\beta$) shows that $\delta\sim\alpha$. This contradicts the
assumption that $\delta$ is not unit-equivalent to $\alpha$. This
contradiction proves that our assumption was wrong. Lemma
\ref{lem.Z[i].prime.Nprime} is proven.
\end{proof}

Next, let us show that conjugation does not change Gaussian primeness:

\begin{lemma}
\label{lem.Z[i].prime.conj}Let $\pi$ be a Gaussian prime. Then, $\overline
{\pi}$ is a Gaussian prime, too.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.Z[i].prime.conj}.]Conjugation (of complex numbers)
sends Gaussian integers to Gaussian integers (by Proposition
\ref{prop.Z[i].gauss.conj}), products to products (by Proposition
\ref{prop.CC.conj.hom} \textbf{(c)}) and inverses to inverses (i.e., we have
$\overline{\alpha^{-1}}=\overline{\alpha}^{-1}$ whenever $\alpha\in\mathbb{C}$
is nonzero). Furthermore, it is an involution (since $\overline{\overline
{\alpha}}=\alpha$ for each $\alpha\in\mathbb{C}$). Thus, conjugation preserves
all \textquotedblleft intrinsic\textquotedblright\ properties of Gaussian
integers; for example:

\begin{itemize}
\item If $\pi$ is nonzero, then $\overline{\pi}$ is nonzero, and vice versa.

\item If $\pi$ is not a unit, then $\overline{\pi}$ is not a unit, and vice versa.

\item If $\delta$ is a Gaussian divisor of $\pi$, then $\overline{\delta}$ is
a Gaussian divisor of $\overline{\pi}$, and vice versa.

\item If $\delta$ is not a unit, then $\overline{\delta}$ is not a unit, and
vice versa.

\item If $\delta$ is not unit-equivalent to $\pi$, then $\overline{\delta}$ is
not unit-equivalent to $\overline{\pi}$, and vice versa.
\end{itemize}

\noindent(These facts are straightforward to prove; see, for example, Exercise
\ref{exe.Z[i].div.conj} for a proof of the third one.)

Hence, if you compare what it means for $\pi$ to be a Gaussian prime with what
it means for $\overline{\pi}$ to be a Gaussian prime, then you will see that
it means the same thing. This proves Lemma \ref{lem.Z[i].prime.conj}.
\end{proof}

Now, we can prove Theorem \ref{thm.Z[i].gauss.prime.1mod4}:

\begin{proof}
[Proof of Theorem \ref{thm.Z[i].gauss.prime.1mod4}.]\textbf{(d)} Assume the
contrary. Thus, $p$ is a Gaussian prime. But $2$ is not a Gaussian prime (by
Example \ref{exa.Z[i].gauss.2notprime}). Hence, $p\neq2$. Thus, $p\equiv
1\operatorname{mod}4$ (since we assumed that either $p=2$ or $p\equiv
1\operatorname{mod}4$). Therefore, $p=2k+1$ for some \textbf{even}
$k\in\mathbb{N}$. Consider this $k$.

Exercise \ref{exe.ent.wilson.-1qr} yields $k!^{2}\equiv-\underbrace{\left(
-1\right)  ^{k}}_{\substack{=1\\\text{(since }k\text{ is even)}}%
}=-1\operatorname{mod}p$. Set $u=k!$; thus, this becomes $u^{2}\equiv
-1\operatorname{mod}p$. In other words,
\[
p\mid u^{2}-\left(  -1\right)  =u^{2}-i^{2}=\left(  u+i\right)  \left(
u-i\right)  .
\]
This is a divisibility in $\mathbb{Z}$, thus also a divisibility in
$\mathbb{Z}\left[  i\right]  $.

Hence, Theorem \ref{thm.Z[i].prime.pab} (applied to $\pi=p$, $\alpha=u+i$ and
$\beta=u-i$) yields that $p\mid u+i$ or $p\mid u-i$ (since $p$ is a Gaussian
prime). But if $p\mid u-i$, then $p\mid u+i$ holds as well (since Exercise
\ref{exe.Z[i].div.conj} shows that $p\mid u-i$ implies $\overline{p}%
\mid\overline{u-i}=u+i$, which means $p=\overline{p}\mid u+i$). Hence, we have
$p\mid u+i$ in both cases.

This means that there exists a Gaussian integer $\gamma$ such that
$u+i=p\gamma$. Consider this $\gamma$. Write $\gamma$ as $\gamma=\left(
a,b\right)  $ with $a,b\in\mathbb{Z}$. Then, $\left(  u,1\right)
=u+i=p\underbrace{\gamma}_{=\left(  a,b\right)  }=p\left(  a,b\right)
=\left(  pa,pb\right)  $. Thus, $u=pa$ and $1=pb$. But $1=pb$ leads to
$p\mid1$ in $\mathbb{Z}$ (since $b\in\mathbb{Z}$), which is absurd (since $p$
is prime). This contradiction shows that our assumption was wrong. Thus,
Theorem \ref{thm.Z[i].gauss.prime.1mod4} \textbf{(d)} is proven.

\textbf{(a)} We have $\operatorname*{N}\left(  p\right)  =p^{2}+0^{2}=p^{2}>1$
(since $p>1$). Thus, $p$ is nonzero and not a unit. But Theorem
\ref{thm.Z[i].gauss.prime.1mod4} \textbf{(d)} shows that $p$ is not a Gaussian
prime. Since $p$ is nonzero and not a unit, this shows that $p$ has a Gaussian
divisor $\delta$ that is neither a unit nor unit-equivalent to $p$. Consider
this $\delta$. Then, $\delta$ is a Gaussian integer and satisfies $\delta\mid
p$ (since $\delta$ is a Gaussian divisor of $p$). Hence, Proposition
\ref{prop.Z[i].gauss.div.1} \textbf{(a)} (applied to $\alpha=\delta$ and
$\beta=p$) yields $\operatorname*{N}\left(  \delta\right)  \mid
\operatorname*{N}\left(  p\right)  =p^{2}+0^{2}=p^{2}$. Also,
$\operatorname*{N}\left(  \delta\right)  \in\mathbb{N}$ (by Proposition
\ref{prop.Z[i].gauss.Norm-N}, applied to $\alpha=\delta$). Hence,
$\operatorname*{N}\left(  \delta\right)  $ is a nonnegative integer. Thus,
$\operatorname*{N}\left(  \delta\right)  $ is a nonnegative divisor of $p^{2}$
(because $\operatorname*{N}\left(  \delta\right)  \mid p^{2}$).

If we had $\operatorname*{N}\left(  \delta\right)  =\operatorname*{N}\left(
p\right)  $, then we would have $\delta\sim p$ (by Exercise
\ref{exe.Z[i].div.proper}, applied to $\alpha=\delta$ and $\beta=p$); but this
would contradict the fact that $\delta$ is not unit-equivalent to $p$. Hence,
we cannot have $\operatorname*{N}\left(  \delta\right)  =\operatorname*{N}%
\left(  p\right)  $. Thus, we have $\operatorname*{N}\left(  \delta\right)
\neq\operatorname*{N}\left(  p\right)  =p^{2}$.

If we had $\operatorname*{N}\left(  \delta\right)  =1$, then $\delta$ would be
a unit (by Proposition \ref{prop.Z[i].gauss.norm1} \textbf{(b)}, applied to
$\alpha=\delta$); but this would contradict the fact that $\delta$ is not a
unit. Hence, we cannot have $\operatorname*{N}\left(  \delta\right)  =1$.
Thus, we have $\operatorname*{N}\left(  \delta\right)  \neq1$.

But the only nonnegative divisors of $p^{2}$ are $1,p,p^{2}$ (indeed, this
follows by applying Exercise \ref{exe.ent.prime.pkdivs} to $k=2$). Hence,
$\operatorname*{N}\left(  \delta\right)  $ must be either $1$ or $p$ or
$p^{2}$ (since $\operatorname*{N}\left(  \delta\right)  $ is a nonnegative
divisor of $p^{2}$). Since we have shown that $\operatorname*{N}\left(
\delta\right)  \neq1$ and $\operatorname*{N}\left(  \delta\right)  \neq p^{2}%
$, we thus conclude that $\operatorname*{N}\left(  \delta\right)  =p$.

But let us write the Gaussian integer $\delta$ as $\left(  a,b\right)  $ for
some $a,b\in\mathbb{Z}$. Thus, $\operatorname*{N}\left(  \delta\right)
=a^{2}+b^{2}$, so that $a^{2}+b^{2}=\operatorname*{N}\left(  \delta\right)
=p$. Hence, there exist integers $x$ and $y$ such that $p=x^{2}+y^{2}$
(namely, $x=a$ and $y=b$). This proves Theorem
\ref{thm.Z[i].gauss.prime.1mod4} \textbf{(a)}.

\textbf{(c)} Theorem \ref{thm.Z[i].gauss.prime.1mod4} \textbf{(a)} shows that
there exist integers $x$ and $y$ such that $p=x^{2}+y^{2}$. Consider these $x$
and $y$. Let $\pi$ be the Gaussian integer $x+iy$. Then, $\pi\overline{\pi
}=\left(  x+iy\right)  \left(  \overline{x+iy}\right)  =x^{2}+y^{2}=p$. Thus,
$p=\pi\overline{\pi}$. It remains to prove that $\pi$ is a Gaussian prime.

The norm of $\pi$ is $\operatorname*{N}\left(  \pi\right)  =x^{2}+y^{2}=p$,
which is prime. Hence, Lemma \ref{lem.Z[i].prime.Nprime} (applied to
$\alpha=\pi$) shows that $\pi$ is a Gaussian prime. This completes the proof
of Theorem \ref{thm.Z[i].gauss.prime.1mod4} \textbf{(c)}.

\textbf{(b)} Assume that $p\equiv1\operatorname{mod}4$. We must prove that
there exist exactly $8$ pairs $\left(  x,y\right)  $ of integers such that
$p=x^{2}+y^{2}$.

One such pair is provided by Theorem \ref{thm.Z[i].gauss.prime.1mod4}
\textbf{(a)}. Let us call it $\left(  a,b\right)  $. To get the other $7$, we
notice that it must satisfy $a\neq0$ (since $p$ is not a perfect square) and
$b\neq0$ (for the same reason) and $a\neq b$ (since $p$ is not $2n^{2}$ for
any $n\in\mathbb{Z}$). Thus, the $8$ pairs%
\begin{align*}
&  \left(  a,b\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  b,a\right)
,\ \ \ \ \ \ \ \ \ \ \left(  a,-b\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
-b,a\right)  ,\\
&  \left(  -a,b\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  b,-a\right)
,\ \ \ \ \ \ \ \ \ \ \left(  -a,-b\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
-b,-a\right)
\end{align*}
are all distinct. Each of these $8$ distinct pairs is a pair $\left(
x,y\right)  $ of integers such that $p=x^{2}+y^{2}$ (because $p=a^{2}%
+b^{2}=b^{2}+a^{2}=a^{2}+\left(  -b\right)  ^{2}$ etc.).

It thus remains to prove that these $8$ pairs are the \textbf{only} pairs
$\left(  x,y\right)  $ of integers such that $p=x^{2}+y^{2}$.

In other words, we need to prove that if $\left(  x,y\right)  $ is a pair of
integers such that $p=x^{2}+y^{2}$, then $\left(  x,y\right)  $ is one of the
above $8$ pairs. So let us fix a pair $\left(  x,y\right)  $ of integers such
that $p=x^{2}+y^{2}$. We must prove that $\left(  x,y\right)  $ is one of the
above $8$ pairs. In other words, we must prove that $\left(  x,y\right)  $
equals $\left(  a,b\right)  $ up to order and signs. This is equivalent to
proving that $x+yi\sim a+bi$ or $x-yi\sim a+bi$.

Set $\pi=x+yi$ and $\alpha=a+bi$. Then, $\pi$ and $\alpha$ are Gaussian
integers having norms $\operatorname*{N}\left(  \pi\right)  =x^{2}+y^{2}=p$
and $\operatorname*{N}\left(  \alpha\right)  =a^{2}+b^{2}=p$ (by the
definition of $\left(  a,b\right)  $). Thus, $\operatorname*{N}\left(
\alpha\right)  =p$ is prime. Hence, Lemma \ref{lem.Z[i].prime.Nprime} shows
that $\alpha$ is a Gaussian prime. Similarly, $\pi$ is a Gaussian prime.

We must prove that $x+yi\sim a+bi$ or $x-yi\sim a+bi$. In other words, we must
prove that $\pi\sim\alpha$ or $\overline{\pi}\sim\alpha$ (since $x+yi=\pi$ and
$x-yi=\overline{\pi}$ and $a+bi=\alpha$).

Now,
\[
\alpha=a+bi\mid\left(  a+bi\right)  \left(  a-bi\right)  =a^{2}+b^{2}%
=p=\operatorname*{N}\left(  \pi\right)  =\pi\overline{\pi}.
\]
Since $\alpha$ is a Gaussian prime, this yields that $\alpha\mid\pi$ or
$\alpha\mid\overline{\pi}$ (by Theorem \ref{thm.Z[i].prime.pab}). Thus, we are
in one of the following two Cases:

\textit{Case 1:} We have $\alpha\mid\pi$.

\textit{Case 2:} We have $\alpha\mid\overline{\pi}$.

In Case 1, we have $\alpha\mid\pi$. In other words, there exists a Gaussian
integer $\xi$ such that $\pi=\alpha\xi$. Consider this $\xi$. We have
$\pi=\alpha\xi$, thus $\operatorname*{N}\left(  \pi\right)  =\operatorname*{N}%
\left(  \alpha\xi\right)  =\operatorname*{N}\left(  \alpha\right)
\operatorname*{N}\left(  \xi\right)  $. Since both $\operatorname*{N}\left(
\pi\right)  $ and $\operatorname*{N}\left(  \alpha\right)  $ are $p$ (because
$\operatorname*{N}\left(  \pi\right)  =x^{2}+y^{2}=p$ and $\operatorname*{N}%
\left(  \alpha\right)  =a^{2}+b^{2}=p$), this rewrites as
$p=p\operatorname*{N}\left(  \xi\right)  $. We can cancel $p$ from this
equality, and obtain $\operatorname*{N}\left(  \xi\right)  =1$. Hence, $\xi$
is a unit. Therefore, $\pi=\alpha\xi$ yields $\pi\sim\alpha$. In other words,
$x+yi\sim a+bi$ (since $\pi=x+yi$ and $\alpha=a+bi$).

In Case 2, we similarly obtain $x-yi\sim a+bi$ (since $\operatorname*{N}%
\left(  \overline{\pi}\right)  =\operatorname*{N}\left(  \pi\right)
=x^{2}+y^{2}=p$ and $\overline{\pi}=x-yi$).

Hence, in both Cases, we have proven that $x+yi\sim a+bi$ or $x-yi\sim a+bi$.
This completes our proof of Theorem \ref{thm.Z[i].gauss.prime.1mod4}
\textbf{(b)}.

\textbf{(e)} Lemma \ref{lem.Z[i].prime.conj} yields that $\overline{\pi}$ is a
Gaussian prime. It remains to prove that we do not have $\pi\sim\overline{\pi
}$.

Assume the contrary. Thus, $\pi\sim\overline{\pi}$. Hence, Exercise
\ref{exe.Z[i].gauss.uneqcon} \textbf{(c)} (applied to $\pi$ instead of
$\alpha$) yields that the norm $\operatorname*{N}\left(  \pi\right)  $ cannot
be an odd prime. In view of $\operatorname*{N}\left(  \pi\right)
=\pi\overline{\pi}=p$, this rewrites as follows: $p$ cannot be an odd prime.

But $p$ is odd (since $p\equiv1\operatorname{mod}4$) and prime. In other
words, $p$ is an odd prime. This contradicts the fact that $p$ cannot be an
odd prime. This contradiction shows that our assumption was false. Thus, the
proof of Theorem \ref{thm.Z[i].gauss.prime.1mod4} \textbf{(e)} is complete.
\end{proof}

We have thus answered Question \ref{quest.intro.sum-of-2sq.2} \textbf{(b)} in
the case when $n$ is a prime: We have shown that a prime $p$ is a sum of two
perfect squares if and only if either $p=2$ or $p\equiv1\operatorname{mod}4$;
and we have shown that the number of pairs $\left(  x,y\right)  \in
\mathbb{Z}^{2}$ satisfying $p=x^{2}+y^{2}$ is $8$ when $p\equiv
1\operatorname{mod}4$ and is $4$ when $p=2$ (the latter claim is easy to check).

What about the case of arbitrary $n$?

For $n=21$, we have $n\equiv1\operatorname{mod}4$, but $n$ is not a sum of two
perfect squares. So the answer we gave for the case of prime $n$ does not
generalize to arbitrary $n$.

\begin{teachingnote}
\textbf{2019-03-13 lecture}
\end{teachingnote}

It turns out that the right answer for arbitrary $n$ will come from the
analogue of prime factorization in $\mathbb{Z}\left[  i\right]  $.

\begin{noncompile}
We begin with the following definition:

\begin{definition}
Let $\nu$ be a Gaussian integer. A \textit{Gaussian prime factor} of $\nu$
means a Gaussian prime $\pi$ such that $\pi\mid\nu$. Some say
\textquotedblleft prime divisor\textquotedblright\ instead of
\textquotedblleft prime factor\textquotedblright.
\end{definition}
\end{noncompile}

\begin{proposition}
\label{prop.Z[i].prime.ex-pri-div}Let $\nu$ be a nonzero Gaussian integer that
is not a unit. Then, there exists at least one Gaussian prime $\pi$ such that
$\pi\mid\nu$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].prime.ex-pri-div}.]This is an analogue of
Proposition \ref{prop.ent.prime.ex-pri-div}, and can be proven in the same
way. Just replace $d$ (the smallest positive divisor of $n$) by $\delta$ (a
Gaussian divisor of $\nu$ that is not a unit and has the smallest norm among
all such divisors).
\end{proof}

\begin{proposition}
\label{prop.Z[i].prime.fac-ex}Let $\nu$ be a nonzero Gaussian integer. Then,
$\nu$ is unit-equivalent to a certain product of finitely many Gaussian primes.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.Z[i].prime.fac-ex}.]This is an analogue of
Proposition \ref{prop.ent.prime.fac-ex}, and can be proven in the same way:
Strong induction on $\operatorname*{N}\left(  \nu\right)  $. The main
difference is that the case of $\operatorname*{N}\left(  \nu\right)  =1$ leads
to $\nu$ being a unit (hence unit-equivalent to an empty product of Gaussian
primes) rather than $\nu$ being $1$.
\end{proof}

\begin{definition}
Let $\nu$ be a nonzero Gaussian integer. A \textit{Gaussian prime
factorization} of $\nu$ means a tuple $\left(  \pi_{1},\pi_{2},\ldots,\pi
_{k}\right)  $ of Gaussian primes such that $\nu\sim\pi_{1}\pi_{2}\cdots
\pi_{k}$.
\end{definition}

Why did we require only $\nu\sim\pi_{1}\pi_{2}\cdots\pi_{k}$ and not $\nu
=\pi_{1}\pi_{2}\cdots\pi_{k}$ ? Because we want $-1$ to have a Gaussian prime
factorization, but there is no way to literally write $-1$ as a product of
Gaussian primes.

\begin{exercise}
\label{exe.Z[i].prime.dist=cop}Let $\pi$ and $\kappa$ be two Gaussian primes
that do not satisfy $\pi\sim\kappa$. Prove that $\pi\perp\kappa$.
\end{exercise}

\begin{proof}
[Solution sketch.]This is an analogue of Exercise \ref{exe.ent.prime.dist=cop}%
, and its solution goes accordingly.
\end{proof}

\begin{lemma}
\label{lem.Z[i].prime.vp-wd}Let $\pi$ be a Gaussian prime. Let $\alpha$ be a
nonzero Gaussian integer. Then, there exists a largest $m\in\mathbb{N}$ such
that $\pi^{m}\mid\alpha$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.Z[i].prime.vp-wd}.]This is an analogue of Lemma
\ref{lem.ent.prime.vp-wd} for Gaussian integers (with $\pi$ and $\alpha$
playing the roles of $p$ and $n$), and the proof also proceeds similarly. Here
are the main differences: Instead of $p>1$, we now have $\operatorname*{N}%
\left(  \pi\right)  >1$ (which is because $\pi$ is nonzero and not a unit).
Again, let $W$ be the set of all $m\in\mathbb{N}$ satisfying $\pi^{m}%
\mid\alpha$. Then, $W$ is a nonempty set of integers (this is proven as in the
proof of Lemma \ref{lem.ent.prime.vp-wd}). Let $u=\operatorname*{N}\left(
\alpha\right)  $. Thus, $u\in\mathbb{N}$. It is easy to see that
$\operatorname*{N}\left(  \pi^{k}\right)  >k$ for each $k\in\mathbb{N}$
(indeed, Corollary \ref{cor.CC.norm.pow} \textbf{(b)} yields
$\operatorname*{N}\left(  \pi^{k}\right)  =\left(  \operatorname*{N}\left(
\pi\right)  \right)  ^{k}>k$ by Exercise \ref{exe.ent.prime.vp-lem} (applied
to $p=\operatorname*{N}\left(  \pi\right)  $)). From this point, we proceed
similarly as in the proof of Lemma \ref{lem.ent.prime.vp-wd}.
\end{proof}

Similarly to Definition \ref{def.ent.prime.vp}, we can define $\pi$-adic valuations:

\begin{definition}
\label{def.Z[i].prime.vp}Let $\pi$ be a Gaussian prime.

\textbf{(a)} Let $\alpha$ be a nonzero Gaussian integer. Then, $v_{\pi}\left(
\alpha\right)  $ shall denote the largest $m\in\mathbb{N}$ such that $\pi
^{m}\mid\alpha$. This is well-defined (by Lemma \ref{lem.Z[i].prime.vp-wd}).
This nonnegative integer $v_{\pi}\left(  \alpha\right)  $ will be called the
$\pi$\textit{-valuation} (or the $\pi$\textit{-adic valuation}) of $\alpha$.

\textbf{(b)} We extend this definition of $v_{\pi}\left(  \alpha\right)  $ to
the case of $\alpha=0$ as follows: Set $v_{\pi}\left(  0\right)  =\infty$.
\end{definition}

Definition \ref{def.Z[i].prime.vp} does not conflict with Definition
\ref{def.ent.prime.vp}. Indeed, if a prime $p$ happens to also be a Gaussian
prime, and if $n$ is an integer, then both definitions yield the same value of
$v_{p}\left(  n\right)  $ (since $p^{m}\mid a$ means the same thing whether we
treat $p$ and $a$ as integers or as Gaussian integers).

\begin{theorem}
\label{thm.Z[i].prime.vp-ring}Let $\pi$ be a Gaussian prime.

\textbf{(a)} We have $v_{\pi}\left(  \alpha\beta\right)  =v_{\pi}\left(
\alpha\right)  +v_{\pi}\left(  \beta\right)  $ for any two Gaussian integers
$\alpha$ and $\beta$.

\textbf{(b)} We have $v_{\pi}\left(  \alpha+\beta\right)  \geq\min\left\{
v_{\pi}\left(  \alpha\right)  ,v_{\pi}\left(  \beta\right)  \right\}  $ for
any two Gaussian integers $\alpha$ and $\beta$.

\textbf{(c)} We have $v_{\pi}\left(  1\right)  =0$. More generally, $v_{\pi
}\left(  \alpha\right)  =0$ for any unit $\alpha\in\mathbb{Z}\left[  i\right]
$.

\textbf{(d)} We have $v_{\pi}\left(  \kappa\right)  =%
\begin{cases}
1, & \text{if }\kappa\sim\pi;\\
0, & \text{otherwise}%
\end{cases}
$ for any Gaussian prime $\kappa$.
\end{theorem}

\begin{proof}
This is an analogue of Theorem \ref{thm.ent.prime.vp-ring}, and is proven similarly.
\end{proof}

\begin{proposition}
\label{prop.Z[i].prime.mult-in-pf}Let $\nu$ be a nonzero Gaussian integer. Let
$\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{k}\right)  $ be a Gaussian prime
factorization of $\nu$. Let $\pi$ be a Gaussian prime. Then,%
\begin{align*}
&  \left(  \text{the number of times a Gaussian integer unit-equivalent to
}\pi\right. \\
&  \ \ \ \ \ \ \ \ \ \ \left.  \text{appears in the tuple }\left(  \alpha
_{1},\alpha_{2},\ldots,\alpha_{k}\right)  \right) \\
&  =\left(  \text{the number of times }\left[  \pi\right]  _{\sim}\text{
appears in the tuple }\left(  \left[  \alpha_{1}\right]  _{\sim},\left[
\alpha_{2}\right]  _{\sim},\ldots,\left[  \alpha_{k}\right]  _{\sim}\right)
\right) \\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,k\right\}  \text{
such that }\alpha_{i}\sim\pi\right) \\
&  =\left(  \text{the number of }i\in\left\{  1,2,\ldots,k\right\}  \text{
such that }\left[  \alpha_{i}\right]  _{\sim}=\left[  \pi\right]  _{\sim
}\right) \\
&  =v_{\pi}\left(  \nu\right)  .
\end{align*}

\end{proposition}

\begin{proof}
This is an analogue of Proposition \ref{prop.ent.prime.mult-in-pf}, and is
proven similarly.
\end{proof}

\begin{theorem}
\label{thm.Z[i].prime.fac-uni}Let $\nu$ be a nonzero Gaussian integer.

\textbf{(a)} There exists a Gaussian prime factorization of $\nu$.

\textbf{(b)} Any two such factorizations differ only by reordering their
entries and multiplying them by units. More precisely: If $\left(  \alpha
_{1},\alpha_{2},\ldots,\alpha_{k}\right)  $ and $\left(  \beta_{1},\beta
_{2},\ldots,\beta_{\ell}\right)  $ are two Gaussian prime factorizations of
$\nu$, then $\left(  \left[  \alpha_{1}\right]  _{\sim},\left[  \alpha
_{2}\right]  _{\sim},\ldots,\left[  \alpha_{k}\right]  _{\sim}\right)  $ is a
permutation of $\left(  \left[  \beta_{1}\right]  _{\sim},\left[  \beta
_{2}\right]  _{\sim},\ldots,\left[  \beta_{\ell}\right]  _{\sim}\right)  $.
\end{theorem}

\begin{proof}
This is an analogue of Theorem \ref{thm.ent.prime.fac-uni}, and is proven similarly.
\end{proof}

\begin{example}
We have
\[
5=\left(  1+2i\right)  \left(  1-2i\right)  =\left(  2+i\right)  \left(
2-i\right)  .
\]
Thus, both $\left(  1+2i,1-2i\right)  $ and $\left(  2+i,2-i\right)  $ are
Gaussian prime factorizations of $5$. They may look different, but actually
you get the second one from the first by swapping the two entries and
multiplying the first entry by the unit $i$ and multiplying the second entry
by the unit $-i$. This perfectly agrees with Theorem
\ref{thm.Z[i].prime.fac-uni}.
\end{example}

In analogy to Exercise \ref{exe.ent.prime.vp-abs} (and with the same proof),
we have:

\begin{exercise}
\label{exe.Z[i].prime.vp-abs}Let $\pi$ be a Gaussian prime. Let $\alpha
,\beta\in\mathbb{Z}\left[  i\right]  $ be such that $\alpha\sim\beta$. Prove
that $v_{\pi}\left(  \alpha\right)  =v_{\pi}\left(  \beta\right)  $.
\end{exercise}

We also have the following:

\begin{exercise}
\label{exe.Z[i].prime.vp-conj}Let $\pi$ be a Gaussian prime. Let $\alpha
\in\mathbb{Z}\left[  i\right]  $. Then, $\overline{\pi}$ is a Gaussian prime
as well, and satisfies%
\[
v_{\overline{\pi}}\left(  \overline{\alpha}\right)  =v_{\pi}\left(
\alpha\right)  .
\]

\end{exercise}

\begin{proof}
[Solution sketch.]Conjugation is a symmetry, taking Gaussian integers to
Gaussian integers and preserving divisibility. Thus, any $i\in\mathbb{N}$
satisfying $\pi^{i}\mid\alpha$ must also satisfy $\overline{\pi}^{i}%
\mid\overline{\alpha}$, and vice versa. Hence, $v_{\overline{\pi}}\left(
\overline{\alpha}\right)  =v_{\pi}\left(  \alpha\right)  $ easily follows.
\end{proof}

\begin{definition}
For the rest of this section, let $\operatorname*{GP}$ be the set of all
Gaussian primes of the form $x+yi$ with $x\in\left\{  1,2,3,\ldots\right\}  $
and $y\in\left\{  0,1,2,\ldots\right\}  $.
\end{definition}

The following is easy to see:

\begin{lemma}
\label{lem.Z[i].prime.GP-reps}Let $\pi$ be a Gaussian prime. Then, there
exists \textbf{exactly one} $\sigma\in\operatorname*{GP}$ such that $\pi
\sim\sigma$.
\end{lemma}

In other words, each Gaussian prime is unit-equivalent to exactly one
$\sigma\in\operatorname*{GP}$. Thus, the set $\operatorname*{GP}$ contains
exactly one element of each unit-equivalence class of Gaussian primes. (Thus,
$\operatorname*{GP}$ is what is called a \textquotedblleft system of distinct
representatives\textquotedblright\ for the unit-equivalence classes of all
Gaussian primes.)

In analogy to Corollary \ref{cor.ent.prime.can-facZ}, we have:

\begin{corollary}
\label{cor.Z[i].prime.can-facZ}Let $\alpha$ be a nonzero Gaussian integer.
Then,
\[
\alpha\sim\prod_{\pi\in\operatorname*{GP}}\pi^{v_{\pi}\left(  \alpha\right)
}.
\]


Here, the infinite product $\prod_{\pi\in\operatorname*{GP}}\pi^{v_{\pi
}\left(  \alpha\right)  }$ is well-defined (according to the Gaussian-integer
analogue of Lemma \ref{lem.ent.prime.vpn=0} \textbf{(b)}).
\end{corollary}

In analogy to Proposition \ref{prop.ent.prime.n|m}, we have the following:

\begin{proposition}
\label{prop.Z[i].prime.n|m}Let $\alpha$ and $\beta$ be Gaussian integers.
Then, $\alpha\mid\beta$ if and only if each Gaussian prime $\pi$ satisfies
$v_{\pi}\left(  \alpha\right)  \leq v_{\pi}\left(  \beta\right)  $.
\end{proposition}

If $\alpha$ is a Gaussian integer, and $c$ is a unit-equivalence class of
Gaussian integers, then either all elements of $c$ divide $\alpha$ or none of
them does.\footnote{This is easy to check. Indeed, it boils down to the fact
that any two elements of $c$ divide each other (because they are
unit-equivalent).} Thus, we can talk of \textit{unit-equivalence classes of
Gaussian divisors of }$\alpha$ (by which we mean unit-equivalence classes of
Gaussian integers whose elements all divide $\alpha$).

Here is an analogue of Proposition \ref{prop.ent.count-divs} for Gaussian integers:

\begin{proposition}
Let $\alpha\in\mathbb{Z}\left[  i\right]  $ be a nonzero Gaussian integer. Then:

\textbf{(a)} The product $\prod_{\pi\in\operatorname*{GP}}\left(  v_{\pi
}\left(  \alpha\right)  +1\right)  $ is well-defined, since all but finitely
many of its factors are $1$.

\textbf{(b)} We have%
\begin{align*}
&  \left(  \text{the number of unit-equivalence classes of Gaussian divisors
of }\alpha\right) \\
=  &  \prod_{\pi\in\operatorname*{GP}}\left(  v_{\pi}\left(  \alpha\right)
+1\right)  .
\end{align*}


\textbf{(c)} We have%
\[
\left(  \text{the number of Gaussian divisors of }\alpha\right)  =4\cdot
\prod_{\pi\in\operatorname*{GP}}\left(  v_{\pi}\left(  \alpha\right)
+1\right)  .
\]

\end{proposition}

\begin{proof}
Same proof as for Proposition \ref{prop.ent.count-divs}, but you have to be
more careful with unit-equivalence (since in part \textbf{(b)}, you are
counting unit-equivalence classes rather than positive divisors). The analogue
of Lemma \ref{lem.ent.divs-bijs} we need to use for this proof is the
following lemma:
\end{proof}

\begin{lemma}
\label{lem.Z[i].divs-bijs}Let $\pi_{1},\pi_{2},\ldots,\pi_{u}$ be finitely
many Gaussian primes, no two of which are unit-equivalent. For each
$i\in\left\{  1,2,\ldots,u\right\}  $, let $a_{i}$ be a nonnegative integer.
Let $\alpha=\pi_{1}^{a_{1}}\pi_{2}^{a_{2}}\cdots\pi_{u}^{a_{u}}$.

Define a set $T$ by%
\begin{align*}
T  &  =\left\{  0,1,\ldots,a_{1}\right\}  \times\left\{  0,1,\ldots
,a_{2}\right\}  \times\cdots\times\left\{  0,1,\ldots,a_{u}\right\} \\
&  =\left\{  \left(  b_{1},b_{2},\ldots,b_{u}\right)  \ \mid\text{ }b_{i}%
\in\left\{  0,1,\ldots,a_{i}\right\}  \text{ for each }i\in\left\{
1,2,\ldots,u\right\}  \right\} \\
&  =\left\{  \left(  b_{1},b_{2},\ldots,b_{u}\right)  \in\mathbb{N}^{u}%
\ \mid\ b_{i}\leq a_{i}\text{ for each }i\in\left\{  1,2,\ldots,u\right\}
\right\}  .
\end{align*}
Then, the map%
\begin{align*}
\Lambda:T  &  \rightarrow\left\{  \text{unit-equivalence classes of Gaussian
divisors of }\alpha\right\}  ,\\
\left(  b_{1},b_{2},\ldots,b_{u}\right)   &  \mapsto\left[  \pi_{1}^{b_{1}}%
\pi_{2}^{b_{2}}\cdots\pi_{u}^{b_{u}}\right]  _{\sim}%
\end{align*}
is well-defined and bijective.
\end{lemma}

Now, we can finally answer Question \ref{quest.intro.sum-of-2sq.2}
\textbf{(b)} (following \cite[\S 8.3, Corollary 19]{Dummit-Foote}):

\begin{theorem}
\label{thm.Z[i].count-xx+yy}Let $n$ be a positive integer.

\textbf{(a)} If there is at least one prime $p\equiv3\operatorname{mod}4$ such
that $v_{p}\left(  n\right)  $ is odd, then there is \textbf{no} pair $\left(
x,y\right)  \in\mathbb{Z}^{2}$ such that $n=x^{2}+y^{2}$.

\textbf{(b)} Assume that for each prime $p\equiv3\operatorname{mod}4$, the
number $v_{p}\left(  n\right)  $ is even. Then,%
\begin{align*}
&  \left(  \text{the number of pairs }\left(  x,y\right)  \in\mathbb{Z}%
^{2}\text{ such that }n=x^{2}+y^{2}\right) \\
&  =4\cdot\prod_{\substack{p\text{ prime;}\\p\equiv1\operatorname{mod}%
4}}\left(  v_{p}\left(  n\right)  +1\right)  .
\end{align*}

\end{theorem}

\begin{noncompile}
In other words: If $n$ is a positive integer, then%
\begin{align*}
&  \left(  \text{the number of pairs }\left(  x,y\right)  \in\mathbb{Z}%
^{2}\text{ such that }n=x^{2}+y^{2}\right) \\
&  =\left(  \text{the number of }\delta\in\mathbb{Z}\left[  i\right]  \text{
such that }n=\delta\overline{\delta}\right) \\
&  =%
\begin{cases}
4\prod_{\substack{p\text{ prime;}\\p\equiv1\operatorname{mod}4}}\left(
v_{p}\left(  n\right)  +1\right)  , & \text{if all primes }p\equiv
3\operatorname{mod}4\text{ satisfy }v_{p}\left(  n\right)  \equiv
0\operatorname{mod}2;\\
0, & \text{if some prime }p\equiv3\operatorname{mod}4\text{ satisfies }%
v_{p}\left(  n\right)  \equiv1\operatorname{mod}2.
\end{cases}
\end{align*}

\end{noncompile}

\begin{teachingnote}
\textbf{2019-03-15 lecture}
\end{teachingnote}

\begin{example}
\textbf{(a)} Let $n=35$. Then, Theorem \ref{thm.Z[i].count-xx+yy} \textbf{(a)}
yields that there are \textbf{no} integers $x$ and $y$ such that
$n=x^{2}+y^{2}$. In fact, the prime $7\equiv3\operatorname{mod}4$ satisfies
$v_{7}\left(  n\right)  =1$.

\textbf{(b)} Let $n=45$. Then, for each prime $p\equiv3\operatorname{mod}4$,
the number $v_{p}\left(  n\right)  $ is even. Indeed, $n=45=3^{2}\cdot5$, so
$v_{3}\left(  n\right)  =2$ is even and $v_{p}\left(  n\right)  =0$ for all
other primes $p$ of Type 3. Hence, Theorem \ref{thm.Z[i].count-xx+yy}
\textbf{(b)} yields%
\begin{align*}
&  \left(  \text{the number of pairs }\left(  x,y\right)  \in\mathbb{Z}%
^{2}\text{ such that }n=x^{2}+y^{2}\right) \\
&  =4\cdot\underbrace{\prod_{\substack{p\text{ prime;}\\p\equiv
1\operatorname{mod}4}}\left(  v_{p}\left(  n\right)  +1\right)  }%
_{\substack{=v_{5}\left(  n\right)  +1\\=1+1=2}}=4\cdot2=8.
\end{align*}

\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.Z[i].count-xx+yy} (sketched).]\textbf{(a)} Assume
that there is at least one prime $p\equiv3\operatorname{mod}4$ such that
$v_{p}\left(  n\right)  $ is odd. We must prove that there is \textbf{no} pair
$\left(  x,y\right)  \in\mathbb{Z}^{2}$ such that $n=x^{2}+y^{2}$.

Indeed, let $\left(  x,y\right)  \in\mathbb{Z}^{2}$ be a pair such that
$n=x^{2}+y^{2}$. We must derive a contradiction.

Let $\alpha$ be the Gaussian integer $x+yi$. Thus, $\alpha\overline{\alpha
}=x^{2}+y^{2}=n$.

We have assumed that there is at least one prime $p\equiv3\operatorname{mod}4$
such that $v_{p}\left(  n\right)  $ is odd. Consider this $p$. Note that $p$
is a Gaussian prime (by Lemma \ref{lem.Z[i].gauss.prime.3mod4}).

Thus, Exercise \ref{exe.Z[i].prime.vp-conj} (applied to $\pi=p$) yields
$v_{\overline{p}}\left(  \overline{\alpha}\right)  =v_{p}\left(
\alpha\right)  $. In view of $\overline{p}=p$, this rewrites as $v_{p}\left(
\overline{\alpha}\right)  =v_{p}\left(  \alpha\right)  $. But
\[
v_{p}\left(  \underbrace{n}_{=\alpha\overline{\alpha}}\right)  =v_{p}\left(
\alpha\overline{\alpha}\right)  =v_{p}\left(  \alpha\right)
+\underbrace{v_{p}\left(  \overline{\alpha}\right)  }_{=v_{p}\left(
\alpha\right)  }=v_{p}\left(  \alpha\right)  +v_{p}\left(  \alpha\right)
=2v_{p}\left(  \alpha\right)  .
\]
Thus, $v_{p}\left(  n\right)  $ is even. This contradicts the fact that
$v_{p}\left(  n\right)  $ is odd. Thus, we have found a contradiction for each
pair $\left(  x,y\right)  \in\mathbb{Z}^{2}$ such that $n=x^{2}+y^{2}$. Hence,
there exists no such pair. This proves Theorem \ref{thm.Z[i].count-xx+yy}
\textbf{(a)}.

\textbf{(b)} We have%
\begin{align*}
&  \left(  \text{the number of }\alpha\in\mathbb{Z}\left[  i\right]  \text{
such that }n=\alpha\overline{\alpha}\right) \\
&  =\left(  \text{the number of pairs }\left(  x,y\right)  \in\mathbb{Z}%
^{2}\text{ such that }n=x^{2}+y^{2}\right)  ,
\end{align*}
since the map%
\begin{align*}
\left\{  \left(  x,y\right)  \in\mathbb{Z}^{2}\ \mid\ n=x^{2}+y^{2}\right\}
&  \rightarrow\left\{  \alpha\in\mathbb{Z}\left[  i\right]  \ \mid
\ n=\alpha\overline{\alpha}\right\}  ,\\
\left(  x,y\right)   &  \mapsto x+yi
\end{align*}
is a bijection.

Write the canonical factorization of $n$ as
\begin{equation}
n=2^{c}\cdot p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{k}^{a_{k}}\cdot q_{1}^{b_{1}%
}q_{2}^{b_{2}}\cdots q_{\ell}^{b_{\ell}},
\label{pf.thm.Z[i].count-xx+yy.b.n=1}%
\end{equation}
where all the exponents $c,a_{h},b_{j}$ are $\in\mathbb{N}$, and where
$p_{1},p_{2},\ldots,p_{k}$ are distinct primes of Type 1, and where
$q_{1},q_{2},\ldots,q_{\ell}$ are distinct primes of Type 3. Note that $c=0$
if $n$ is odd.

We have assumed that for each prime $p\equiv3\operatorname{mod}4$, the number
$v_{p}\left(  n\right)  $ is even. In other words, for each prime $p$ of Type
3, the number $v_{p}\left(  n\right)  $ is even. In other words, $b_{1}%
,b_{2},\ldots,b_{\ell}$ are even (since $q_{1},q_{2},\ldots,q_{\ell}$ are
primes of Type 3, and thus the corresponding exponents $b_{j}=v_{q_{j}}\left(
n\right)  $ must be even). Hence, $b_{j}/2\in\mathbb{N}$ for each $j$.

Each $q_{j}$ is a prime of Type 3, and thus is a Gaussian prime (by Lemma
\ref{lem.Z[i].gauss.prime.3mod4}). Meanwhile, each $p_{h}$ is a prime of Type
1, and thus can be written in the form $p_{h}=\pi_{h}\overline{\pi_{h}}$ for
some Gaussian prime $\pi_{h}$ (by Theorem \ref{thm.Z[i].gauss.prime.1mod4}
\textbf{(c)}). Consider these $\pi_{h}$. For every $h$, Theorem
\ref{thm.Z[i].gauss.prime.1mod4} \textbf{(e)} shows that the conjugate
$\overline{\pi_{h}}$ is also a Gaussian prime, and that we do not have
$\pi_{h}\sim\overline{\pi_{h}}$.

Finally, let $\rho$ be the Gaussian prime $1+i$; thus $2=\rho\overline{\rho}$.
But note that $\rho\sim\overline{\rho}$ (indeed, $\overline{\rho}=1-i=\left(
-i\right)  \underbrace{\left(  1+i\right)  }_{=\rho}=\left(  -i\right)  \rho
$). Now, (\ref{pf.thm.Z[i].count-xx+yy.b.n=1}) becomes%
\begin{align}
n  &  =\underbrace{2^{c}}_{\substack{=\rho^{c}\overline{\rho}^{c}%
\\\text{(since }2=\rho\overline{\rho}\text{)}}}\cdot\left(  \prod_{h=1}%
^{k}\underbrace{p_{h}^{a_{h}}}_{\substack{=\pi_{h}^{a_{h}}\overline{\pi_{h}%
}^{a_{h}}\\\text{(since }p_{h}=\pi_{h}\overline{\pi_{h}}\text{)}}}\right)
\cdot q_{1}^{b_{1}}q_{2}^{b_{2}}\cdots q_{\ell}^{b_{\ell}}\nonumber\\
&  =\rho^{c}\overline{\rho}^{c}\cdot\left(  \prod_{h=1}^{k}\left(  \pi
_{h}^{a_{h}}\overline{\pi_{h}}^{a_{h}}\right)  \right)  \cdot q_{1}^{b_{1}%
}q_{2}^{b_{2}}\cdots q_{\ell}^{b_{\ell}},
\label{pf.thm.Z[i].count-xx+yy.b.n=2}%
\end{align}
and this is a decomposition of $n$ as a product of powers of Gaussian primes
(albeit $\rho$ and $\overline{\rho}$ are unit-equivalent).

No two of the Gaussian primes $\rho,\pi_{h},\overline{\pi_{h}},q_{j}$ are
unit-equivalent. (\textit{Proof:} Compare their norms (since unit-equivalent
Gaussian integers have equal norms). The only of these Gaussian primes that
have equal norms are $\pi_{h}$ and $\overline{\pi_{h}}$. So we merely need to
rule out $\pi_{h}\sim\overline{\pi_{h}}$. But this is clear, since we already
showed that we do not have $\pi_{h}\sim\overline{\pi_{h}}$.)

Now, define a map%
\begin{align*}
F:\left\{  1,i,-1,-i\right\}  \times\prod_{h=1}^{k}\left\{  0,1,\ldots
,a_{h}\right\}   &  \rightarrow\left\{  \alpha\in\mathbb{Z}\left[  i\right]
\ \mid\ n=\alpha\overline{\alpha}\right\}  ,\\
\left(  \gamma,\left(  d_{1},d_{2},\ldots,d_{k}\right)  \right)   &
\mapsto\gamma\cdot\rho^{c}\cdot\left(  \prod_{h=1}^{k}\left(  \pi_{h}^{d_{h}%
}\overline{\pi_{h}}^{a_{h}-d_{h}}\right)  \right)  \cdot q_{1}^{b_{1}/2}%
q_{2}^{b_{2}/2}\cdots q_{\ell}^{b_{\ell}/2}.
\end{align*}
It is easy to check that this map $F$ is well-defined\footnote{Just multiply
out $\alpha\overline{\alpha}$ for $\alpha=\gamma\cdot\rho^{c}\cdot\left(
\prod_{h=1}^{k}\left(  \pi_{h}^{d_{h}}\overline{\pi_{h}}^{a_{h}-d_{h}}\right)
\right)  \cdot q_{1}^{b_{1}/2}q_{2}^{b_{2}/2}\cdots q_{\ell}^{b_{\ell}/2}$ and
check that you obtain $n$. Corollary \ref{cor.CC.norm.pow} \textbf{(a)} needs
to be used.}. We claim that this map $F$ is a bijection.

[\textit{Proof:} To see that $F$ is injective, we must find a way to
reconstruct $\left(  \gamma,\left(  d_{1},d_{2},\ldots,d_{k}\right)  \right)
\in\left\{  1,i,-1,-i\right\}  \times\prod_{h=1}^{k}\left\{  0,1,\ldots
,a_{h}\right\}  $ from
\begin{align*}
\alpha:  &  =F\left(  \left(  \gamma,\left(  d_{1},d_{2},\ldots,d_{k}\right)
\right)  \right) \\
&  =\gamma\cdot\rho^{c}\cdot\left(  \prod_{h=1}^{k}\left(  \pi_{h}^{d_{h}%
}\overline{\pi_{h}}^{a_{h}-d_{h}}\right)  \right)  \cdot q_{1}^{b_{1}/2}%
q_{2}^{b_{2}/2}\cdots q_{\ell}^{b_{\ell}/2}.
\end{align*}


But this is easy: You first reconstruct the $k$-tuple $\left(  d_{1}%
,d_{2},\ldots,d_{k}\right)  $ by observing that $d_{h}=v_{\pi_{h}}\left(
\alpha\right)  $ for each $h$. Once you have that, you can reconstruct
$\gamma$ by%
\[
\gamma=\dfrac{\alpha}{\rho^{c}\cdot\left(  \prod_{h=1}^{k}\left(  \pi
_{h}^{d_{h}}\overline{\pi_{h}}^{a_{h}-d_{h}}\right)  \right)  \cdot
q_{1}^{b_{1}/2}q_{2}^{b_{2}/2}\cdots q_{\ell}^{b_{\ell}/2}}.
\]
So $F$ is injective.

To see that $F$ is surjective, we must prove that each $\alpha\in
\mathbb{Z}\left[  i\right]  $ satisfying $n=\alpha\overline{\alpha}$ has the
form
\[
\alpha=\gamma\cdot\rho^{c}\cdot\left(  \prod_{h=1}^{k}\left(  \pi_{h}^{d_{h}%
}\overline{\pi_{h}}^{a_{h}-d_{h}}\right)  \right)  \cdot q_{1}^{b_{1}/2}%
q_{2}^{b_{2}/2}\cdots q_{\ell}^{b_{\ell}/2}%
\]
for some $\left(  \gamma,\left(  d_{1},d_{2},\ldots,d_{k}\right)  \right)  $.
To prove this, use canonical factorization of $\alpha$ inside $\mathbb{Z}%
\left[  i\right]  $ to see that%
\begin{equation}
\alpha=\gamma\cdot\rho^{c^{\prime}}\cdot\left(  \prod_{h=1}^{k}\left(  \pi
_{h}^{d_{h}^{\prime}}\overline{\pi_{h}}^{e_{h}^{\prime}}\right)  \right)
\cdot q_{1}^{b_{1}^{\prime}}q_{2}^{b_{2}^{\prime}}\cdots q_{\ell}^{b_{\ell
}^{\prime}} \label{pf.thm.Z[i].count-xx+yy.b.al=2}%
\end{equation}
for some $c^{\prime},d_{h}^{\prime},e_{h}^{\prime},b_{j}^{\prime}\in
\mathbb{N}$. Consider these $c^{\prime},d_{h}^{\prime},e_{h}^{\prime}%
,b_{j}^{\prime}\in\mathbb{N}$. From (\ref{pf.thm.Z[i].count-xx+yy.b.al=2}), we
obtain
\begin{align*}
\alpha\overline{\alpha}  &  =\gamma\cdot\rho^{c^{\prime}}\cdot\left(
\prod_{h=1}^{k}\left(  \pi_{h}^{d_{h}^{\prime}}\overline{\pi_{h}}%
^{e_{h}^{\prime}}\right)  \right)  \cdot q_{1}^{b_{1}^{\prime}}q_{2}%
^{b_{2}^{\prime}}\cdots q_{\ell}^{b_{\ell}^{\prime}}\cdot\overline{\gamma
\cdot\rho^{c^{\prime}}\cdot\left(  \prod_{h=1}^{k}\left(  \pi_{h}%
^{d_{h}^{\prime}}\overline{\pi_{h}}^{e_{h}^{\prime}}\right)  \right)  \cdot
q_{1}^{b_{1}^{\prime}}q_{2}^{b_{2}^{\prime}}\cdots q_{\ell}^{b_{\ell}^{\prime
}}}\\
&  =\underbrace{\gamma\overline{\gamma}}_{\substack{=\operatorname*{N}\left(
\gamma\right)  =1\\\text{(since }\gamma\text{ is a unit)}}}\cdot
\underbrace{\rho^{c^{\prime}}\overline{\rho}^{c^{\prime}}}_{\substack{=\left(
\rho\overline{\rho}\right)  ^{c^{\prime}}=2^{c^{\prime}}\\\text{(since }%
\rho\overline{\rho}=2\text{)}}}\cdot\left(  \prod_{h=1}^{k}\left(  \pi
_{h}^{d_{h}^{\prime}}\overline{\pi_{h}}^{e_{h}^{\prime}}\overline{\pi
_{h}^{d_{h}^{\prime}}\overline{\pi_{h}}^{e_{h}^{\prime}}}\right)  \right)
\cdot q_{1}^{b_{1}^{\prime}}q_{2}^{b_{2}^{\prime}}\cdots q_{\ell}^{b_{\ell
}^{\prime}}\cdot\underbrace{\overline{q_{1}^{b_{1}^{\prime}}q_{2}%
^{b_{2}^{\prime}}\cdots q_{\ell}^{b_{\ell}^{\prime}}}}_{\substack{=q_{1}%
^{b_{1}^{\prime}}q_{2}^{b_{2}^{\prime}}\cdots q_{\ell}^{b_{\ell}^{\prime}%
}\\\text{(since }q_{1},q_{2},\ldots,q_{\ell}\\\text{are reals)}}}\\
&  =2^{c^{\prime}}\cdot\left(  \prod_{h=1}^{k}\underbrace{\left(  \pi
_{h}^{d_{h}^{\prime}}\overline{\pi_{h}}^{e_{h}^{\prime}}\overline{\pi
_{h}^{d_{h}^{\prime}}\overline{\pi_{h}}^{e_{h}^{\prime}}}\right)  }_{=\left(
\pi_{h}\overline{\pi_{h}}\right)  ^{d_{h}^{\prime}+e_{h}^{\prime}}}\right)
\cdot\underbrace{q_{1}^{b_{1}^{\prime}}q_{2}^{b_{2}^{\prime}}\cdots q_{\ell
}^{b_{\ell}^{\prime}}\cdot q_{1}^{b_{1}^{\prime}}q_{2}^{b_{2}^{\prime}}\cdots
q_{\ell}^{b_{\ell}^{\prime}}}_{=q_{1}^{2b_{1}^{\prime}}q_{2}^{2b_{2}^{\prime}%
}\cdots q_{\ell}^{2b_{\ell}^{\prime}}}\\
&  =2^{c^{\prime}}\cdot\left(  \prod_{h=1}^{k}\left(  \underbrace{\pi
_{h}\overline{\pi_{h}}}_{=p_{h}}\right)  ^{d_{h}^{\prime}+e_{h}^{\prime}%
}\right)  \cdot q_{1}^{2b_{1}^{\prime}}q_{2}^{2b_{2}^{\prime}}\cdots q_{\ell
}^{2b_{\ell}^{\prime}}=2^{c^{\prime}}\cdot\left(  \prod_{h=1}^{k}p_{h}%
^{d_{h}^{\prime}+e_{h}^{\prime}}\right)  \cdot q_{1}^{2b_{1}^{\prime}}%
q_{2}^{2b_{2}^{\prime}}\cdots q_{\ell}^{2b_{\ell}^{\prime}}.
\end{align*}
Thus,%
\begin{equation}
n=\alpha\overline{\alpha}=2^{c^{\prime}}\cdot\left(  \prod_{h=1}^{k}%
p_{h}^{d_{h}^{\prime}+e_{h}^{\prime}}\right)  \cdot q_{1}^{2b_{1}^{\prime}%
}q_{2}^{2b_{2}^{\prime}}\cdots q_{\ell}^{2b_{\ell}^{\prime}}.
\label{pf.thm.Z[i].count-xx+yy.b.n=5}%
\end{equation}
This is a prime factorization of $n$ as an integer. But so is
(\ref{pf.thm.Z[i].count-xx+yy.b.n=1}). Since the prime factorization of an
integer is unique (or by comparing $p$-valuations of the right hand sides on
(\ref{pf.thm.Z[i].count-xx+yy.b.n=5}) and (\ref{pf.thm.Z[i].count-xx+yy.b.n=1}%
)), we thus conclude%
\begin{align*}
c^{\prime}  &  =c;\ \ \ \ \ \ \ \ \ \ d_{h}^{\prime}+e_{h}^{\prime}%
=a_{h}\ \ \ \ \ \ \ \ \ \ \text{for all }h;\\
2b_{j}^{\prime}  &  =b_{j}\ \ \ \ \ \ \ \ \ \ \text{for all }j.
\end{align*}
In other words,%
\begin{align*}
c^{\prime}  &  =c;\ \ \ \ \ \ \ \ \ \ e_{h}^{\prime}=a_{h}-d_{h}^{\prime
}\ \ \ \ \ \ \ \ \ \ \text{for all }h;\\
b_{j}^{\prime}  &  =b_{j}/2\ \ \ \ \ \ \ \ \ \ \text{for all }j.
\end{align*}
Hence, (\ref{pf.thm.Z[i].count-xx+yy.b.al=2}) rewrites as%
\begin{align*}
\alpha &  =\gamma\cdot\rho^{c}\cdot\left(  \prod_{h=1}^{k}\left(  \pi
_{h}^{d_{h}^{\prime}}\overline{\pi_{h}}^{a_{h}-d_{h}^{\prime}}\right)
\right)  \cdot q_{1}^{b_{1}/2}q_{2}^{b_{2}/2}\cdots q_{\ell}^{b_{\ell}/2}\\
&  =F\left(  \left(  \gamma,\left(  d_{1}^{\prime},d_{2}^{\prime},\ldots
,d_{k}^{\prime}\right)  \right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
the definition of }F\right)  .
\end{align*}
Thus, we have shown that $\alpha$ is a value of $F$. This proves that $F$ is surjective.

Now, $F$ is injective and surjective, hence bijective.]

So $F$ is a bijection. Thus,%
\begin{align*}
&  \left\vert \left\{  1,i,-1,-i\right\}  \times\prod_{h=1}^{k}\left\{
0,1,\ldots,a_{h}\right\}  \right\vert \\
&  =\left\vert \left\{  \alpha\in\mathbb{Z}\left[  i\right]  \ \mid
\ n=\alpha\overline{\alpha}\right\}  \right\vert \\
&  =\left(  \text{the number of }\alpha\in\mathbb{Z}\left[  i\right]  \text{
such that }n=\alpha\overline{\alpha}\right) \\
&  =\left(  \text{the number of pairs }\left(  x,y\right)  \in\mathbb{Z}%
^{2}\text{ such that }n=x^{2}+y^{2}\right)  ,
\end{align*}
so that%
\begin{align*}
&  \left(  \text{the number of pairs }\left(  x,y\right)  \in\mathbb{Z}%
^{2}\text{ such that }n=x^{2}+y^{2}\right) \\
&  =\left\vert \left\{  1,i,-1,-i\right\}  \times\prod_{h=1}^{k}\left\{
0,1,\ldots,a_{h}\right\}  \right\vert =\underbrace{\left\vert \left\{
1,i,-1,-i\right\}  \right\vert }_{=4}\cdot\prod_{h=1}^{k}%
\underbrace{\left\vert \left\{  0,1,\ldots,a_{h}\right\}  \right\vert
}_{=a_{h}+1}\\
&  =4\cdot\prod_{h=1}^{k}\left(  \underbrace{a_{h}}_{=v_{p_{h}}\left(
n\right)  }+1\right)  =4\cdot\prod_{h=1}^{k}\left(  v_{p_{h}}\left(  n\right)
+1\right)  =4\cdot\prod_{\substack{p\text{ prime;}\\p\equiv1\operatorname{mod}%
4}}\left(  v_{p}\left(  n\right)  +1\right)  .
\end{align*}
(The last equality sign is a consequence of the fact that $p_{1},p_{2}%
,\ldots,p_{h}$ are distinct primes of Type 1, and that all other primes
$p\notin\left\{  p_{1},p_{2},\ldots,p_{h}\right\}  $ of Type 1 satisfy
$v_{p}\left(  n\right)  =0$.) This proves Theorem \ref{thm.Z[i].count-xx+yy}
\textbf{(b)}.
\end{proof}

One consequence of Theorem \ref{thm.Z[i].count-xx+yy} is that a positive
integer $n$ can be written in the form $x^{2}+y^{2}$ with $x,y\in\mathbb{Z}$
if and only if it has the property that for each prime $p\equiv
3\operatorname{mod}4$, the number $v_{p}\left(  n\right)  $ is even. A
different proof of this fact appears in \cite[Theorem in Chapter 4]{AigZie}.

\subsubsection{What are the Gaussian primes?}

We have so far seen the following Gaussian primes:

\begin{itemize}
\item Each prime of Type 3 is a Gaussian prime.

\item $1+i$ is a Gaussian prime.

\item For each prime $p$ of Type 1, we have a Gaussian prime $\pi$ such that
$p=\pi\overline{\pi}$, and then $\overline{\pi}$ is also a Gaussian prime.
\end{itemize}

\begin{theorem}
Each Gaussian prime is unit-equivalent to one of the Gaussian primes in this list.
\end{theorem}

\begin{proof}
See \href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw5s.pdf}{homework set
\#5} exercise 3.
\end{proof}

\subsection{Brief survey of similar number systems}

\begin{itemize}
\item Let us now see when a prime $p$ can be written as $x^{2}+2y^{2}$ with
$x,y\in\mathbb{Z}$.

The set
\[
\mathbb{Z}\left[  \sqrt{-2}\right]  =\mathbb{Z}\left[  \sqrt{2}i\right]
\]
is defined as the set of all complex numbers of the form $a+b\sqrt{2}i$ with
$a,b\in\mathbb{Z}$. It is perhaps easier to regard it as its own variant of
Gaussian integers, which I will call the \textquotedblleft$2$-Gaussian
integers\textquotedblright. These \textquotedblleft$2$-Gaussian
integers\textquotedblright\ can be defined as pairs $\left(  a,b\right)
\in\mathbb{Z}^{2}$ with addition and subtraction defined entrywise and
multiplication defined by%
\[
\left(  a,b\right)  \left(  c,d\right)  =\left(  ac-2bd,ad+bc\right)  .
\]
\footnote{Be careful, however: This definition of $2$-Gaussian integers as
pairs of integers conflicts with the definition of complex numbers as pairs of
reals; the $2$-Gaussian integer $\left(  a,b\right)  $ and the complex number
$\left(  a,b\right)  $ are two different numbers (unless $b=0$).} You can then
write such pairs $\left(  a,b\right)  $ as $a+b\sqrt{2}i$, where $\sqrt{2}i$
is simply a symbol for the $2$-Gaussian integer $\left(  0,1\right)  $. Each
$2$-Gaussian integer $\left(  a,b\right)  $ has a norm, defined by
$\operatorname*{N}\left(  \left(  a,b\right)  \right)  =a^{2}+2b^{2}$.

Much of the theory of Gaussian integers still applies verbatim to $2$-Gaussian
integers. In particular, division with remainder still works for $2$-Gaussian
integers (like it does for Gaussian integers, i.e., non-uniquely), and the
proof uses the same argument, but this time we have $\operatorname*{N}\left(
\rho\right)  \leq3\operatorname*{N}\left(  \beta\right)  /4$ instead of
$\operatorname*{N}\left(  \rho\right)  \leq\operatorname*{N}\left(
\beta\right)  /2$. Hence, $2$-Gaussian integers have unique factorizations
into \textquotedblleft$2$-Gaussian primes\textquotedblright.

This can be used to show that a prime $p$ can be written as $x^{2}+2y^{2}$ if
and only if there is an integer $u$ satisfying $u^{2}\equiv
-2\operatorname{mod}p$. It can furthermore be shown that such an integer $u$
exists if and only if $p=2$ or $p\equiv1,3\operatorname{mod}8$ (where
\textquotedblleft$p\equiv1,3\operatorname{mod}8$\textquotedblright\ is
shorthand for \textquotedblleft$p\equiv1\operatorname{mod}8$ or $p\equiv
3\operatorname{mod}8$\textquotedblright). The proof uses a fact called
\textit{quadratic reciprocity}, which we \textbf{may} see later in this course.

\item When can a prime $p$ be written as $x^{2}+3y^{2}$ with $x,y\in
\mathbb{Z}$ ?

The logical continuation of the above pattern would be \textquotedblleft when
$p=3$ or $p\equiv1\operatorname{mod}3$\textquotedblright, since these are the
cases when there is an integer $u$ satisfying $u^{2}\equiv-3\operatorname{mod}%
p$. And that is indeed true, but the proof is more complicated. Indeed, the
\textquotedblleft$3$-Gaussian integers\textquotedblright\ no longer have
division with remainder, as $\operatorname*{N}\left(  \rho\right)
\leq\operatorname*{N}\left(  \beta\right)  /2$ turns into $\operatorname*{N}%
\left(  \rho\right)  \leq\operatorname*{N}\left(  \beta\right)  $ which is not
a strict inequality. Nevertheless we can prove our guess with more complicated
reasoning: We need to use not $\mathbb{Z}\left[  \sqrt{-3}\right]  $ but
rather \href{https://en.wikipedia.org/wiki/Eisenstein_integer}{the
\textit{Eisenstein integers}} $a+b\omega$ with $a,b\in\mathbb{Z}$ and
$\omega=\dfrac{-1+i\sqrt{3}}{2}$. These are best understood as pairs $\left(
a,b\right)  \in\mathbb{Z}^{2}$ with addition and subtraction defined entrywise
and multiplication defined by%
\[
\left(  a,b\right)  \left(  c,d\right)  =\left(  ac-bd,ad+bc-bd\right)  .
\]
Their norm is $\operatorname*{N}\left(  \left(  a,b\right)  \right)
=a^{2}-ab+b^{2}$. They form a triangular lattice, not a rectangular one, and
they do have division with remainder. Note that $\operatorname*{N}\left(
a+b\omega\right)  =a^{2}-ab+b^{2}$, so some more work is needed to turn them
into $x^{2}+3y^{2}$ solutions, but it's doable.

\item When can a prime $p$ be written as $x^{2}+4y^{2}$ with $x,y\in
\mathbb{Z}$ ?

This is easy: $4y^{2}=\left(  2y\right)  ^{2}$, so we are looking for a way of
writing $p$ as $x^{2}+y^{2}$ with $y$ even.

I claim that the answer is \textquotedblleft when $p\equiv1\operatorname{mod}%
4$\textquotedblright. Do you see why?

\item When can a prime $p$ be written as $x^{2}+5y^{2}$ with $x,y\in
\mathbb{Z}$ ?

Our guess, by following the above pattern, would be \textquotedblleft when
$p=2$ or $p=5$ or $p\equiv1,3,7,9\operatorname{mod}20$\textquotedblright,
since these are the cases when there is an integer $u$ satisfying $u^{2}%
\equiv-5\operatorname{mod}p$. But this is not true anymore. The right answer
is \textquotedblleft when $p=2$ or $p=5$ or $p\equiv1,9\operatorname{mod}%
20$\textquotedblright. And unsurprisingly, $\mathbb{Z}\left[  \sqrt
{-5}\right]  $ does not have division with remainder.

\item More generally, you can fix $n\in\mathbb{N}$ and ask when a prime can be
written in the form $x^{2}+ny^{2}$. There is a whole book \cite{Cox13} devoted
to this question! The answer becomes more complicated with $n$ getting large,
and touches on a surprising number of different fields of mathematics
(geometry, complex analysis, elliptic functions and elliptic curves).

\item We can also ask when a prime $p$ can be written as $x^{2}-ny^{2}$. The
appropriate analogue of $\mathbb{Z}\left[  i\right]  $ tailored to this
question is $\mathbb{Z}\left[  \sqrt{n}\right]  $, which however behaves much
differently, since $\sqrt{n}$ is real. For example, as you saw on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw4s.pdf}{homework set \#4}
(in the Remark after Exercise 4), there are infinitely many units in
$\mathbb{Z}\left[  \sqrt{2}\right]  $; the same is true for each
$\mathbb{Z}\left[  \sqrt{n}\right]  $ with $n>1$ and $n$ not being a perfect
square (but this is much harder to prove).

\item When can an $n\in\mathbb{N}$ be written as a sum of three squares?
\href{https://en.wikipedia.org/wiki/Legendre's_three-square_theorem}{Legendre's
three-squares theorem} says that the answer is \textquotedblleft if and only
if $n$ is not of the form $n=4^{a}\left(  8b+7\right)  $ for $a,b\in
\mathbb{N}$\textquotedblright. This is very hard to prove (\cite[Chapter
XIII]{Uspensky-Heaslet} might have the only elementary proof).

\item When can an $n\in\mathbb{N}$ be written as a sum of four squares?
\href{https://en.wikipedia.org/wiki/Lagrange's_four-square_theorem}{Lagrange's
four-squares theorem} reveals that the answer to this question is
\textquotedblleft always\textquotedblright!\footnote{An application
(fortunately, no longer relevant):
\par
\textquotedblleft\texttt{Warning: Due to a known bug, the default Linux
document viewer evince prints N*N copies of a PDF file when N copies
requested. As a workaround, use Adobe Reader acroread for printing multiple
copies of PDF documents, or use the fact that every natural number is a sum of
at most four squares.}\textquotedblright} This is easier to show, and there is
even a formula for the number of representations: it is $8\sum
_{\substack{d\mid n;\\4\nmid d}}d$. The existence part can be proven using
\textquotedblleft Hurwitz integers\textquotedblright, which are certain quaternions.
\end{itemize}

\begin{teachingnote}
\textbf{2019-03-25 lecture}
\end{teachingnote}

\section{\label{chp.ring}Rings and fields}

\subsection{\label{sect.ring.ring}Definition of a ring}

We have seen several \textquotedblleft number systems\textquotedblright\ in
the above chapters:

\begin{itemize}
\item $\mathbb{N}$ (the nonnegative integers);

\item $\mathbb{Z}$ (the integers);

\item $\mathbb{R}$ (the real numbers);

\item $\mathbb{Z}/n$ (the residue classes modulo $n$) for an integer $n$;

\item $\mathbb{C}$ (the complex numbers);

\item $\mathbb{Z}\left[  i\right]  $ (the Gaussian integers);

\item $\mathbb{D}$ (the dual numbers -- see
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw4s.pdf}{homework set \#4}
exercise 3);

\item $\mathbb{Z}\left[  \sqrt{2}\right]  =\left\{  a+b\sqrt{2}\ \mid
\ a,b\in\mathbb{Z}\right\}  $ (see
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw4s.pdf}{homework set \#4}
exercise 4);

\item $\mathbb{Z}\left[  \omega\right]  =\left\{  a+b\omega\ \mid
\ a,b\in\mathbb{Z}\right\}  $ (the Eisenstein integers);

\item $\mathbb{Z}\left[  \sqrt{-3}\right]  $ (see
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw5s.pdf}{homework set \#5}
exercise 6).
\end{itemize}

\noindent It may be a stretch to refer to the elements of some of these
systems as \textquotedblleft numbers\textquotedblright, but it is not taboo
(the word \textquotedblleft number\textquotedblright\ has no precise meaning
in mathematics), and these sets have a lot in common: We can add, subtract and
multiply their elements (except for $\mathbb{N}$, which does not allow
subtraction); these operations satisfy the usual rules (e.g., associativity of
multiplication, distributivity, etc.); these sets contain some element
\textquotedblleft behaving like $0$\textquotedblright\ (that is, an element
$\mathbf{0}$ such that $a+\mathbf{0}=\mathbf{0}+a=a$ and $a\cdot
\mathbf{0}=\mathbf{0}\cdot a=\mathbf{0}$ for all $a$) and some element
\textquotedblleft behaving like $1$\textquotedblright\ (that is, an element
$\mathbf{1}$ such that $a\cdot\mathbf{1}=\mathbf{1}\cdot a=a$ for all $a$). It
turns out that just a few of these rules are sufficient to make
\textquotedblleft all the other rules\textquotedblright\ (in a certain
appropriate sense) follow from them. Thus, it is reasonable to crystallize
these few rules into a common, general notion (of which the above examples --
excluding $\mathbb{N}$ -- will be particular cases); this notion will be
called a \textquotedblleft\textbf{ring}\textquotedblright. Hence, we shall
define a \textbf{ring} to be (roughly speaking) a set with operations $+$ and
$\cdot$ and elements $0$ and $1$ that satisfy these few rules. Let us be
specific about what these rules are:\footnote{Recall the definition of a
\textquotedblleft binary operation\textquotedblright\ (Definition
\ref{def.intro.binop}). In particular, a binary operation on a set $S$ must
have all its values in $S$.}

\begin{definition}
\label{def.rings.ring}\textbf{(a)} A \textit{ring} means a set $\mathbb{K}$
endowed with

\begin{itemize}
\item two binary operations called \textquotedblleft\textit{addition}%
\textquotedblright\ and \textquotedblleft\textit{multiplication}%
\textquotedblright, and denoted by $+_{\mathbb{K}}$ and $\cdot_{\mathbb{K}}$,
respectively, and

\item two elements called \textquotedblleft\textit{zero}\textquotedblright%
\ (or \textquotedblleft\textit{origin}\textquotedblright) and
\textquotedblleft\textit{unity}\textquotedblright\ (or \textquotedblleft%
\textit{one}\textquotedblright), and denoted by $0_{\mathbb{K}}$ and
$1_{\mathbb{K}}$, respectively
\end{itemize}

\noindent such that the following axioms are satisfied:

\begin{itemize}
\item \textbf{Commutativity of addition:} We have $a+_{\mathbb{K}%
}b=b+_{\mathbb{K}}a$ for all $a,b\in\mathbb{K}$.

\item \textbf{Associativity of addition:} We have $a+_{\mathbb{K}}\left(
b+_{\mathbb{K}}c\right)  =\left(  a+_{\mathbb{K}}b\right)  +_{\mathbb{K}}c$
for all $a,b,c\in\mathbb{K}$.

\item \textbf{Neutrality of zero:} We have $a+_{\mathbb{K}}0_{\mathbb{K}%
}=0_{\mathbb{K}}+_{\mathbb{K}}a=a$ for all $a\in\mathbb{K}$.

\item \textbf{Existence of additive inverses:} For any $a\in\mathbb{K}$, there
exists an element $a^{\prime}\in\mathbb{K}$ such that $a+_{\mathbb{K}%
}a^{\prime}=a^{\prime}+_{\mathbb{K}}a=0_{\mathbb{K}}$. (It is not
\textbf{immediately} obvious, but will be shown later, that such an
$a^{\prime}$ is unique. Thus, $a^{\prime}$ is called the \textit{additive
inverse} of $a$, and is denoted by $-a$.)

\item \textbf{Associativity of multiplication:} We have $a\left(  bc\right)
=\left(  ab\right)  c$ for all $a,b,c\in\mathbb{K}$. Here and in the
following, we use \textquotedblleft$xy$\textquotedblright\ as an abbreviation
for \textquotedblleft$x\cdot_{\mathbb{K}}y$\textquotedblright.

\item \textbf{Neutrality of one:} We have $a1_{\mathbb{K}}=1_{\mathbb{K}}a=a$
for all $a\in\mathbb{K}$.

\item \textbf{Annihilation:} We have $a0_{\mathbb{K}}=0_{\mathbb{K}%
}a=0_{\mathbb{K}}$ for all $a\in\mathbb{K}$.

\item \textbf{Distributivity:} We have%
\[
a\left(  b+_{\mathbb{K}}c\right)  =ab+_{\mathbb{K}}%
ac\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(  a+_{\mathbb{K}%
}b\right)  c=ac+_{\mathbb{K}}bc
\]
for all $a,b,c\in\mathbb{K}$. Here and in the following, we are using the
PEMDAS convention for order of operations; thus, for example,
\textquotedblleft$ab+_{\mathbb{K}}ac$\textquotedblright\ must be understood as
\textquotedblleft$\left(  ab\right)  +_{\mathbb{K}}\left(  ac\right)
$\textquotedblright.
\end{itemize}

\noindent These eight axioms will be called the \textit{ring axioms}.

(Note that we do not require the existence of a \textquotedblleft
subtraction\textquotedblright\ operation $-_{\mathbb{K}}$. But we will later
construct such an operation out of the existing operations and axioms; it is
thus unnecessary to require it. We also do not require the existence of
multiplicative inverses; nor do we require commutativity of multiplication yet.)

\textbf{(b)} A ring $\mathbb{K}$ (with operations $+_{\mathbb{K}}$ and
$\cdot_{\mathbb{K}}$) is called \textit{commutative} if it satisfies the
following extra axiom:

\begin{itemize}
\item \textbf{Commutativity of multiplication:} We have $ab=ba$ for all
$a,b\in\mathbb{K}$.
\end{itemize}
\end{definition}

Note a few things:

\begin{itemize}
\item We shall abbreviate $+_{\mathbb{K}}$, $\cdot_{\mathbb{K}}$,
$0_{\mathbb{K}}$ and $1_{\mathbb{K}}$ as $+$, $\cdot$, $0$ and $1$ unless
there is a chance of confusion with the \textquotedblleft
usual\textquotedblright\ notions of addition, multiplication, zero and one.
(The example of the ring $\mathbb{Z}^{\prime}$ shown below is a case where
such confusion is possible; but most of the time, it is not.)

\item We have not required our rings to be endowed with a \textquotedblleft
subtraction\textquotedblright\ operation. Nevertheless, each ring $\mathbb{K}$
automatically has a subtraction operation: Namely, for any $a,b\in\mathbb{K}$,
we can define $a-b$ to be $a+b^{\prime}$, where $b^{\prime}$ is the additive
inverse of $b$. (We will later see that this operation is well-defined
(Definition \ref{def.rings.inv-add-a}) and satisfies the rules you would
expect (Definition \ref{prop.rings.inv-add.rules}).)

\item Some of the ring axioms we required in Definition \ref{def.rings.ring}
are redundant, i.e., they follow from other ring axioms. (For example,
Annihilation follows from the other axioms.) We don't mind this, as long as
these axioms are natural and easy to check in real examples.

\item We have required commutativity of addition to hold for all rings, but
commutativity of multiplication only to hold for commutative rings. You may
wonder what happens if we also omit the commutativity of addition. The answer
is \textquotedblleft nothing new\textquotedblright: Commutativity of addition
follows from the other axioms! (Proving this is a fun, although
inconsequential, puzzle.)

\item By our definition, a ring consists of a set $\mathbb{K}$, two operations
$+$ and $\cdot$ and two elements $0$ and $1$. Thus, strictly speaking, a ring
is a $5$-tuple $\left(  \mathbb{K},+,\cdot,0,1\right)  $. In reality, we will
often just speak of the \textquotedblleft ring $\mathbb{K}$\textquotedblright%
\ (so we will mention only the set and not the other four pieces of data) and
assume that the reader can figure out the rest of the $5$-tuple. This is okay
as long as the rest of the $5$-tuple can be inferred from the context. For
example, when we say \textquotedblleft the ring $\mathbb{Z}$\textquotedblright%
, it is clear that we mean the ring $\left(  \mathbb{Z},+,\cdot,0,1\right)  $
with the usual addition and multiplication operations and the usual numbers
$0$ and $1$. The same applies when we speak of \textquotedblleft the ring
$\mathbb{R}$\textquotedblright\ or \textquotedblleft the ring $\mathbb{C}%
$\textquotedblright\ or \textquotedblleft the ring $\mathbb{Z}\left[
i\right]  $\textquotedblright. In general, whenever a set $S$ is equipped with
two operations that are called $+$ and $\cdot$ and two elements that are
called $0$ and $1$ (even if these elements are not literally the numbers $0$
and $1$), we automatically understand \textquotedblleft the ring
$S$\textquotedblright\ to be the ring $\left(  S,+,\cdot,0,1\right)  $ that is
defined using these operations and elements. If we want to make a different
ring out of the set $S$, then we have to say this explicitly.

\item Some authors do not require the element $1$ as part of what it means to
be a ring. But we do. Be careful when reading the literature, as the truth or
falsehood of many results depends on whether the $1$ is included in the
definition of a ring or not. (When authors do not require the element $1$ in
the definition of a ring, they reserve the notion of a \textquotedblleft
unital ring\textquotedblright\ for a ring that does come equipped with a $1$
that satisfies the \textquotedblleft Neutrality of one\textquotedblright%
\ axiom; i.e., they call \textquotedblleft unital ring\textquotedblright\ what
we call \textquotedblleft ring\textquotedblright.)

The variant of the notion of rings in which the element $1$ is not required is
most commonly called a \textit{nonunital ring}; it appears in Exercises 1 and
2 of \href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/mt3s.pdf}{midterm \#3}.
\end{itemize}

\subsection{\label{sect.ring.exa}Examples of rings}

Many of the \textquotedblleft number systems\textquotedblright\ seen above,
and several others, are examples of rings:

\begin{itemize}
\item The sets $\mathbb{Z}$, $\mathbb{Q}$ and $\mathbb{R}$ (each endowed with
the usual addition, multiplication, $0$ and $1$) are commutative rings. In
each case, the additive inverse of an element $a$ is what we know as $-a$ from
high school. (Rigorous proofs of the ring axioms, as well as rigorous
definitions of $\mathbb{Z}$, $\mathbb{Q}$ and $\mathbb{R}$, can be found in
textbooks and lecture notes on the construction of the number system -- such
as \cite[Chapter 3]{Swanso18}.)

\item The set $\mathbb{N}$ (again endowed with the usual addition,
multiplication, $0$ and $1$) is not a ring. Indeed, the \textquotedblleft
existence of additive inverses\textquotedblright\ axiom fails for $a=1$,
because the element $1$ has no additive inverse in $\mathbb{N}$ (that is,
there is no $1^{\prime}\in\mathbb{N}$ such that $1+1^{\prime}=1^{\prime}+1=0$).

\item The sets $\mathbb{C}$, $\mathbb{Z}\left[  i\right]  $, $\mathbb{D}$,
$\mathbb{Z}\left[  \sqrt{2}\right]  $, $\mathbb{Z}\left[  \omega\right]  $ and
$\mathbb{Z}\left[  \sqrt{-3}\right]  $ (from Chapter \ref{chp.CC} and from the
homework sets) are commutative rings. All of the axioms are easy to check, and
some of them we have checked. (For example, the ring axioms for $\mathbb{C}$
follow easily from Theorem \ref{thm.CC.CC.rules}.) In each case, the element
$a^{\prime}$ in the \textquotedblleft existence of additive
inverses\textquotedblright\ axiom is $-a$.

\item If you have seen polynomials: The set $\mathbb{Z}\left[  x\right]  $ of
all polynomials in a single variable $x$ with integer coefficients is a
commutative ring. Similarly for other kinds of coefficients, and several
variables. We will come back to this once we have rigorously defined
polynomials in Chapter \ref{chp.pol}.

\item We can define a commutative ring $\mathbb{Z}^{\prime}$ as follows:

We define a binary operation $\widetilde{\times}$ on $\mathbb{Z}$ by%
\[
\left(  a\widetilde{\times}b=-ab\ \ \ \ \ \ \ \ \ \ \text{for all }%
a,b\in\mathbb{Z}\right)  .
\]
Now, let $\mathbb{Z}^{\prime}$ be the \textbf{set} $\mathbb{Z}$, endowed with
the usual addition $+$ and the unusual multiplication $\widetilde{\times}$ and
the elements $0_{\mathbb{Z}^{\prime}}=0$ and $1_{\mathbb{Z}^{\prime}}=-1$.

Is this $\mathbb{Z}^{\prime}$ a commutative ring? Let us check the axioms:

\begin{itemize}
\item The first four axioms involve only addition and $0$ (but not
multiplication and $1$), and therefore still hold for $\mathbb{Z}^{\prime}$
(because $\mathbb{Z}^{\prime}$ has the same addition and $0$ as $\mathbb{Z}$).

\item Associativity of multiplication in $\mathbb{Z}^{\prime}$: We must check
that%
\[
a\widetilde{\times}\left(  b\widetilde{\times}c\right)  =\left(
a\widetilde{\times}b\right)  \widetilde{\times}c\ \ \ \ \ \ \ \ \ \ \text{for
all }a,b,c\in\mathbb{Z}^{\prime}.
\]
(Note that we cannot omit the \textquotedblleft multiplication
sign\textquotedblright\ $\widetilde{\times}$ here and simply write
\textquotedblleft$bc$\textquotedblright\ for \textquotedblleft%
$b\widetilde{\times}c$\textquotedblright, because \textquotedblleft%
$bc$\textquotedblright\ already means something different. Note also that
\textquotedblleft$a,b,c\in\mathbb{Z}^{\prime}$\textquotedblright\ means the
same as \textquotedblleft$a,b,c\in\mathbb{Z}$\textquotedblright, because
$\mathbb{Z}^{\prime}=\mathbb{Z}$ as sets.)

Checking this is straightforward: Let $a,b,c\in\mathbb{Z}^{\prime}$. Then,
comparing
\begin{align*}
a\widetilde{\times}\underbrace{\left(  b\widetilde{\times}c\right)  }_{=-bc}
&  =a\widetilde{\times}\left(  -bc\right)  =-a\left(  -bc\right)
=abc\ \ \ \ \ \ \ \ \ \ \text{with}\\
\underbrace{\left(  a\widetilde{\times}b\right)  }_{=-ab}\widetilde{\times}c
&  =\left(  -ab\right)  \widetilde{\times}c=-\left(  -ab\right)  c=abc,
\end{align*}
we obtain $a\widetilde{\times}\left(  b\widetilde{\times}c\right)  =\left(
a\widetilde{\times}b\right)  \widetilde{\times}c$. Thus, associativity of
multiplication holds for $\mathbb{Z}^{\prime}$.

\item Neutrality of one in $\mathbb{Z}^{\prime}$: We must check that%
\[
a\widetilde{\times}1_{\mathbb{Z}^{\prime}}=1_{\mathbb{Z}^{\prime}%
}\widetilde{\times}a=a\ \ \ \ \ \ \ \ \ \ \text{for all }a\in\mathbb{Z}%
^{\prime}.
\]


This, too, is straightforward: If $a\in\mathbb{Z}^{\prime}$, then
$a\widetilde{\times}\underbrace{1_{\mathbb{Z}^{\prime}}}_{=-1}%
=a\widetilde{\times}\left(  -1\right)  =-a\left(  -1\right)  =a$ and similarly
$1_{\mathbb{Z}^{\prime}}\widetilde{\times}a=a$.

\item Annihilation and commutativity of multiplication are just as easy to check.

\item Distributivity for $\mathbb{Z}^{\prime}$: We must check that%
\[
a\widetilde{\times}\left(  b+c\right)  =a\widetilde{\times}%
b+a\widetilde{\times}c\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \left(  a+b\right)  \widetilde{\times}c=a\widetilde{\times
}c+b\widetilde{\times}c
\]
for all $a,b,c\in\mathbb{Z}^{\prime}$.

So let $a,b,c\in\mathbb{Z}^{\prime}$. In order to verify $a\widetilde{\times
}\left(  b+c\right)  =a\widetilde{\times}b+a\widetilde{\times}c$, we compare%
\[
a\widetilde{\times}\left(  b+c\right)  =-a\left(  b+c\right)  =-ab-ac
\]
with%
\[
a\widetilde{\times}b+a\widetilde{\times}c=\left(  -ab\right)  +\left(
-ac\right)  =-ab-ac.
\]
Similarly we can check $\left(  a+b\right)  \widetilde{\times}%
c=a\widetilde{\times}c+b\widetilde{\times}c$.
\end{itemize}

So $\mathbb{Z}^{\prime}$ is a ring.

(Note that $\left(  \mathbb{Z},+,\widetilde{\times},0,1\right)  $ is not a ring.)

However, $\mathbb{Z}^{\prime}$ is not a \textbf{new} ring. It is just
$\mathbb{Z}$ with its elements renamed. Namely, if we rename each integer $a$
as $-a$, then the operations of $+$ and $\cdot$ and the elements $0$ and $1$
of $\mathbb{Z}$ turn into the operations $+$ and $\widetilde{\times}$ and the
elements $0$ and $1_{\mathbb{Z}^{\prime}}$ of $\mathbb{Z}^{\prime}$. This is a
confusing thing to say (please don't actually rename numbers as other
numbers!); the rigorous (and hopefully not confusing) way to say this is as
follows: The bijection%
\[
\varphi:\mathbb{Z}\rightarrow\mathbb{Z}^{\prime},\ \ \ \ \ \ \ \ \ \ a\mapsto
-a
\]
satisfies%
\begin{align}
\varphi\left(  a+b\right)   &  =\varphi\left(  a\right)  +\varphi\left(
b\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{Z}%
;\label{eq.exa.ring.ZZ'.phi.1}\\
\varphi\left(  ab\right)   &  =\varphi\left(  a\right)  \widetilde{\times
}\varphi\left(  b\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in
\mathbb{Z};\label{eq.exa.ring.ZZ'.phi.2}\\
\varphi\left(  0\right)   &  =0=0_{\mathbb{Z}^{\prime}}%
;\label{eq.exa.ring.ZZ'.phi.3}\\
\varphi\left(  1\right)   &  =-1=1_{\mathbb{Z}^{\prime}}.
\label{eq.exa.ring.ZZ'.phi.4}%
\end{align}
Thus, we can view $\varphi$ as a way of relabelling the integers so that the
data $+,\cdot,0,1$ of the ring $\mathbb{Z}$ become the data
$+,\widetilde{\times},0_{\mathbb{Z}^{\prime}},1_{\mathbb{Z}^{\prime}}$ of the
ring $\mathbb{Z}^{\prime}$. We will later call bijections like $\varphi$
\textquotedblleft ring isomorphisms\textquotedblright. (See Definition
\ref{def.riiso.riiso} for the definition of a ring homomorphism.)

\item Recall: If $A$ and $B$ are two sets, then
\[
B^{A}:=\left\{  \text{maps }A\rightarrow B\right\}  .
\]
(This notation is not wantonly chosen to annoy you with its seeming
backwardness; instead, it harkens back to the fact that $\left\vert
B^{A}\right\vert =\left\vert B\right\vert ^{\left\vert A\right\vert }$.)

The set $\mathbb{Q}^{\mathbb{Q}}$ of all the maps from $\mathbb{Q}$ to
$\mathbb{Q}$ is a commutative ring, where

\begin{itemize}
\item addition and multiplication are defined pointwise: i.e., if
$f,g\in\mathbb{Q}^{\mathbb{Q}}$ are two maps, then the maps $f+g$ and $f\cdot
g$ are defined by
\begin{align*}
\left(  f+g\right)  \left(  x\right)   &  =f\left(  x\right)  +g\left(
x\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  f\cdot g\right)  \left(  x\right)   &  =f\left(  x\right)  \cdot
g\left(  x\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }x\in\mathbb{Q};
\end{align*}


\item $0$ means the \textquotedblleft constant $0$\textquotedblright\ function
(i.e., the map $\mathbb{Q}\rightarrow\mathbb{Q},\ x\mapsto0$);

\item $1$ means the \textquotedblleft constant $1$\textquotedblright\ function
(i.e., the map $\mathbb{Q}\rightarrow\mathbb{Q},\ x\mapsto1$).
\end{itemize}

All the ring axioms are easy to check. For example, each $f\in\mathbb{Q}%
^{\mathbb{Q}}$ has an additive inverse (namely, the map $-f\in\mathbb{Q}%
^{\mathbb{Q}}$ that sends each $x\in\mathbb{Q}$ to $-f\left(  x\right)  $).

Similarly, the sets $\mathbb{Q}^{\mathbb{C}}$ or $\mathbb{Q}^{\mathbb{N}}$ or
$\mathbb{R}^{\mathbb{R}}$ (the set of \textquotedblleft
functions\textquotedblright\ you know from calculus) or $\mathbb{C}%
^{\mathbb{C}}$ (or, more generally, for $\mathbb{K}^{S}$, where $\mathbb{K}$
is any commutative ring and $S$ is any set) can be made into commutative
rings; but the set $\mathbb{N}^{\mathbb{Q}}$ cannot. The problem with
$\mathbb{N}^{\mathbb{Q}}$ is that \textquotedblleft existence of additive
inverses\textquotedblright\ is not satisfied, since $-a\notin\mathbb{N}$ for
positive $a\in\mathbb{N}$.

\item Recall that%
\[
\mathbb{Z}\left[  \sqrt{2}\right]  =\left\{  a+b\sqrt{2}\ \mid\ a,b\in
\mathbb{Z}\right\}  \text{ is a ring.}%
\]
But the set $\left\{  a+b\sqrt[3]{2}\ \mid\ a,b\in\mathbb{Z}\right\}  $ (with
the usual addition and multiplication) is \textbf{not} a ring. The reason is
that multiplication is not a binary operation on this set, since it is
possible that two numbers $\alpha$ and $\beta$ lie in this set but their
product $\alpha\beta$ does not. For example, $1+\sqrt[3]{2}$ lies in this set,
but%
\[
\left(  1+\sqrt[3]{2}\right)  \left(  1+\sqrt[3]{2}\right)  =1+2\sqrt[3]%
{2}+\sqrt[3]{4}%
\]
does not. (That said, this set does satisfy all the eight ring axioms.)
\end{itemize}

\begin{teachingnote}
\textbf{2019-03-27 lecture}
\end{teachingnote}

\begin{itemize}
\item The set of $2\times2$-matrices with rational entries (endowed with
matrix addition as $+$, matrix multiplication as $\cdot$, the zero matrix
$\left(
\begin{array}
[c]{cc}%
0 & 0\\
0 & 0
\end{array}
\right)  $ as $0$, and $\left(
\begin{array}
[c]{cc}%
1 & 0\\
0 & 1
\end{array}
\right)  $ as $1$) is a ring, but \textbf{not} a commutative ring. Indeed, the
ring axioms are true (this is known from linear algebra), but commutativity of
multiplication is not (the product $AB$ of two $2\times2$-matrices $A$ and $B$
is not always equal to $BA$). The same applies to $n\times n$-matrices for
arbitrary $n\in\mathbb{N}$. (We will see this in Corollary
\ref{cor.matrix.ring} below, in greater generality.)

\item If you like the empty set, you will enjoy the \textit{zero ring}. This
is the one-element set $\left\{  0\right\}  $, endowed with the only possible
addition (given by $0+0=0$), the only possible multiplication (given by
$0\cdot0=0$), the only possible zero (namely, $0$) and the only possible unity
(also $0$). This is a commutative ring, and is known as the \textit{zero
ring}. Resist the temptation of denoting its unity by $1$, as this will
quickly lead to painful confusion.

(Some authors choose to forbid this ring, usually for no good reasons.)

\item If $n$ is an integer, then $\mathbb{Z}/n$ is a ring (with the operations
$+$ and $\cdot$ that we defined, with the zero $\left[  0\right]  _{n}$ and
the unity $\left[  1\right]  _{n}$). When the integer $n$ is positive, this
ring $\mathbb{Z}/n$ has $n$ elements. (When $n$ is prime, it can be shown that
$\mathbb{Z}/n$ is the only ring with exactly $n$ elements, up to relabeling
its elements. In general, however, there can be several rings with $n$ elements.)

\item In set theory, the
\textit{\href{https://en.wikipedia.org/wiki/Symmetric_difference}{\textit{symmetric
difference}}} $A\bigtriangleup B$ of two sets $A$ and $B$ is defined to be the
set%
\begin{align*}
\left(  A\cup B\right)  \setminus\left(  A\cap B\right)   &  =\left(
A\setminus B\right)  \cup\left(  B\setminus A\right) \\
&  =\left\{  x\ \mid\ x\text{ belongs to \textbf{exactly one} of }A\text{ and
}B\right\}  .
\end{align*}


Now, let $S$ be any set. Let $\mathcal{P}\left(  S\right)  $ denote the power
set of $S$ (that is, the set of all subsets of $S$). Then, it is easy to check
that the following properties hold:%
\begin{align*}
A\bigtriangleup B  &  =B\bigtriangleup A\ \ \ \ \ \ \ \ \ \ \text{for any sets
}A\text{ and }B;\\
A\cap B  &  =B\cap A\ \ \ \ \ \ \ \ \ \ \text{for any sets }A\text{ and }B;\\
\left(  A\bigtriangleup B\right)  \bigtriangleup C  &  =A\bigtriangleup\left(
B\bigtriangleup C\right)  \ \ \ \ \ \ \ \ \ \ \text{for any sets }A,B,C;\\
\left(  A\cap B\right)  \cap C  &  =A\cap\left(  B\cap C\right)
\ \ \ \ \ \ \ \ \ \ \text{for any sets }A,B,C;\\
A\bigtriangleup\varnothing &  =\varnothing\bigtriangleup
A=A\ \ \ \ \ \ \ \ \ \ \text{for any set }A;\\
A\cap S  &  =S\cap A=A\ \ \ \ \ \ \ \ \ \ \text{for any subset }A\text{ of
}S;\\
A\bigtriangleup A  &  =\varnothing\ \ \ \ \ \ \ \ \ \ \text{for any set }A;\\
\varnothing\cap A  &  =A\cap\varnothing=\varnothing
\ \ \ \ \ \ \ \ \ \ \text{for any set }A;\\
A\cap\left(  B\bigtriangleup C\right)   &  =\left(  A\cap B\right)
\bigtriangleup\left(  A\cap C\right)  \ \ \ \ \ \ \ \ \ \ \text{for any sets
}A,B,C;\\
\left(  A\bigtriangleup B\right)  \cap C  &  =\left(  A\cap C\right)
\bigtriangleup\left(  B\cap C\right)  \ \ \ \ \ \ \ \ \ \ \text{for any sets
}A,B,C.
\end{align*}
Therefore, the set $\mathcal{P}\left(  S\right)  $, endowed with the addition
$\bigtriangleup$, the multiplication $\cap$, the zero $\varnothing$ and the
unity $S$ is a commutative ring. Furthermore, the additive inverse of any
$A\in\mathcal{P}\left(  S\right)  $ is $A$ itself (since $A\bigtriangleup
A=\varnothing$). Moreover, each $A\in\mathcal{P}\left(  S\right)  $ satisfies
$A\cap A=A$, which means (in the language of ring operations) that its square
is itself. Thus, $\mathcal{P}\left(  S\right)  $ is what is called a
\textit{\href{https://en.wikipedia.org/wiki/Boolean_ring}{\textit{Boolean
ring}}}. (See Exercise 2 on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/mt2s.pdf}{midterm \#2} for
the precise definition and a few properties of Boolean rings.)
\end{itemize}

Let us now see some non-examples -- i.e., examples of things that are not rings:

\begin{itemize}
\item You probably remember the
\textit{\href{https://en.wikipedia.org/wiki/Cross_product}{\textit{cross
product}}} from analytic geometry. In a nutshell: The set $\mathbb{R}^{3}$ of
vectors in $3$-dimensional space has a binary operation $\times$ defined on
it, which is given by%
\[
\left(  a_{1},a_{2},a_{3}\right)  \times\left(  b_{1},b_{2},b_{3}\right)
=\left(  a_{2}b_{3}-a_{3}b_{2},a_{3}b_{1}-a_{1}b_{3},a_{1}b_{2}-a_{2}%
b_{1}\right)  .
\]
Is the set $\mathbb{R}^{3}$, equipped with the addition $+$ and the
multiplication $\times$ (and some elements playing the roles of zero and
unity) a ring?

The answer is \textquotedblleft no\textquotedblright, no matter which elements
you want to play the roles of zero and unity. Indeed, the \textquotedblleft
Associativity of multiplication\textquotedblright\ axiom does not hold,
because three vectors $\mathbf{a},\mathbf{b},\mathbf{c}\in\mathbb{R}^{3}$
usually do \textbf{not} satisfy $\mathbf{a}\times\left(  \mathbf{b}%
\times\mathbf{c}\right)  =\left(  \mathbf{a}\times\mathbf{b}\right)
\times\mathbf{c}$.

Nevertheless, not all is lost; for example, the \textquotedblleft
Distributivity\textquotedblright\ axiom holds. The structure formed by the set
$\mathbb{R}^{3}$, its addition $+$ and its cross product $\times$ is an
instance of a different concept -- namely, of a
\href{https://en.wikipedia.org/wiki/Lie_algebra}{Lie algebra}.

\item So the cross product does not work; what about the dot product? The dot
product of two vectors $\left(  a_{1},a_{2},a_{3}\right)  $ and $\left(
b_{1},b_{2},b_{3}\right)  $ in $\mathbb{R}^{3}$ is a real number given by%
\[
\left(  a_{1},a_{2},a_{3}\right)  \cdot\left(  b_{1},b_{2},b_{3}\right)
=a_{1}b_{1}+a_{2}b_{2}+a_{3}b_{3}.
\]
Can this be used to make $\mathbb{R}^{3}$ into a ring?

No, because the dot product is not even a binary operation on $\mathbb{R}^{3}%
$. Indeed, our definition of a binary operation requires that its output
belongs to the same domain as its two inputs; this is clearly not true of the
dot product (since its output is a real number, while its two inputs are vectors).

\item The set $\left\{  a+b\sqrt[3]{2}\ \mid\ a,b\in\mathbb{Z}\right\}  $ is
not a ring (despite the superficial similarity to $\left\{  a+b\sqrt{2}%
\ \mid\ a,b\in\mathbb{Z}\right\}  $, which is a ring), at least not if we try
to use the usual multiplication of real numbers as its multiplication. In
fact, this multiplication is not a binary operation on this set, because the
product of $\sqrt[3]{2}$ and $\sqrt[3]{2}$ is not an element of this set.

However, the larger set $\left\{  a+b\sqrt[3]{2}+c\left(  \sqrt[3]{2}\right)
^{2}\ \mid\ a,b\in\mathbb{Z}\right\}  $ is a ring (endowed with the usual
addition, the usual multiplication, the usual $0$ and the usual $1$). (Check this!)

\item For each $a,b\in\mathbb{R}$, we let $A_{a,b}$ be the function%
\[
\mathbb{R}\rightarrow\mathbb{R},\ \ \ \ \ \ \ \ \ \ x\mapsto ax+b.
\]
This sort of function is called \textquotedblleft linear
function\textquotedblright\ in high school; research mathematicians prefer to
call it \textquotedblleft affine-linear function\textquotedblright\ instead
(while reserving the word \textquotedblleft linear\textquotedblright\ for a
more restrictive class of functions). Let $\operatorname*{ALF}$ be the set of
these affine-linear functions $A_{a,b}$ for all $a,b\in\mathbb{R}$.

We can define a pointwise addition $+$ on $\operatorname*{ALF}$; that is, for
any $f,g\in A_{a,b}$, we define a function $f+g\in A_{a,b}$ by%
\[
\left(  f+g\right)  \left(  x\right)  =f\left(  x\right)  +g\left(  x\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }x\in\mathbb{R}.
\]
We can also try to define a multiplication $\cdot$ on $\operatorname*{ALF}$.
One obvious choice would be to define multiplication to be composition (that
is, $f\cdot g=f\circ g$); another would be pointwise multiplication (that is,
$\left(  f\cdot g\right)  \left(  x\right)  =f\left(  x\right)  \cdot g\left(
x\right)  $ for all $x\in\mathbb{R}$). Does any of these lead to a ring?

No. If we define multiplication to be composition, then the \textquotedblleft
Distributivity\textquotedblright\ axiom is violated, since affine-linear
functions $f,g,h$ do not always satisfy $f\circ\left(  g+h\right)  =f\circ
g+f\circ h$. If we define multiplication to be pointwise multiplication, then
it is not a binary operation on $\operatorname*{ALF}$, since the pointwise
product of two affine-linear functions is not an affine-linear function in general.

\item You know from high school that you cannot divide by $0$. Why not?

Let us make the question precise. Of course, we cannot find an integer $a$
that satisfies $0\cdot a=1$, or a real, or a complex number, etc. But could we
perhaps find such a number $a$ in some larger \textquotedblleft number
system\textquotedblright?

The answer, of course, depends on what \textquotedblleft number
system\textquotedblright\ means for you. If it means a ring, then we cannot
find such an $a$ in any ring.

Indeed, assume that we can. In other words, assume that there is a ring
$\mathbb{K}$ that contains the usual set $\mathbb{Z}$ of integers as well as a
new element $\infty$ such that $0\cdot\infty=1$. And assume (this is a very
reasonable assumption) that the numbers $0$ and $1$ are indeed the zero and
the unity of this ring. Then, the Annihilation axiom yields $0\cdot\infty=0$,
so that $0=0\cdot\infty=1$, which is absurd. So such a ring $\mathbb{K}$
cannot exist. Thus, we cannot divide by $0$, even if we extend our
\textquotedblleft number system\textquotedblright.

\item Here is an \textquotedblleft almost-ring\textquotedblright\ beloved to
combinatorialists: the \textit{max-plus semiring} $\mathbb{T}$ (also known as
the \textit{tropical semiring}\footnote{To be pedantic: The name
\textquotedblleft tropical semiring\textquotedblright\ refers to several
different objects, of which $\mathbb{T}$ is but one.}).

We introduce a new symbol $-\infty$, and we set $\mathbb{T}=\mathbb{Z}%
\cup\left\{  -\infty\right\}  $ as sets. But we do \textbf{not}
\textquotedblleft inherit\textquotedblright\ the addition and multiplication
from $\mathbb{Z}$. Instead, let us define two new \textquotedblleft
addition\textquotedblright\ and \textquotedblleft
multiplication\textquotedblright\ operations $+_{\mathbb{T}}$ and
$\cdot_{\mathbb{T}}$ (not to be mistaken for the original addition $+$ and
multiplication $\cdot$ of integers) as follows:%
\begin{align*}
a+_{\mathbb{T}}b  &  =\max\left\{  a,b\right\}  ;\\
a\cdot_{\mathbb{T}}b  &  =a+b\ \ \ \ \ \ \ \ \ \ \left(  \text{usual addition
of integers}\right)  ,
\end{align*}
where we set%
\begin{align*}
\max\left\{  -\infty,n\right\}   &  =\max\left\{  n,-\infty\right\}
=n\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  -\infty\right)  +n  &  =n+\left(  -\infty\right)  =-\infty
\ \ \ \ \ \ \ \ \ \ \text{for any }n\in\mathbb{Z}\cup\left\{  -\infty\right\}
.
\end{align*}


This set $\mathbb{T}$ endowed with the \textquotedblleft
addition\textquotedblright\ $+_{\mathbb{T}}$, \textquotedblleft
multiplication\textquotedblright\ $\cdot_{\mathbb{T}}$, \textquotedblleft
zero\textquotedblright\ $-\infty$ and \textquotedblleft
unity\textquotedblright\ $0$ satisfies all but one of the ring
axioms.\footnote{For example, the distributivity axiom for $\mathbb{T}$ boils
down to the two identities%
\begin{align*}
a+\max\left\{  b,c\right\}   &  =\max\left\{  a+b,a+c\right\}
\ \ \ \ \ \ \ \ \ \ \text{and}\\
\max\left\{  a,b\right\}  +c  &  =\max\left\{  a+c,b+c\right\}  .
\end{align*}
} The only one that it does not satisfy is the existence of additive inverses.
Such a structure is called a \textit{semiring}.

\item Consider the set
\[
2\mathbb{Z}:=\left\{  2a\ \mid\ a\in\mathbb{Z}\right\}  =\left\{
\ldots,-4,-2,0,2,4,\ldots\right\}  =\left\{  \text{all even integers}\right\}
.
\]
Endowing this set with the usual addition and multiplication (and $0$), we
obtain a structure that is like a ring but has no unity. This is called a
\textit{nonunital ring}. There is no way to find a unity for it, because (for
example) $2$ is not a product of any two elements of $2\mathbb{Z}$.
\end{itemize}

\subsection{\label{sect.ring.subring}Subrings}

Looking back at the examples of rings listed above, you might notice that a
lot of them are \textquotedblleft nested\textquotedblright\ inside one
another: For example, the rings $\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$ and
$\mathbb{C}$ form a chain $\mathbb{Z}\subseteq\mathbb{Q}\subseteq
\mathbb{R}\subseteq\mathbb{C}$ in which each ring not only is a subset of the
subsequent one\footnote{To be fully honest, we are relying on Convention
\ref{conv.CC.RRtoCC.embed} in order to make $\mathbb{R}$ a subset of
$\mathbb{C}$. And if you look closely at the definitions of $\mathbb{Q}$ and
$\mathbb{R}$, the relations $\mathbb{Z}\subseteq\mathbb{Q}$ and $\mathbb{Q}%
\subseteq\mathbb{R}$ are also not immediately satisfied but rather rely on
similar conventions. For example, rational numbers are defined as equivalence
classes of pairs of integers; an integer is not an equivalence class of such
pairs. Thus, we need a convention which identifies each integer $z$ with an
appropriate rational number in order to turn $\mathbb{Z}$ into a subset of
$\mathbb{Q}$. Similarly for turning $\mathbb{Q}$ into a subset of $\mathbb{R}%
$. But let us not worry about this issue for now.}, but also has
\textquotedblleft the same\textquotedblright\ addition, multiplication, zero
and unity as the subsequent one. Of course, when we are saying
\textquotedblleft the same\textquotedblright\ here, we do not literally mean
\textquotedblleft the same binary operation\textquotedblright\footnote{The
addition of $\mathbb{R}$ is a map from $\mathbb{R}\times\mathbb{R}$ to
$\mathbb{R}$, while the addition of $\mathbb{C}$ is a map from $\mathbb{C}%
\times\mathbb{C}$ to $\mathbb{C}$. Thus, of course, these two additions are
not literally the same binary operation.}; we mean that, e.g., if we add two
integers in $\mathbb{Z}$, we get the same result as if we add the same two
integers as elements of $\mathbb{Q}$, or as elements of $\mathbb{R}$, or as
elements of $\mathbb{C}$. In other words, the addition operation of the ring
$\mathbb{Z}$ is a \textbf{restriction} of the addition operation of the ring
$\mathbb{Q}$, which in turn is a restriction of the addition operation of the
ring $\mathbb{R}$, etc.. The same holds for multiplication. The zeroes of the
rings $\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$ and $\mathbb{C}$ are literally
identical, as are the unities of these rings.

It is worth introducing a name for this situation:

\begin{definition}
\label{def.ring.subring}Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. We say
that $\mathbb{K}$ is a \textit{subring} of $\mathbb{L}$ if and only if it
satisfies the following five requirements:

\begin{itemize}
\item the set $\mathbb{K}$ is a subset of $\mathbb{L}$;

\item the addition of $\mathbb{K}$ is a restriction of the addition of
$\mathbb{L}$ (that is, we have $a_{1}+_{\mathbb{K}}a_{2}=a_{1}+_{\mathbb{L}%
}a_{2}$ for all $a_{1},a_{2}\in\mathbb{K}$);

\item the multiplication of $\mathbb{K}$ is a restriction of the
multiplication of $\mathbb{L}$ (that is, we have $a_{1}\cdot_{\mathbb{K}}%
a_{2}=a_{1}\cdot_{\mathbb{L}}a_{2}$ for all $a_{1},a_{2}\in\mathbb{K}$);

\item the zero of $\mathbb{K}$ is the zero of $\mathbb{L}$ (that is, we have
$0_{\mathbb{K}}=0_{\mathbb{L}}$);

\item the unity of $\mathbb{K}$ is the unity of $\mathbb{L}$ (that is, we have
$1_{\mathbb{K}}=1_{\mathbb{L}}$).
\end{itemize}
\end{definition}

Thus, according to this definition:

\begin{itemize}
\item the ring $\mathbb{Z}$ is a subring of $\mathbb{Q}$;

\item the ring $\mathbb{Q}$ is a subring of $\mathbb{R}$;

\item the ring $\mathbb{R}$ is a subring of $\mathbb{C}$;

\item the ring $\mathbb{Z}\left[  i\right]  $ (of Gaussian integers) is a
subring of $\mathbb{C}$;

\item every ring $\mathbb{K}$ is a subring of itself.
\end{itemize}

What is an example of two rings $\mathbb{K}$ and $\mathbb{L}$ for which the
set $\mathbb{K}$ is a \textbf{subset} of $\mathbb{L}$ yet the ring
$\mathbb{K}$ is \textbf{not a subring} of $\mathbb{L}$ ? Here is one example
of an \textquotedblleft almost-subring\textquotedblright:

\begin{example}
One of our above examples of rings (in Section \ref{sect.ring.exa}) is the
power set of any set $S$. Namely, if $S$ is any set, then we have observed
that its power set $\mathcal{P}\left(  S\right)  $, endowed with the addition
$\bigtriangleup$, the multiplication $\cap$, the zero $\varnothing$ and the
unity $S$ is a commutative ring. We shall refer to this ring by $\mathcal{P}%
\left(  S\right)  $ (omitting mention of its addition, multiplication, zero
and unity).

Now, let $T$ be a subset of a set $S$. Is $\mathcal{P}\left(  T\right)  $ a
subring of the ring $\mathcal{P}\left(  S\right)  $ ? The first four
requirements of Definition \ref{def.ring.subring} are satisfied: The set
$\mathcal{P}\left(  T\right)  $ is a subset of $\mathcal{P}\left(  S\right)
$; its addition is a restriction of the addition of $\mathcal{P}\left(
S\right)  $ (indeed, both of these additions turn two sets $A$ and $B$ into
$A\bigtriangleup B$); its multiplication is a restriction of the
multiplication of $\mathcal{P}\left(  S\right)  $; its zero is the zero of
$\mathcal{P}\left(  S\right)  $. But its unity is not the unity of
$\mathcal{P}\left(  S\right)  $ (unless $T=S$); indeed, the former unity is
$T$, while the latter unity is $S$. Thus, $\mathcal{P}\left(  T\right)  $ is
not a subring of $\mathcal{P}\left(  S\right)  $ (unless $T=S$). It fails the
fifth requirement of Definition \ref{def.ring.subring}.

(As we have remarked, some authors do not require rings to have a unity.
Correspondingly, these authors do not pose the fifth requirement in Definition
\ref{def.ring.subring}. Thus, for these authors, $\mathcal{P}\left(  T\right)
$ is a subring of $\mathcal{P}\left(  S\right)  $.)
\end{example}

For a less subtle example, recall the ring $\mathbb{Z}^{\prime}$ constructed
in Section \ref{sect.ring.exa}. The sets $\mathbb{Z}^{\prime}$ and
$\mathbb{Z}$ are identical, but the rings $\mathbb{Z}^{\prime}$ and
$\mathbb{Z}$ are not, so the ring $\mathbb{Z}^{\prime}$ is not a subring of
$\mathbb{Z}$ despite being a subset of $\mathbb{Z}$.

When we have two rings $\mathbb{K}$ and $\mathbb{L}$ such that $\mathbb{K}%
\subseteq\mathbb{L}$ as sets (or, more generally, such that $\mathbb{K}$ and
$\mathbb{L}$ have elements in common), we generally need to be careful using
the symbol \textquotedblleft$+$\textquotedblright: This symbol may mean both
the addition of $\mathbb{K}$ and the addition of $\mathbb{L}$, and these
additions might not be the same. Thus it is prudent to disambiguate its
meaning by attaching a subscript \textquotedblleft$_{\mathbb{K}}%
$\textquotedblright\ or \textquotedblleft$_{\mathbb{L}}$\textquotedblright\ to
it. The same applies to the symbols \textquotedblleft$\cdot$\textquotedblright%
, \textquotedblleft$0$\textquotedblright\ and \textquotedblleft$1$%
\textquotedblright\ and expressions like \textquotedblleft$ab$%
\textquotedblright\ (which have an implicit multiplication sign). However,
when $\mathbb{K}$ is a subring of $\mathbb{L}$, we do not need to take this
precaution; in this case, the meaning of expressions like \textquotedblleft%
$a+b$\textquotedblright\ does not depend on whether you read \textquotedblleft%
$+$\textquotedblright\ as the addition of $\mathbb{K}$ or as the addition of
$\mathbb{L}$.

The following facts are essentially obvious:

\begin{proposition}
\label{prop.ring.subring.comm}A subring of a commutative ring is always commutative.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ring.subring.comm}.]Let $\mathbb{K}$ be a
subring of a commutative ring $\mathbb{L}$. We must prove that $\mathbb{K}$ is commutative.

We have $ab=ba$ for all $a,b\in\mathbb{L}$ (since $\mathbb{L}$ is
commutative). Thus, $ab=ba$ for all $a,b\in\mathbb{K}$ (since $\mathbb{K}$ is
a subring of $\mathbb{L}$). In other words, $\mathbb{K}$ is commutative. This
completes our proof.

Note how we were able to write expressions like \textquotedblleft%
$ab$\textquotedblright\ and \textquotedblleft$ba$\textquotedblright\ without
specifying whether we were using the multiplication of $\mathbb{K}$ or the
multiplication of $\mathbb{L}$. This was legitimate because $\mathbb{K}$ is a
subring (not just a subset) of $\mathbb{L}$.
\end{proof}

\begin{proposition}
\label{prop.ring.subring.as-subset}Let $\mathbb{L}$ be a ring. Let $S$ be a
subset of $\mathbb{L}$ that satisfies the following four conditions:\footnotemark

\begin{itemize}
\item We have $0\in S$ and $1\in S$.

\item The subset $S$ is \textit{closed under addition}. (This means that all
$a,b\in S$ satisfy $a+b\in S$.)

\item The subset $S$ is \textit{closed under additive inverses}. (This means
that all $a\in S$ satisfy $-a\in S$.)

\item The subset $S$ is \textit{closed under multiplication}. (This means that
all $a,b\in S$ satisfy $ab\in S$.)
\end{itemize}

Then, the set $S$ itself becomes a ring if we endow it with the following two operations:

\begin{itemize}
\item an addition operation $+$ which is defined as the restriction of the
addition operation of the ring $\mathbb{L}$;

\item a multiplication operation $\cdot$ which is defined as the restriction
of the multiplication operation of the ring $\mathbb{L}$,
\end{itemize}

\noindent and the zero $0$ and the unity $1$. Furthermore, this ring $S$ is a
subring of $\mathbb{L}$.
\end{proposition}

\footnotetext{In this proposition, the symbols \textquotedblleft%
$+$\textquotedblright, \textquotedblleft$\cdot$\textquotedblright,
\textquotedblleft$0$\textquotedblright\ and \textquotedblleft$1$%
\textquotedblright\ mean the addition, the multiplication, the zero and the
unity of $\mathbb{L}$.}

\begin{proof}
[Proof of Proposition \ref{prop.ring.subring.as-subset}.]The addition
operation $+$ that we are trying to define on $S$ is indeed a well-defined
binary operation on $S$, because $S$ is closed under addition. Ditto for the
multiplication operation $\cdot$. Also, $0$ and $1$ are elements of $S$ (by
the first of our four conditions). Thus, in order to prove that the subset $S$
becomes a ring (when endowed with these two operations and two elements), we
just need to check that it satisfies the ring axioms. This is easy: The
\textquotedblleft Existence of additive inverses\textquotedblright\ axiom
follows from the fact that $S$ is closed under additive inverses; all the
remaining axioms follow from the fact that $\mathbb{L}$ is a ring. Finally,
this ring $S$ is a subring of $\mathbb{L}$, because of how we defined it.
Thus, Proposition \ref{prop.ring.subring.as-subset} is proven.
\end{proof}

\begin{definition}
Let $\mathbb{L}$ be a ring. Let $S$ be a subset of $\mathbb{L}$ that satisfies
the four conditions of Proposition \ref{prop.ring.subring.as-subset}. Then, we
shall say that \textquotedblleft$S$ is a subring of $\mathbb{L}$%
\textquotedblright. Technically speaking, this is premature, since $S$ is so
far just a subset of $\mathbb{L}$ without the structure of a ring; however,
Proposition \ref{prop.ring.subring.as-subset} shows that there is an obvious
way of turning $S$ into a ring (viz.: define two operations $+$ and $\cdot$ by
restricting the corresponding operations of $\mathbb{L}$, and steal the zero
and the unity from $\mathbb{L}$), and we shall automatically regard $S$ as
becoming a ring in this way (unless we say otherwise). We say that the
operations $+$ and $\cdot$ on $S$ (obtained by restricting the corresponding
operations on $\mathbb{L}$) and the zero and the unity of $S$ (which are
exactly those of $\mathbb{L}$) are \textit{inherited from }$\mathbb{L}$.
\end{definition}

Thus, finding subrings of a ring $\mathbb{L}$ boils down to finding subsets
that contain its $0$ and $1$ and are closed under addition, under additive
inverses and under multiplication; the ring axioms don't need to be
re-checked. This offers an easy way to discover subrings:

\begin{example}
Let us define a few subsets of the ring $\mathbb{Z}\left[  i\right]  $ and see
whether they are subrings.

\textbf{(a)} Let
\[
S_{1}=\left\{  a+bi\ \mid\ a,b\in\mathbb{Z}\text{, and }b\text{ is
even}\right\}  =\left\{  a+2ci\ \mid\ a,c\in\mathbb{Z}\right\}  .
\]
Is $S_{1}$ a subring of $\mathbb{Z}\left[  i\right]  $ ?

It is easy to check that $0\in S_{1}$ and $1\in S_{1}$. Let us now check that
$S_{1}$ is closed under multiplication: Let $\alpha,\beta\in S_{1}$; we need
to show that $\alpha\beta\in S_{1}$. We have $\alpha\in S_{1}=\left\{
a+2ci\ \mid\ a,c\in\mathbb{Z}\right\}  $; in other words, we can write
$\alpha$ in the form $\alpha=x+2yi$ for some $x,y\in\mathbb{Z}$. Similarly, we
can write $\beta$ in the form $\beta=z+2wi$ for some $z,w\in\mathbb{Z}$. Now,
multiplying the two equalities $\alpha=x+2yi$ and $\beta=z+2wi$, we obtain%
\begin{align*}
\alpha\beta &  =\left(  x+2yi\right)  \left(  z+2wi\right)
=xz+2xwi+2yzi+4yw\underbrace{i^{2}}_{=-1}\\
&  =\left(  xz-4yw\right)  +2\left(  xw+yz\right)  i.
\end{align*}
Thus, $\alpha\beta$ can be written in the form $a+2ci$ for some $a,c\in
\mathbb{Z}$ (namely, for $a=xz-4yw$ and $c=xw+yz$). Thus, $\alpha\beta\in
S_{1}$. Now, forget that we fixed $\alpha,\beta$. We thus have shown that all
$\alpha,\beta\in S_{1}$ satisfy $\alpha\beta\in S_{1}$. In other words,
$S_{1}$ is closed under multiplication. Similar arguments show that $S_{1}$ is
closed under addition and under additive inverses. Thus, $S_{1}$ is a subring
of $\mathbb{Z}\left[  i\right]  $.

This subring $S_{1}$ is only \textquotedblleft half as large\textquotedblright%
\ as $\mathbb{Z}\left[  i\right]  $ (in a vague sense that can be made
precise), but it has rather different properties. For example, $\mathbb{Z}%
\left[  i\right]  $ has greatest common divisors and unique factorization into
primes; the subring $S_{1}$
\href{https://math.stackexchange.com/questions/657058}{does not}.

There is nothing special about the number $2$; we could have just as easily
shown that $\left\{  a+kci\ \mid\ a,c\in\mathbb{Z}\right\}  $ is a subring of
$\mathbb{Z}\left[  i\right]  $ for each $k\in\mathbb{Z}$.

\textbf{(b)} Let
\[
S_{2}=\left\{  a+bi\ \mid\ a,b\in\mathbb{Z}\text{, and }a\text{ is
even}\right\}  =\left\{  2c+bi\ \mid\ c,b\in\mathbb{Z}\right\}  .
\]
Is $S_{2}$ a subring of $\mathbb{Z}\left[  i\right]  $ ? No, since $1\notin
S_{2}$.

\textbf{(c)} Let
\[
S_{3}=\left\{  a+bi\ \mid\ a,b\in\mathbb{Z}\text{, and }b\text{ is a multiple
of }a\right\}  =\left\{  a+aci\ \mid\ a,c\in\mathbb{Z}\right\}  .
\]
Is $S_{3}$ a subring of $\mathbb{Z}\left[  i\right]  $ ? The subset $S_{3}$
does contain both $0$ and $1$ and is closed under additive inverses; but
$S_{3}$ is not closed under addition (nor under multiplication). Thus, $S_{3}$
is not a subring of $\mathbb{Z}\left[  i\right]  $. (For a concrete example:
The numbers $1+2i$ and $1+3i$ both belong to $S_{3}$, but their sum $2+5i$
does not.)

\textbf{(d)} Let%
\[
S_{4}=\left\{  a+bi\ \mid\ a,b\in\mathbb{N}\right\}  .
\]
Is $S_{4}$ a subring of $\mathbb{Z}\left[  i\right]  $ ? No, because $S_{4}$
is not closed under additive inverses (although $S_{4}$ satisfies two of the
other conditions of Proposition \ref{prop.ring.subring.as-subset}).

\textbf{(e)} A pattern emerges: It appears that the only subrings of
$\mathbb{Z}\left[  i\right]  $ are the ones of the form $\left\{
a+kci\ \mid\ a,c\in\mathbb{Z}\right\}  $ for $k\in\mathbb{Z}$. This is indeed
true. (It is not hard to prove, if you are so inclined! \textbf{Hint:} Let $S$
be any subring of $\mathbb{Z}\left[  i\right]  $. Clearly, $S$ contains $1$
and therefore all the integer multiples of $1$; in other words, $\mathbb{Z}%
\subseteq S$. Hence, if $S\subseteq\mathbb{Z}$, then clearly $S=\mathbb{Z}$,
which means that $S=\left\{  a+kci\ \mid\ a,c\in\mathbb{Z}\right\}  $ for
$k=0$. Thus, we can WLOG assume that $S\not \subseteq \mathbb{Z}$. Hence,
there exists at least one $a+bi\in S$ with $b\neq0$. Thus, there exists at
least one $a+bi\in S$ with $b>0$ (indeed, if $b<0$, then we replace this
element by its additive inverse). Pick the one with the \textbf{smallest} $b$.
Then, from $a+bi\in S$ and $a\in\mathbb{Z}\subseteq S$, we obtain $\left(
a+bi\right)  -a\in S$ (since $S$ is a ring), which means that $bi\in S$. Next,
argue that $S=\left\{  a+kci\ \mid\ a,c\in\mathbb{Z}\right\}  $ for $k=b$.)
\end{example}

\subsection{\label{sect.ring.rules}Additive inverses, sums, powers and their
properties}

What can you do when you have a ring?

\begin{convention}
\label{conv.rings.K}For the rest of this section, we fix a ring $\mathbb{K}$,
and we denote its addition, multiplication, zero and unity by $+$, $\cdot$,
$0$ and $1$.
\end{convention}

One thing you can do is subtraction. This relies on the following fact:

\begin{theorem}
\label{thm.rings.inv-add.uni}Let $a\in\mathbb{K}$. Then, $a$ has exactly one
additive inverse.
\end{theorem}

Before we prove this, let us recall how additive inverses are defined:

\begin{definition}
\label{def.rings.inv-add}Let $a\in\mathbb{K}$. An \textit{additive inverse} of
$a$ means an element $a^{\prime}$ of $\mathbb{K}$ such that $a+a^{\prime
}=a^{\prime}+a=0$.
\end{definition}

\begin{proof}
[Proof of Theorem \ref{thm.rings.inv-add.uni}.]By the ring axioms, $a$ has
\textbf{at least one} additive inverse. We must thus only show that $a$ has
\textbf{at most one} additive inverse.

This can be done by the same argument that we used previously to prove that a
residue class in $\mathbb{Z}/n$ has at most one inverse (in the proof of
Proposition \ref{prop.equiv.modinv.uni}), but now we need to replace
$\mathbb{Z}/n$, multiplication and $\left[  1\right]  _{n}$ by $\mathbb{K}$,
addition and $0$, respectively.

In detail: Let $b$ and $c$ be two additive inverses of $a$. We must prove that
$b=c$. We have $a+b=0$ (since $b$ is an additive inverse of $a$) and $c+a=0$
(since $c$ is an additive inverse of $a$). Hence, the associativity of
addition yields%
\[
\left(  c+a\right)  +b=c+\underbrace{\left(  a+b\right)  }_{=0}=c+0=c
\]
(by the neutrality of zero). Comparing this with%
\[
\underbrace{\left(  c+a\right)  }_{=0}+b=0+b=b\qquad\left(  \text{by the
neutrality of zero}\right)  ,
\]
we obtain $b=c$, so our two additive inverses are equal. This shows that the
additive inverse is unique. Thus, Theorem \ref{thm.rings.inv-add.uni} is proven.
\end{proof}

\begin{definition}
\label{def.rings.inv-add-a}\textbf{(a)} If $a\in\mathbb{K}$, then the additive
inverse of $a$ will be called $-a$. (This is well-defined, since Theorem
\ref{thm.rings.inv-add.uni} shows that this additive inverse is unique.)

\textbf{(b)} If $a\in\mathbb{K}$ and $b\in\mathbb{K}$, then we define the
\textit{difference} $a-b$ to be the element $a+\left(  -b\right)  $ of
$\mathbb{K}$. This new binary operation $-$ on $\mathbb{K}$ is called
\textquotedblleft\textit{subtraction}\textquotedblright.
\end{definition}

Additive inverses and subtraction satisfy certain rules that should not
surprise you:

\begin{proposition}
\label{prop.rings.inv-add.rules}Let $a,b,c\in\mathbb{K}$.

\textbf{(a)} We have $a-b=c$ if and only if $a=b+c$. (Roughly speaking, this
means that subtraction undoes addition.)

\textbf{(b)} We have $-\left(  a+b\right)  =\left(  -a\right)  +\left(
-b\right)  $.

\textbf{(c)} We have $-0=0$.

\textbf{(d)} We have $0-a=-a$.

\textbf{(e)} We have $-\left(  -a\right)  =a$.

\textbf{(f)} We have $-\left(  ab\right)  =\left(  -a\right)  b=a\left(
-b\right)  $.

\textbf{(g)} We have $a-b-c=a-\left(  b+c\right)  $. (Here and in the
following, \textquotedblleft$a-b-c$\textquotedblright\ should be read as
\textquotedblleft$\left(  a-b\right)  -c$\textquotedblright.)

\textbf{(h)} We have $a\left(  b-c\right)  =ab-ac$ and $\left(  a-b\right)
c=ac-bc$.

\textbf{(i)} We have $-\left(  a-b\right)  =b-a$.

\textbf{(j)} We have $a-\left(  -b\right)  =a+b$.

\textbf{(k)} We have $\left(  -1\right)  a=-a$. (Here, the \textquotedblleft%
$1$\textquotedblright\ on the left hand side means the unity of $\mathbb{K}$.)

\textbf{(l)} If $-a=-b$, then $a=b$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.rings.inv-add.rules}.]All of this is fairly
straightforward to prove:

\textbf{(a)} $\Longrightarrow:$ Assume $a-b=c$. Thus, $c=a-b=a+\left(
-b\right)  $ (by the definition of $a-b$). Adding $b$ on both sides of this
equation, we get%
\begin{align*}
c+b  &  =\left(  a+\left(  -b\right)  \right)  +b=a+\underbrace{\left(
\left(  -b\right)  +b\right)  }_{\substack{=0\\\text{(since }-b\text{ is
the}\\\text{additive inverse of }b\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(
\text{by associativity of addition}\right) \\
&  =a+0=a
\end{align*}
(by the neutrality of zero), so that $a=c+b=b+c$. This proves the
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction of Proposition
\ref{prop.rings.inv-add.rules} \textbf{(a)}.

$\Longleftarrow:$ Assume $a=b+c$. Adding $-b$ to both sides of this equation,
we get%
\begin{align*}
a+\left(  -b\right)   &  =\underbrace{\left(  b+c\right)  }%
_{\substack{=c+b\\\text{(by commutativity}\\\text{of addition)}}}+\left(
-b\right)  =\left(  c+b\right)  +\left(  -b\right)  =c+\underbrace{\left(
b+\left(  -b\right)  \right)  }_{\substack{=0\\\text{(since }-b\text{ is
the}\\\text{additive inverse of }b\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by associativity of addition}\right) \\
&  =c+0=c
\end{align*}
(by the neutrality of zero), so that $c=a+\left(  -b\right)  =a-b$. In other
words, $a-b=c$. This proves the \textquotedblleft$\Longleftarrow
$\textquotedblright\ direction of Proposition \ref{prop.rings.inv-add.rules}
\textbf{(a)}. Thus, Proposition \ref{prop.rings.inv-add.rules} \textbf{(a)} is proven.

\textbf{(b)} We need to prove that $\left(  -a\right)  +\left(  -b\right)
=-\left(  a+b\right)  $. In other words, we need to prove that $\left(
-a\right)  +\left(  -b\right)  $ is the additive inverse of $a+b$ (because
that's what $-\left(  a+b\right)  $ is). In other words, we need to prove
that
\[
\left(  a+b\right)  +\left(  \left(  -a\right)  +\left(  -b\right)  \right)
=\left(  \left(  -a\right)  +\left(  -b\right)  \right)  +\left(  a+b\right)
=0.
\]


Associativity of addition yields%
\begin{align*}
\left(  a+b\right)  +\left(  \left(  -a\right)  +\left(  -b\right)  \right)
&  =a+\left(  b+\underbrace{\left(  \left(  -a\right)  +\left(  -b\right)
\right)  }_{=\left(  -b\right)  +\left(  -a\right)  }\right)
=a+\underbrace{\left(  b+\left(  \left(  -b\right)  +\left(  -a\right)
\right)  \right)  }_{\substack{=\left(  b+\left(  -b\right)  \right)  +\left(
-a\right)  \\\text{(by associativity}\\\text{of addition)}}}\\
&  =a+\left(  \underbrace{\left(  b+\left(  -b\right)  \right)  }%
_{\substack{=0\\\text{(since }-b\text{ is the}\\\text{additive inverse of
}b\text{)}}}+\left(  -a\right)  \right)  =a+\underbrace{\left(  0+\left(
-a\right)  \right)  }_{=-a}\\
&  =a+\left(  -a\right)  =0
\end{align*}
(since $-a$ is the additive inverse of $a$). Also, $\left(  a+b\right)
+\left(  \left(  -a\right)  +\left(  -b\right)  \right)  =\left(  \left(
-a\right)  +\left(  -b\right)  \right)  +\left(  a+b\right)  $ (by
commutativity of addition). Combining these two equalities, we obtain%
\[
\left(  a+b\right)  +\left(  \left(  -a\right)  +\left(  -b\right)  \right)
=\left(  \left(  -a\right)  +\left(  -b\right)  \right)  +\left(  a+b\right)
=0.
\]
This completes the proof of Proposition \ref{prop.rings.inv-add.rules}
\textbf{(b)}.

\textbf{(c)} We have $0+0=0$ (by the neutrality of $0$). But this shows
precisely that $0$ is an additive inverse of $0$. In other words, $0=-0$. This
proves Proposition \ref{prop.rings.inv-add.rules} \textbf{(c)}.

\textbf{(d)} The definition of subtraction yields $0-a=0+\left(  -a\right)
=-a$ (by the neutrality of $0$). This proves Proposition
\ref{prop.rings.inv-add.rules} \textbf{(d)}.

\textbf{(e)} Since $-a$ is an additive inverse of $a$, we have $\left(
-a\right)  +a=0$ and $a+\left(  -a\right)  =0$. But the same two equations say
that $a$ is an additive inverse of $-a$. In other words, $a=-\left(
-a\right)  $. This proves Proposition \ref{prop.rings.inv-add.rules}
\textbf{(e)}.

\textbf{(f)} We have $\left(  -a\right)  +a=0$ (since $-a$ is an additive
inverse of $a$). But distributivity yields $\left(  -a\right)
b+ab=\underbrace{\left(  \left(  -a\right)  +a\right)  }_{=0}b=0b=0$ (by
annihilation). Likewise, $ab+\left(  -a\right)  b=0$. Hence, $\left(
-a\right)  b$ is an additive inverse of $ab$. In other words, $\left(
-a\right)  b=-\left(  ab\right)  $.

We have $b+\left(  -b\right)  =0$ (since $-b$ is an additive inverse of $b$).
But distributivity yields $ab+a\left(  -b\right)  =a\underbrace{\left(
b+\left(  -b\right)  \right)  }_{=0}=a0=0$ (by annihilation). Likewise,
$a\left(  -b\right)  +ab=0$. Hence, $a\left(  -b\right)  $ is an additive
inverse of $ab$. In other words, $a\left(  -b\right)  =-\left(  ab\right)  $.
Combining this with $\left(  -a\right)  b=-\left(  ab\right)  $, we obtain
$-\left(  ab\right)  =\left(  -a\right)  b=a\left(  -b\right)  $. This proves
Proposition \ref{prop.rings.inv-add.rules} \textbf{(f)}.

\textbf{(g)} The definition of subtraction yields%
\[
a-b-c=\underbrace{\left(  a-b\right)  }_{\substack{=a+\left(  -b\right)
\\\text{(by the definition of}\\\text{subtraction)}}}+\left(  -c\right)
=\left(  a+\left(  -b\right)  \right)  +\left(  -c\right)  =a+\left(  \left(
-b\right)  +\left(  -c\right)  \right)
\]
(by associativity of addition). But Proposition \ref{prop.rings.inv-add.rules}
\textbf{(b)} (applied to $b$ and $c$ instead of $a$ and $b$) yields $-\left(
b+c\right)  =\left(  -b\right)  +\left(  -c\right)  $. The definition of
subtraction yields%
\[
a-\left(  b+c\right)  =a+\underbrace{\left(  -\left(  b+c\right)  \right)
}_{=\left(  -b\right)  +\left(  -c\right)  }=a+\left(  \left(  -b\right)
+\left(  -c\right)  \right)  .
\]
Comparing this with $a-b-c=a+\left(  \left(  -b\right)  +\left(  -c\right)
\right)  $, we obtain $a-b-c=a-\left(  b+c\right)  $. This proves Proposition
\ref{prop.rings.inv-add.rules} \textbf{(g)}.

\textbf{(h)} Proposition \ref{prop.rings.inv-add.rules} \textbf{(f)} (applied
to $c$ instead of $b$) yields $-\left(  ac\right)  =\left(  -a\right)
c=a\left(  -c\right)  $.

The definition of subtraction yields $b-c=b+\left(  -c\right)  $ and%
\begin{align*}
ab-ac  &  =ab+\underbrace{\left(  -\left(  ac\right)  \right)  }_{=a\left(
-c\right)  }=ab+a\left(  -c\right)  =a\underbrace{\left(  b+\left(  -c\right)
\right)  }_{=b-c}\ \ \ \ \ \ \ \ \ \ \left(  \text{by distributivity}\right)
\\
&  =a\left(  b-c\right)  .
\end{align*}
Thus, $a\left(  b-c\right)  =ab-ac$. A similar argument show that $\left(
a-b\right)  c=ac-bc$. This proves Proposition \ref{prop.rings.inv-add.rules}
\textbf{(h)}.

\textbf{(i)} Proposition \ref{prop.rings.inv-add.rules} \textbf{(e)} (applied
to $b$ instead of $a$) yields $-\left(  -b\right)  =b$. But the definition of
subtraction yields $a-b=a+\left(  -b\right)  $. Hence,%
\begin{align*}
-\left(  a-b\right)   &  =-\left(  a+\left(  -b\right)  \right)  =\left(
-a\right)  +\underbrace{\left(  -\left(  -b\right)  \right)  }_{=b}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.rings.inv-add.rules} \textbf{(b)}, applied to }-b\text{ instead of
}b\right) \\
&  =\left(  -a\right)  +b=b+\left(  -a\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by commutativity of addition}\right) \\
&  =b-a
\end{align*}
(since $b-a$ is defined to be $b+\left(  -a\right)  $). This proves
Proposition \ref{prop.rings.inv-add.rules} \textbf{(i)}.

\textbf{(j)} Proposition \ref{prop.rings.inv-add.rules} \textbf{(e)} (applied
to $b$ instead of $a$) yields $-\left(  -b\right)  =b$. The definition of
subtraction yields%
\[
a-\left(  -b\right)  =a+\underbrace{\left(  -\left(  -b\right)  \right)
}_{=b}=a+b.
\]
This proves Proposition \ref{prop.rings.inv-add.rules} \textbf{(j)}.

\textbf{(k)} Proposition \ref{prop.rings.inv-add.rules} \textbf{(f)} (applied
to $1$ and $a$ instead of $a$ and $b$) yields $-\left(  1a\right)  =\left(
-1\right)  a=1\left(  -a\right)  $. Hence, $\left(  -1\right)
a=-\underbrace{\left(  1a\right)  }_{=a}=-a$. This proves Proposition
\ref{prop.rings.inv-add.rules} \textbf{(k)}.

\textbf{(l)} Assume that $-a=-b$. Proposition \ref{prop.rings.inv-add.rules}
\textbf{(e)} (applied to $b$ instead of $a$) yields $-\left(  -b\right)  =b$.
Proposition \ref{prop.rings.inv-add.rules} \textbf{(e)} yields $-\left(
-a\right)  =a$. Thus, $a=-\underbrace{\left(  -a\right)  }_{=-b}=-\left(
-b\right)  =b$. This proves Proposition \ref{prop.rings.inv-add.rules}
\textbf{(l)}.
\end{proof}

If $a,b\in\mathbb{K}$, then the expression \textquotedblleft$-ab$%
\textquotedblright\ can be considered ambiguous, since it can be read either
as \textquotedblleft$\left(  -a\right)  b$\textquotedblright\ or as
\textquotedblleft$-\left(  ab\right)  $\textquotedblright. But Proposition
\ref{prop.rings.inv-add.rules} \textbf{(f)} shows that these two readings
yield the same result; therefore, you need not fear this ambiguity.

Furthermore, we don't need to parenthesize expressions like $a+b+c$ or $abc$. Indeed:

\begin{theorem}
\label{thm.rings.sum.wd}Finite sums of elements of $\mathbb{K}$ can be defined
in the same way as finite sums of usual (i.e., real or rational) numbers (with
the empty sum defined to be $0$). That is, if $S$ is a finite set, and if
$a_{s}\in\mathbb{K}$ for each $s\in S$, then $\sum\limits_{s\in S}a_{s}$ is
well-defined and satisfies the usual rules, such as%
\[
\sum\limits_{s\in S}\left(  a_{s}+b_{s}\right)  =\sum\limits_{s\in S}%
a_{s}+\sum\limits_{s\in S}b_{s}.
\]


Thus, in particular, sums like $\sum_{i=p}^{q}a_{i}$ or $a_{1}+a_{2}%
+\cdots+a_{k}$ are well-defined. We don't need to put parentheses or specify
the order of summation in order to make them non-ambiguous.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.rings.sum.wd}.]This is proven just as for numbers.
(See \cite[\S 2.14 and \S 1.4]{detnotes} for how it is proven for numbers.)
\end{proof}

What about finite products? Is $\prod_{s\in S}a_{s}$ well-defined? Not always,
but only for commutative rings. Indeed, a product like $\prod_{s\in S}a_{s}$
has no pre-defined order of multiplication (in general), so for it to be
well-defined, it would have to be independent of the order; but this would
require the commutativity of multiplication.

\begin{theorem}
\label{thm.rings.prod.wd}\textbf{(a)} Finite products of elements of
$\mathbb{K}$ can be defined in the same way as finite products of usual (i.e.,
real or rational) numbers (with the empty product defined to be $1$)
\textbf{as long as the ring }$\mathbb{K}$ \textbf{is commutative}.

\textbf{(b)} For general (not necessarily commutative) rings $\mathbb{K}$, we
can still define products with a pre-determined order, such as $a_{1}%
a_{2}\cdots a_{k}$ (where $a_{1},a_{2},\ldots,a_{k}\in\mathbb{K}$). These
products can be defined recursively as follows:%
\[
a_{1}a_{2}\cdots a_{k}=1\ \ \ \ \ \ \ \ \ \ \text{if }k=0;
\]
otherwise,%
\[
a_{1}a_{2}\cdots a_{k}=\left(  a_{1}a_{2}\cdots a_{k-1}\right)  a_{k}.
\]


These products still satisfy the rule%
\[
a_{1}a_{2}\cdots a_{k}=\left(  a_{1}a_{2}\cdots a_{i}\right)  \left(
a_{i+1}a_{i+2}\cdots a_{k}\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }%
i\in\left\{  0,1,\ldots,k\right\}  .
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.rings.prod.wd}.]\textbf{(a)} This is proven just as
for numbers. (See \cite[\S 2.14 and \S 1.4]{detnotes} for how it is proven for
numbers, and replace every appearance of $\mathbb{A}$ in that proof by
$\mathbb{K}$.)

\textbf{(b)} This follows from Exercise 4 \textbf{(b)} on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}
(applied to the set $S=\mathbb{K}$, the binary operation $\cdot=\ast$, and the
neutral element $e=1$).\ \ \ \ \footnote{To be fully honest, we are skipping
over a little subtlety here. Exercise 4 \textbf{(b)} on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}
(applied to $S=\mathbb{K}$, $\cdot=\ast$ and $e=1$) does indeed show that%
\[
a_{1}a_{2}\cdots a_{k}=\left(  a_{1}a_{2}\cdots a_{i}\right)  \left(
a_{i+1}a_{i+2}\cdots a_{k}\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }%
i\in\left\{  0,1,\ldots,k\right\}  .
\]
However, this exercise assumes a slightly different definition of the
\textquotedblleft$k$-tuple product\textquotedblright\ $a_{1}a_{2}\cdots a_{k}$
(which is denoted by $P\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ in this
exercise); namely, it assumes the following recursive definition:
\par
\begin{itemize}
\item For $k=0$, we set $a_{1}a_{2}\cdots a_{k}=1$. (This is written as
\textquotedblleft$P\left(  {}\right)  =e$\textquotedblright\ in the exercise.)
\par
\item For $k=1$, we set $a_{1}a_{2}\cdots a_{k}=a_{1}$. (This is written as
\textquotedblleft$P\left(  a_{1}\right)  =a_{1}$\textquotedblright\ in the
exercise.)
\par
\item For $k>1$, we set $a_{1}a_{2}\cdots a_{k}=\left(  a_{1}a_{2}\cdots
a_{k-1}\right)  a_{k}$. (This is written as \textquotedblleft$P\left(
a_{1},a_{2},\ldots,a_{k}\right)  =\left(  P\left(  a_{1},a_{2},\ldots
,a_{k-1}\right)  \right)  \ast a_{k}$\textquotedblright\ in the exercise.)
\end{itemize}
\par
\noindent Comparing this definition to the one we gave in Theorem
\ref{thm.rings.prod.wd} \textbf{(b)}, we realize that it is slightly
different; to wit, it treats the cases $k=1$ and $k>1$ separately, while the
definition in Theorem \ref{thm.rings.prod.wd} \textbf{(b)} uses the same
recursive formula for all $k>0$.
\par
Fortunately, these two definitions are nevertheless equivalent, i.e., they
yield the same value for $a_{1}a_{2}\cdots a_{k}$ whenever $k\in\mathbb{N}$
and $a_{1},a_{2},\ldots,a_{k}\in\mathbb{K}$. To see this, you can argue by
induction on $k$ as follows:
\par
\begin{itemize}
\item When $k=0$, the two definitions clearly yield the same value for
$a_{1}a_{2}\cdots a_{k}$ (namely, the value $1$).
\par
\item When $k=1$, the two definitions also yield the same value for
$a_{1}a_{2}\cdots a_{k}$ (indeed, the definition from Exercise 4 \textbf{(b)}
on \href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set
\#0} defines $a_{1}a_{2}\cdots a_{k}$ to be $a_{1}$ in this case, whereas the
definition we gave in Theorem \ref{thm.rings.prod.wd} \textbf{(b)} defines it
to be%
\begin{align*}
\left(  a_{1}a_{2}\cdots a_{k-1}\right)  a_{k}  &  =\underbrace{\left(
a_{1}a_{2}\cdots a_{0}\right)  }_{=1}a_{1}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }k=1\right) \\
&  =1a_{1}=a_{1}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the \textquotedblleft
Neutrality of one\textquotedblright\ axiom}\right)  ,
\end{align*}
and obviously these two values are the same).
\par
\item When $k>1$, the two definitions yield the same value for $a_{1}%
a_{2}\cdots a_{k}$, because they define $a_{1}a_{2}\cdots a_{k}$ by the same
recursive formula (viz., $a_{1}a_{2}\cdots a_{k}=\left(  a_{1}a_{2}\cdots
a_{k-1}\right)  a_{k}$) in this case. (Here, we need the inductive hypothesis
to tell us that the two definitions yield the same value for $a_{1}a_{2}\cdots
a_{k-1}$.)
\end{itemize}
\par
Thus, Exercise 4 \textbf{(b)} on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}
can indeed be applied to our definition of $a_{1}a_{2}\cdots a_{k}$, and as a
result, Theorem \ref{thm.rings.prod.wd} \textbf{(b)} follows.}

(Alternatively, you can find proofs in various texts on algebra, such as
\cite[Proposition 2.1.4]{Artin} or \cite[Appendix A]{Warner71}, or at
\url{https://groupprops.subwiki.org/wiki/Associative_implies_generalized_associative}
.)
\end{proof}

Theorem \ref{thm.rings.prod.wd} \textbf{(b)} is called the \textit{general
associativity theorem for rings}. Note that Theorem \ref{thm.rings.prod.wd}
\textbf{(b)} entails that if we have $k$ elements $a_{1},a_{2},\ldots,a_{k}$
of a ring $\mathbb{K}$, then any two ways of parenthesizing the product
$a_{1}a_{2}\cdots a_{k}$ yield the same result. For example, for $k=4$, we
have%
\[
\left(  \left(  a_{1}a_{2}\right)  a_{3}\right)  a_{4}=\left(  a_{1}\left(
a_{2}a_{3}\right)  \right)  a_{4}=\left(  a_{1}a_{2}\right)  \left(
a_{3}a_{4}\right)  =a_{1}\left(  \left(  a_{2}a_{3}\right)  a_{4}\right)
=a_{1}\left(  a_{2}\left(  a_{3}a_{4}\right)  \right)  .
\]
(It is not hard to prove this particular chain of identities by applying the
associativity of multiplication in the appropriate places; but for higher
values of $k$, such a manual approach becomes more and more cumbersome.)

What else can we do with our ring $\mathbb{K}$ ?

By definition, we know how to multiply two elements of $\mathbb{K}$. But there
is also a natural way to multiply an element of $\mathbb{K}$ with an integer.
This is defined as follows:

\begin{definition}
\label{def.rings.na}Let $a\in\mathbb{K}$ and $n\in\mathbb{Z}$. Then, we define
an element $na$ of $\mathbb{K}$ by%
\[
na=%
\begin{cases}
\underbrace{a+a+\cdots+a}_{n\text{ times}}, & \text{if }n\geq0;\\
-\left(  \underbrace{a+a+\cdots+a}_{-n\text{ times}}\right)  , & \text{if }n<0
\end{cases}
.
\]

\end{definition}

The \textquotedblleft$na$\textquotedblright\ that we have just defined has
nothing to do with the multiplication $\cdot$ of $\mathbb{K}$, since $n$ is
not (generally) an element of $\mathbb{K}$. However, when $\mathbb{K}$ is one
of the usual rings of numbers (like $\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$,
$\mathbb{C}$), then this kind of multiplication is a restriction of the
multiplication $\cdot$ of $\mathbb{K}$ (that is, $na$ means the same thing).
Indeed, Definition \ref{def.rings.na} clearly generalizes the definition of
$na$ for rational numbers $a$. Furthermore, when $\mathbb{K}=\mathbb{Z}/n$ for
some integer $n$, Definition \ref{def.rings.na} agrees with Definition
\ref{def.eqrel.Z/n.scaling} (in the sense that both definitions yield the same
result for $r\alpha$ when $r\in\mathbb{Z}$ and $\alpha\in\mathbb{Z}/n$). (This
is easy to prove by induction.)

The \textquotedblleft$na$\textquotedblright\ multiplication introduced in
Definition \ref{def.rings.na} has several properties that you would expect
such an operation to have:

\begin{proposition}
\label{prop.rings.Zscal.rules}We have%
\begin{align}
\left(  n+m\right)  a  &  =na+ma\ \ \ \ \ \ \ \ \ \ \text{for all }%
a\in\mathbb{K}\text{ and }n,m\in\mathbb{Z}%
;\label{eq.prop.rings.Zscal.rules.(n+m)a}\\
n\left(  a+b\right)   &  =na+nb\ \ \ \ \ \ \ \ \ \ \text{for all }%
a,b\in\mathbb{K}\text{ and }n\in\mathbb{Z}%
;\label{eq.prop.rings.Zscal.rules.n(a+b)}\\
-\left(  na\right)   &  =\left(  -n\right)  a=n\left(  -a\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }a\in\mathbb{K}\text{ and }n\in
\mathbb{Z};\label{eq.prop.rings.Zscal.rules.-na}\\
\left(  nm\right)  a  &  =n\left(  ma\right)  \ \ \ \ \ \ \ \ \ \ \text{for
all }a\in\mathbb{K}\text{ and }n,m\in\mathbb{Z}%
;\label{eq.prop.rings.Zscal.rules.nma}\\
n\left(  ab\right)   &  =\left(  na\right)  b=a\left(  nb\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{K}\text{ and }n\in
\mathbb{Z};\label{eq.prop.rings.Zscal.rules.nab}\\
n0_{\mathbb{K}}  &  =0_{\mathbb{K}}\ \ \ \ \ \ \ \ \ \ \text{for all }%
n\in\mathbb{Z};\label{eq.prop.rings.Zscal.rules.n0}\\
1a  &  =a\ \ \ \ \ \ \ \ \ \ \text{for all }a\in\mathbb{K}%
\label{eq.prop.rings.Zscal.rules.1a}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, the \textquotedblleft%
}1\text{\textquotedblright\ means the integer }1\right)  ;\nonumber\\
0a  &  =0_{\mathbb{K}}\ \ \ \ \ \ \ \ \ \ \text{for all }a\in\mathbb{K}%
\label{eq.prop.rings.Zscal.rules.0a}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, the \textquotedblleft%
}0\text{\textquotedblright\ on the left hand side means the integer }0\right)
;\nonumber\\
\left(  -1\right)  a  &  =-a\ \ \ \ \ \ \ \ \ \ \text{for all }a\in
\mathbb{K};\label{eq.prop.rings.Zscal.rules.-1a}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, the \textquotedblleft%
}-1\text{\textquotedblright\ means the integer }-1\right)  .\nonumber
\end{align}
In particular:

\begin{itemize}
\item The equality (\ref{eq.prop.rings.Zscal.rules.-na}) shows that the
expression \textquotedblleft$-na$\textquotedblright\ (with $a\in\mathbb{K}$
and $n\in\mathbb{Z}$) is unambiguous (since its two possible interpretations,
namely $-\left(  na\right)  $ and $\left(  -n\right)  a$, yield equal results).

\item The equality (\ref{eq.prop.rings.Zscal.rules.nma}) shows that the
expression \textquotedblleft$nma$\textquotedblright\ (with $a\in\mathbb{K}$
and $n,m\in\mathbb{Z}$) is unambiguous.

\item The equality (\ref{eq.prop.rings.Zscal.rules.nab}) shows that the
expression \textquotedblleft$nab$\textquotedblright\ (with $a,b\in\mathbb{K}$
and $n\in\mathbb{Z}$) is unambiguous.
\end{itemize}
\end{proposition}

\begin{exercise}
\label{exe.rings.Zscal.rules}Prove Proposition \ref{prop.rings.Zscal.rules}.

[\textbf{Hint:} The proofs of the rules in Proposition
\ref{prop.rings.Zscal.rules} are analogous to the proofs of the corresponding
rules for rationals -- at least if you know the right proofs of the latter.
One way is to start by proving the equalities
(\ref{eq.prop.rings.Zscal.rules.0a}), (\ref{eq.prop.rings.Zscal.rules.1a}) and
(\ref{eq.prop.rings.Zscal.rules.-1a}), which follow almost immediately from
Definition \ref{def.rings.na}; then, prove
(\ref{eq.prop.rings.Zscal.rules.(n+m)a}) for $n,m\in\mathbb{N}$; then, prove
(\ref{eq.prop.rings.Zscal.rules.n0}) and
(\ref{eq.prop.rings.Zscal.rules.n(a+b)}) for $n\in\mathbb{N}$; then, prove
(\ref{eq.prop.rings.Zscal.rules.nma}) for $n,m\in\mathbb{N}$; then, prove
(\ref{eq.prop.rings.Zscal.rules.nab}) for $n\in\mathbb{N}$; then, show that
$\left(  -n\right)  a=-\left(  na\right)  $ for all $a\in\mathbb{K}$ and
$n\in\mathbb{Z}$ (by distinguishing between the cases $n>0$, $n=0$ and $n<0$);
and then extend the identities that have already been shown for elements of
$\mathbb{N}$ to elements of $\mathbb{Z}$ (using Proposition
\ref{prop.rings.inv-add.rules}). Note that this is rather similar to the
process by which we proved Proposition \ref{prop.CC.CC.power-rules} in the
solution to Exercise \ref{exe.CC.CC.power-rules}, with the main difference
being that we now are studying multiples instead of powers (and addition
instead of multiplication). Our solution to Exercise
\ref{exe.CC.CC.power-rules} cannot be copied literally, however, because the
way we defined $na$ for negative $n$ in Definition \ref{def.rings.na} is
somewhat different from the way we defined $\alpha^{n}$ for negative $n$ in
Definition \ref{def.CC.CC.power-}.]
\end{exercise}

\begin{teachingnote}
\textbf{2019-03-29 lecture}
\end{teachingnote}

We can also define powers of elements of a ring:

\begin{definition}
\label{def.rings.pow}Let $a\in\mathbb{K}$ and $n\in\mathbb{N}$. Then, we
define an element $a^{n}$ of $\mathbb{K}$ by%
\[
a^{n}=\underbrace{a\cdot a\cdot\cdots\cdot a}_{n\text{ times}}.
\]

\end{definition}

This definition clearly generalizes the definition of $a^{n}$ for rational
numbers $a$. Furthermore, when $\mathbb{K}=\mathbb{Z}/n$ for some integer $n$,
Definition \ref{def.rings.pow} agrees with Definition
\ref{def.eqrel.Z/n.kpower} (in the sense that both definitions yield the same
result for $\alpha^{k}$ when $\alpha\in\mathbb{Z}/n$ and $k\in\mathbb{N}$).
(This follows from Theorem \ref{thm.eqrel.Z/n.rules-exp} \textbf{(c)}.)
Furthermore, when $\mathbb{K}=\mathbb{C}$, Definition \ref{def.rings.pow}
agrees with Definition \ref{def.CC.CC.power}.

Powers of elements of a ring satisfy some properties you would expect but fail
to satisfy some others:

\begin{proposition}
\label{prop.rings.pow.rules}\textbf{(a)} We have%
\begin{align}
a^{0}  &  =1\ \ \ \ \ \ \ \ \ \ \text{for all }a\in\mathbb{K}%
;\label{eq.prop.rings.pow.rules.a-to-0}\\
1^{n}  &  =1\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}%
\label{eq.prop.rings.pow.rules.1-to-n}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, the \textquotedblleft%
}1\text{\textquotedblright\ means the unity of }\mathbb{K}\right)
;\nonumber\\
0^{n}  &  =%
\begin{cases}
0, & \text{if }n>0\\
1, & \text{if }n=0
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}%
\label{eq.prop.rings.pow.rules.5}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, the \textquotedblleft%
}0\text{\textquotedblright\ in \textquotedblleft}0^{n}\text{\textquotedblright%
\ means the zero of }\mathbb{K}\right)  ;\nonumber\\
a^{n+m}  &  =a^{n}a^{m}\ \ \ \ \ \ \ \ \ \ \text{for all }a\in\mathbb{K}\text{
and }n,m\in\mathbb{N};\label{eq.prop.rings.pow.rules.7}\\
\left(  a^{n}\right)  ^{m}  &  =a^{nm}\ \ \ \ \ \ \ \ \ \ \text{for all }%
a\in\mathbb{K}\text{ and }n,m\in\mathbb{N}. \label{eq.prop.rings.pow.rules.8}%
\end{align}


\textbf{(b)} For any $a,b\in\mathbb{K}$, we have
\begin{align*}
\left(  a+b\right)  ^{2}  &  =\left(  a+b\right)  \left(  a+b\right)
=a\left(  a+b\right)  +b\left(  a+b\right) \\
&  =aa+ab+ba+bb=a^{2}+ab+ba+b^{2}.
\end{align*}
This further equals $a^{2}+2ab+b^{2}$ if $\mathbb{K}$ is commutative.

\textbf{(c)} Let $a,b\in\mathbb{K}$ satisfy $ab=ba$. (This holds automatically
when $\mathbb{K}$ is commutative.) Then:%
\begin{align}
ab^{n}  &  =b^{n}a\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}%
;\label{eq.prop.rings.pow.rules.c.1}\\
a^{i}b^{j}  &  =b^{j}a^{i}\ \ \ \ \ \ \ \ \ \ \text{for all }i,j\in
\mathbb{N};\label{eq.prop.rings.pow.rules.c.2}\\
\left(  ab\right)  ^{n}  &  =a^{n}b^{n}\ \ \ \ \ \ \ \ \ \ \text{for all }%
n\in\mathbb{N};\label{eq.prop.rings.pow.rules.c.3}\\
\left(  a+b\right)  ^{n}  &  =\sum_{k=0}^{n}\dbinom{n}{k}a^{k}b^{n-k}%
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}.
\label{eq.prop.rings.pow.rules.c.binom}%
\end{align}


\textbf{(d)} Let $a,b\in\mathbb{K}$ satisfy $ab=ba$. Then,%
\[
a^{n}-b^{n}=\left(  a-b\right)  \left(  a^{n-1}+a^{n-2}b+\cdots+ab^{n-2}%
+b^{n-1}\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.rings.pow.rules} (sketched).]\textbf{(a)} The
equality (\ref{eq.prop.rings.pow.rules.a-to-0}) follows from the definition of
products (specifically, the part when empty products were defined to be $1$).
The proof of (\ref{eq.prop.rings.pow.rules.1-to-n}) is analogous to the proof
of Proposition \ref{prop.CC.CC.power-rules} \textbf{(e)}. The proof of
(\ref{eq.prop.rings.pow.rules.5}) is almost obvious (just observe that
$0^{n}=0\cdot0^{n-1}=0$ whenever $n>0$). The proof of
(\ref{eq.prop.rings.pow.rules.7}) is analogous to the proof of Proposition
\ref{prop.CC.CC.power-rules} \textbf{(b)}. The proof of
(\ref{eq.prop.rings.pow.rules.8}) is analogous to the proof of Proposition
\ref{prop.CC.CC.power-rules} \textbf{(d)}.

\textbf{(b)} Expand using distributivity.

\textbf{(c)} First prove (\ref{eq.prop.rings.pow.rules.c.1}) by induction on
$n$\ \ \ \ \footnote{Here are the details:
\par
\textit{Proof of (\ref{eq.prop.rings.pow.rules.c.1}):} We shall prove
(\ref{eq.prop.rings.pow.rules.c.1}) by induction on $n$:
\par
\textit{Induction base:} Applying (\ref{eq.prop.rings.pow.rules.a-to-0}) to
$b$ instead of $a$, we conclude that $b^{0}=1$. Thus, $a\underbrace{b^{0}%
}_{=1}=a$ and $\underbrace{b^{0}}_{=1}a=a$. Comparing these two equalities, we
find $ab^{0}=b^{0}a$. In other words, (\ref{eq.prop.rings.pow.rules.c.1})
holds for $n=0$. This completes the induction base.
\par
\textit{Induction step:} Let $m\in\mathbb{N}$. Assume that
(\ref{eq.prop.rings.pow.rules.c.1}) holds for $n=m$. We must prove that
(\ref{eq.prop.rings.pow.rules.c.1}) holds for $n=m+1$.
\par
We have assumed that (\ref{eq.prop.rings.pow.rules.c.1}) holds for $n=m$. In
other words, we have $ab^{m}=b^{m}a$. But the definition of $b^{1}$ yields
$b^{1}=\underbrace{b\cdot b\cdot\cdots\cdot b}_{1\text{ times}}=b$. Now,
(\ref{eq.prop.rings.pow.rules.7}) (applied to $b$, $m$ and $1$ instead of $a$,
$n$ and $m$) yields $b^{m+1}=b^{m}\underbrace{b^{1}}_{=b}=b^{m}b$. Hence,%
\[
a\underbrace{b^{m+1}}_{=b^{m}b}=\underbrace{ab^{m}}_{=b^{m}a}b=b^{m}%
\underbrace{ab}_{=ba}=\underbrace{b^{m}b}_{=b^{m+1}}a=b^{m+1}a.
\]
In other words, (\ref{eq.prop.rings.pow.rules.c.1}) holds for $n=m+1$. This
completes the induction step. Hence, the induction proof of
(\ref{eq.prop.rings.pow.rules.c.1}) is complete.}. Then, prove
(\ref{eq.prop.rings.pow.rules.c.2}) by induction on $j$ (using
(\ref{eq.prop.rings.pow.rules.c.1}) in the induction
step)\footnote{Alternatively, you can prove (\ref{eq.prop.rings.pow.rules.c.2}%
) as follows:
\par
Let $i,j\in\mathbb{N}$. We must prove that $a^{i}b^{j}=b^{j}a^{i}$.
\par
We have $ab=ba$, thus $ba=ab$. Hence, (\ref{eq.prop.rings.pow.rules.c.1})
(applied to $b$, $a$ and $i$ instead of $a$, $b$ and $n$) yields $ba^{i}%
=a^{i}b$. In other words, $a^{i}b=ba^{i}$. Thus,
(\ref{eq.prop.rings.pow.rules.c.1}) (applied to $a^{i}$ and $j$ instead of $a$
and $n$) yields $a^{i}b^{j}=b^{j}a^{i}$. Thus,
(\ref{eq.prop.rings.pow.rules.c.2}) is proven.}. Then, prove
(\ref{eq.prop.rings.pow.rules.c.3}) by induction on $n$ (using
(\ref{eq.prop.rings.pow.rules.c.1}) in the induction step)\footnote{Here is
the argument in detail:
\par
\textit{Proof of (\ref{eq.prop.rings.pow.rules.c.3}):} We shall prove
(\ref{eq.prop.rings.pow.rules.c.3}) by induction on $n$:
\par
\textit{Induction base:} From (\ref{eq.prop.rings.pow.rules.a-to-0}), we
obtain $a^{0}=1$. Similarly, $b^{0}=1$ and $\left(  ab\right)  ^{0}=1$. Hence,
$\left(  ab\right)  ^{0}=1=\underbrace{1}_{=a^{0}}\cdot\underbrace{1}_{=b^{0}%
}=a^{0}b^{0}$. In other words, (\ref{eq.prop.rings.pow.rules.c.3}) holds for
$n=0$. This completes the induction base.
\par
\textit{Induction step:} Let $m\in\mathbb{N}$. Assume that
(\ref{eq.prop.rings.pow.rules.c.3}) holds for $n=m$. We must prove that
(\ref{eq.prop.rings.pow.rules.c.3}) holds for $n=m+1$.
\par
We have assumed that (\ref{eq.prop.rings.pow.rules.c.3}) holds for $n=m$. In
other words, we have $\left(  ab\right)  ^{m}=a^{m}b^{m}$. But the definition
of $b^{1}$ yields $b^{1}=\underbrace{b\cdot b\cdot\cdots\cdot b}_{1\text{
times}}=b$. Now, (\ref{eq.prop.rings.pow.rules.7}) (applied to $b$, $m$ and
$1$ instead of $a$, $n$ and $m$) yields $b^{m+1}=b^{m}\underbrace{b^{1}}%
_{=b}=b^{m}b$. Similarly, $a^{m+1}=a^{m}a$.
\par
But (\ref{eq.prop.rings.pow.rules.c.1}) (applied to $n=m$) yields
$ab^{m}=b^{m}a$. Now,%
\begin{equation}
\underbrace{a^{m+1}}_{=a^{m}a}\underbrace{b^{m+1}}_{=b^{m}b}=a^{m}%
\underbrace{ab^{m}}_{=b^{m}a}b=a^{m}b^{m}ab.
\label{pf.prop.rings.pow.rules.c.3.pf.1}%
\end{equation}
\par
But the same argument that we used to show that $b^{m+1}=b^{m}b$ can be
applied to $ab$ instead of $b$. We thus obtain%
\[
\left(  ab\right)  ^{m+1}=\underbrace{\left(  ab\right)  ^{m}}_{=a^{m}b^{m}%
}\left(  ab\right)  =a^{m}b^{m}\left(  ab\right)  =a^{m}b^{m}ab.
\]
Comparing this with (\ref{pf.prop.rings.pow.rules.c.3.pf.1}), we obtain
$\left(  ab\right)  ^{m+1}=a^{m+1}b^{m+1}$. In other words,
(\ref{eq.prop.rings.pow.rules.c.3}) holds for $n=m+1$. This completes the
induction step. Hence, the induction proof of
(\ref{eq.prop.rings.pow.rules.c.3}) is complete.}. Finally, prove
(\ref{eq.prop.rings.pow.rules.c.binom}) by induction on $n$, just as Theorem
\ref{thm.binom.binf} is proven (but using (\ref{eq.prop.rings.pow.rules.c.2})
in the induction step in order to move powers of $a$ past powers of $b$).

\textbf{(d)} For $\mathbb{K}=\mathbb{Q}$, this was proven in Exercise 1 on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.
The proof in the case of general rings $\mathbb{K}$ is
analogous\footnote{There is only one minor complication: We need to justify
that $\left(  a-b\right)  a=a\left(  a-b\right)  $ (since this was used in the
proof). Luckily, this is very easy: Just note that
\[
\left(  a-b\right)  a=aa-\underbrace{ba}_{=ab}=aa-ab=a\left(  a-b\right)  .
\]
}.
\end{proof}

\subsection{\label{sect.ring.inv}Multiplicative inverses and fields}

\begin{convention}
For the rest of this section, we fix a ring $\mathbb{K}$, and we denote its
addition, multiplication, zero and unity by $+$, $\cdot$, $0$ and $1$.
\end{convention}

Each element $a$ of the ring $\mathbb{K}$ has an additive inverse $-a$, which
satisfies $\left(  -a\right)  +a=a+\left(  -a\right)  =0$. What about a
\textquotedblleft multiplicative inverse\textquotedblright?

\begin{definition}
\label{def.rings.inv-mul}Let $a\in\mathbb{K}$. A \textit{multiplicative
inverse} of $a$ means an element $a^{\prime}$ of $\mathbb{K}$ such that
$aa^{\prime}=a^{\prime}a=1$.
\end{definition}

Multiplicative inverses don't always exist. In the ring $\mathbb{Q}$, the
number $0$ has none. In the ring $\mathbb{Z}$, the number $2$ has none (since
$\dfrac{1}{2}\notin\mathbb{Z}$). But when they do exist, they are unique:

\begin{theorem}
\label{thm.rings.inv-mul.uni}Let $a\in\mathbb{K}$. Then, $a$ has \textbf{at
most one} multiplicative inverse.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.rings.inv-mul.uni}.]This is analogous to Theorem
\ref{thm.rings.inv-add.uni}, but we have to replace $+$ and $0$ by $\cdot$ and
$1$.
\end{proof}

\textbf{Warning:} In Definition \ref{def.rings.inv-add}, we could have
replaced \textquotedblleft$a+a^{\prime}=a^{\prime}+a=0$\textquotedblright\ by
\textquotedblleft$a+a^{\prime}=0$\textquotedblright, since $a+a^{\prime
}=a^{\prime}+a$ already follows from commutativity of addition. But in
Definition \ref{def.rings.inv-mul}, we cannot replace \textquotedblleft%
$aa^{\prime}=a^{\prime}a=1$\textquotedblright\ by \textquotedblleft%
$aa^{\prime}=1$\textquotedblright, since $\mathbb{K}$ need not be commutative.
If we require $aa^{\prime}=1$ only, then $a^{\prime}$ is just a \textit{right
inverse} of $a$; such a right inverse is not necessarily unique.

The following definition generalizes Definition \ref{def.equiv.Zn.inverse},
Definition \ref{def.CC.CC.inverse.notations} and Definition
\ref{def.CC.CC.division.notations}:

\begin{definition}
\label{def.rings.inv-mul-a}\textbf{(a)} An element $a\in\mathbb{K}$ is said to
be \textit{invertible} if it has a multiplicative inverse. An invertible
element is also called a \textit{unit}.

\textbf{(b)} If $a\in\mathbb{K}$ is invertible, then the multiplicative
inverse of $a$ will be called $a^{-1}$. (This is well-defined, since Theorem
\ref{thm.rings.inv-mul.uni} shows that this multiplicative inverse is unique.)

\textbf{(c)} Assume that $\mathbb{K}$ is commutative. If $a\in\mathbb{K}$ and
$b\in\mathbb{K}$ are such that $b$ is invertible, then we define the
\textit{quotient }$a/b$ (also called $\dfrac{a}{b}$) to be the element
$ab^{-1}$ of $\mathbb{K}$. This new binary partial operation $/$ on
$\mathbb{K}$ is called \textquotedblleft\textit{division}\textquotedblright.
\end{definition}

The word \textquotedblleft partial\textquotedblright\ in \textquotedblleft
partial operation\textquotedblright\ means that it is not always defined. We
already have seen this for rational numbers: We cannot divide by $0$.

Again, we follow PEMDAS rules as far as division is concerned. Do not use the
ambiguous expression \textquotedblleft$a/bc$\textquotedblright; it can mean
either $a/\left(  bc\right)  $ or $\left(  a/b\right)  c$, depending on whom
you ask, and thus should always be parenthesized.

The notion of \textquotedblleft unit\textquotedblright\ we have just defined
generalizes the units of $\mathbb{Z}\left[  i\right]  $. Don't confuse
\textquotedblleft unit\textquotedblright\ (= invertible element) with
\textquotedblleft unity\textquotedblright\ (= $1_{\mathbb{K}}$). The unity is
always a unit (by Exercise \ref{exe.rings.inv-mul.rules} \textbf{(a)} further
below), but often not the only unit.

Definition \ref{def.rings.inv-mul-a} \textbf{(c)} generalizes the usual
meaning of $a/b$ in $\mathbb{Q}$, $\mathbb{R}$ and $\mathbb{C}$.

Please do not use Definition \ref{def.rings.inv-mul-a} \textbf{(c)} when
$\mathbb{K}$ is not commutative; that would cause confusion, since $ab^{-1}$
and $b^{-1}a$ would have equal rights to the name \textquotedblleft$\dfrac
{a}{b}$\textquotedblright.

If $\mathbb{K}=\mathbb{Z}/n$ for a positive integer $n$, and if $\alpha
\in\mathbb{K}$, then the multiplicative inverse of $\alpha$ is the same as an
inverse of $\alpha$ (as defined in Definition \ref{def.equiv.modinv.inverse}).
Thus, multiplicative inverses in arbitrary rings generalize the concept of
inverses in $\mathbb{Z}/n$. Likewise, they generalize inverses in $\mathbb{C}%
$; that is, an inverse of a complex number $\alpha\in\mathbb{C}$ (as defined
in Definition \ref{def.CC.CC.inverse.inverse}) is the same as a multiplicative
inverse of $\alpha$.

Again, it is not hard to check that multiplicative inverses and division have
the properties you would hope them to have:

\begin{exercise}
\label{exe.rings.inv-mul.rules}Prove the following:

\textbf{(a)} The element $1_{\mathbb{K}}$ of $\mathbb{K}$ is always invertible.

\textbf{(b)} The element $-1_{\mathbb{K}}$ of $\mathbb{K}$ is always
invertible. (Note that $-1_{\mathbb{K}}$ is not always distinct from
$1_{\mathbb{K}}$.)

\textbf{(c)} Let $a\in\mathbb{K}$ be invertible. Then, its inverse $a^{-1}$ is
invertible as well, and its inverse is $\left(  a^{-1}\right)  ^{-1}=a$.

\textbf{(d)} Let $a,b\in\mathbb{K}$ be invertible. Then, their product $ab$ is
invertible as well, and its inverse is $\left(  ab\right)  ^{-1}=b^{-1}a^{-1}%
$. (Mind the order of multiplication: it is $b^{-1}a^{-1}$, not $a^{-1}b^{-1}$.)

\textbf{(e)} Assume that $\mathbb{K}$ is commutative. Let $a,b,c,d\in
\mathbb{K}$ be such that $b$ and $d$ are invertible. Then,
\[
a/b+c/d=\left(  ad+bc\right)  /\left(  bd\right)
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(  a/b\right)  \left(
c/d\right)  =\left(  ac\right)  /\left(  bd\right)  .
\]

\end{exercise}

Some rings have many invertible elements (such as $\mathbb{Q}$, where each
nonzero element is invertible), while others have few (such as $\mathbb{Z}$,
whose only invertible elements are $1$ and $-1$). The extreme case on the
former end is called a \textit{skew field} or a \textit{field}, depending on
its commutativity:

\begin{definition}
\label{def.field.field}\textbf{(a)} An element $a\in\mathbb{K}$ is said to be
\textit{nonzero} if $a\neq0$. (Here, of course, $0$ means the zero of
$\mathbb{K}$.)

\textbf{(b)} We say that $\mathbb{K}$ is a \textit{skew field} if $0\neq1$ in
$\mathbb{K}$ and if every nonzero $a\in\mathbb{K}$ is invertible. (Here,
\textquotedblleft$0\neq1$ in $\mathbb{K}$\textquotedblright\ means
\textquotedblleft$0_{\mathbb{K}}\neq1_{\mathbb{K}}$\textquotedblright; we are
clearly not requiring the \textbf{integers} $0$ and $1$ to be distinct.)

\textbf{(c)} We say that $\mathbb{K}$ is a \textit{field} if $\mathbb{K}$ is a
commutative skew field.
\end{definition}

The condition \textquotedblleft$0\neq1$ in $\mathbb{K}$\textquotedblright\ has
been made to rule out an annoying exception. It is easy to see that if a ring
$\mathbb{K}$ satisfies $0=1$ in $\mathbb{K}$, then it has only one element (to
wit: any $a\in\mathbb{K}$ must satisfy $a=\underbrace{1}_{=0}\cdot a=0\cdot
a=0$), which entails that $\mathbb{K}$ is the zero ring (up to relabeling of
its element $0$). We do not want the zero ring to count as a skew
field\footnote{just as we don't want the number $1$ to count as a prime}; thus
we require $0\neq1$ in $\mathbb{K}$ in Definition \ref{def.field.field}.

Some authors call skew fields \textit{division rings}.

\begin{fineprint}
\begin{remark}
\label{rmk.field.constr-def}If you work in
\href{https://en.wikipedia.org/wiki/Intuitionistic_logic}{constructive logic},
you will want to replace the condition%
\begin{equation}
\text{\textquotedblleft every nonzero }a\in\mathbb{K}\text{ is
invertible\textquotedblright} \label{eq.rmk.field.constr-def.class}%
\end{equation}
in Definition \ref{def.field.field} \textbf{(b)} by the stronger condition%
\begin{equation}
\text{\textquotedblleft every }a\in\mathbb{K}\text{ equals }0_{\mathbb{K}%
}\text{ or is invertible\textquotedblright.}
\label{eq.rmk.field.constr-def.cons}%
\end{equation}
While the condition (\ref{eq.rmk.field.constr-def.cons}) is clearly equivalent
to (\ref{eq.rmk.field.constr-def.class}) in classical logic, it is stronger in
constructive logic, because it can be applied to any $a\in\mathbb{K}$ that is
not a-priori known to be either zero or nonzero (whereas
(\ref{eq.rmk.field.constr-def.class}) requires $a$ to be known to be nonzero,
which is too burdensome a requirement to make it useful in constructive logic).
\end{remark}
\end{fineprint}

\begin{example}
\label{exa.field.fields}\textbf{(a)} The rings $\mathbb{Q}$, $\mathbb{R}$ and
$\mathbb{C}$ are fields.

\begin{fineprint}
If you work in constructive logic, then you cannot prove that $\mathbb{R}$ and
$\mathbb{C}$ are fields, because constructively there is no way to tell
whether a real number is $0$ or not. This is not a big issue for us, since we
never truly use $\mathbb{R}$ and $\mathbb{C}$ in these notes (and when we do,
we can replace them by smaller subrings of $\mathbb{C}$ that can be shown to
be fields constructively -- such as the Gaussian rationals).
\end{fineprint}

\textbf{(b)} The rings $\mathbb{Z}$, $\mathbb{Z}\left[  i\right]  $ and
$\mathbb{Z}\left[  \sqrt{2}\right]  $ are not fields (since, for example, $2$
is not invertible in any of these rings). However, $\mathbb{Z}\left[
i\right]  $ and $\mathbb{Z}\left[  \sqrt{2}\right]  $ would become fields if
we had used $\mathbb{Q}$ instead of $\mathbb{Z}$ in their definitions.

\textbf{(c)} The polynomial ring $\mathbb{Z}\left[  x\right]  $ (which we will
formally define in Chapter \ref{chp.pol}) is not a field (since, for example,
$x$ is not invertible in it). There is a way to get a field out of it,
similarly to how $\mathbb{Q}$ is obtained from $\mathbb{Z}$. (This leads to
the so-called
\textit{\href{https://en.wikipedia.org/wiki/Rational_function}{\textit{rational
functions}}}.)

\textbf{(d)} Recall the commutative ring $\mathbb{Q}^{\mathbb{Q}}$; the
elements of this ring are functions from $\mathbb{Q}$ to $\mathbb{Q}$, and the
operations $+$ and $\cdot$ are defined pointwise. Is this ring a field?

Let us see what the multiplicative inverse of a function $f\in\mathbb{Q}%
^{\mathbb{Q}}$ is. If $f,g\in\mathbb{Q}^{\mathbb{Q}}$ are two functions, then
we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  g\text{ is the multiplicative inverse of }f\right) \\
&  \Longleftrightarrow\ \left(  fg=gf=1_{\mathbb{Q}^{\mathbb{Q}}}\right) \\
&  \Longleftrightarrow\ \left(  \left(  fg\right)  \left(  x\right)  =\left(
gf\right)  \left(  x\right)  =1_{\mathbb{Q}^{\mathbb{Q}}}\left(  x\right)
\text{ for all }x\in\mathbb{Q}\right) \\
&  \Longleftrightarrow\ \left(  f\left(  x\right)  \cdot g\left(  x\right)
=g\left(  x\right)  \cdot f\left(  x\right)  =1\text{ for all }x\in
\mathbb{Q}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }x\in\mathbb{Q}\text{ satisfies }\left(  fg\right)  \left(
x\right)  =f\left(  x\right)  \cdot g\left(  x\right) \\
\text{and }\left(  gf\right)  \left(  x\right)  =g\left(  x\right)  \cdot
f\left(  x\right)  \text{ and }1_{\mathbb{Q}^{\mathbb{Q}}}\left(  x\right)  =1
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  g\left(  x\right)  =\dfrac{1}{f\left(
x\right)  }\text{ for all }x\in\mathbb{Q}\right)  .
\end{align*}
(Note that this is \textbf{not} the same as saying that $f$ and $g$ are
inverse maps! The multiplication of $\mathbb{Q}^{\mathbb{Q}}$ is not given by
composition of maps.)

This shows that a function $f\in\mathbb{Q}^{\mathbb{Q}}$ is invertible in
$\mathbb{Q}^{\mathbb{Q}}$ if and only if it never takes the value $0$ (because
its multiplicative inverse $g$ would have to satisfy $g\left(  x\right)
=\dfrac{1}{f\left(  x\right)  }$ for all $x\in\mathbb{Q}$). But a function
$f\in\mathbb{Q}^{\mathbb{Q}}$ can be $0$ at some point and $\neq0$ at another.
Then, it is not invertible (since it is $0$ at some point) yet nonzero (since
it is $\neq0$ at another). For example, the function $\operatorname*{id}%
\in\mathbb{Q}^{\mathbb{Q}}$ is not invertible yet nonzero. Thus,
$\mathbb{Q}^{\mathbb{Q}}$ is not a field.

\textbf{(e)} The ring $\mathbb{Q}^{2\times2}$ of $2\times2$-matrices with
rational entries is not a skew field. Indeed, the $2\times2$-matrix $\left(
\begin{array}
[c]{cc}%
1 & 0\\
1 & 0
\end{array}
\right)  $ is nonzero but not invertible. (More generally: For each
$n\in\mathbb{N}$, the $n\times n$-matrices over $\mathbb{Q}$ form a ring,
which we will study later. Our notion of \textquotedblleft
invertible\textquotedblright\ for elements of this ring coincides with the
usual notion of \textquotedblleft invertible\textquotedblright\ for $n\times
n$-matrices in linear algebra.)
\end{example}

What about $\mathbb{Z}/n$ ?

\begin{theorem}
\label{thm.field.Z/n}Let $n$ be a positive integer. The ring $\mathbb{Z}/n$ is
a field if and only if $n$ is prime.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.field.Z/n}.]$\Longleftarrow:$ Assume that $n$ is
prime. We must prove that $\mathbb{Z}/n$ is a field.

First of all, $n>1$ (since $n$ is prime). Thus, $n\nmid1$, so that
$1\not \equiv 0\operatorname{mod}n$, so that $0\not \equiv 1\operatorname{mod}%
n$. In other words, $\left[  0\right]  _{n}\neq\left[  1\right]  _{n}$. In
other words, $0\neq1$ in $\mathbb{Z}/n$ (since $0_{\mathbb{Z}/n}=\left[
0\right]  _{n}$ and $1_{\mathbb{Z}/n}=\left[  1\right]  _{n}$).

Also, the ring $\mathbb{Z}/n$ is commutative.

So it remains to prove that every nonzero $\alpha\in\mathbb{Z}/n$ is
invertible (because then, we will immediately conclude that $\mathbb{Z}/n$ is
a skew field and therefore a field).

Indeed, let $\alpha\in\mathbb{Z}/n$ be nonzero. We must prove that $\alpha$ is invertible.

Proposition \ref{prop.eqrel.Z/n.PR} \textbf{(b)} shows that there exists a
unique $a\in\left\{  0,1,\ldots,n-1\right\}  $ satisfying $\alpha=\left[
a\right]  _{n}$. Consider this $a$. If we had $a=0$, then $\alpha=\left[
a\right]  _{n}$ would become $\alpha=\left[  0\right]  _{n}=0_{\mathbb{Z}/n}$,
which would contradict the assumption that $\alpha$ is nonzero. So $a\neq0$.
Thus, $a\in\left\{  1,2,\ldots,n-1\right\}  $ (since $a\in\left\{
0,1,\ldots,n-1\right\}  $). Hence, Proposition
\ref{prop.ent.prime.each-i-coprime} (applied to $i=a$ and $p=n$) shows that
$a$ is coprime to $n$. In other words, $a\perp n$.

Now, define a set $U_{n}$ as in Corollary \ref{cor.equiv.modinv.Unphi}. Then,
Corollary \ref{cor.equiv.modinv.Unphi} \textbf{(a)} yields $\left[  a\right]
_{n}\in U_{n}$ (since $a\perp n$). In other words, $\left[  a\right]  _{n}$
has an inverse (by the definition of $U_{n}$). In other words, $\alpha$ has an
inverse (since $\alpha=\left[  a\right]  _{n}$). In other words, $\alpha$ has
a multiplicative inverse (because inverses in $\mathbb{Z}/n$ are precisely
what we now call multiplicative inverses). In other words, $\alpha$ is
invertible. So we have proven the \textquotedblleft$\Longleftarrow
$\textquotedblright\ direction of Theorem \ref{thm.field.Z/n}.

$\Longrightarrow:$ Rough idea: Assume that $\mathbb{Z}/n$ is a field. We must
prove that $n$ is a prime. Assume the contrary.

We have $0\neq1$ in $\mathbb{Z}/n$ (since $\mathbb{Z}/n$ is a field); in other
words, $0\not \equiv 1\operatorname{mod}n$. Hence, $n\neq1$, so that $n>1$
(since $n$ is a positive integer). Hence, there must exist two elements
$d,e\in\left\{  1,2,\ldots,n-1\right\}  $ such that $n=de$ (since $n$ is not a
prime). Consider these $d$ and $e$. Theorem \ref{thm.eqrel.Z/n.explicit} shows
that the $n$ residue classes $\left[  0\right]  _{n},\left[  1\right]
_{n},\ldots,\left[  n-1\right]  _{n}$ are distinct. Hence, the residue classes
$\left[  d\right]  _{n}$ and $\left[  e\right]  _{n}$ are nonzero (since
$d,e\in\left\{  1,2,\ldots,n-1\right\}  $ are distinct from $0$). Thus, these
two residue classes are invertible (since $\mathbb{Z}/n$ is a field). Thus, by
Exercise \ref{exe.rings.inv-mul.rules} \textbf{(d)}, their product $\left[
d\right]  _{n}\left[  e\right]  _{n}$ is invertible as well. But this product
is $\left[  d\right]  _{n}\left[  e\right]  _{n}=\left[  de\right]
_{n}=\left[  n\right]  _{n}=\left[  0\right]  _{n}=0_{\mathbb{Z}/n}$, which is
not invertible. Contradiction. Thus, the \textquotedblleft$\Longrightarrow
$\textquotedblright\ direction of Theorem \ref{thm.field.Z/n} is proven.
\end{proof}

\begin{teachingnote}
\textbf{2019-04-01 lecture}
\end{teachingnote}

It is tricky to find a skew field that is not a field. Here is the simplest
example of such a skew field:

\begin{example}
\label{exa.ring.H}Informally, we have obtained $\mathbb{C}$ from $\mathbb{R}$
by throwing in a new number $i$ that satisfies $i^{2}=-1$. In order for $i$
not to feel alone, let us introduce yet another new \textquotedblleft
number\textquotedblright\ $j$ such that $j^{2}=-1$ and $ji=-ij$. Now we try to
calculate with these $i$ and $j$. Of course, $i$ and $j$ cannot belong to a
commutative ring together, but let us assume that they (and the further
numbers we obtain from them) at least satisfy the ring axioms.

We have%
\begin{align*}
i\cdot ij  &  =\underbrace{ii}_{=i^{2}=-1}j=\left(  -1\right)
j=-j\ \ \ \ \ \ \ \ \ \ \text{and}\\
j\cdot ij  &  =\underbrace{ji}_{=-ij}j=-i\underbrace{jj}_{=j^{2}=-1}=-i\left(
-1\right)  =i\ \ \ \ \ \ \ \ \ \ \text{and}\\
ij\cdot ij  &  =i\underbrace{ji}_{=-ij}j=-\underbrace{ii}_{=i^{2}%
=-1}\underbrace{jj}_{=j^{2}=-1}=-\left(  -1\right)  \left(  -1\right)  =-1
\end{align*}
and (using the distributivity laws)%
\begin{align*}
\left(  1+2i+3ij\right)  \left(  2-3j\right)   &
=2+4i+6ij-3j-6ij-9i\underbrace{j^{2}}_{=-1}\\
&  =2+4i-3j+9i=2+13i-3j.
\end{align*}
Similarly, any of these new \textquotedblleft numbers\textquotedblright\ can
be written in the form $a+bi+cj+dij$ for reals $a,b,c,d$.

Blithely introducing new \textquotedblleft numbers\textquotedblright\ like
this can be risky. It could happen that (just as with defining $\infty$ to be
$\dfrac{1}{0}$) our new numbers would lead to contradictions. For example,
what if we have some expression that involves $i$ and $j$ and that can be
simplified to $0$ in one way and simplified to $1$ in another; would that mean
that $0=1$ ? No; it would simply mean that the new \textquotedblleft
numbers\textquotedblright\ we have introduced do not actually exist. (Or,
speaking more abstractly: that the new numbers are just the zero ring in a
complicated disguise.)

So it makes sense to look for a rigorous definition of our new numbers. There
is a direct (though rather painful) way of doing this: We can rigorously
define our new numbers as $4$-tuples $\left(  a,b,c,d\right)  $ of real
numbers, with addition and subtraction defined entrywise, and with
multiplication given by%
\begin{align*}
&  \left(  x_{1},x_{2},x_{3},x_{4}\right)  \cdot\left(  y_{1},y_{2}%
,y_{3},y_{4}\right) \\
&  =\left(  x_{1}y_{1}-x_{2}y_{2}-x_{3}y_{3}-x_{4}y_{4},x_{1}y_{2}+x_{2}%
y_{1}+x_{3}y_{4}-x_{4}y_{3},\right. \\
&  \ \ \ \ \ \ \ \ \ \ \left.  x_{1}y_{3}-x_{2}y_{4}+x_{3}y_{1}+x_{4}%
y_{2},x_{1}y_{4}+x_{2}y_{3}-x_{3}y_{2}+x_{4}y_{1}\right)  .
\end{align*}
(The $4$-tuple $\left(  a,b,c,d\right)  $ is a rigorous model for the
\textquotedblleft number\textquotedblright\ $a+bi+cj+dij$.)

These new numbers are known as
\href{https://en.wikipedia.org/wiki/Quaternion}{the \textit{quaternions}}. It
turns out that they form a skew field, albeit not a field (since commutativity
is lacking). They have several properties that make them useful in physics and
space geometry. For one, they encode both the dot product and the cross
product of two vectors in $\mathbb{R}^{3}$: Namely, if $\mathbf{a}=\left(
\begin{array}
[c]{c}%
a_{1}\\
a_{2}\\
a_{3}%
\end{array}
\right)  \in\mathbb{R}^{3}$ and $\mathbf{b}=\left(
\begin{array}
[c]{c}%
b_{1}\\
b_{2}\\
b_{3}%
\end{array}
\right)  \in\mathbb{R}^{3}$ are two vectors, then the quaternion%
\begin{align*}
&  \left(  0,a_{1},a_{2},a_{3}\right)  \cdot\left(  0,b_{1},b_{2},b_{3}\right)
\\
&  =\left(  \underbrace{-a_{1}b_{1}-a_{2}b_{2}-a_{3}b_{3}}%
_{\substack{=-\mathbf{a}\cdot\mathbf{b}\\\text{(where }\cdot\text{ stands
for}\\\text{the dot product)}}},\underbrace{a_{2}b_{3}-a_{3}b_{2},a_{3}%
b_{1}-a_{1}b_{3},a_{1}b_{2}-a_{2}b_{1}}_{\substack{\text{the three
coordinates}\\\text{of the cross product }\mathbf{a}\times\mathbf{b}}}\right)
.
\end{align*}
Also,
\href{https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation}{the
quaternions can be used to encode rotations in 3-dimensional space} (see,
e.g., \cite{Jia13}).
\end{example}

\begin{exercise}
\label{exe.field.xy=0}Let $\mathbb{K}$ be a skew field. Let $x,y\in\mathbb{K}$
satisfy $xy=0$. (Here, of course, \textquotedblleft$0$\textquotedblright%
\ means the zero of $\mathbb{K}$.) Prove that $x=0$ or $y=0$.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.field.xy=0}.]Assume the contrary. Thus, neither
$x=0$ nor $y=0$. In other words, we have $x\neq0$ and $y\neq0$.

We know that $\mathbb{K}$ is a skew field. Thus, every nonzero $a\in
\mathbb{K}$ is invertible (by the definition of a skew field).

The element $x$ of $\mathbb{K}$ is nonzero (since $x\neq0$) and thus
invertible (since every nonzero $a\in\mathbb{K}$ is invertible). Hence, its
inverse $x^{-1}$ exists. Comparing $x^{-1}\underbrace{xy}_{=0}=x^{-1}0=0$ with
$\underbrace{x^{-1}x}_{=1}y=1y=y$, we obtain $y=0$; this contradicts $y\neq0$.
This contradiction shows that our assumption was false. Hence, Exercise
\ref{exe.field.xy=0} is solved.
\end{proof}
\end{fineprint}

\begin{exercise}
\label{exe.ring.invertible.indirect}Let $\mathbb{K}$ be a ring. Let
$a,b,c\in\mathbb{K}$ be such that $ab=1$ and $bc=1$. Prove that the element
$b$ is invertible and its multiplicative inverse satisfies $b^{-1}=a=c$.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ring.invertible.indirect}.]Comparing
$abc=\underbrace{\left(  ab\right)  }_{=1}c=c$ with $abc=a\underbrace{\left(
bc\right)  }_{=1}=a$, we obtain $a=c$. Furthermore, $a$ is a multiplicative
inverse of $b$ (since $ab=1$ and $b\underbrace{a}_{=c}=bc=1$). Thus, the
element $b$ has a multiplicative inverse, i.e., is invertible. Furthermore, we
have $b^{-1}=a$ (since $a$ is a multiplicative inverse of $b$), thus
$b^{-1}=a=c$. This solves Exercise \ref{exe.ring.invertible.indirect}.
\end{proof}
\end{fineprint}

\subsection{\label{sect.ring.hunting1}Hunting for finite fields I}

\begin{definition}
\label{def.ring.size}\textbf{(a)} The \textit{ground set} of a ring $\left(
\mathbb{K},+,\cdot,0,1\right)  $ is defined to be the set $\mathbb{K}$.

\textbf{(b)} The \textit{elements} of a ring are defined to be the elements of
its ground set.

\textbf{(c)} The \textit{size} (or \textit{cardinality}) of a ring is defined
to be the size of its ground set.

\textbf{(d)} A ring is said to be \textit{finite} if its size is finite (i.e.,
if it has only finitely many elements).

\textbf{(e)} A ring is said to be \textit{trivial} if its size is $1$.
\end{definition}

We have seen a bunch of finite rings. For example, if $S$ is a finite set,
then the commutative ring $\left(  \mathcal{P}\left(  S\right)
,\bigtriangleup,\cap,\varnothing,S\right)  $ (which was constructed in one of
the examples in Section \ref{sect.ring.exa}) has size $\left\vert
\mathcal{P}\left(  S\right)  \right\vert =2^{\left\vert S\right\vert }$, and
thus is finite.

We also have seen infinitely many finite fields:%
\[
\mathbb{Z}/2,\ \ \ \ \ \ \ \ \ \ \mathbb{Z}/3,\ \ \ \ \ \ \ \ \ \ \mathbb{Z}%
/5,\ \ \ \ \ \ \ \ \ \ \mathbb{Z}/7,\ \ \ \ \ \ \ \ \ \ \mathbb{Z}%
/11,\ \ \ \ \ \ \ \ \ \ \ldots
\]
Indeed, Theorem \ref{thm.field.Z/n} yields that $\mathbb{Z}/p$ is a finite
field whenever $p$ is a prime.

\begin{question}
\label{quest.finfield.nonprime}Are there any further finite fields?
\end{question}

\begin{remark}
\label{rmk.finfield.shamir1}Why do we care?

Recall Shamir's Secret Sharing Scheme, which we introduced in Subsection
\ref{subsect.intro.shamir.k=3}. The way we defined the Scheme, it had a
problem: It relied on a spurious notion of a \textquotedblleft uniformly
random rational number\textquotedblright, which does not exist in nature. Now
we can fix this problem: Replace rational numbers by elements of a finite
field. More precisely, let $N$ again be the length of the bitstring that we
want to encrypt. Pick a prime $p$ that satisfies both $p\geq2^{N}$ and $p>n$;
this exists due to Theorem \ref{thm.ent.prime.infin}. Now, use elements of the
finite field $\mathbb{Z}/p$ instead of integers. (Thus, a bitstring
$a_{N-1}a_{N-2}\cdots a_{0}$ will be encoded as the residue class $\left[
a_{N-1}\cdot2^{N-1}+a_{N-2}\cdot2^{N-2}+\cdots+a_{0}\cdot2^{0}\right]  _{p}%
\in\mathbb{Z}/p$ rather than as the number $a_{N-1}\cdot2^{N-1}+a_{N-2}%
\cdot2^{N-2}+\cdots+a_{0}\cdot2^{0}\in\mathbb{Z}$. This encoding can be
uniquely decoded, because $p\geq2^{N}$.) Instead of picking two uniformly
random bitstrings $\mathbf{c}$ and $\mathbf{b}$ and transforming them into
numbers $c$ and $b$, just pick two uniformly random residue classes
$c,b\in\mathbb{Z}/p$. (This is possible, since $\mathbb{Z}/p$ is a finite set.)

This relies on having a well-behaved notion of polynomials over $\mathbb{Z}%
/p$, which should satisfy the obvious analogue of Proposition
\ref{prop.intro.shamir.quadpol} (with \textquotedblleft
numbers\textquotedblright\ replaced by \textquotedblleft elements of
$\mathbb{Z}/p$\textquotedblright). We will give a rigorous definition of this
notion in Chapter \ref{chp.pol}.

Finite fields have many uses -- not just in making Shamir's Secret Sharing
Scheme work. One great source of applications is \textit{coding theory}, which
we will briefly encounter in Subsection \ref{subsect.pol.id.app-RS}.
\end{remark}

Let us take some first steps towards addressing Question
\ref{quest.finfield.nonprime}. We have found a field of size $p$ for each
prime $p$. Are there fields of other finite sizes? Let us first focus on the
probably simplest case beyond $\mathbb{Z}/p$: Given a prime $p$, can we
construct a field of size $p^{2}$ ?

\textbf{First idea:} Let us try to get such a field by \textquotedblleft
duplicating\textquotedblright\ the known field $\mathbb{Z}/p$. Thus, we fix a
prime $p$, and consider the Cartesian product $\left(  \mathbb{Z}/p\right)
\times\left(  \mathbb{Z}/p\right)  $. Define addition, subtraction and
multiplication on this Cartesian product entrywise\footnote{That is,%
\begin{align*}
\left(  a,b\right)  +\left(  c,d\right)   &  =\left(  a+c,b+d\right)  ;\\
\left(  a,b\right)  -\left(  c,d\right)   &  =\left(  a-c,b-d\right)  ;\\
\left(  a,b\right)  \left(  c,d\right)   &  =\left(  ac,bd\right)
\end{align*}
for all $\left(  a,b\right)  ,\left(  c,d\right)  \in\left(  \mathbb{Z}%
/p\right)  \times\left(  \mathbb{Z}/p\right)  $.}. This will yield a
commutative ring with zero $\left(  \left[  0\right]  _{p},\left[  0\right]
_{p}\right)  $ and unity $\left(  \left[  1\right]  _{p},\left[  1\right]
_{p}\right)  $.

However, the element $\left(  \left[  0\right]  _{p},\left[  1\right]
_{p}\right)  $ of this ring is nonzero (because it is not $\left(  \left[
0\right]  _{p},\left[  0\right]  _{p}\right)  $) but has no inverse (since
multiplying it by anything will never make its first entry anything other than
$\left[  0\right]  _{p}$). So this ring is not a field.

(This is not a useless construction -- we will see it in greater generality in
Section \ref{sect.ring.cart-prod} below. But it does not help us find new fields.)

\textbf{Second idea:} We obtained $\mathbb{C}$ from $\mathbb{R}$ by
\textquotedblleft adjoining\textquotedblright\ a square root of $-1$. (In
abstract algebra, the verb \textquotedblleft adjoin\textquotedblright\ means
\textquotedblleft insert\textquotedblright\ or \textquotedblleft
add\textquotedblright\ -- not in the sense of the addition operation $+$, but
in the sense of throwing in something new into an existing collection.)

Let us try to do this with $\mathbb{Z}/p$ instead of $\mathbb{R}$.

More generally, let us start with an arbitrary commutative ring $\mathbb{K}$,
and try to \textquotedblleft adjoin\textquotedblright\ a square root of $-1$
to it. We are bold and don't care whether there might already be such a square
root in $\mathbb{K}$; if there is, then we will get a second one!

Let $0$ and $1$ stand for the zero and the unity of $\mathbb{K}$. If
$\mathbb{K}=\mathbb{Z}/n$ for some integer $n$, then these are the residue
classes $\left[  0\right]  _{n}$ and $\left[  1\right]  _{n}$.

Now, we want to define a new commutative ring $\mathbb{K}^{\prime}$ by
\textquotedblleft adjoining\textquotedblright\ a square root of $-1$ to
$\mathbb{K}$. A way to make this rigorous is as follows (just as we defined
$\mathbb{C}$ rigorously in Definition \ref{def.CC.CC}):

\begin{definition}
\label{def.finfield.K'}Let $\mathbb{K}$ be a commutative ring.

\textbf{(a)} Let $\mathbb{K}^{\prime}$ be the set of all pairs $\left(
a,b\right)  \in\mathbb{K}\times\mathbb{K}$.

\textbf{(b)} For each $r\in\mathbb{K}$, we denote the pair $\left(
r,0\right)  \in\mathbb{K}^{\prime}$ by $r_{\mathbb{K}^{\prime}}$. We identify
$r\in\mathbb{K}$ with $r_{\mathbb{K}^{\prime}}=\left(  r,0\right)
\in\mathbb{K}^{\prime}$, so that $\mathbb{K}$ becomes a subset of
$\mathbb{K}^{\prime}$.

\textbf{(c)} We let $i$ be the pair $\left(  0,1\right)  \in\mathbb{K}%
^{\prime}$.

\textbf{(d)} We define three binary operations $+$, $-$ and $\cdot$ on
$\mathbb{K}^{\prime}$ by setting%
\begin{align*}
\left(  a,b\right)  +\left(  c,d\right)   &  =\left(  a+c,b+d\right)  ,\\
\left(  a,b\right)  -\left(  c,d\right)   &  =\left(  a-c,b-d\right)
,\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  a,b\right)  \cdot\left(  c,d\right)   &  =\left(  ac-bd,ad+bc\right)
\end{align*}
for all $\left(  a,b\right)  \in\mathbb{K}^{\prime}$ and $\left(  c,d\right)
\in\mathbb{K}^{\prime}$.

\textbf{(e)} If $\alpha,\beta\in\mathbb{K}^{\prime}$, then we write
$\alpha\beta$ for $\alpha\cdot\beta$.
\end{definition}

You will, of course, recognize this definition to be a calque of Definition
\ref{def.CC.CC} with $\mathbb{R}$ and $\mathbb{C}$ replaced by $\mathbb{K}$
and $\mathbb{K}^{\prime}$. The elements of $\mathbb{K}^{\prime}$ are like
complex numbers, but built upon $\mathbb{K}$ instead of $\mathbb{R}$.

\begin{proposition}
\label{prop.finfield.K'.cring}\textbf{(a)} The set $\mathbb{K}^{\prime}$
defined in Definition \ref{def.finfield.K'} (equipped with the operations $+$
and $\cdot$ and the elements $0_{\mathbb{K}^{\prime}}$ and $1_{\mathbb{K}%
^{\prime}}$) is a commutative ring. Its subtraction is the binary operation
$-$ defined in Definition \ref{def.finfield.K'} \textbf{(d)}.

\textbf{(b)} Furthermore, the ring $\mathbb{K}$ is a subring of $\mathbb{K}%
^{\prime}$ (where we regard $\mathbb{K}$ as a subset of $\mathbb{K}^{\prime}$
as explained in Definition \ref{def.finfield.K'} \textbf{(b)}).
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.finfield.K'.cring}.]\textbf{(a)} Same argument
as we did for $\mathbb{C}$ in the proof of Theorem \ref{thm.CC.CC.rules}.

\textbf{(b)} This is straightforward to check.
\end{proof}

\begin{convention}
For the rest of this section, we let $\mathbb{K}^{\prime}$ be the commutative
ring constructed in Proposition \ref{prop.finfield.K'.cring} (i.e., the set
$\mathbb{K}^{\prime}$ equipped with the operations $+$ and $\cdot$ and the
elements $0_{\mathbb{K}^{\prime}}$ and $1_{\mathbb{K}^{\prime}}$).
\end{convention}

Thus, if $\mathbb{K}=\mathbb{Z}/p$, then $\mathbb{K}^{\prime}$ is a
commutative ring with $p^{2}$ elements.

\begin{question}
When is $\mathbb{K}^{\prime}$ is a field?
\end{question}

Assume that $0\neq1$ in $\mathbb{K}$; thus, $0\neq1$ in $\mathbb{K}^{\prime}$
as well (since $0_{\mathbb{K}^{\prime}}=\left(  0,0\right)  \neq\left(
1,0\right)  =1_{\mathbb{K}^{\prime}}$). Hence, in order for $\mathbb{K}%
^{\prime}$ to be a field, every nonzero $\xi\in\mathbb{K}^{\prime}$ needs to
have a multiplicative inverse. Thus, in particular, every nonzero element of
$\mathbb{K}$ must have a multiplicative inverse in $\mathbb{K}^{\prime}$. It
is easy to see that such an inverse, if it exists, must belong to $\mathbb{K}$
as well (i.e., it must have the form $r_{\mathbb{K}^{\prime}}$ for some
$r\in\mathbb{K}$); thus, this means that every nonzero element of $\mathbb{K}$
must have a multiplicative inverse in $\mathbb{K}$. In other words,
$\mathbb{K}$ itself must be a field.

Thus, we assume from now on that $\mathbb{K}$ is a field. But we are not done
yet. It is definitely not always true that $\mathbb{K}^{\prime}$ is a field.
For example, if $\mathbb{K}=\mathbb{Z}/2$, then the element $\left(
1,1\right)  $ of $\mathbb{K}^{\prime}$ has no inverse (check this!), and so
$\mathbb{K}^{\prime}$ is not a field in this case. What must $\mathbb{K}$
satisfy in order for $\mathbb{K}^{\prime}$ to be a field?

We know what it must satisfy: The condition is that every nonzero $\xi
\in\mathbb{K}^{\prime}$ has a multiplicative inverse. We just need to see when
this condition holds.

So let $\xi=\left(  x,y\right)  \in\mathbb{K}^{\prime}$ (with $x,y\in
\mathbb{K}$) be nonzero. Thus, $\left(  x,y\right)  \neq\left(  0,0\right)  $.

How to find $\xi^{-1}$ ? Notice that $\xi=\left(  x,y\right)  =x+yi$ (this is
proven just as for complex numbers). Thus, you can try to compute $\xi^{-1}$
by rationalizing the denominator (just as we learned to divide complex
numbers):%
\[
\dfrac{1}{\xi}=\dfrac{1}{x+yi}=\dfrac{x-yi}{\left(  x+yi\right)  \left(
x-yi\right)  }=\dfrac{x-yi}{x^{2}+y^{2}}%
\]
(since $\left(  x+yi\right)  \left(  x-yi\right)  =\left(  x,y\right)  \left(
x,-y\right)  =\left(  x^{2}+y^{2},0\right)  $, as you can easily see using the
definition of $\cdot$ on $\mathbb{K}^{\prime}$).

We need $x^{2}+y^{2}\neq0$ in $\mathbb{K}$ for this to work. In other words,
we need the following condition to hold:

\begin{statement}
\textit{Condition 1:} For every pair $\left(  x,y\right)  \in\mathbb{K}%
\times\mathbb{K}$ satisfying $\left(  x,y\right)  \neq\left(  0,0\right)  $,
we have $x^{2}+y^{2}\neq0$ in $\mathbb{K}$.
\end{statement}

Thus, $\mathbb{K}^{\prime}$ is a field if Condition 1 holds. Conversely, if
$\mathbb{K}^{\prime}$ is a field, then Condition 1 holds (because if $\left(
x,y\right)  \in\mathbb{K}\times\mathbb{K}$ satisfies $\left(  x,y\right)
\neq\left(  0,0\right)  $, then $\left(  x,y\right)  \left(  x,-y\right)
=\left(  x^{2}+y^{2},0\right)  $ would have to be $\neq\left(  0,0\right)  $
in order for $\mathbb{K}^{\prime}$ to be a field\footnote{by Exercise
\ref{exe.field.xy=0}}). So $\mathbb{K}^{\prime}$ is a field if and only if
Condition 1 holds.

If $\mathbb{K}=\mathbb{Z}/p$ for some prime $p$, then Condition 1 can be
restated as follows:

\begin{statement}
\textit{Condition 1':} For every pair $\left(  x,y\right)  \in\left(
\mathbb{Z}/p\right)  \times\left(  \mathbb{Z}/p\right)  $ satisfying $\left(
x,y\right)  \neq\left(  0,0\right)  $, we have $x^{2}+y^{2}\neq0$ in
$\mathbb{Z}/p$.
\end{statement}

We can further restate Condition 1' in terms of integers by replacing the
residue classes $x$ and $y$ with their representatives $a$ and $b$:

\begin{statement}
\textit{Condition 2:} For every pair $\left(  a,b\right)  \in\mathbb{Z}%
\times\mathbb{Z}$ such that \textbf{not both} $a$ and $b$ are divisible by
$p$, the sum $a^{2}+b^{2}$ is not divisible by $p$.
\end{statement}

So the ring $\mathbb{K}^{\prime}$ constructed from $\mathbb{K}=\mathbb{Z}/p$
is a field if and only if Condition 2 holds. When does Condition 2 hold?

\begin{example}
Let $\mathbb{K}=\mathbb{Z}/p$.

\textbf{(a)} If $p=2$, then Condition 2 fails for $\left(  a,b\right)
=\left(  1,1\right)  $. So $\mathbb{K}^{\prime}$ is not a field for $p=2$.

\textbf{(b)} If $p=3$, then Condition 2 holds. So $\mathbb{K}^{\prime}$ is a
field for $p=3$. Thus we have found a field with $3^{2}=9$ elements.

\textbf{(c)} If $p=5$, then Condition 2 fails for $\left(  a,b\right)
=\left(  1,2\right)  $. So $\mathbb{K}^{\prime}$ is not a field for $p=5$.
\end{example}

This suggests that the following:

\begin{proposition}
\label{prop.finfield.K'.prime-p-cond2}A prime $p$ satisfies Condition 2 if and
only if $p\equiv3\operatorname{mod}4$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.finfield.K'.prime-p-cond2} (sketched).]%
$\Longrightarrow:$ Assume that a prime $p$ satisfies Condition 2. Assume (for
contradiction) that $p\not \equiv 3\operatorname{mod}4$. So $p$ is a prime of
Type 1 or 2. Thus, $p=x^{2}+y^{2}$ for two integers $x,y$ (by Theorem
\ref{thm.Z[i].gauss.prime.1mod4} \textbf{(a)}). Now, $\left(  x,y\right)  $ is
a pair in $\mathbb{Z}\times\mathbb{Z}$ such that \textbf{not both} $x$ and $y$
are divisible by $p$ (why not?), but the sum $x^{2}+y^{2}=p$ is divisible by
$p$. So Condition 2 fails for $\left(  a,b\right)  =\left(  x,y\right)  $.
This proves the \textquotedblleft$\Longrightarrow$\textquotedblright%
\ direction of Proposition \ref{prop.finfield.K'.prime-p-cond2}.

$\Longleftarrow:$ Assume that a prime $p$ satisfies $p\equiv
3\operatorname{mod}4$. Thus, $\left(  p-1\right)  /2$ is an odd nonnegative integer.

We must prove that Condition 2 holds. In other words, we must prove that for
every pair $\left(  a,b\right)  \in\mathbb{Z}\times\mathbb{Z}$ such that
\textbf{not both} $a$ and $b$ are divisible by $p$, the sum $a^{2}+b^{2}$ is
not divisible by $p$.

Let $\left(  a,b\right)  \in\mathbb{Z}\times\mathbb{Z}$ be a pair such that
\textbf{not both} $a$ and $b$ are divisible by $p$. We must prove that the sum
$a^{2}+b^{2}$ is not divisible by $p$.

Assume the contrary. Thus, $a^{2}+b^{2}\equiv0\operatorname{mod}p$.

If we had $p\mid a$, then we would have $a\equiv0\operatorname{mod}p$ and thus
$a^{2}+b^{2}\equiv0^{2}+b^{2}=b^{2}\operatorname{mod}p$, so that $b^{2}\equiv
a^{2}+b^{2}\equiv0\operatorname{mod}p$ and thus $p\mid b^{2}$ and therefore
$p\mid b$; but this would contradict our assumption that \textbf{not both} $a$
and $b$ are divisible by $p$. Hence, we cannot have $p\mid a$. Thus, we have
$p\nmid a$. Hence, Fermat's Little Theorem (Theorem \ref{thm.ent.fermat}
\textbf{(a)}) yields $a^{p-1}\equiv1\operatorname{mod}p$. Similarly,
$b^{p-1}\equiv1\operatorname{mod}p$.

From $a^{2}+b^{2}\equiv0\operatorname{mod}p$, we get $a^{2}\equiv
-b^{2}\operatorname{mod}p$. Taking this congruence to the $\left(  p-1\right)
/2$-th power\footnote{We can do this, since $\left(  p-1\right)  /2$ is a
nonnegative integer.}, we find%
\[
\left(  a^{2}\right)  ^{\left(  p-1\right)  /2}\equiv\left(  -b^{2}\right)
^{\left(  p-1\right)  /2}=\underbrace{\left(  -1\right)  ^{\left(  p-1\right)
/2}}_{\substack{=-1\\\text{(since }\left(  p-1\right)  /2\text{ is odd)}%
}}\underbrace{\left(  b^{2}\right)  ^{\left(  p-1\right)  /2}}%
_{\substack{=b^{p-1}\\\equiv1\operatorname{mod}p}}\equiv-1\operatorname{mod}%
p.
\]
Hence,%
\[
-1\equiv\left(  a^{2}\right)  ^{\left(  p-1\right)  /2}=a^{p-1}\equiv
1\operatorname{mod}p.
\]
Hence, $p\mid\left(  -1\right)  -1=-2\mid2$, so $p=2$ (since $p$ is prime).
This contradicts $p\equiv3\operatorname{mod}4$. This contradiction shows that
our assumption was false; thus, Condition 2 holds. This proves the
\textquotedblleft$\Longleftarrow$\textquotedblright\ direction of Proposition
\ref{prop.finfield.K'.prime-p-cond2}.
\end{proof}

Thus, if we set $\mathbb{K}=\mathbb{Z}/p$ where $p$ is a prime of Type 3, then
$\mathbb{K}^{\prime}$ will be a field. So we have found a field $\mathbb{K}%
^{\prime}$ with $p^{2}$ elements for any prime $p$ of Type 3. What about the
other primes?

We can try to vary the construction above: Instead of adjoining a square root
of $-1$, we adjoin a square root of some other element $\eta\in\mathbb{Z}/p$.

\begin{definition}
\label{def.ring.square}Let $\mathbb{K}$ be a ring. A \textit{square} (in
$\mathbb{K}$) means an element of the form $a^{2}$ for some $a\in\mathbb{K}$.
\end{definition}

Now, we generalize Definition \ref{def.finfield.K'} as follows:

\begin{definition}
\label{def.finfield.K'eta}Let $\mathbb{K}$ be a commutative ring. Let $\eta
\in\mathbb{K}$.

\textbf{(a)} Let $\mathbb{K}_{\eta}^{\prime}$ be the set of all pairs $\left(
a,b\right)  \in\mathbb{K}\times\mathbb{K}$.

\textbf{(b)} For each $r\in\mathbb{K}$, we denote the pair $\left(
r,0\right)  \in\mathbb{K}_{\eta}^{\prime}$ by $r_{\mathbb{K}_{\eta}^{\prime}}%
$. We identify $r\in\mathbb{K}$ with $r_{\mathbb{K}_{\eta}^{\prime}}=\left(
r,0\right)  \in\mathbb{K}_{\eta}^{\prime}$, so that $\mathbb{K}$ becomes a
subset of $\mathbb{K}_{\eta}^{\prime}$.

\textbf{(c)} We let $i_{\eta}$ be the pair $\left(  0,1\right)  \in
\mathbb{K}_{\eta}^{\prime}$.

\textbf{(d)} We define three binary operations $+$, $-$ and $\cdot$ on
$\mathbb{K}_{\eta}^{\prime}$ by setting%
\begin{align*}
\left(  a,b\right)  +\left(  c,d\right)   &  =\left(  a+c,b+d\right)  ,\\
\left(  a,b\right)  -\left(  c,d\right)   &  =\left(  a-c,b-d\right)
,\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  a,b\right)  \cdot\left(  c,d\right)   &  =\left(  ac+\eta
bd,ad+bc\right)
\end{align*}
for all $\left(  a,b\right)  \in\mathbb{K}_{\eta}^{\prime}$ and $\left(
c,d\right)  \in\mathbb{K}_{\eta}^{\prime}$.

\textbf{(e)} If $\alpha,\beta\in\mathbb{K}_{\eta}^{\prime}$, then we write
$\alpha\beta$ for $\alpha\cdot\beta$.
\end{definition}

Note that $\mathbb{K}_{\eta}^{\prime}$ differs from $\mathbb{K}^{\prime}$ only
in how the multiplication is defined. Note also that $\mathbb{K}_{-1}^{\prime
}=\mathbb{K}^{\prime}$.

\begin{theorem}
\label{thm.finfield.K'eta.cring}\textbf{(a)} The set $\mathbb{K}_{\eta
}^{\prime}$ defined in Definition \ref{def.finfield.K'eta} (equipped with the
operations $+$ and $\cdot$ and the elements $0_{\mathbb{K}_{\eta}^{\prime}}$
and $1_{\mathbb{K}_{\eta}^{\prime}}$) is a commutative ring. Its subtraction
is the operation $-$ defined in Definition \ref{def.finfield.K'eta}
\textbf{(d)}.

\textbf{(b)} If $\mathbb{K}$ is a field and $\eta$ is not a square in
$\mathbb{K}$, then $\mathbb{K}_{\eta}^{\prime}$ is a field.

\textbf{(c)} Let $p$ be a prime. There always exists an element $\eta
\in\mathbb{Z}/p$ that is not a square, \textbf{unless} $p=2$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.finfield.K'eta.cring}.]\textbf{(a)} This is similar
to our above proof that $\mathbb{C}$ is a commutative ring.

\textbf{(b)} Assume that $\mathbb{K}$ is a field and that $\eta$ is not a
square in $\mathbb{K}$. We need to prove that $\mathbb{K}_{\eta}^{\prime}$ is
a field. In other words, we need to prove that each nonzero $\xi\in
\mathbb{K}_{\eta}^{\prime}$ is invertible.

So let $\xi\in\mathbb{K}_{\eta}^{\prime}$ be nonzero, and write $\xi$ as
$\xi=\left(  x,y\right)  $ with $x,y\in\mathbb{K}$. We must show that $\xi$ is invertible.

We have $\left(  x,y\right)  \left(  x,-y\right)  =\left(  x^{2}-\eta
y^{2},0\right)  $ (by the definition of the operation $\cdot$ on
$\mathbb{K}_{\eta}^{\prime}$). If $x^{2}-\eta y^{2}$ is nonzero, then this
shows quickly that $\left(  \dfrac{x}{x^{2}-\eta y^{2}},\dfrac{-y}{x^{2}-\eta
y^{2}}\right)  $ is an inverse of $\left(  x,y\right)  =\xi$, and thus $\xi$
is invertible. So we need to prove that $x^{2}-\eta y^{2}$ is nonzero.

Assume the contrary. Thus, $x^{2}-\eta y^{2}=0$, so that $x^{2}=\eta y^{2}$.
If $y$ is nonzero, then this can be rewritten as $\dfrac{x^{2}}{y^{2}}=\eta$,
whence $\eta=\dfrac{x^{2}}{y^{2}}=\left(  \dfrac{x}{y}\right)  ^{2}$, which
contradicts the fact that $\eta$ is not a square. So $y$ cannot be nonzero.
Thus, $y=0$. Hence, $x^{2}=\eta\underbrace{y^{2}}_{=0^{2}}=0$. Since
$\xi=\left(  x,\underbrace{y}_{=0}\right)  =\left(  x,0\right)  $, we know
that $x$ is nonzero (since $\xi$ is nonzero). Hence, $x$ has a multiplicative
inverse (since $\mathbb{K}$ is a field). Hence, multiplying $x^{2}=0$ by
$x^{-1}$, we obtain $x=0$, which contradicts $x$ being nonzero. So our
assumption was wrong. Theorem \ref{thm.finfield.K'eta.cring} \textbf{(b)} is proven.

\textbf{(c)} Assume that $p\neq2$. Thus, $p>2$. Hence, the two residue classes
$\left[  1\right]  _{p}$ and $\left[  p-1\right]  _{p}$ in $\mathbb{Z}/p$ are distinct.

Consider the map%
\[
\mathbb{Z}/p\rightarrow\mathbb{Z}/p,\ \ \ \ \ \ \ \ \ \ \alpha\mapsto
\alpha^{2}.
\]
This map is \textbf{not} injective (since it sends the two distinct residue
classes $\left[  1\right]  _{p}$ and $\left[  p-1\right]  _{p}$ both to
$\left[  1\right]  _{p}$). Hence, it cannot be surjective either (since
otherwise, the Pigeonhole Principle for Surjections would entail that it is
bijective, hence injective). In other words, there exists some $\eta
\in\mathbb{Z}/p$ that is not in its image. In other words, there exists an
element $\eta\in\mathbb{Z}/p$ that is not a square. This proves Theorem
\ref{thm.finfield.K'eta.cring} \textbf{(c)}.
\end{proof}

Now, if $p$ is a prime with $p>2$, then Theorem \ref{thm.finfield.K'eta.cring}
\textbf{(c)} yields that there exists an element $\eta\in\mathbb{Z}/p$ that is
not a square; therefore, Theorem \ref{thm.finfield.K'eta.cring} \textbf{(b)}
shows that $\mathbb{K}_{\eta}^{\prime}$ is a field where $\mathbb{K}%
=\mathbb{Z}/p$. This is a field with $p^{2}$ elements.

Is there a field of size $4$, too?

We cannot get such a field by adjoining a square root to $\mathbb{Z}/2$. So
let us instead try to adjoin an element $j$ such that $j^{2}=j+1$. Formally,
we can do this as follows: We define $\mathbb{K}^{\prime\prime}$ as the set of
all pairs $\left(  a,b\right)  \in\left(  \mathbb{Z}/2\right)  \times\left(
\mathbb{Z}/2\right)  $, and we define three operations $+$, $-$ and $\cdot$ on
$\mathbb{K}^{\prime\prime}$ by%
\begin{align*}
\left(  a,b\right)  +\left(  c,d\right)   &  =\left(  a+c,b+d\right)  ,\\
\left(  a,b\right)  -\left(  c,d\right)   &  =\left(  a-c,b-d\right)
,\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  a,b\right)  \cdot\left(  c,d\right)   &  =\left(
ac+bd,ad+bc+bd\right)  .
\end{align*}
You can check that this is a field with $4$ elements.

Thus, for each prime $p$, we have found a field with $p^{2}$ elements.

For the sake of completeness, let me mention a \textbf{third idea} for
constructing fields of size $p^{2}$: Recall that our field $\mathbb{Z}/p$ of
size $p$ consisted of residue classes of integers modulo $p$. What happens if
we take the residue classes of Gaussian integers modulo a Gaussian prime $\pi$ ?

I will not go into details, but here is a summary:

\begin{itemize}
\item The result is always a field of size $\operatorname*{N}\left(
\pi\right)  $.

\item If $\pi$ is not unit-equivalent to an integer, then this is a field that
we already know (namely, $\mathbb{Z}/p$ for $p=\operatorname*{N}\left(
\pi\right)  $) with its elements relabelled.

\item If $\pi$ is unit-equivalent to an integer, then $\pi$ is unit-equivalent
to a prime $p$ of Type 3, and the field of residue classes modulo $\pi$ will
be a field with $p^{2}$ elements. Namely, it will be the field $\mathbb{K}%
^{\prime}$ we constructed above (for $\mathbb{K}=\mathbb{Z}/p$), with its
elements relabelled.
\end{itemize}

So this approach only gets us fields of size $p^{2}$ when $p$ is a prime of
Type 3; it is thus inferior to the second idea above. Nevertheless, it
illustrates a general idea: that residue classes make sense not only for integers.

\begin{teachingnote}
\textbf{2019-04-03 lecture}
\end{teachingnote}

\textbf{Warning:} When $p$ is a prime, the ring $\mathbb{Z}/p^{2}$ is
\textbf{not} a field; thus, the field with $p^{2}$ elements that we
constructed is not $\mathbb{Z}/p^{2}$.

Now, what about finite fields of size $p^{3},p^{4},\ldots$ ? What about finite
fields of size $6$ ?

\textbf{Spoiler:} It turns out that the former exist, while the latter do not.
We will hopefully prove this later. More generally, for an integer $n>1$,
there exists a field of size $n$ if and only if $n$ is a prime power (= a
positive power of a prime). Even better, if $n$ is a prime power, then a field
of size $n$ is unique up to relabeling. We hope to see a proof of this (at
least of the existence part) further on in this class.

\subsection{\label{sect.ring.cart-prod}Cartesian products}

Next comes a basic and unimaginative way of constructing new rings from old:

\begin{definition}
\label{def.ring.dirprod1}Let $\mathbb{K}_{1},\mathbb{K}_{2},\ldots
,\mathbb{K}_{n}$ be $n$ rings. Consider the set $\mathbb{K}_{1}\times
\mathbb{K}_{2}\times\cdots\times\mathbb{K}_{n}$, whose elements are $n$-tuples
$\left(  k_{1},k_{2},\ldots,k_{n}\right)  $ with $k_{i}\in\mathbb{K}_{i}$.

We define operations $+$ and $\cdot$ on $\mathbb{K}_{1}\times\mathbb{K}%
_{2}\times\cdots\times\mathbb{K}_{n}$ by%
\begin{align*}
\left(  a_{1},a_{2},\ldots,a_{n}\right)  +\left(  b_{1},b_{2},\ldots
,b_{n}\right)   &  =\left(  a_{1}+b_{1},a_{2}+b_{2},\ldots,a_{n}+b_{n}\right)
\ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  a_{1},a_{2},\ldots,a_{n}\right)  \cdot\left(  b_{1},b_{2},\ldots
,b_{n}\right)   &  =\left(  a_{1}b_{1},a_{2}b_{2},\ldots,a_{n}b_{n}\right)  .
\end{align*}

\end{definition}

\begin{proposition}
\label{prop.ring.dirprod.ring}Let $\mathbb{K}_{1},\mathbb{K}_{2}%
,\ldots,\mathbb{K}_{n}$ be $n$ rings.

\textbf{(a)} The set $\mathbb{K}_{1}\times\mathbb{K}_{2}\times\cdots
\times\mathbb{K}_{n}$, endowed with the operations $+$ and $\cdot$ we just
defined and with the zero $\left(  0,0,\ldots,0\right)  $ and the unity
$\left(  1,1,\ldots,1\right)  $, is a ring.

\textbf{(b)} If the rings $\mathbb{K}_{1},\mathbb{K}_{2},\ldots,\mathbb{K}%
_{n}$ are commutative, then so is the ring $\mathbb{K}_{1}\times\mathbb{K}%
_{2}\times\cdots\times\mathbb{K}_{n}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ring.dirprod.ring}.]All axioms are checked
entrywise: For example, associativity of multiplication follows from comparing%
\begin{align*}
&  \underbrace{\left(  \left(  a_{1},a_{2},\ldots,a_{n}\right)  \cdot\left(
b_{1},b_{2},\ldots,b_{n}\right)  \right)  }_{=\left(  a_{1}b_{1},a_{2}%
b_{2},\ldots,a_{n}b_{n}\right)  }\cdot\left(  c_{1},c_{2},\ldots,c_{n}\right)
\\
&  =\left(  a_{1}b_{1},a_{2}b_{2},\ldots,a_{n}b_{n}\right)  \cdot\left(
c_{1},c_{2},\ldots,c_{n}\right) \\
&  =\left(  \left(  a_{1}b_{1}\right)  c_{1},\left(  a_{2}b_{2}\right)
c_{2},\ldots,\left(  a_{n}b_{n}\right)  c_{n}\right) \\
&  =\left(  a_{1}\left(  b_{1}c_{1}\right)  ,a_{2}\left(  b_{2}c_{2}\right)
,\ldots,a_{n}\left(  b_{n}c_{n}\right)  \right)
\end{align*}
with%
\begin{align*}
&  \left(  a_{1},a_{2},\ldots,a_{n}\right)  \cdot\underbrace{\left(
b_{1},b_{2},\ldots,b_{n}\right)  \cdot\left(  c_{1},c_{2},\ldots,c_{n}\right)
}_{=\left(  b_{1}c_{1},b_{2}c_{2},\ldots,b_{n}c_{n}\right)  }\\
&  =\left(  a_{1},a_{2},\ldots,a_{n}\right)  \cdot\left(  b_{1}c_{1}%
,b_{2}c_{2},\ldots,b_{n}c_{n}\right) \\
&  =\left(  a_{1}\left(  b_{1}c_{1}\right)  ,a_{2}\left(  b_{2}c_{2}\right)
,\ldots,a_{n}\left(  b_{n}c_{n}\right)  \right)  .
\end{align*}


The additive inverse of $\left(  a_{1},a_{2},\ldots,a_{n}\right)  $ is
$\left(  -a_{1},-a_{2},\ldots,-a_{n}\right)  $.
\end{proof}

\begin{definition}
\label{def.ring.dirprod2}The ring $\mathbb{K}_{1}\times\mathbb{K}_{2}%
\times\cdots\times\mathbb{K}_{n}$ constructed in Proposition
\ref{prop.ring.dirprod.ring} is called the \textit{Cartesian product} (or
\textit{direct product}) of the rings $\mathbb{K}_{1},\mathbb{K}_{2}%
,\ldots,\mathbb{K}_{n}$.
\end{definition}

\begin{example}
\label{exa.ring.dirprod.XOR}We have already seen a Cartesian product. Indeed,
recall the binary operations $\operatorname*{XOR}$ defined back in Subsection
\ref{subsect.intro.XOR}.

\textbf{(a)} We first defined an operation $\operatorname*{XOR}$ on bits
(Definition \ref{def.intro.XOR.XOR01}), and then defined an operation
$\operatorname*{XOR}$ on bitstrings (Definition \ref{def.intro.XOR.XOR01m}).
It is easy to see that
\[
\left(  \left\{  0,1\right\}  ,\operatorname*{XOR},\cdot,0,1\right)
\]
is a commutative ring. Let me call this ring $\mathbb{X}$ for now. Note that
this ring $\mathbb{X}$ can be seen as $\mathbb{Z}/2$ with its elements
relabeled (more precisely, the elements $\left[  0\right]  _{2}$ and $\left[
1\right]  _{2}$ of $\mathbb{Z}/2$ need to be relabelled as $0$ and $1$ in
order to get $\mathbb{X}$); for example, the correspondence between the
$\operatorname*{XOR}$ operation on $\mathbb{X}$ and the addition on
$\mathbb{Z}/2$ can be seen by comparing their results face to face:%
\begin{align*}
0\operatorname*{XOR}0  &  =0\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \left[  0\right]  _{2}+\left[  0\right]  _{2}=\left[
0\right]  _{2},\\
0\operatorname*{XOR}1  &  =1\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \left[  0\right]  _{2}+\left[  1\right]  _{2}=\left[
1\right]  _{2},\\
1\operatorname*{XOR}0  &  =1\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \left[  1\right]  _{2}+\left[  0\right]  _{2}=\left[
1\right]  _{2},\\
1\operatorname*{XOR}1  &  =0\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \left[  1\right]  _{2}+\left[  1\right]  _{2}=\left[
0\right]  _{2}.
\end{align*}


\textbf{(b)} Let $m\in\mathbb{N}$. In Definition \ref{def.intro.XOR.XOR01m},
we defined a binary operation $\operatorname*{XOR}$ on $\left\{  0,1\right\}
^{m}$, i.e., on length-$m$ bitstrings. This gives a ring%
\[
\left(  \left\{  0,1\right\}  ^{m},\operatorname*{XOR},\text{entrywise
multiplication},00\cdots0,11\cdots1\right)
\]
of bitstrings. This ring is precisely the Cartesian product%
\[
\underbrace{\mathbb{X}\times\mathbb{X}\times\cdots\times\mathbb{X}}_{m\text{
times}}.
\]

\end{example}

\subsection{\label{sect.ring.matrix}Matrices and matrix rings}

\begin{convention}
In this section, we fix a ring $\mathbb{K}$.
\end{convention}

We take the familiar concept of matrices, and generalize it in a
straightforward way, allowing matrices with entries in $\mathbb{K}$:

\begin{definition}
\label{def.matrix.matrix}Given $n,m\in\mathbb{N}$, we define an $n\times
m$\textit{-matrix over }$\mathbb{K}$ to be a rectangular table with $n$ rows
and $m$ columns whose entries are elements of $\mathbb{K}$. When $\mathbb{K}$
is clear from the context (or irrelevant), we just say \textquotedblleft%
$n\times m$-matrix\textquotedblright\ instead of \textquotedblleft$n\times
m$-matrix over $\mathbb{K}$\textquotedblright.
\end{definition}

For example, if $\mathbb{K}=\mathbb{Q}$, then%
\[
\left(
\begin{array}
[c]{ccc}%
0 & 1/3 & -6\\
-1 & -2/5 & 1
\end{array}
\right)
\]
is a $2\times3$-matrix over $\mathbb{K}$.

(Formally, an $n\times m$-matrix is defined as a map from $\left\{
1,2,\ldots,n\right\}  \times\left\{  1,2,\ldots,m\right\}  $ to $\mathbb{K}$.
Its entry in row $i$ and column $j$ is then defined to be the image of the
pair $\left(  i,j\right)  $ under this map.)

Note that the \textquotedblleft$\times$\textquotedblright\ symbol in the
notion of an \textquotedblleft$n\times m$-matrix\textquotedblright\ is just a
symbol, not an invitation to actually multiply the numbers $n$ and $m$
together! For example, $2\cdot3=3\cdot2$, yet a $2\times3$-matrix is not the
same as a $3\times2$-matrix.

Let us define two pieces of notation:

\begin{definition}
\label{def.matrix.ij-entry}Let $A$ be an $n\times m$-matrix over $\mathbb{K}$.
Let $i\in\left\{  1,2,\ldots,n\right\}  $ and $j\in\left\{  1,2,\ldots
,m\right\}  $. The $\left(  i,j\right)  $\textit{-th entry of}\textbf{ }$A$ is
defined to be the entry of $A$ in row $i$ and column $j$.
\end{definition}

\begin{definition}
\label{def.matrix.(aij)}Let $n,m\in\mathbb{N}$. Assume that we are given some
element $a_{i,j}\in\mathbb{K}$ for every $\left(  i,j\right)  \in\left\{
1,2,\ldots,n\right\}  \times\left\{  1,2,\ldots,m\right\}  $. Then, we shall
use the notation
\begin{equation}
\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq m}
\label{eq.def.matrix.(aij).(aij)}%
\end{equation}
for the $n\times m$-matrix%
\[
\left(
\begin{array}
[c]{cccc}%
a_{1,1} & a_{1,2} & \cdots & a_{1,m}\\
a_{2,1} & a_{2,2} & \cdots & a_{2,m}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n,1} & a_{n,2} & \cdots & a_{n,m}%
\end{array}
\right)
\]
(this is the $n\times m$-matrix whose $\left(  i,j\right)  $-th entry is
$a_{i,j}$ for all $i$ and $j$).
\end{definition}

For example,%
\begin{align*}
\left(  i+j\right)  _{1\leq i\leq3,\ 1\leq j\leq4}  &  =\left(
\begin{array}
[c]{cccc}%
2 & 3 & 4 & 5\\
3 & 4 & 5 & 6\\
4 & 5 & 6 & 7
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\\
\left(  i-j\right)  _{1\leq i\leq3,\ 1\leq j\leq4}  &  =\left(
\begin{array}
[c]{cccc}%
0 & -1 & -2 & -3\\
1 & 0 & -1 & -2\\
2 & 1 & 0 & -1
\end{array}
\right)  .
\end{align*}


The letters $i$ and $j$ in the notation (\ref{eq.def.matrix.(aij).(aij)}) are
not set in stone; we can use any other letters instead. For example,%
\[
\left(  i-j\right)  _{1\leq i\leq3,\ 1\leq j\leq4}=\left(  x-y\right)  _{1\leq
x\leq3,\ 1\leq y\leq4}=\left(  j-i\right)  _{1\leq j\leq3,\ 1\leq i\leq4}.
\]


\begin{definition}
\label{def.matrix.Knm}Let $n,m\in\mathbb{N}$. Then, $\mathbb{K}^{n\times m}$
will denote the set of all $n\times m$-matrices. (Some call it
$\operatorname*{M}\nolimits_{n,m}\left(  \mathbb{K}\right)  $ instead.)
\end{definition}

Again, the \textquotedblleft$\times$\textquotedblright\ symbol in this
notation is just a symbol; it does not stand for a product of numbers.

\begin{definition}
\label{def.matrix.square}\textbf{(a)} A \textit{matrix} means an $n\times
m$-matrix for some $n,m\in\mathbb{N}$.

\textbf{(b)} A \textit{square matrix} means an $n\times n$-matrix for some
$n\in\mathbb{N}$.
\end{definition}

For example, $\left(
\begin{array}
[c]{ccc}%
1 & 2 & 6\\
3 & 4 & 5
\end{array}
\right)  $ is a matrix, and $\left(
\begin{array}
[c]{cc}%
2 & 6\\
4 & 5
\end{array}
\right)  $ is a square matrix.

We now define various operations with matrices:

\begin{definition}
\label{def.matrix.+-}Fix $n,m\in\mathbb{N}$.

\textbf{(a)} The \textit{sum} $A+B$ of two $n\times m$-matrices $A$ and $B$ is
defined entrywise: i.e., if $A=\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq
j\leq m}$ and $B=\left(  b_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq m}$,
then%
\[
A+B=\left(  a_{i,j}+b_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq m}.
\]


\textbf{(b)} The \textit{difference} $A-B$ of two $n\times m$-matrices $A$ and
$B$ is defined entrywise: i.e., if $A=\left(  a_{i,j}\right)  _{1\leq i\leq
n,\ 1\leq j\leq m}$ and $B=\left(  b_{i,j}\right)  _{1\leq i\leq n,\ 1\leq
j\leq m}$, then%
\[
A-B=\left(  a_{i,j}-b_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq m}.
\]


\textbf{(c)} We define \textit{scaling} of $n\times m$-matrices as follows: If
$\lambda\in\mathbb{K}$ and $A\in\mathbb{K}^{n\times m}$, then the matrix
$\lambda A\in\mathbb{K}^{n\times m}$ is defined by multiplying each entry of
$A$ by $\lambda$. Formally speaking: if $A=\left(  a_{i,j}\right)  _{1\leq
i\leq n,\ 1\leq j\leq m}$, then%
\[
\lambda A=\left(  \lambda a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq m}.
\]

\end{definition}

To be more honest, the operation we defined in Definition \ref{def.matrix.+-}
\textbf{(c)} should have been called \textquotedblleft left
scaling\textquotedblright\ rather than \textquotedblleft
scaling\textquotedblright. And we should have defined an analogous operation
called \textquotedblleft right scaling\textquotedblright, which takes an
element $\lambda\in\mathbb{K}$ and a matrix $A=\left(  a_{i,j}\right)  _{1\leq
i\leq n,\ 1\leq j\leq m}\in\mathbb{K}^{n\times m}$, and returns a new matrix
\[
A\lambda=\left(  a_{i,j}\lambda\right)  _{1\leq i\leq n,\ 1\leq j\leq m}.
\]
But we will mostly be dealing with the case when the ring $\mathbb{K}$ is
commutative; and in this case, we always have $A\lambda=\lambda A$ (meaning
that \textquotedblleft right scaling\textquotedblright\ and \textquotedblleft
left scaling\textquotedblright\ are the same operation). Thus, we take the
liberty to neglect the \textquotedblleft right scaling\textquotedblright%
\ operation. (Its properties are analogous to the corresponding properties of
\textquotedblleft left scaling\textquotedblright\ anyway.)

Let us now define an operation on matrices that is \textbf{not} computed
entrywise: their product.

\begin{definition}
\label{def.matrix.AB}Let $n,m,p\in\mathbb{N}$. Let $A=\left(  a_{i,j}\right)
_{1\leq i\leq n,\ 1\leq j\leq m}$ be an $n\times m$-matrix. Let $B=\left(
b_{i,j}\right)  _{1\leq i\leq m,\ 1\leq j\leq p}$ be an $m\times p$-matrix.
Then, we define the \textit{product} $AB$ of the two matrices $A$ and $B$ by%
\[
AB=\left(  \sum_{k=1}^{m}a_{i,k}b_{k,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
p}.
\]
This is an $n\times p$-matrix.
\end{definition}

So you can add together two $n\times m$-matrices, but only multiply an
$n\times m$-matrix with an $m\times p$-matrix. (You cannot multiply two
$n\times m$-matrices, unless $n=m$.)

Next, we define two special families of matrices:

\begin{definition}
\label{def.matrix.01}\textbf{(a)} If $n,m\in\mathbb{N}$, then the $n\times m$
\textit{zero matrix} is defined to be the $n\times m$-matrix%
\[
\left(  0\right)  _{1\leq i\leq n,\ 1\leq j\leq m}=\left(
\begin{array}
[c]{cccc}%
0 & 0 & \cdots & 0\\
0 & 0 & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots\\
0 & 0 & \cdots & 0
\end{array}
\right)  .
\]
It is called $0_{n\times m}$.

\textbf{(b)} If $n\in\mathbb{N}$, then the $n\times n$\textbf{ }%
\textit{identity matrix} is defined to be the $n\times n$-matrix%
\[
\left(  \delta_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}=\left(
\begin{array}
[c]{cccc}%
1 & 0 & \cdots & 0\\
0 & 1 & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots\\
0 & 0 & \cdots & 1
\end{array}
\right)  ,
\]
where%
\[
\delta_{i,j}=%
\begin{cases}
1, & \text{if }i=j;\\
0, & \text{if }i\neq j
\end{cases}
.
\]
(Note that using the Iverson bracket notation we introduced in Exercise
\ref{exe.binom.legendre}, we have $\delta_{i,j}=\left[  i=j\right]
\cdot1_{\mathbb{K}}$.)

The $n\times n$ identity matrix is called $I_{n}$.
\end{definition}

Note that the $0$ and the $1$ here are the zero and the unity of $\mathbb{K}$.

Thus, a zero matrix can be of any size, but an identity matrix has to be a
square matrix.

If $n,m\in\mathbb{N}$ and $A\in\mathbb{K}^{n\times m}$, then $-A$ shall denote
the matrix $0_{n\times m}-A\in\mathbb{K}^{n\times m}$.

The following rules hold for addition, subtraction, multiplication and scaling
of matrices:

\begin{theorem}
\label{thm.matrix.rules}Let $n,m,p,q\in\mathbb{N}$.

\textbf{(a)} We have $A+B=B+A$ for any $A,B\in\mathbb{K}^{n\times m}$.

\textbf{(b)} We have $A+\left(  B+C\right)  =\left(  A+B\right)  +C$ for any
$A,B,C\in\mathbb{K}^{n\times m}$.

\textbf{(c)} We have $A+0_{n\times m}=0_{n\times m}+A=A$ for any
$A\in\mathbb{K}^{n\times m}$.

\textbf{(d)} We have $A\cdot I_{m}=I_{n}\cdot A=A$ for any $A\in
\mathbb{K}^{n\times m}$.

\textbf{(e)} In general, we \textbf{do not} have $AB=BA$. In fact, it can
happen that one of $AB$ and $BA$ is defined and the other is not; but even if
both are defined, they can be distinct (even if $\mathbb{K}$ is commutative).

\textbf{(f)} We have $A\left(  BC\right)  =\left(  AB\right)  C$ for any
$A\in\mathbb{K}^{n\times m}$, $B\in\mathbb{K}^{m\times p}$ and $C\in
\mathbb{K}^{p\times q}$.

\textbf{(g)} We have $A\left(  B+C\right)  =AB+AC$ for any $A\in
\mathbb{K}^{n\times m}$ and $B,C\in\mathbb{K}^{m\times p}$.

We have $\left(  A+B\right)  C=AC+BC$ for any $A,B\in\mathbb{K}^{n\times m}$
and $C\in\mathbb{K}^{m\times p}$.

\textbf{(h)} We have $A\cdot0_{m\times p}=0_{n\times p}$ and $0_{p\times
n}\cdot A=0_{p\times m}$ for any $A\in\mathbb{K}^{n\times m}$.

\textbf{(i)} If $A,B,C\in\mathbb{K}^{n\times m}$, then we have the equivalence
$\left(  A-B=C\right)  \Longleftrightarrow\left(  A=B+C\right)  $.

\textbf{(j)} We have $r\left(  A+B\right)  =rA+rB$ for any $r\in\mathbb{K}$
and $A,B\in\mathbb{K}^{n\times m}$.

\textbf{(k)} We have $\left(  r+s\right)  A=rA+sA$ for any $r,s\in\mathbb{K}$
and $A\in\mathbb{K}^{n\times m}$.

\textbf{(l)} We have $r\left(  sA\right)  =\left(  rs\right)  A$ for any
$r,s\in\mathbb{K}$ and $A\in\mathbb{K}^{n\times m}$.

\textbf{(m)} We have $r\left(  AB\right)  =\left(  rA\right)  B=A\left(
rB\right)  $ for any $r\in\mathbb{K}$ and $A\in\mathbb{K}^{n\times m}$ and
$B\in\mathbb{K}^{m\times p}$ if $\mathbb{K}$ is commutative. The first
equality also holds in general.

\textbf{(n)} We have $-\left(  rA\right)  =\left(  -r\right)  A=r\left(
-A\right)  $ for any $r\in\mathbb{K}$ and $A\in\mathbb{K}^{n\times m}$.

\textbf{(o)} We have $1A=A$ for any $A\in\mathbb{K}^{n\times m}$.

\textbf{(p)} We have $\left(  -1\right)  A=-A$ for any $A\in\mathbb{K}%
^{n\times m}$.

\textbf{(q)} We have $-\left(  A+B\right)  =\left(  -A\right)  +\left(
-B\right)  $ for any $A,B\in\mathbb{K}^{n\times m}$.

\textbf{(r)} We have $-0_{n\times m}=0_{n\times m}$.

\textbf{(s)} We have $-\left(  -A\right)  =A$ for any $A\in\mathbb{K}^{n\times
m}$.

\textbf{(t)} We have $-\left(  AB\right)  =\left(  -A\right)  B=A\left(
-B\right)  $ for any $A\in\mathbb{K}^{n\times m}$ and $B\in\mathbb{K}^{m\times
p}$.

\textbf{(u)} We have $A-B-C=A-\left(  B+C\right)  $ for any $A,B,C\in
\mathbb{K}^{n\times m}$. (Here and in the following, \textquotedblleft%
$A-B-C$\textquotedblright\ should be read as \textquotedblleft$\left(
A-B\right)  -C$\textquotedblright.)
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.matrix.rules}.]Most of these are trivial. The
hardest one is part \textbf{(f)}. See \cite[\S 2.9]{lina} for its
proof\footnote{To be precise, the proof in \cite[\S 2.9]{lina} only handles
the case when $\mathbb{K}=\mathbb{R}$. But the same argument works whenever
$\mathbb{K}$ is a commutative ring. With a little modification, it works
whenever $\mathbb{K}$ is any ring.}.
\end{proof}

\begin{corollary}
\label{cor.matrix.ring}Let $n\in\mathbb{N}$. The set $\mathbb{K}^{n\times n}$
of all $n\times n$-matrices (endowed with addition $+$, multiplication $\cdot
$, zero $0_{n\times n}$ and unity $I_{n}$) is a ring.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.matrix.ring}.]This follows from Theorem
\ref{thm.matrix.rules}. (For example, the \textquotedblleft
Distributivity\textquotedblright\ axiom follows from Theorem
\ref{thm.matrix.rules} \textbf{(g)}, whereas the \textquotedblleft Existence
of additive inverses\textquotedblright\ follows from the fact that any
$A\in\mathbb{K}^{n\times n}$ has additive inverse $-A$\ \ \ \ \footnote{This
fact can be easily derived from Theorem \ref{thm.matrix.rules} \textbf{(p)}
and Theorem \ref{thm.matrix.rules} \textbf{(k)}, for example (or just checked
by hand).}.)
\end{proof}

\begin{definition}
\label{def.matrix.ring}Let $n\in\mathbb{N}$. The ring $\mathbb{K}^{n\times n}$
defined in Corollary \ref{cor.matrix.ring} is called the $n$\textit{-th matrix
ring} over $\mathbb{K}$.
\end{definition}

\begin{teachingnote}
\textbf{2019-04-05 lecture}
\end{teachingnote}

So we know that $\mathbb{K}^{n\times n}$ is a ring whenever $n\in\mathbb{N}$.
Hence, Proposition \ref{thm.rings.sum.wd} shows that we can define finite sums
and finite products in $\mathbb{K}^{n\times n}$ (but finite products need to
have the order of their factors specified: i.e., we can make sense of
\textquotedblleft$A_{1}A_{2}\cdots A_{k}$\textquotedblright\ but not of
\textquotedblleft$\prod_{s\in S}A_{s}$\textquotedblright). These also make
sense for non-square matrices whenever \textquotedblleft their sizes
match\textquotedblright:\ e.g., you can define a sum of finitely many $n\times
m$-matrices, and a product $A_{1}A_{2}\cdots A_{k}$ where each $A_{i}$ is an
$n_{i}\times n_{i+1}$-matrix (for any $n_{1},n_{2},\ldots,n_{k+1}\in
\mathbb{N}$). Standard rules for sums and products hold, at least to the
extent they don't rely on commutativity of multiplication.

But $\mathbb{K}^{n\times n}$ is not the only ring we can make out of matrices.
In fact, $\mathbb{K}^{n\times n}$ is full of interesting subrings, which are
obtained by restricting ourselves to special kinds of matrices. Here are some
of these:

\begin{definition}
\label{def.matrix.triang}Let $n\in\mathbb{N}$. Let $A=\left(  a_{i,j}\right)
_{1\leq i\leq n,\ 1\leq j\leq n}$ be an $n\times n$-matrix.

\textbf{(a)} We say that $A$ is \textit{lower-triangular} if and only if
\[
a_{i,j}=0\ \ \ \ \ \ \ \ \ \ \text{whenever }i<j.
\]


\textbf{(b)} We say that $A$ is \textit{upper-triangular} if and only if
\[
a_{i,j}=0\ \ \ \ \ \ \ \ \ \ \text{whenever }i>j.
\]


\textbf{(c)} We say that $A$ is \textit{diagonal} if and only if
\[
a_{i,j}=0\ \ \ \ \ \ \ \ \ \ \text{whenever }i\neq j.
\]

\end{definition}

For example, the $2\times2$-matrix $\left(
\begin{array}
[c]{cc}%
1 & 2\\
0 & 3
\end{array}
\right)  $ is upper-triangular (but not lower-triangular), while the
$2\times2$-matrix $\left(
\begin{array}
[c]{cc}%
1 & 0\\
2 & 3
\end{array}
\right)  $ is lower-triangular (but not upper-triangular).

\begin{proposition}
\label{prop.matrix.triang-ring}Let $n\in\mathbb{N}$.

\textbf{(a)} The set of all lower-triangular $n\times n$-matrices is a subring
of $\mathbb{K}^{n\times n}$.

\textbf{(b)} The set of all upper-triangular $n\times n$-matrices is a subring
of $\mathbb{K}^{n\times n}$.

\textbf{(c)} The set of all diagonal $n\times n$-matrices is a subring of
$\mathbb{K}^{n\times n}$.
\end{proposition}

\begin{example}
For $n=2$, the multiplication of lower-triangular $n\times n$-matrices looks
as follows:%
\[
\left(
\begin{array}
[c]{cc}%
a & b\\
0 & c
\end{array}
\right)  \left(
\begin{array}
[c]{cc}%
x & y\\
0 & z
\end{array}
\right)  =\left(
\begin{array}
[c]{cc}%
ax & ay+bz\\
0 & cz
\end{array}
\right)  ,
\]
and the multiplication of diagonal $n\times n$-matrices looks as follows:%
\[
\left(
\begin{array}
[c]{cc}%
a & 0\\
0 & c
\end{array}
\right)  \left(
\begin{array}
[c]{cc}%
x & 0\\
0 & z
\end{array}
\right)  =\left(
\begin{array}
[c]{cc}%
ax & 0\\
0 & cz
\end{array}
\right)  .
\]

\end{example}

\begin{proof}
[Proof of Proposition \ref{prop.matrix.triang-ring}.]The main
\textquotedblleft difficulty\textquotedblright\ is showing that the product of
two upper-triangular matrices is upper-triangular (and similarly for
lower-triangular matrices). This is \cite[Theorem 3.23 \textbf{(a)}]{lina}.
\end{proof}

Note that diagonal $n\times n$-matrices are \textquotedblleft
essentially\textquotedblright\ the same as $n$-tuples of elements of
$\mathbb{K}$; the ring they form is $\underbrace{\mathbb{K}\times
\mathbb{K}\times\cdots\times\mathbb{K}}_{n\text{ times}}$ in disguise. We will
make this precise in Example \ref{exa.riiso.dn} (using the notion of a ring isomorphism).

One of the most important operations on matrices is taking the transpose:

\begin{definition}
\label{def.matrix.transpose}Let $n\in\mathbb{N}$ and $m\in\mathbb{N}$. Let
$A=\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq m}$ be an $n\times
m$-matrix. Then, we define an $m\times n$-matrix $A^{T}$ by%
\[
A^{T}=\left(  a_{j,i}\right)  _{1\leq i\leq m,\ 1\leq j\leq n}.
\]
Thus, for each $i\in\left\{  1,2,\ldots,m\right\}  $ and $j\in\left\{
1,2,\ldots,n\right\}  $, the $\left(  i,j\right)  $-th entry of $A^{T}$ is the
$\left(  j,i\right)  $-th entry of $A$. This matrix $A^{T}$ is called the
\textit{transpose} of $A$.
\end{definition}

For example,%
\[
\left(
\begin{array}
[c]{ccc}%
1 & 2 & 3\\
4 & 5 & 6
\end{array}
\right)  ^{T}=\left(
\begin{array}
[c]{cc}%
1 & 4\\
2 & 5\\
3 & 6
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{cc}%
1 & 2\\
1 & 0
\end{array}
\right)  ^{T}=\left(
\begin{array}
[c]{cc}%
1 & 1\\
2 & 0
\end{array}
\right)  .
\]


Let us use this occasion to define column vectors and row vectors:

\begin{definition}
\label{def.matrix.row-col-vecs}Let $n\in\mathbb{N}$.

\textbf{(a)} A \textit{column vector of size }$n$ will mean an $n\times1$-matrix.

\textbf{(b)} A \textit{row vector of size }$n$ will mean a $1\times n$-matrix.
\end{definition}

For example, $\left(
\begin{array}
[c]{c}%
1\\
2
\end{array}
\right)  $ is a column vector of size $2$, while $\left(
\begin{array}
[c]{ccc}%
1 & 2 & 3
\end{array}
\right)  $ is a row vector of size $3$. We will often identify a row vector
$\left(
\begin{array}
[c]{cccc}%
a_{1} & a_{2} & \cdots & a_{n}%
\end{array}
\right)  \in\mathbb{K}^{1\times n}$ with the corresponding $n$-tuple $\left(
a_{1},a_{2},\ldots,a_{n}\right)  $.

If $v$ is a column vector of size $n$, then $v^{T}$ is a row vector of size
$n$.

\subsection{\label{sect.ring.riho}Ring homomorphisms}

\begin{definition}
\label{def.riho.riho}Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. A
\textit{ring homomorphism} from $\mathbb{K}$ to $\mathbb{L}$ means a map
$f:\mathbb{K}\rightarrow\mathbb{L}$ that satisfies the following four axioms:

\begin{itemize}
\item \textbf{(a)} We have $f\left(  a+b\right)  =f\left(  a\right)  +f\left(
b\right)  $ for all $a,b\in\mathbb{K}$. (This is called \textquotedblleft$f$
respects addition\textquotedblright\ or \textquotedblleft$f$ preserves
addition\textquotedblright.)

\item \textbf{(b)} We have $f\left(  0\right)  =0$. (This, of course, means
$f\left(  0_{\mathbb{K}}\right)  =0_{\mathbb{L}}$.)

\item \textbf{(c)} We have $f\left(  ab\right)  =f\left(  a\right)  f\left(
b\right)  $ for all $a,b\in\mathbb{K}$. (This is called \textquotedblleft$f$
respects multiplication\textquotedblright\ or \textquotedblleft$f$ preserves
multiplication\textquotedblright.)

\item \textbf{(d)} We have $f\left(  1\right)  =1$. (This, of course, means
$f\left(  1_{\mathbb{K}}\right)  =1_{\mathbb{L}}$.)
\end{itemize}
\end{definition}

\begin{remark}
The statement \textquotedblleft$f\left(  a+b\right)  =f\left(  a\right)
+f\left(  b\right)  $\textquotedblright\ in Definition \ref{def.riho.riho}
should, of course, be understood as \textquotedblleft$f\left(  a+_{\mathbb{K}%
}b\right)  =f\left(  a\right)  +_{\mathbb{L}}f\left(  b\right)  $%
\textquotedblright. Likewise, the statement \textquotedblleft$f\left(
ab\right)  =f\left(  a\right)  f\left(  b\right)  $\textquotedblright\ should
be understood as \textquotedblleft$f\left(  a\cdot_{\mathbb{K}}b\right)
=f\left(  a\right)  \cdot_{\mathbb{L}}f\left(  b\right)  $\textquotedblright.
In Definition \ref{def.riho.riho}, we could afford omitting the
\textquotedblleft$_{\mathbb{K}}$\textquotedblright\ and \textquotedblleft%
$_{\mathbb{L}}$\textquotedblright\ subscripts under the \textquotedblleft%
$+$\textquotedblright\ and \textquotedblleft$\cdot$\textquotedblright\ signs
because it is always clear whether the things being added (or multiplied) are
in $\mathbb{K}$ or in $\mathbb{L}$; but in many practical situations we do not
have such luxury (for example, because $\mathbb{K}$ and $\mathbb{L}$ have
elements in common) and thus need to include these subscripts. (See Example
\ref{exa.riiso.ZZ'} for an example of such a situation.)
\end{remark}

\begin{remark}
\label{rmk.riho.0-free}The axiom \textbf{(b)} in Definition
\ref{def.riho.riho} is redundant -- it follows from axiom \textbf{(a)}.
\end{remark}

\begin{proof}
[Proof of Remark \ref{rmk.riho.0-free}.]Assume that axiom \textbf{(a)} holds.
Apply axiom \textbf{(a)} to $a=0$ and $b=0$. Thus, you get%
\[
f\left(  0+0\right)  =f\left(  0\right)  +f\left(  0\right)  .
\]
Since $0+0=0$, this rewrites as%
\[
f\left(  0\right)  =f\left(  0\right)  +f\left(  0\right)  .
\]
Subtracting $f\left(  0\right)  $ on both sides (we can do this, since
$\mathbb{L}$ is a ring), we obtain $0=f\left(  0\right)  $, thus $f\left(
0\right)  =0$. Thus, axiom \textbf{(b)} holds.
\end{proof}

If the axiom \textbf{(b)} in Definition \ref{def.riho.riho} is redundant, then
why did we require it? One reason to do so is purely aesthetic: It ensures
that each of the two \textquotedblleft multiplicative\textquotedblright%
\ axioms (viz., axioms \textbf{(c)} and \textbf{(d)}) is matched by a
corresponding \textquotedblleft additive\textquotedblright\ axiom (viz.,
axioms \textbf{(a)} and \textbf{(b)}). We cannot omit axiom \textbf{(d)}%
\footnote{More precisely: if we did, then we would obtain a weaker, less
useful notion of ring homomorphism.}; thus, to avoid breaking the symmetry, I
prefer not to omit axiom \textbf{(b)} either. But there is also another reason
to keep axiom \textbf{(b)}. Indeed, if we want to define \textit{semiring
homomorphisms} (i.e., the analogue of ring homomorphisms in which rings are
replaced by semirings), then axiom \textbf{(b)} is no longer redundant (since
we cannot subtract elements in a semiring); thus, if we omitted axiom
\textbf{(b)}, our definition of ring homomorphisms would become less robust
with respect to replacing \textquotedblleft ring\textquotedblright\ by
\textquotedblleft semiring\textquotedblright.

\begin{example}
\label{exa.riho.id}Let $\mathbb{K}$ be any ring. The map $\operatorname*{id}%
:\mathbb{K}\rightarrow\mathbb{K}$ is a ring homomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.riho.id}.]Let us check that $\operatorname*{id}$
satisfies the axiom \textbf{(c)} in Definition \ref{def.riho.riho}: Indeed,
this simply means checking that $\operatorname*{id}\left(  ab\right)
=\operatorname*{id}\left(  a\right)  \operatorname*{id}\left(  b\right)  $ for
all $a,b\in\mathbb{K}$. But this rewrites as $ab=ab$, which is obvious.
Similarly, the other three axioms hold.
\end{proof}

We can slightly generalize Example \ref{exa.riho.id} as follows:

\begin{example}
\label{exa.riho.incl}Let $\mathbb{K}$ be a subring of a ring $\mathbb{L}$. Let
$\iota:\mathbb{K}\rightarrow\mathbb{L}$ be the map that sends each
$a\in\mathbb{K}$ to $a$ itself. (This map is called the \textit{inclusion map}
from $\mathbb{K}$ to $\mathbb{L}$.) Then, $\iota$ is a ring homomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.riho.incl}.]The four axioms in Definition
\ref{def.riho.riho} follow straight from the five requirements in Definition
\ref{def.ring.subring}.
\end{proof}

\begin{example}
\label{exa.riho.triv}Let $\mathbb{K}$ be any ring, and let $\mathbb{M}$ be the
zero ring $\left\{  0\right\}  $. Then, the map%
\[
\mathbb{K}\rightarrow\mathbb{M},\ \ \ \ \ \ \ \ \ \ a\mapsto0
\]
is a ring homomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.riho.triv}.]Each of the four axioms in Definition
\ref{def.riho.riho} holds trivially for this map (since $\mathbb{M}$ has only
one element, and thus any two elements of $\mathbb{M}$ are equal).
\end{proof}

\begin{example}
\label{exa.riho.pin}Let $n$ be an integer. Consider the projection%
\begin{align*}
\pi_{\underset{n}{\equiv}}:\mathbb{Z}  &  \rightarrow\mathbb{Z}/n,\\
s  &  \mapsto\left[  s\right]  _{n}.
\end{align*}
This is a ring homomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.riho.pin}.]Again, let us check axiom \textbf{(c)}
only. So let $a,b\in\mathbb{Z}$. We must prove that $\pi_{\underset{n}{\equiv
}}\left(  ab\right)  =\pi_{\underset{n}{\equiv}}\left(  a\right)  \cdot
\pi_{\underset{n}{\equiv}}\left(  b\right)  $.

The left hand side is $\left[  ab\right]  _{n}$, while the right hand side is
$\left[  a\right]  _{n}\cdot\left[  b\right]  _{n}$. So they are equal,
because this is how $\left[  a\right]  _{n}\cdot\left[  b\right]  _{n}$ was
defined. Thus, axiom \textbf{(c)} holds.
\end{proof}

\begin{example}
\label{exa.riho.Rn-not}Let $n$ be a positive integer. Consider the map%
\begin{align*}
R_{n}:\mathbb{Z}/n  &  \rightarrow\mathbb{Z},\\
\left[  s\right]  _{n}  &  \mapsto s\%n.
\end{align*}
(This is the map sending $\left[  0\right]  _{n},\left[  1\right]  _{n}%
,\ldots,\left[  n-1\right]  _{n}$ to the numbers $0,1,\ldots,n-1$.) This map
$R_{n}$ is \textbf{not} a ring homomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.riho.Rn-not}.]Assume the contrary. Thus, $R_{n}$ is
a ring homomorphism. We want a contradiction.

We are in one of the following two cases:

\textit{Case 1:} We have $n>1$.

\textit{Case 2:} We have $n=1$.

Let us first consider Case 1. In this case, we have $n>1$.

We have assumed that $R_{n}$ is a ring homomorphism. Thus, axiom \textbf{(a)}
can be applied to $a=\left[  1\right]  _{n}$ and $b=\left[  n-1\right]  _{n}$,
and thus we get $R_{n}\left(  \left[  1\right]  _{n}+\left[  n-1\right]
_{n}\right)  =R_{n}\left(  \left[  1\right]  _{n}\right)  +R_{n}\left(
\left[  n-1\right]  _{n}\right)  $. But comparing%
\[
R_{n}\left(  \left[  1\right]  _{n}+\left[  n-1\right]  _{n}\right)
=R_{n}\left(  \left[  n\right]  _{n}\right)  =R_{n}\left(  \left[  0\right]
_{n}\right)  =0
\]
with%
\[
\underbrace{R_{n}\left(  \left[  1\right]  _{n}\right)  }_{=1}%
+\underbrace{R_{n}\left(  \left[  n-1\right]  _{n}\right)  }_{=n-1}=1+\left(
n-1\right)  =n,
\]
we see that this is not true. So we have found a contradiction in Case 1.

Let us now consider Case 2. In this case, we have $n=1$. Thus, $\left[
1\right]  _{1}=\left[  0\right]  _{1}$. But the map $R_{n}$ maps $\left[
0\right]  _{1}$ to $0$ (by its definition). However, axiom \textbf{(d)} forces
$R_{n}\left(  \left[  1\right]  _{1}\right)  =1$, which contradicts
$R_{n}\left(  \left[  1\right]  _{1}\right)  =R_{n}\left(  \left[  0\right]
_{1}\right)  =0$. So we have found a contradiction in Case 2.

Thus, we always get a contradiction.
\end{proof}

\textbf{Warning:} The same people who don't require rings to have a unity, of
course, do not require ring homomorphisms to satisfy axiom \textbf{(d)}. So
for them, $R_{n}$ would be a ring homomorphism for $n=1$.

\begin{example}
\label{exa.riho.pind}Let $n$ and $d$ be integers such that $d\mid n$. Then,
the map%
\begin{align*}
\pi_{n,d}:\mathbb{Z}/n  &  \rightarrow\mathbb{Z}/d,\\
\left[  s\right]  _{n}  &  \mapsto\left[  s\right]  _{d}%
\end{align*}
is a ring homomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.riho.pind}.]Let us check axiom \textbf{(c)}. So we
must prove that $\pi_{n,d}\left(  \alpha\beta\right)  =\pi_{n,d}\left(
\alpha\right)  \cdot\pi_{n,d}\left(  \beta\right)  $ for all $\alpha,\beta
\in\mathbb{Z}/n$.

Fix $\alpha,\beta\in\mathbb{Z}/n$. Write $\alpha$ as $\alpha=\left[  a\right]
_{n}$ with $a\in\mathbb{Z}$. Write $\beta$ as $\beta=\left[  b\right]  _{n}$
with $b\in\mathbb{Z}$.

Thus, $\pi_{n,d}\left(  \alpha\right)  =\pi_{n,d}\left(  \left[  a\right]
_{n}\right)  =\left[  a\right]  _{d}$ and $\pi_{n,d}\left(  \beta\right)
=\pi_{n,d}\left(  \left[  b\right]  _{n}\right)  =\left[  b\right]  _{d}$.
Multiplying these two equalities, we obtain
\begin{equation}
\underbrace{\pi_{n,d}\left(  \alpha\right)  }_{=\left[  a\right]  _{d}}%
\cdot\underbrace{\pi_{n,d}\left(  \beta\right)  }_{=\left[  b\right]  _{d}%
}=\left[  a\right]  _{d}\cdot\left[  b\right]  _{d}=\left[  ab\right]  _{d}.
\label{pf.exa.riho.pind.2}%
\end{equation}


But $\underbrace{\alpha}_{=\left[  a\right]  _{n}}\underbrace{\beta}_{=\left[
b\right]  _{n}}=\left[  a\right]  _{n}\cdot\left[  b\right]  _{n}=\left[
ab\right]  _{n}$ and thus $\pi_{n,d}\left(  \alpha\beta\right)  =\pi
_{n,d}\left(  \left[  ab\right]  _{n}\right)  =\left[  ab\right]  _{d}$.
Comparing this equality to (\ref{pf.exa.riho.pind.2}), we conclude $\pi
_{n,d}\left(  \alpha\beta\right)  =\pi_{n,d}\left(  \alpha\right)  \cdot
\pi_{n,d}\left(  \beta\right)  $. Thus, axiom \textbf{(c)} is proven. The
other three axioms are proven similarly (we leave the details to the reader).
\end{proof}

\begin{remark}
\label{rmk.riho.pind.only}Let $n$ and $d$ be integers. Then:

\textbf{(a)} If $d\mid n$, then the only ring homomorphism from $\mathbb{Z}/n$
to $\mathbb{Z}/d$ is $\pi_{n,d}$.

\textbf{(b)} If $d\nmid n$, then there is no ring homomorphism from
$\mathbb{Z}/n$ to $\mathbb{Z}/d$.
\end{remark}

Remark \ref{rmk.riho.pind.only} is not hard to prove, but we won't do this here.

\begin{example}
\label{exa.riho.C-mu}Consider the map $\mu:\mathbb{C}\rightarrow
\mathbb{R}^{2\times2}$ defined in Proposition \ref{prop.CC.as-matrices.mu}.
This map $\mu$ is a ring homomorphism.
\end{example}

\begin{proof}
Proposition \ref{prop.CC.as-matrices.mu} yields that the map $\mu$ satisfies
axioms \textbf{(a)} and \textbf{(c)}. It is easy to see that it satisfies the
other two.
\end{proof}

\begin{example}
\label{exa.riho.C-iota}Let $\iota_{\mathbb{C}}$ be the map%
\begin{align*}
\mathbb{R}  &  \rightarrow\mathbb{C},\\
r  &  \mapsto r_{\mathbb{C}}=\left(  r,0\right)  .
\end{align*}
This is a ring homomorphism.
\end{example}

\begin{proof}
Theorem \ref{thm.CC.RRtoCC.hom} shows that $\iota_{\mathbb{C}}$ satisfies
axioms \textbf{(a)} and \textbf{(c)}. As for \textbf{(b)} and \textbf{(d)},
these follow from the fact that the zero of $\mathbb{C}$ is $0_{\mathbb{C}%
}=\left(  0,0\right)  $ and the unity of $\mathbb{C}$ is $1_{\mathbb{C}%
}=\left(  1,0\right)  $.
\end{proof}

\begin{example}
\label{exa.riho.transp2}Let $\mathbb{K}$ be a commutative ring.

Let $\mathbb{K}^{2\leq2}$ be the ring of upper-triangular $2\times2$-matrices.
(This is a ring, by Proposition \ref{prop.matrix.triang-ring}.)

Let $\mathbb{K}^{2\geq2}$ be the ring of lower-triangular $2\times2$-matrices.
(This is a ring, by Proposition \ref{prop.matrix.triang-ring}.)

\textbf{(a)} Consider the map%
\begin{align*}
\mathbb{K}^{2\leq2}  &  \rightarrow\mathbb{K}^{2\geq2},\\
\left(
\begin{array}
[c]{cc}%
a & b\\
0 & c
\end{array}
\right)   &  \mapsto\left(
\begin{array}
[c]{cc}%
a & 0\\
b & c
\end{array}
\right)  .
\end{align*}
In other words, this is the map sending each $A$ to $A^{T}$ (the transpose of
$A$). Is this a ring homomorphism? No, because $\left(  AB\right)  ^{T}$ is
$B^{T}A^{T}$, not $A^{T}B^{T}$ (in general). This is called a \textit{ring
antihomomorphism}. Note that if $\mathbb{K}$ was an arbitrary (not
commutative) ring, then $\left(  AB\right)  ^{T}$ would (in general!) equal
neither $B^{T}A^{T}$ nor $A^{T}B^{T}$.

\textbf{(b)} Consider the map%
\begin{align*}
\mathbb{K}^{2\leq2}  &  \rightarrow\mathbb{K}^{2\geq2},\\
\left(
\begin{array}
[c]{cc}%
a & b\\
0 & c
\end{array}
\right)   &  \mapsto\left(
\begin{array}
[c]{cc}%
c & 0\\
b & a
\end{array}
\right)  .
\end{align*}
In other words, this is the map that reverses the order of the rows and
reverses the order of the columns. You can check that this is a ring
homomorphism. This holds even if $\mathbb{K}$ is an arbitrary (not
commutative) ring.
\end{example}

\begin{proposition}
\label{prop.riho.subtract}Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. Let
$f:\mathbb{K}\rightarrow\mathbb{L}$ be a ring homomorphism.

\textbf{(a)} We have $f\left(  -a\right)  =-f\left(  a\right)  $ for all
$a\in\mathbb{K}$. (In other words, $f$ \textquotedblleft preserves additive
inverses\textquotedblright.)

\textbf{(b)} If $a\in\mathbb{K}$ is invertible, then $f\left(  a\right)
\in\mathbb{L}$ is also invertible, and we have $f\left(  a^{-1}\right)
=\left(  f\left(  a\right)  \right)  ^{-1}$. (In other words, $f$
\textquotedblleft preserves multiplicative inverses\textquotedblright.)

\textbf{(c)} We have $f\left(  a-b\right)  =f\left(  a\right)  -f\left(
b\right)  $ for all $a,b\in\mathbb{K}$.

\textbf{(d)} If the rings $\mathbb{K}$ and $\mathbb{L}$ are commutative, then
we have $f\left(  \dfrac{a}{b}\right)  =\dfrac{f\left(  a\right)  }{f\left(
b\right)  }$ for all $a,b\in\mathbb{K}$ for which $b$ is invertible.

\textbf{(e)} We have $f\left(  \sum_{s\in S}a_{s}\right)  =\sum_{s\in
S}f\left(  a_{s}\right)  $ whenever $S$ is a finite set and $a_{s}%
\in\mathbb{K}$ for all $s\in S$.

\textbf{(f)} We have $f\left(  a_{1}a_{2}\cdots a_{k}\right)  =f\left(
a_{1}\right)  f\left(  a_{2}\right)  \cdots f\left(  a_{k}\right)  $ whenever
$a_{1},a_{2},\ldots,a_{k}\in\mathbb{K}$.

\textbf{(g)} If the rings $\mathbb{K}$ and $\mathbb{L}$ are commutative, then
$f\left(  \prod_{s\in S}a_{s}\right)  =\prod_{s\in S}f\left(  a_{s}\right)  $
whenever $S$ is a finite set and $a_{s}\in\mathbb{K}$ for all $s\in S$.

\textbf{(h)} We have $f\left(  a^{n}\right)  =\left(  f\left(  a\right)
\right)  ^{n}$ for each $a\in\mathbb{K}$ and each $n\in\mathbb{N}$.

\textbf{(i)} We have $f\left(  na\right)  =nf\left(  a\right)  $ for each
$a\in\mathbb{K}$ and each $n\in\mathbb{Z}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.riho.subtract}.]The map $f$ is a ring
homomorphism, and thus satisfies the four axioms \textbf{(a)}, \textbf{(b)},
\textbf{(c)} and \textbf{(d)} of Definition \ref{def.riho.riho}.

\textbf{(b)} Let $a\in\mathbb{K}$ be invertible. We have%
\[
f\left(  a^{-1}a\right)  =f\left(  a^{-1}\right)  f\left(  a\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by axiom \textbf{(c)}}\right)  .
\]
Thus,%
\[
f\left(  a^{-1}\right)  f\left(  a\right)  =f\left(  \underbrace{a^{-1}a}%
_{=1}\right)  =f\left(  1\right)  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{by axiom
\textbf{(d)}}\right)  .
\]
Similarly, $f\left(  a\right)  f\left(  a^{-1}\right)  =1$. These two
equations are saying that $f\left(  a^{-1}\right)  $ is a multiplicative
inverse of $f\left(  a\right)  $. Thus, $f\left(  a\right)  $ is invertible,
and $f\left(  a^{-1}\right)  =\left(  f\left(  a\right)  \right)  ^{-1}$. This
proves Proposition \ref{prop.riho.subtract} \textbf{(b)}.

\textbf{(a)} Repeat the proof we just gave for Proposition
\ref{prop.riho.subtract} \textbf{(b)}, but replace multiplication and $1$ by
addition and $0$ (and forget about invertibility, because every element of
$\mathbb{K}$ or $\mathbb{L}$ has an additive inverse).

\textbf{(c)} Let $a,b\in\mathbb{K}$. Then, $a-b=a+\left(  -b\right)  $ (by the
definition of subtraction). Thus,%
\begin{align*}
f\left(  a-b\right)   &  =f\left(  a+\left(  -b\right)  \right)  =f\left(
a\right)  +\underbrace{f\left(  -b\right)  }_{\substack{=-f\left(  b\right)
\\\text{(by Proposition \ref{prop.riho.subtract} \textbf{(a)})}}%
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by axiom \textbf{(a)}}\right) \\
&  =f\left(  a\right)  +\left(  -f\left(  b\right)  \right)  =f\left(
a\right)  -f\left(  b\right)
\end{align*}
(since the definition of subtraction yields $f\left(  a\right)  -f\left(
b\right)  =f\left(  a\right)  +\left(  -f\left(  b\right)  \right)  $). This
proves Proposition \ref{prop.riho.subtract} \textbf{(c)}.

\textbf{(d)} Similar to part \textbf{(c)}, but addition is replaced by multiplication.

\textbf{(e)} Induction on $\left\vert S\right\vert $. The induction base uses
axiom \textbf{(b)}; the induction step uses axiom \textbf{(a)}.

\textbf{(f)} Induction on $k$. The induction base uses axiom \textbf{(d)}; the
induction step uses axiom \textbf{(c)}.

\textbf{(g)} Induction on $\left\vert S\right\vert $. The induction base uses
axiom \textbf{(d)}; the induction step uses axiom \textbf{(c)}.

\textbf{(h)} Follows from Proposition \ref{prop.riho.subtract} \textbf{(f)},
applied to $k=n$ and $a_{i}=a$.

\textbf{(i)} If $n\geq0$, then Definition \ref{def.rings.na} yields
$na=\underbrace{a+a+\cdots+a}_{n\text{ times}}$ and $nf\left(  a\right)
=\underbrace{f\left(  a\right)  +f\left(  a\right)  +\cdots+f\left(  a\right)
}_{n\text{ times}}$. Thus, if $n\geq0$, then Proposition
\ref{prop.riho.subtract} \textbf{(i)} boils down to%
\[
f\left(  \underbrace{a+a+\cdots+a}_{n\text{ times}}\right)
=\underbrace{f\left(  a\right)  +f\left(  a\right)  +\cdots+f\left(  a\right)
}_{n\text{ times}},
\]
which follows from Proposition \ref{prop.riho.subtract} \textbf{(e)} (applied
to $S=\left\{  1,2,\ldots,n\right\}  $ and $a_{s}=a$). The case when $n<0$ can
be reduced to the case when $n\geq0$ by using Proposition
\ref{prop.riho.subtract} \textbf{(a)}.
\end{proof}

The composition of two ring homomorphisms is again a ring homomorphism, as the
following proposition shows:

\begin{proposition}
\label{prop.riho.compose}Let $\mathbb{K}$, $\mathbb{L}$ and $\mathbb{M}$ be
three rings. Let $f:\mathbb{K}\rightarrow\mathbb{L}$ and $g:\mathbb{L}%
\rightarrow\mathbb{M}$ be two ring homomorphisms. Then, the composition
$g\circ f:\mathbb{K}\rightarrow\mathbb{M}$ is also a ring homomorphism.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.riho.compose}.]This is exercise 4 \textbf{(a)}
on \href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw6s.pdf}{homework set
\#6}.
\end{proof}

\subsection{\label{sect.ring.riiso}Ring isomorphisms}

\begin{definition}
\label{def.riiso.riiso}Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. Let
$f:\mathbb{K}\rightarrow\mathbb{L}$ be a map. Then, $f$ is called a
\textit{ring isomorphism} if and only if $f$ is invertible (i.e., bijective)
and both $f$ and $f^{-1}$ are ring homomorphisms.
\end{definition}

\begin{example}
\label{exa.riiso.id}Let $\mathbb{K}$ be a ring. The identity map
$\operatorname*{id}:\mathbb{K}\rightarrow\mathbb{K}$ is a ring isomorphism.
\end{example}

\begin{example}
\label{exa.riiso.dn}Let $\mathbb{K}$ be a ring. Let $n\in\mathbb{N}$. Consider
the map%
\begin{align*}
\mathbf{d}_{n}:\underbrace{\mathbb{K}\times\mathbb{K}\times\cdots
\times\mathbb{K}}_{n\text{ times}}  &  \rightarrow\left\{  \text{diagonal
}n\times n\text{-matrices over }\mathbb{K}\right\}  ,\\
\left(  d_{1},d_{2},\ldots,d_{n}\right)   &  \mapsto\left(
\begin{array}
[c]{ccccc}%
d_{1} & 0 & 0 & \cdots & 0\\
0 & d_{2} & 0 & \cdots & 0\\
0 & 0 & d_{3} & \cdots & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
0 & 0 & 0 & \cdots & d_{n}%
\end{array}
\right)  .
\end{align*}
Note that both $\underbrace{\mathbb{K}\times\mathbb{K}\times\cdots
\times\mathbb{K}}_{n\text{ times}}$ and $\left\{  \text{diagonal }n\times
n\text{-matrices over }\mathbb{K}\right\}  $ are rings (the former by
Definition \ref{def.ring.dirprod2}; the latter by Proposition
\ref{prop.matrix.triang-ring} \textbf{(c)}).

The map $\mathbf{d}_{n}$ is invertible. I claim that furthermore,
$\mathbf{d}_{n}$ is a ring isomorphism. This is easiest to check using
Proposition \ref{prop.riiso.invertible} further below. Note that this claim is
a rigorous version of our earlier informal statement that the ring formed by
the diagonal $n\times n$-matrices is just $\underbrace{\mathbb{K}%
\times\mathbb{K}\times\cdots\times\mathbb{K}}_{n\text{ times}}$ in disguise.
The isomorphism $\mathbf{d}_{n}$ is responsible for the disguise!
\end{example}

\begin{example}
The map from $\mathbb{K}^{2\leq2}$ to $\mathbb{K}^{2\geq2}$ introduced in
Example \ref{exa.riho.transp2} \textbf{(b)} is a ring isomorphism. Its inverse
is the map%
\begin{align*}
\mathbb{K}^{2\geq2}  &  \rightarrow\mathbb{K}^{2\leq2},\\
\left(
\begin{array}
[c]{cc}%
c & 0\\
b & a
\end{array}
\right)   &  \mapsto\left(
\begin{array}
[c]{cc}%
a & b\\
0 & c
\end{array}
\right)  .
\end{align*}

\end{example}

\begin{proposition}
\label{prop.riiso.invertible}Let $\mathbb{K}$ and $\mathbb{L}$ be two rings.
Let $f:\mathbb{K}\rightarrow\mathbb{L}$ be an invertible ring homomorphism.
Then, $f$ is a ring isomorphism.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.riiso.invertible}.]We just need to show that
$f^{-1}$ is a ring homomorphism.

Let us verify axiom \textbf{(c)} for $f^{-1}$. This means that we must prove
that%
\[
f^{-1}\left(  ab\right)  =f^{-1}\left(  a\right)  f^{-1}\left(  b\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{L}.
\]


So let $a,b\in\mathbb{L}$. We know that $f$ is a ring homomorphism; thus it
satisfies axiom \textbf{(c)}. Applying this axiom to $f^{-1}\left(  a\right)
$ and $f^{-1}\left(  b\right)  $ instead of $a$ and $b$, we find%
\[
f\left(  f^{-1}\left(  a\right)  f^{-1}\left(  b\right)  \right)
=\underbrace{f\left(  f^{-1}\left(  a\right)  \right)  }_{=a}\cdot
\underbrace{f\left(  f^{-1}\left(  b\right)  \right)  }_{=b}=ab=f\left(
f^{-1}\left(  ab\right)  \right)  .
\]
Since $f$ is injective (because $f$ is invertible), we thus conclude%
\[
f^{-1}\left(  a\right)  f^{-1}\left(  b\right)  =f^{-1}\left(  ab\right)  ,
\]
which is precisely what we wanted to prove.

So axiom \textbf{(c)} for $f^{-1}$ is verified. Axiom \textbf{(a)} follows by
the same argument with $+$ instead of $\cdot$.

Since $f$ satisfies axiom \textbf{(d)} (being a ring homomorphism), we have
$f\left(  1\right)  =1$. But this yields $f^{-1}\left(  1\right)  =1$; thus,
$f^{-1}$ satisfies axiom \textbf{(d)}. Similarly, $f^{-1}$ satisfies axiom
\textbf{(b)}.

Thus, the map $f^{-1}:\mathbb{L}\rightarrow\mathbb{K}$ satisfies all four
axioms for a ring homomorphism. Hence, $f^{-1}$ is a ring homomorphism. Thus,
$f$ is a ring isomorphism (by the definition of a ring isomorphism). This
proves Proposition \ref{prop.riiso.invertible}.
\end{proof}

\begin{example}
\label{exa.riiso.ZZ'}Recall the ring $\mathbb{Z}^{\prime}$ introduced in
Section \ref{sect.ring.exa}. It is the \textbf{set} $\mathbb{Z}$, endowed with
the usual addition $+$ and the unusual multiplication $\widetilde{\times}$ and
the elements $0_{\mathbb{Z}^{\prime}}=0$ and $1_{\mathbb{Z}^{\prime}}=-1$.

As we have suggested back in that section, this ring $\mathbb{Z}^{\prime}$ is
simply a relabelled version of $\mathbb{Z}$. We now have the proper language
for this: The map%
\[
\varphi:\mathbb{Z}\rightarrow\mathbb{Z}^{\prime},\ \ \ \ \ \ \ \ \ \ a\mapsto
-a
\]
is a ring isomorphism. This can easily be checked using Proposition
\ref{prop.riiso.invertible}, since this map $\varphi$ is invertible (actually,
$\varphi\circ\varphi=\operatorname*{id}$), and since $\varphi$ is a ring
homomorphism (because of (\ref{eq.exa.ring.ZZ'.phi.1}),
(\ref{eq.exa.ring.ZZ'.phi.2}), (\ref{eq.exa.ring.ZZ'.phi.3}) and
(\ref{eq.exa.ring.ZZ'.phi.4})).
\end{example}

\begin{teachingnote}
\textbf{2019-04-08 lecture}
\end{teachingnote}

\begin{example}
\label{exa.riiso.CRT}Let $m$ and $n$ be two coprime positive integers. Then,
$\left(  \mathbb{Z}/m\right)  \times\left(  \mathbb{Z}/n\right)  $ is a ring
(according to Definition \ref{def.ring.dirprod2}). Theorem
\ref{thm.eqrel.CRT2} says that the map%
\begin{align*}
S_{m,n}:\mathbb{Z}/\left(  mn\right)   &  \rightarrow\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  ,\\
\alpha &  \mapsto\left(  \pi_{mn,m}\left(  \alpha\right)  ,\pi_{mn,n}\left(
\alpha\right)  \right)
\end{align*}
is well-defined and is a bijection. This map $S_{m,n}$ is furthermore a ring isomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.riiso.CRT}.]The map $S_{m,n}$ is a bijection, thus invertible.

Let us next prove that the map $S_{m,n}$ is a ring homomorphism.

For each $s\in\mathbb{Z}$, we have%
\begin{equation}
S_{m,n}\left(  \left[  s\right]  _{mn}\right)  =\left(  \underbrace{\pi
_{mn,m}\left(  \left[  s\right]  _{mn}\right)  }_{=\left[  s\right]  _{m}%
},\underbrace{\pi_{mn,n}\left(  \left[  s\right]  _{mn}\right)  }_{=\left[
s\right]  _{n}}\right)  =\left(  \left[  s\right]  _{m},\left[  s\right]
_{n}\right)  . \label{pf.exa.riiso.CRT.1}%
\end{equation}


Let us check axiom \textbf{(c)} from Definition \ref{def.riho.riho} for
$f=S_{m,n}$. Let $\alpha,\beta\in\mathbb{Z}/\left(  mn\right)  $. We must
prove that $S_{m,n}\left(  \alpha\beta\right)  =S_{m,n}\left(  \alpha\right)
\cdot S_{m,n}\left(  \beta\right)  $.

Write $\alpha$ and $\beta$ in the form $\alpha=\left[  a\right]  _{mn}$ and
$\beta=\left[  b\right]  _{mn}$ for some $a,b\in\mathbb{Z}$. Then,
$\alpha\beta=\left[  a\right]  _{mn}\left[  b\right]  _{mn}=\left[  ab\right]
_{mn}$, so
\[
S_{m,n}\left(  \alpha\beta\right)  =S_{m,n}\left(  \left[  ab\right]
_{mn}\right)  =\left(  \left[  ab\right]  _{m},\left[  ab\right]  _{n}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.exa.riiso.CRT.1})}\right)  .
\]
Comparing this with%
\begin{align*}
&  S_{m,n}\left(  \underbrace{\alpha}_{=\left[  a\right]  _{mn}}\right)  \cdot
S_{m,n}\left(  \underbrace{\beta}_{=\left[  b\right]  _{mn}}\right) \\
&  =\underbrace{S_{m,n}\left(  \left[  a\right]  _{mn}\right)  }%
_{\substack{=\left(  \left[  a\right]  _{m},\left[  a\right]  _{n}\right)
\\\text{(by (\ref{pf.exa.riiso.CRT.1}))}}}\cdot\underbrace{S_{m,n}\left(
\left[  b\right]  _{mn}\right)  }_{\substack{=\left(  \left[  b\right]
_{m},\left[  b\right]  _{n}\right)  \\\text{(by (\ref{pf.exa.riiso.CRT.1}))}%
}}\\
&  =\left(  \left[  a\right]  _{m},\left[  a\right]  _{n}\right)  \cdot\left(
\left[  b\right]  _{m},\left[  b\right]  _{n}\right)  =\left(
\underbrace{\left[  a\right]  _{m}\left[  b\right]  _{m}}_{=\left[  ab\right]
_{m}},\underbrace{\left[  a\right]  _{n}\left[  b\right]  _{n}}_{=\left[
ab\right]  _{n}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the multiplication }\cdot\text{ on the Cartesian product }\left(
\mathbb{Z}/m\right)  \times\left(  \mathbb{Z}/n\right) \\
\text{is defined entrywise}%
\end{array}
\right) \\
&  =\left(  \left[  ab\right]  _{m},\left[  ab\right]  _{n}\right)  ,
\end{align*}
we obtain $S_{m,n}\left(  \alpha\beta\right)  =S_{m,n}\left(  \alpha\right)
\cdot S_{m,n}\left(  \beta\right)  $. This proves axiom \textbf{(c)} for our
map $S_{m,n}$. Similarly, the other axioms can be shown. Thus, $S_{m,n}$ is a
ring homomorphism. Therefore, Proposition \ref{prop.riiso.invertible} shows
that $S_{m,n}$ is a ring isomorphism (since $S_{m,n}$ is invertible).
\end{proof}

Note one more simple general fact:

\begin{proposition}
\label{prop.riiso.inverse}Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. Let
$f:\mathbb{K}\rightarrow\mathbb{L}$ be a ring isomorphism. Then,
$f^{-1}:\mathbb{L}\rightarrow\mathbb{K}$ is also a ring isomorphism.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.riiso.inverse}.]Clearly, $f^{-1}$ is a ring
homomorphism (since $f$ is a ring isomorphism). Furthermore, $f^{-1}$ is
invertible (with inverse $\left(  f^{-1}\right)  ^{-1}=f$) and its inverse
$\left(  f^{-1}\right)  ^{-1}=f$ is a ring homomorphism as well. Thus,
$f^{-1}$ is a ring isomorphism. This proves Proposition
\ref{prop.riiso.inverse}.
\end{proof}

Let me attempt to discuss the use of ring isomorphisms; unfortunately, I will
have to be vague at this point. Ring homomorphisms allow us to transfer some
things from one ring into another. For example, if $f:\mathbb{K\rightarrow L}$
is a ring homomorphism from a ring $\mathbb{K}$ to a ring $\mathbb{L}$, then
$f$ sends any invertible element of $\mathbb{K}$ to an invertible element of
$\mathbb{L}$ (by Proposition \ref{prop.riho.subtract} \textbf{(b)}). However,
they are generally only \textquotedblleft one-way roads\textquotedblright. For
instance, if $f:\mathbb{K\rightarrow L}$ is a ring homomorphism from a ring
$\mathbb{K}$ to a ring $\mathbb{L}$, and if $a\in\mathbb{K}$ is such that
$f\left(  a\right)  \in\mathbb{L}$ is invertible, then $a$ may and may not be
invertible. A ring homomorphism from a ring $\mathbb{K}$ to a ring
$\mathbb{L}$ does not determine either ring in terms of the other. You can
have homomorphisms between completely different rings, such as from
$\mathbb{Z}$ to the zero ring, or from $\mathbb{Z}$ to $\mathbb{C}$.

On the other hand, ring isomorphisms let us go \textquotedblleft back and
forth\textquotedblright\ between the rings they connect; if we have a ring
isomorphism $f:\mathbb{K}\rightarrow\mathbb{L}$, we can regard $\mathbb{L}$ as
being \textquotedblleft the same ring as $\mathbb{K}$, with its elements
renamed\textquotedblright. (The isomorphism $f$ does the renaming: you should
think of each $a\in\mathbb{K}$ being renamed as $f\left(  a\right)  $.)

Thus, when you have a ring isomorphism $f:\mathbb{K}\rightarrow\mathbb{L}$,
you can take any ``intrinsic'' property\footnote{What do we mean by
``intrinsic''? Roughly speaking, an \textit{intrinsic} property of a ring is a
property that can be stated entirely in terms of its structure (i.e., its
ground set and its operations $+$ and $\cdot$ and its elements $0$ and $1$),
without referring to outside objects. For instance, ``every element $a$ of the
ring satisfies $a^{3} = a^{2}$'' is an intrinsic property (since $a^{3}=aaa$
and $a^{2}=aa$ are defined purely in terms of the operation $\cdot$), and
``the ring has two nonzero elements $a$ and $b$ such that $ab = 0$'' is an
intrinsic property as well (provided that ``nonzero'' and ``$0$'' refer to the
zero of the ring, rather than the number $0$), but ``the ring contains the
number $\sqrt[3]{2}$'' is not an intrinsic property (since it refers to an
outside object -- namely, the number $\sqrt[3]{2}$).} of $\mathbb{K}$ and
obtain the corresponding property of $\mathbb{L}$, and vice versa. Here is an example:

\begin{proposition}
\label{prop.riiso.fieldfield}Let $\mathbb{K}$ and $\mathbb{L}$ be two rings.
Let $f:\mathbb{K}\rightarrow\mathbb{L}$ be a ring isomorphism.

\textbf{(a)} If $\mathbb{K}$ is commutative, then $\mathbb{L}$ is commutative.

\textbf{(b)} If $0\neq1$ in $\mathbb{K}$, then $0\neq1$ in $\mathbb{L}$.

\textbf{(c)} If $\mathbb{K}$ is a skew field, then $\mathbb{L}$ is a skew field.

\textbf{(d)} If $\mathbb{K}$ is a field, then $\mathbb{L}$ is a field.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.riiso.fieldfield}.]The proofs given below are
exemplary; you should be able to similarly transfer any other property of
$\mathbb{K}$ to $\mathbb{L}$ and vice versa.

Recall that $f$ is a ring isomorphism. Thus, the map $f$ is invertible, and
both $f$ and $f^{-1}$ are ring homomorphisms (by the definition of a ring isomorphism).

\textbf{(a)} Assume that $\mathbb{K}$ is commutative. We must prove that
$\mathbb{L}$ is commutative. In other words, we must prove that $ab=ba$ for
any $a,b\in\mathbb{L}$.

Fix $a,b\in\mathbb{L}$. We know that $f$ is invertible. Hence, $f^{-1}\left(
a\right)  ,f^{-1}\left(  b\right)  \in\mathbb{K}$ are well-defined. Since
$\mathbb{K}$ is commutative, these satisfy%
\[
f^{-1}\left(  a\right)  f^{-1}\left(  b\right)  =f^{-1}\left(  b\right)
f^{-1}\left(  a\right)  .
\]
Applying $f$ to this equality, we get%
\begin{equation}
f\left(  f^{-1}\left(  a\right)  f^{-1}\left(  b\right)  \right)  =f\left(
f^{-1}\left(  b\right)  f^{-1}\left(  a\right)  \right)  .
\label{pf.prop.riiso.fieldfield.a.1}%
\end{equation}
But since $f$ is a ring homomorphism, we can apply axiom \textbf{(c)} of
Definition \ref{def.riho.riho} to $f^{-1}\left(  a \right)  $ and
$f^{-1}\left(  b \right)  $ instead of $a$ and $b$. We thus obtain
\[
f\left(  f^{-1}\left(  a\right)  f^{-1}\left(  b\right)  \right)
=\underbrace{f\left(  f^{-1}\left(  a\right)  \right)  }_{=a}%
\underbrace{f\left(  f^{-1}\left(  b\right)  \right)  }_{=b}=ab
\]
and similarly $f\left(  f^{-1}\left(  b\right)  f^{-1}\left(  a\right)
\right)  =ba$; thus, the equality (\ref{pf.prop.riiso.fieldfield.a.1}) becomes
$ab=ba$. This shows that $\mathbb{L}$ is commutative. This proves Proposition
\ref{prop.riiso.fieldfield} \textbf{(a)}.

Before I move on to the next part of Proposition \ref{prop.riiso.fieldfield},
let me explain how the above proof could be found straightforwardly, without
any creative input. The point of this is to show how to prove not just
Proposition \ref{prop.riiso.fieldfield} \textbf{(a)}, but any similar claim as well.

The (only) idea involved in the above proof was the following: The two
mutually inverse bijections $f : \mathbb{K} \to\mathbb{L}$ and $f^{-1} :
\mathbb{L} \to\mathbb{K}$ provide a ``railway system'' that can be used to
transport anything (elements, equalities, subsets, etc.) between $\mathbb{K}$
and $\mathbb{L}$. Since these bijections are ring homomorphisms, the structure
of the objects that we are transporting does not get ``damaged in transit'':
Products remain products (i.e., if we have three elements $a$, $b$ and $c$ of
$\mathbb{K}$ satisfying $ab = c$, and if we transport these three elements to
$\mathbb{L}$ via $f$, then the resulting three elements of $\mathbb{L}$ will
still satisfy $f\left(  a \right)  f\left(  b \right)  = f\left(  c \right)
$), sums remain sums, etc.. Thus, we can move back and forth between
$\mathbb{K}$ and $\mathbb{L}$ without keeping track of where precisely we take
our sums and products.

With this in mind, our above proof of Proposition \ref{prop.riiso.fieldfield}
\textbf{(a)} can be discovered as follows:

Assume that $\mathbb{K}$ is commutative. We must prove that $\mathbb{L}$ is
commutative. In other words, we must prove that $ab = ba$ for any $a, b
\in\mathbb{L}$. So let us fix $a, b \in\mathbb{L}$. We want to prove $ab =
ba$, but all we have is an analogous identity for elements of $\mathbb{K}$
(since we know that $\mathbb{K}$ is commutative). In other words, we have
\begin{equation}
a^{\prime}b^{\prime}= b^{\prime}a^{\prime}\ \ \ \ \ \ \ \ \ \ \text{for all }
a^{\prime}, b^{\prime}\in\mathbb{K} .
\label{pf.prop.riiso.fieldfield.a.idea.1}%
\end{equation}


So we transport our two elements $a,b$ of $\mathbb{L}$ to $\mathbb{K}$ (by our
\textquotedblleft railway system\textquotedblright\ -- specifically, using the
map $f^{-1}$), in order to be able to apply
\eqref{pf.prop.riiso.fieldfield.a.idea.1} to them. The result are the two
elements $f^{-1}\left(  a\right)  ,f^{-1}\left(  b\right)  $ of $\mathbb{K}$.
Applying the identity \eqref{pf.prop.riiso.fieldfield.a.idea.1} to $a^{\prime
}=f^{-1}\left(  a\right)  $ and $b^{\prime}=f^{-1}\left(  b\right)  $, we
obtain $f^{-1}\left(  a\right)  f^{-1}\left(  b\right)  =f^{-1}\left(
b\right)  f^{-1}\left(  a\right)  $. This is an equality inside $\mathbb{K}$,
whereas our goal is to prove an equality inside $\mathbb{L}$ (namely, the
equality $ab=ba$). So we transport this equality back into $\mathbb{L}$ by
applying $f$ to its two sides. We thus obtain
\begin{equation}
f\left(  f^{-1}\left(  a\right)  f^{-1}\left(  b\right)  \right)  =f\left(
f^{-1}\left(  b\right)  f^{-1}\left(  a\right)  \right)  .
\label{pf.prop.riiso.fieldfield.a.idea.2}%
\end{equation}
But recalling that $f$ is a ring homomorphism and thus no structure gets
\textquotedblleft damaged in transit\textquotedblright, we see that
\[
f\left(  f^{-1}\left(  a\right)  f^{-1}\left(  b\right)  \right)
=\underbrace{f\left(  f^{-1}\left(  a\right)  \right)  }_{=a}%
\underbrace{f\left(  f^{-1}\left(  b\right)  \right)  }_{=b}=ab
\]
and similarly $f\left(  f^{-1}\left(  b\right)  f^{-1}\left(  a\right)
\right)  =ba$. Hence, the equality (\ref{pf.prop.riiso.fieldfield.a.idea.2})
that we have just proven rewrites as $ab=ba$, which is precisely what we
wanted to prove. Thus, we have proven Proposition \ref{prop.riiso.fieldfield}
\textbf{(a)} by merely going back and forth between $\mathbb{K}$ and
$\mathbb{L}$.

Let us now prove the rest of Proposition \ref{prop.riiso.fieldfield}:

\textbf{(b)} Assume $0\neq1$ in $\mathbb{K}$. We must prove $0\neq1$ in
$\mathbb{L}$.

The map $f$ is an isomorphism, thus invertible, thus bijective, thus
injective. Hence, from $0\neq1$ in $\mathbb{K}$, we conclude $f\left(
0\right)  \neq f\left(  1\right)  $ in $\mathbb{L}$. But since $f$ is a ring
homomorphism, we have $f\left(  0\right)  =0$ and $f\left(  1\right)  =1$; so
this rewrites as $0\neq1$ in $\mathbb{L}$. This proves Proposition
\ref{prop.riiso.fieldfield} \textbf{(b)}.

\textbf{(c)} Assume that $\mathbb{K}$ is a skew field. We must prove that
$\mathbb{L}$ is a skew field.

Since $\mathbb{K}$ is a skew field, we have $0\neq1$ in $\mathbb{K}$, thus
$0\neq1$ in $\mathbb{L}$ (by Proposition \ref{prop.riiso.fieldfield}
\textbf{(b)}). Hence, it remains to prove that every nonzero element
$a\in\mathbb{L}$ has a multiplicative inverse.

Let $a\in\mathbb{L}$ be nonzero. Then, $f^{-1}\left(  a\right)  \in\mathbb{K}$
is nonzero (because if it was zero, then we would have $f^{-1}\left(
a\right)  =0$ and thus $f\left(  f^{-1}\left(  a\right)  \right)  =f\left(
0\right)  =0$ (since $f$ is a ring homomorphism); but this would contradict
the fact that $f\left(  f^{-1}\left(  a\right)  \right)  =a$ is nonzero).
Hence, $f^{-1}\left(  a\right)  \in\mathbb{K}$ has a multiplicative inverse
$b$ (since $\mathbb{K}$ is a skew field). Consider this $b$. Thus,
$f^{-1}\left(  a\right)  b=bf^{-1}\left(  a\right)  =1$ (since $b$ is a
multiplicative inverse of $f^{-1}\left(  a\right)  $). Applying $f$ to this
chain of equalities, we obtain%
\[
f\left(  f^{-1}\left(  a\right)  b\right)  =f\left(  bf^{-1}\left(  a\right)
\right)  =f\left(  1\right)  .
\]
This quickly rewrites as
\[
af\left(  b\right)  =f\left(  b\right)  a=1
\]
(since $f$ is a ring homomorphism). Thus, $f\left(  b\right)  $ is a
multiplicative inverse of $a$. Hence, $a$ has a multiplicative inverse. Thus,
we have shown that every nonzero element $a\in\mathbb{L}$ has a multiplicative
inverse. Since $0\neq1$ in $\mathbb{L}$, this shows that $\mathbb{L}$ is a
skew field. This proves Proposition \ref{prop.riiso.fieldfield} \textbf{(c)}.

\textbf{(d)} Assume that $\mathbb{K}$ is a field. We must prove that
$\mathbb{L}$ is a field.

Since $\mathbb{K}$ is a field, $\mathbb{K}$ is commutative, and thus
$\mathbb{L}$ is commutative (by Proposition \ref{prop.riiso.fieldfield}
\textbf{(a)}).

But $\mathbb{K}$ is a field, and thus a skew field. Hence, Proposition
\ref{prop.riiso.fieldfield} \textbf{(c)} shows that $\mathbb{L}$ is a skew
field. Since $\mathbb{L}$ is commutative, this yields that $\mathbb{L}$ is a
field. This proves Proposition \ref{prop.riiso.fieldfield} \textbf{(d)}.
\end{proof}

The idea of the above proof (and of many similar proofs, which we will omit)
is that if you have a ring isomorphism $f:\mathbb{K}\rightarrow\mathbb{L}$,
you can transport any equality or element from $\mathbb{K}$ to $\mathbb{L}$
(via $f$) or vice versa (via $f^{-1}$); and each time, the ring operations
($+$, $-$, $\cdot$, $\sum$, $0$, $1$) do not get damaged on the way (since $f$
and $f^{-1}$ are ring homomorphisms).

Here is another example of this sort of reasoning:

\begin{proposition}
\label{prop.riiso.equal-invertibles}Let $\mathbb{K}$ and $\mathbb{L}$ be two
rings. Let $f:\mathbb{K}\rightarrow\mathbb{L}$ be a ring isomorphism. Then:

\textbf{(a)} We have%
\[
\left\vert \left\{  \text{invertible elements of }\mathbb{K}\right\}
\right\vert =\left\vert \left\{  \text{invertible elements of }\mathbb{L}%
\right\}  \right\vert .
\]


\textbf{(b)} We have%
\[
\left\vert \left\{  \text{idempotent elements of }\mathbb{K}\right\}
\right\vert =\left\vert \left\{  \text{idempotent elements of }\mathbb{L}%
\right\}  \right\vert .
\]

\end{proposition}

Here, an element $a$ of a ring $\mathbb{K}$ is said to be \textit{idempotent}
if $a^{2}=a$.

\begin{proof}
[Proof of Proposition \ref{prop.riiso.equal-invertibles}.]Proposition
\ref{prop.riiso.equal-invertibles} is another instance of the
\textquotedblleft anything can be transported along a ring
isomorphism\textquotedblright\ principle (which we have used in Proposition
\ref{prop.riiso.fieldfield}). Here is a proof in more detail:

\textbf{(a)} If $a$ is an invertible element of $\mathbb{K}$, then $f\left(
a\right)  $ is an invertible element of $\mathbb{L}$ (since we can pick a
multiplicative inverse $b$ of $a$ in $\mathbb{K}$, and then $f\left(
b\right)  $ will be a multiplicative inverse of $f\left(  a\right)  $ in
$\mathbb{L}$). Hence, the map%
\begin{align*}
\left\{  \text{invertible elements of }\mathbb{K}\right\}   &  \rightarrow
\left\{  \text{invertible elements of }\mathbb{L}\right\}  ,\\
a  &  \mapsto f\left(  a\right)
\end{align*}
is well-defined. Similarly, the map%
\begin{align*}
\left\{  \text{invertible elements of }\mathbb{L}\right\}   &  \rightarrow
\left\{  \text{invertible elements of }\mathbb{K}\right\}  ,\\
a  &  \mapsto f^{-1}\left(  a\right)
\end{align*}
is also well-defined (since Proposition \ref{prop.riiso.inverse} shows that
the map $f^{-1}:\mathbb{L}\rightarrow\mathbb{K}$ is also a ring isomorphism).
These two maps are clearly mutually inverse, and therefore are bijections.
Hence, we have found a bijection from $\left\{  \text{invertible elements of
}\mathbb{K}\right\}  $ to $\left\{  \text{invertible elements of }%
\mathbb{L}\right\}  $. Thus,%
\[
\left\vert \left\{  \text{invertible elements of }\mathbb{K}\right\}
\right\vert =\left\vert \left\{  \text{invertible elements of }\mathbb{L}%
\right\}  \right\vert .
\]
This proves Proposition \ref{prop.riiso.equal-invertibles} \textbf{(a)}.

\textbf{(b)} If $a$ is an idempotent element of $\mathbb{K}$, then $f\left(
a\right)  $ is an idempotent element of $\mathbb{L}$ (since $f$ is a ring
homomorphism and thus $\left(  f\left(  a\right)  \right)  ^{2}=f\left(
\underbrace{a^{2}}_{=a}\right)  =f\left(  a\right)  $). Hence, the map%
\begin{align*}
\left\{  \text{idempotent elements of }\mathbb{K}\right\}   &  \rightarrow
\left\{  \text{idempotent elements of }\mathbb{L}\right\}  ,\\
a  &  \mapsto f\left(  a\right)
\end{align*}
is well-defined. Similarly, the map%
\begin{align*}
\left\{  \text{idempotent elements of }\mathbb{L}\right\}   &  \rightarrow
\left\{  \text{idempotent elements of }\mathbb{K}\right\}  ,\\
a  &  \mapsto f^{-1}\left(  a\right)
\end{align*}
is also well-defined (since Proposition \ref{prop.riiso.inverse} shows that
the map $f^{-1}:\mathbb{L}\rightarrow\mathbb{K}$ is also a ring isomorphism).
These two maps are clearly mutually inverse, and therefore are bijections.
Hence, we have found a bijection from $\left\{  \text{idempotent elements of
}\mathbb{K}\right\}  $ to $\left\{  \text{idempotent elements of }%
\mathbb{L}\right\}  $. Thus,%
\[
\left\vert \left\{  \text{idempotent elements of }\mathbb{K}\right\}
\right\vert =\left\vert \left\{  \text{idempotent elements of }\mathbb{L}%
\right\}  \right\vert .
\]
This proves Proposition \ref{prop.riiso.equal-invertibles} \textbf{(b)}.
\end{proof}

Now let us see some applications of ring isomorphisms.

Recall that we proved Theorem \ref{thm.ent.phi.mult} using the Chinese
Remainder Theorem in Section \ref{sect.equiv.CRT-bij}. Let us redo this proof
in a shorter way:

\begin{proof}
[New version of our Second proof of Theorem \ref{thm.ent.phi.mult}.]Example
\ref{exa.riiso.CRT} says that the map%
\begin{align*}
S_{m,n}:\mathbb{Z}/\left(  mn\right)   &  \rightarrow\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  ,\\
\alpha &  \mapsto\left(  \pi_{mn,m}\left(  \alpha\right)  ,\pi_{mn,n}\left(
\alpha\right)  \right)
\end{align*}
is a ring isomorphism. Thus,%
\begin{align}
&  \left\vert \left\{  \text{invertible elements of }\mathbb{Z}/\left(
mn\right)  \right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  \text{invertible elements of }\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  \right\}  \right\vert
\label{pf.thm.ent.phi.mult.3rd.1}%
\end{align}
(by Proposition \ref{prop.riiso.equal-invertibles} \textbf{(a)}).

But if $\mathbb{K}$ and $\mathbb{L}$ are any two rings, then%
\begin{align*}
&  \left\{  \text{invertible elements of }\mathbb{K}\times\mathbb{L}\right\}
\\
&  =\left\{  \text{invertible elements of }\mathbb{K}\right\}  \times\left\{
\text{invertible elements of }\mathbb{L}\right\}
\end{align*}
(since multiplication on $\mathbb{K}\times\mathbb{L}$ is defined entrywise, so
an element $\left(  a,b\right)  \in\mathbb{K}\times\mathbb{L}$ is invertible
if and only if both $a\in\mathbb{K}$ and $b\in\mathbb{L}$ are invertible).
Hence,%
\begin{align*}
&  \left\{  \text{invertible elements of }\left(  \mathbb{Z}/m\right)
\times\left(  \mathbb{Z}/n\right)  \right\} \\
&  =\left\{  \text{invertible elements of }\mathbb{Z}/m\right\}
\times\left\{  \text{invertible elements of }\mathbb{Z}/n\right\}  ,
\end{align*}
so that%
\begin{align*}
&  \left\vert \left\{  \text{invertible elements of }\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  \right\}  \right\vert \\
&  =\left\vert \left\{  \text{invertible elements of }\mathbb{Z}/m\right\}
\times\left\{  \text{invertible elements of }\mathbb{Z}/n\right\}  \right\vert
\\
&  =\left\vert \left\{  \text{invertible elements of }\mathbb{Z}/m\right\}
\right\vert \cdot\left\vert \left\{  \text{invertible elements of }%
\mathbb{Z}/n\right\}  \right\vert .
\end{align*}
Hence, (\ref{pf.thm.ent.phi.mult.3rd.1}) becomes%
\begin{align}
&  \left\vert \left\{  \text{invertible elements of }\mathbb{Z}/\left(
mn\right)  \right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  \text{invertible elements of }\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  \right\}  \right\vert
\nonumber\\
&  =\left\vert \left\{  \text{invertible elements of }\mathbb{Z}/m\right\}
\right\vert \cdot\left\vert \left\{  \text{invertible elements of }%
\mathbb{Z}/n\right\}  \right\vert . \label{pf.thm.ent.phi.mult.3rd.5}%
\end{align}


On the other hand, we know that%
\[
\phi\left(  n\right)  =\left\vert \left\{  \text{invertible elements of
}\mathbb{Z}/n\right\}  \right\vert
\]
(in fact, this is Corollary \ref{cor.equiv.modinv.Unphi} \textbf{(b)}, since
what we called $U_{n}$ in this corollary is exactly $\left\{  \text{invertible
elements of }\mathbb{Z}/n\right\}  $). Similarly,%
\begin{align*}
\phi\left(  m\right)   &  =\left\vert \left\{  \text{invertible elements of
}\mathbb{Z}/m\right\}  \right\vert \ \ \ \ \ \ \ \ \ \ \text{and}\\
\phi\left(  mn\right)   &  =\left\vert \left\{  \text{invertible elements of
}\mathbb{Z}/\left(  mn\right)  \right\}  \right\vert .
\end{align*}
So the equality (\ref{pf.thm.ent.phi.mult.3rd.5}) rewrites as $\phi\left(
mn\right)  =\phi\left(  m\right)  \cdot\phi\left(  n\right)  $. So Theorem
\ref{thm.ent.phi.mult} is proven again.
\end{proof}

The next exercise offers another example of the same strategy:

\begin{exercise}
\label{exe.riiso.idpZpq}Let $p$ and $q$ be two distinct primes. How many
idempotent elements does the ring $\mathbb{Z}/\left(  pq\right)  $ have?
\end{exercise}

\begin{proof}
[Solution to Exercise \ref{exe.riiso.idpZpq} (sketched).]The primes $p$ and
$q$ are distinct, so they are coprime. Hence, Example \ref{exa.riiso.CRT}
(applied to $m=p$ and $n=q$) says that the map%
\begin{align*}
S_{p,q}:\mathbb{Z}/\left(  pq\right)   &  \rightarrow\left(  \mathbb{Z}%
/p\right)  \times\left(  \mathbb{Z}/q\right)  ,\\
\alpha &  \mapsto\left(  \pi_{pq,p}\left(  \alpha\right)  ,\pi_{pq,q}\left(
\alpha\right)  \right)
\end{align*}
is a ring isomorphism. Hence, Proposition \ref{prop.riiso.equal-invertibles}
\textbf{(b)} yields%
\begin{align*}
&  \left\vert \left\{  \text{idempotent elements of }\mathbb{Z}/\left(
pq\right)  \right\}  \right\vert \\
&  =\left\vert \left\{  \text{idempotent elements of }\left(  \mathbb{Z}%
/p\right)  \times\left(  \mathbb{Z}/q\right)  \right\}  \right\vert \\
&  =\left\vert \left\{  \text{idempotent elements of }\mathbb{Z}/p\right\}
\times\left\{  \text{idempotent elements of }\mathbb{Z}/q\right\}
\right\vert
\end{align*}
(since for any two rings $\mathbb{K}$ and $\mathbb{L}$, we have%
\begin{align*}
&  \left\{  \text{idempotent elements of }\mathbb{K}\times\mathbb{L}\right\}
\\
&  =\left\{  \text{idempotent elements of }\mathbb{K}\right\}  \times\left\{
\text{idempotent elements of }\mathbb{L}\right\}  ,
\end{align*}
because of the entrywise multiplication on $\mathbb{K}\times\mathbb{L}$).
Thus, it remains to find the number of idempotent elements of $\mathbb{Z}/p$
and the number of idempotent elements of $\mathbb{Z}/q$.

How many idempotent elements does $\mathbb{Z}/p$ have? For any $a\in
\mathbb{Z}$, we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  \left[  a\right]  _{p}\text{ is idempotent}\right) \\
&  \Longleftrightarrow\ \left(  \left(  \left[  a\right]  _{p}\right)
^{2}=\left[  a\right]  _{p}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the
definition of \textquotedblleft idempotent\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \left[  a^{2}\right]  _{p}=\left[  a\right]
_{p}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  \left[
a\right]  _{p}\right)  ^{2}=\left[  a^{2}\right]  _{p}\right) \\
&  \Longleftrightarrow\ \left(  a^{2}\equiv a\operatorname{mod}p\right) \\
&  \Longleftrightarrow\ \left(  p\mid\underbrace{a^{2}-a}_{=a\left(
a-1\right)  }\right)  \ \Longleftrightarrow\ \left(  p\mid a\left(
a-1\right)  \right) \\
&  \Longleftrightarrow\ \left(  p\mid a\text{ or }p\mid a-1\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }p\text{ is prime}\right) \\
&  \Longleftrightarrow\ \left(  a\equiv0\operatorname{mod}p\text{ or }%
a\equiv1\operatorname{mod}p\right) \\
&  \Longleftrightarrow\ \left(  \left[  a\right]  _{p}=\left[  0\right]
_{p}\text{ or }\left[  a\right]  _{p}=\left[  1\right]  _{p}\right)  .
\end{align*}
In other words, for a given $a\in\mathbb{Z}$, the residue class $\left[
a\right]  _{p}$ is idempotent if and only if $\left[  a\right]  _{p}$ equals
$\left[  0\right]  _{p}$ or $\left[  1\right]  _{p}$. Since every residue
class $\alpha\in\mathbb{Z}/p$ has the form $\left[  a\right]  _{p}$ for some
$a\in\mathbb{Z}$, we can restate this as follows: A residue class $\alpha
\in\mathbb{Z}/p$ is idempotent if and only if it equals $\left[  0\right]
_{p}$ or $\left[  1\right]  _{p}$. Thus, the ring $\mathbb{Z}/p$ has exactly
two idempotent elements (namely, $\left[  0\right]  _{p}$ and $\left[
1\right]  _{p}$). In other words,%
\[
\left\vert \left\{  \text{idempotent elements of }\mathbb{Z}/p\right\}
\right\vert =2.
\]
Similarly,%
\[
\left\vert \left\{  \text{idempotent elements of }\mathbb{Z}/q\right\}
\right\vert =2.
\]
Now, the above computation becomes%
\begin{align*}
&  \left\vert \left\{  \text{idempotent elements of }\mathbb{Z}/\left(
pq\right)  \right\}  \right\vert \\
&  =\left\vert \left\{  \text{idempotent elements of }\mathbb{Z}/p\right\}
\times\left\{  \text{idempotent elements of }\mathbb{Z}/q\right\}  \right\vert
\\
&  =\underbrace{\left\vert \left\{  \text{idempotent elements of }%
\mathbb{Z}/p\right\}  \right\vert }_{=2}\cdot\underbrace{\left\vert \left\{
\text{idempotent elements of }\mathbb{Z}/q\right\}  \right\vert }_{=2}\\
&  =2\cdot2=4.
\end{align*}
In other words, the ring $\mathbb{Z}/\left(  pq\right)  $ has $4$ idempotent elements.

Side-note: What are these $4$ idempotent elements?

Two of them are easy to find: $\left[  0\right]  _{pq}$ and $\left[  1\right]
_{pq}$ (in fact, $0$ and $1$ are idempotent elements in any ring). But how to
get the other two?

Here is a systematic approach: Recall that $S_{p,q}:\mathbb{Z}/\left(
pq\right)  \rightarrow\left(  \mathbb{Z}/p\right)  \times\left(
\mathbb{Z}/q\right)  $ is a ring isomorphism. Thus, looking back at the proof
of Proposition \ref{prop.riiso.equal-invertibles} \textbf{(b)}, we see that
the idempotent elements of $\mathbb{Z}/\left(  pq\right)  $ are the preimages
of the idempotent elements of $\left(  \mathbb{Z}/p\right)  \times\left(
\mathbb{Z}/q\right)  $ under this isomorphism $S_{p,q}$.

The $4$ idempotent elements of $\left(  \mathbb{Z}/p\right)  \times\left(
\mathbb{Z}/q\right)  $ are%
\[
\left(  \left[  0\right]  _{p},\left[  0\right]  _{q}\right)
,\ \ \ \ \ \ \ \ \ \ \left(  \left[  1\right]  _{p},\left[  1\right]
_{q}\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  \left[  0\right]  _{p},\left[
1\right]  _{q}\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  \left[  1\right]
_{p},\left[  0\right]  _{q}\right)  .
\]
To find the $4$ idempotent elements in $\mathbb{Z}/\left(  pq\right)  $, we
thus have to apply the inverse $\left(  S_{p,q}\right)  ^{-1}$ of the
isomorphism $S_{p,q}$ to them.

\begin{itemize}
\item The first gets sent to $\left[  0\right]  _{pq}$.

\item The second gets sent to $\left[  1\right]  _{pq}$.

\item The last two get sent to $\left[  xp\right]  _{pq}$ and $\left[
yq\right]  _{pq}$, where $x$ is a modular inverse of $p$ modulo $q$, and where
$y$ is a modular inverse of $q$ modulo $p$. (It does not matter which inverses
we choose; we get the same elements.)

Here is a slightly different way to get the last two idempotent elements:
Bezout's theorem yields that there exist integers $x$ and $y$ such that
$xp+yq=1$. Then, $\left[  xp\right]  _{pq}$ and $\left[  yq\right]  _{pq}$ are
the two missing idempotents. (In truth, this is not different from the
previous answer; in fact, if $x$ and $y$ are integers such that $xp+yq=1$,
then $x$ is a modular inverse of $p$ modulo $q$, and $y$ is a modular inverse
of $q$ modulo $p$.)
\end{itemize}
\end{proof}

\begin{teachingnote}
\textbf{2019-04-10 lecture}
\end{teachingnote}

\begin{example}
Let $A$ be the $2\times2$-matrix $\left(
\begin{array}
[c]{cc}%
0 & 1\\
1 & 1
\end{array}
\right)  \in\mathbb{Z}^{2\times2}$.

On \href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/mt2s.pdf}{midterm \#2}
exercise 5, you have encountered the ring%
\[
\mathcal{F}=\left\{  aA+bI_{2}\ \mid\ a,b\in\mathbb{Z}\right\}  =\left\{
\left(
\begin{array}
[c]{cc}%
b & a\\
a & a+b
\end{array}
\right)  \ \mid\ a,b\in\mathbb{Z}\right\}  .
\]
This is a subring of the matrix ring $\mathbb{Z}^{2\times2}$.

On \href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw5s.pdf}{homework set
\#5} exercise 5, you have encountered the ring%
\[
\mathbb{Z}\left[  \phi\right]  =\left\{  a+b\phi\ \mid\ a,b\in\mathbb{Z}%
\right\}  ,
\]
where $\phi=\dfrac{1+\sqrt{5}}{2}=\allowbreak1.\,\allowbreak618\ldots$ is the
golden ratio. This is a subring of $\mathbb{R}$.

I claim that there is an isomorphism from $\mathbb{Z}\left[  \phi\right]  $ to
$\mathcal{F}$. Namely, the map%
\begin{align*}
f:\mathbb{Z}\left[  \phi\right]   &  \rightarrow\mathcal{F},\\
a+b\phi &  \mapsto bA+aI_{2}=\left(
\begin{array}
[c]{cc}%
a & b\\
b & a+b
\end{array}
\right)
\end{align*}
is a ring isomorphism (but not the only one!).
\end{example}

(Check this by hand.)

\begin{definition}
\label{def.riiso.isomorphic}Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. We
say that the rings $\mathbb{K}$ and $\mathbb{L}$ are \textit{isomorphic} if
there exists a ring isomorphism $f:\mathbb{K}\rightarrow\mathbb{L}$.

We write \textquotedblleft$\mathbb{K}\cong\mathbb{L}$ (as
rings)\textquotedblright\ to say that the rings $\mathbb{K}$ and $\mathbb{L}$
are isomorphic.
\end{definition}

\begin{example}
\label{exa.riiso.0}Let $\mathbb{K}$ be any ring, and let $\mathbb{M}$ be the
zero ring $\left\{  0\right\}  $. In Example \ref{exa.riho.triv}, we saw that
the map
\[
\mathbb{K}\rightarrow\mathbb{M},\ \ \ \ \ \ \ \ \ \ a\mapsto0
\]
is a ring homomorphism. This homomorphism is a ring isomorphism if and only if
the ring $\mathbb{K}$ is trivial (i.e., has only one element). Thus, each
trivial ring is isomorphic to the zero ring.
\end{example}

\subsection{Freshman's Dream}

Let us now prove a property of $p$-th powers in rings. At this point, this
property appears to be a mere curiosity, but it will come useful later (in
proving Theorem \ref{thm.binom.lucas}).

\begin{theorem}
\label{thm.ring.freshdream}Let $p$ be a prime. Let $\mathbb{K}$ be a ring such
that $p\cdot1_{\mathbb{K}}=0$. Let $a,b\in\mathbb{K}$ be such that $ab=ba$.
Then,%
\[
\left(  a+b\right)  ^{p}=a^{p}+b^{p}.
\]

\end{theorem}

Theorem \ref{thm.ring.freshdream} is often called \textquotedblleft%
\href{https://en.wikipedia.org/wiki/Freshman's_dream#Prime_characteristic}{Freshman's
Dream}\textquotedblright\ (in writing) or \textquotedblleft Idiot's Binomial
Formula\textquotedblright\ (colloquially).

\begin{example}
\label{exa.ring.freshdream.1}Let $p$ be a prime.

\textbf{(a)} The simplest example of a ring $\mathbb{K}$ in which
$p\cdot1_{\mathbb{K}}=0$ (apart from the zero ring) is the ring $\mathbb{Z}%
/p$. Unfortunately, this is too simple to make a good example for Theorem
\ref{thm.ring.freshdream}. Indeed, if $\mathbb{K}=\mathbb{Z}/p$, then any
$\alpha\in\mathbb{K}$ satisfies $\alpha^{p}=\alpha$ (because we can write
$\alpha$ as $\left[  a\right]  _{p}$ for some $a\in\mathbb{Z}$, and then apply
Theorem \ref{thm.ent.fermat} \textbf{(b)} to this $a$). Thus, as long as we
are staying in $\mathbb{K}=\mathbb{Z}/p$, the equality $\left(  a+b\right)
^{p}=a^{p}+b^{p}$ claimed by Theorem \ref{thm.ring.freshdream} boils down to
$a+b=a+b$ (since $\left(  a+b\right)  ^{p}=a+b$ and $a^{p}=a$ and $b^{p}=b$).

\textbf{(b)} In Section \ref{sect.ring.hunting1}, we have taken a prime $p>2$,
and constructed a finite field $\mathbb{K}_{\eta}^{\prime}$ of size $p^{2}$
(by picking a non-square $\eta\in\mathbb{Z}/p$ and performing the construction
in Definition \ref{def.finfield.K'eta}). This field satisfies $p\cdot
1_{\mathbb{K}_{\eta}^{\prime}}=0$, so we can apply Theorem
\ref{thm.ring.freshdream} to it as well. This time, $\alpha^{p}=\alpha$ will
no longer hold for all $\alpha$ in the field, so the result we get will not be obvious.

\textbf{(c)} Here is another example. Let $n\in\mathbb{N}$, and let
$\mathbb{K}$ be the matrix ring $\left(  \mathbb{Z}/p\right)  ^{n\times n}$.
This matrix ring $\mathbb{K}$ satisfies $p\cdot1_{\mathbb{K}}=0$ (since
scaling is defined entrywise on matrices). Thus, Theorem
\ref{thm.ring.freshdream} yields that any $a,b\in\mathbb{K}$ satisfying
$ab=ba$ must satisfy $\left(  a+b\right)  ^{p}=a^{p}+b^{p}$. Of course, not
every two matrices $a,b\in\mathbb{K}$ satisfy $ab=ba$, but there are many
matrices that do.

A particularly striking situation is the following: Assume that $n\leq p$, and
let $N\in\mathbb{K}$ be a strictly lower-triangular $n\times n$-matrix. For
example, if $n=3$, then $N$ has the form $\left(
\begin{array}
[c]{ccc}%
0 & 0 & 0\\
u & 0 & 0\\
v & w & 0
\end{array}
\right)  $. Then, I claim that
\begin{equation}
\left(  I_{n}+N\right)  ^{p}=I_{n}. \label{eq.exa.ring.freshdream.1.c.claim}%
\end{equation}


To prove this, we observe that $I_{n}\cdot N=N=N\cdot I_{n}$. Hence, Theorem
\ref{thm.ring.freshdream} can be applied to $a=I_{n}$ and $b=N$. As a result,
we obtain $\left(  I_{n}+N\right)  ^{p}=I_{n}^{p}+N^{p}$. But $N$ is a
strictly lower-triangular $n\times n$-matrix, and therefore satisfies
$N^{n}=0_{n\times n}$ (by \cite[Corollary 3.78]{lina}), and therefore
\begin{align*}
N^{p}  &  =\underbrace{N^{n}}_{=0_{n\times n}}N^{p-n}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n\leq p\right) \\
&  =0_{n\times n}N^{p-n}=0_{n\times n}.
\end{align*}
Furthermore, $I_{n}^{p}=I_{n}$ (since $I_{n}$ is the unity of the ring
$\mathbb{K}$). Hence, $\left(  I_{n}+N\right)  ^{p}=\underbrace{I_{n}^{p}%
}_{=I_{n}}+\underbrace{N^{p}}_{=0_{n\times n}}=I_{n}+0_{n\times n}=I_{n}$.
This proves (\ref{eq.exa.ring.freshdream.1.c.claim}).
\end{example}

\begin{proof}
[Proof of Theorem \ref{thm.ring.freshdream}.]For each $k\in\left\{
1,2,\ldots,p-1\right\}  $, we have $p\mid\dbinom{p}{k}$ (by Theorem
\ref{thm.binom.p|bin}) and thus%
\begin{equation}
\dbinom{p}{k}1_{\mathbb{K}}=0 \label{pf.thm.ring.freshdream.1}%
\end{equation}
(since $p\cdot1_{\mathbb{K}}=0$)\ \ \ \ \footnote{Here is this argument in
more detail:
\par
Let $k\in\left\{  1,2,\ldots,p-1\right\}  $. Then, $p\mid\dbinom{p}{k}$ (by
Theorem \ref{thm.binom.p|bin}). Hence, there exists an integer $c$ such that
$\dbinom{p}{k}=pc$. Consider this $c$. Then,%
\[
\underbrace{\dbinom{p}{k}}_{=pc=cp}1_{\mathbb{K}}=c\underbrace{p\cdot
1_{\mathbb{K}}}_{=0}=c\cdot0=0,
\]
qed.}.

But $ab=ba$. Hence, the binomial formula (more precisely, the identity
(\ref{eq.prop.rings.pow.rules.c.binom}), applied to $n=p$) yields%
\begin{align*}
\left(  a+b\right)  ^{p}  &  =\sum_{k=0}^{p}\dbinom{p}{k}a^{k}b^{p-k}\\
&  =\underbrace{\dbinom{p}{0}}_{=1}\underbrace{a^{0}}_{=1}\underbrace{b^{p-0}%
}_{=b^{p}}+\sum_{k=1}^{p-1}\dbinom{p}{k}\underbrace{a^{k}}_{=1_{\mathbb{K}%
}\cdot a^{k}}b^{p-k}+\underbrace{\dbinom{p}{p}}_{=1}a^{p}\underbrace{b^{p-p}%
}_{=b^{0}=1}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split off the addends for }k=0\text{ and for }k=p\\
\text{from the sum}%
\end{array}
\right) \\
&  =b^{p}+\sum_{k=1}^{p-1}\underbrace{\dbinom{p}{k}1_{\mathbb{K}}%
}_{\substack{=0\\\text{(by (\ref{pf.thm.ring.freshdream.1}))}}}a^{k}%
b^{p-k}+a^{p}=b^{p}+\underbrace{\sum_{k=1}^{p-1}0a^{k}b^{p-k}}_{=0}+a^{p}\\
&  =b^{p}+a^{p}=a^{p}+b^{p}.
\end{align*}
This proves Theorem \ref{thm.ring.freshdream}.
\end{proof}

We note that Theorem \ref{thm.ring.freshdream} would be false if $p$ wasn't
assumed to be prime. For example, it would be false for $p=4$ (a simple
counterexample being $\mathbb{K}=\mathbb{Z}/4$, $a=1$ and $b=1$).

As a consequence of Theorem \ref{thm.ring.freshdream}, we obtain some
unexpected ring homomorphisms:

\begin{corollary}
\label{cor.ring.frobenius}Let $p$ be a prime. Let $\mathbb{K}$ be a
commutative ring such that $p\cdot1_{\mathbb{K}}=0$. Let $F$ be the map%
\[
\mathbb{K}\rightarrow\mathbb{K},\ \ \ \ \ \ \ \ \ \ a\mapsto a^{p}.
\]
Then, $F$ is a ring homomorphism.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.ring.frobenius}.]According to Definition
\ref{def.riho.riho}, we must prove that it satisfies the following four axioms:

\textbf{(a)} We have $F\left(  a+b\right)  =F\left(  a\right)  +F\left(
b\right)  $ for all $a,b\in\mathbb{K}$.

\textbf{(b)} We have $F\left(  0\right)  =0$.

\textbf{(c)} We have $F\left(  ab\right)  =F\left(  a\right)  F\left(
b\right)  $ for all $a,b\in\mathbb{K}$.

\textbf{(d)} We have $F\left(  1\right)  =1$.

The axiom \textbf{(a)} boils down to $\left(  a+b\right)  ^{p}=a^{p}+b^{p}$,
which follows from Theorem \ref{thm.ring.freshdream} (since the commutativity
of $\mathbb{K}$ entails $ab=ba$).

The axiom \textbf{(c)} boils down to $\left(  ab\right)  ^{p}=a^{p}b^{p}$,
which follows from (\ref{eq.prop.rings.pow.rules.c.3}) (again because $ab=ba$).

The axioms \textbf{(b)} and \textbf{(d)} are obviously satisfied (since
$0^{p}=0$ and $1^{p}=1$). Thus, Corollary \ref{cor.ring.frobenius} is proven.
\end{proof}

The ring homomorphism $F$ in Corollary \ref{cor.ring.frobenius} is called the
\textit{Frobenius endomorphism}\footnote{The word \textquotedblleft
endomorphism\textquotedblright\ means \textquotedblleft homomorphism of some
object (here, a ring) to itself\textquotedblright, i.e., \textquotedblleft
homomorphism whose domain and codomain are the same\textquotedblright.} of
$\mathbb{K}$.

\section{\label{chp.la}Linear algebra over commutative rings}

We shall now continue studying rings, but slowly shift our focus: So far, we
have been studying rings themselves, but now we are going to move towards
structures \textquotedblleft over\textquotedblright\ rings, such as matrices
and $\mathbb{K}$-modules (a generalization of vector spaces). The rings will
no longer be the place where everything happens, but rather they will
\textquotedblleft act\textquotedblright\ on our structures in the way scalars
act on vectors in linear algebra.

\subsection{\label{sect.la.matrix-review}An overview of matrix algebra over
fields}

Next I shall give a quick review of matrix algebra adapted to the situation in
which the entries of the vectors belong to an arbitrary field. This review
will be quick and terse, but can be skipped, since the rest of this course
will not depend on it. It does, however, provide context and examples for
several constructions we will do further on.

I assume you have seen some basic matrix algebra: Gaussian elimination, ranks
of matrices, inverses of matrices, determinants, etc. (If not, see
\cite{Hefferon}.)

Usually, these things are done for matrices over $\mathbb{R}$ or $\mathbb{C}$.
But we can try doing the same with matrices over an arbitrary commutative ring
$\mathbb{K}$.

\subsubsection{Matrices over fields}

Let us first study the situation when $\mathbb{K}$ is a field.

\textbf{Example:} Let $\mathbb{K}=\mathbb{Z}/3$, and let $A=\left(
\begin{array}
[c]{ccc}%
0 & 1 & 1\\
1 & 0 & 1\\
1 & 1 & 0
\end{array}
\right)  \in\mathbb{K}^{3\times3}$. (Here, of course, \textquotedblleft%
$0$\textquotedblright\ and \textquotedblleft$1$\textquotedblright\ mean
$\left[  0\right]  _{3}$ and $\left[  1\right]  _{3}$.) Let $b=\left(
\begin{array}
[c]{c}%
1\\
1\\
1
\end{array}
\right)  \in\mathbb{K}^{3\times1}$. We want to find a column vector
$x\in\mathbb{K}^{3\times1}$ such that $Ax=b$. This means, explicitly, to find
$x_{1},x_{2},x_{3}\in\mathbb{K}$ such that%
\[
\left\{
\begin{array}
[c]{c}%
0x_{1}+1x_{2}+1x_{3}=1;\\
1x_{1}+0x_{2}+1x_{3}=1;\\
1x_{1}+1x_{2}+0x_{3}=1.
\end{array}
\right.
\]


Can we do this? Well, we can try: Augment the matrix $A$ with the column $b$,
obtaining the augmented matrix%
\[
\left(  A\mid b\right)  =\left(
\begin{array}
[c]{cccc}%
0 & 1 & 1 & 1\\
1 & 0 & 1 & 1\\
1 & 1 & 0 & 1
\end{array}
\right)  .
\]
Now, we shall transform this matrix into reduced row echelon form (see
\cite[\S 5]{Strickland} or \cite[Chapter One, \S III]{Hefferon}\footnote{The
reduced row echelon form is called \textquotedblleft reduced echelon
form\textquotedblright\ in \cite{Hefferon}.}) by a series of row operations
(this is called \textit{Gauss--Jordan reduction} in \cite[Chapter One,
\S III]{Hefferon}, and also appears as Method 6.3 in \cite{Strickland}):%
\begin{align*}
\left(  A\mid b\right)   &  =\left(
\begin{array}
[c]{cccc}%
0 & 1 & 1 & 1\\
1 & 0 & 1 & 1\\
1 & 1 & 0 & 1
\end{array}
\right)  \overset{\text{swap row }2\text{ with row }1}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 1\\
0 & 1 & 1 & 1\\
1 & 1 & 0 & 1
\end{array}
\right) \\
&  \overset{\text{subtract row }1\text{ from row }3}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 1\\
0 & 1 & 1 & 1\\
0 & 1 & 2 & 0
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }-1=2\text{ in }%
\mathbb{Z}/3\right) \\
&  \overset{\text{subtract row }2\text{ from row }3}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 1\\
0 & 1 & 1 & 1\\
0 & 0 & 1 & 2
\end{array}
\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{this is a row echelon form, but not a
reduced one}\right) \\
&  \overset{\text{subtract row }3\text{ from row }1}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 0 & 2\\
0 & 1 & 1 & 1\\
0 & 0 & 1 & 2
\end{array}
\right) \\
&  \overset{\text{subtract row }3\text{ from row }2}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 0 & 2\\
0 & 1 & 0 & 2\\
0 & 0 & 1 & 2
\end{array}
\right)  .
\end{align*}
So for any vector $x=\left(
\begin{array}
[c]{c}%
x_{1}\\
x_{2}\\
x_{3}%
\end{array}
\right)  \in\mathbb{K}^{3\times1}$, we have the following chain of
equivalences:%
\begin{align*}
&  \ \left(  Ax=b\right) \\
&  \Longleftrightarrow\ \left(  Ax-b=0_{3\times1}\right) \\
&  \Longleftrightarrow\ \left(  \left(  A\mid b\right)  \left(
\begin{array}
[c]{c}%
x_{1}\\
x_{2}\\
x_{3}\\
-1
\end{array}
\right)  =0_{3\times1}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since
}Ax-b=\left(  A\mid b\right)  \left(
\begin{array}
[c]{c}%
x_{1}\\
x_{2}\\
x_{3}\\
-1
\end{array}
\right)  \right) \\
&  \Longleftrightarrow\ \left(  \left(
\begin{array}
[c]{cccc}%
1 & 0 & 0 & 2\\
0 & 1 & 0 & 2\\
0 & 0 & 1 & 2
\end{array}
\right)  \left(
\begin{array}
[c]{c}%
x_{1}\\
x_{2}\\
x_{3}\\
-1
\end{array}
\right)  =0_{3\times1}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  A\mid b\right)
\mapsto\left(
\begin{array}
[c]{cccc}%
1 & 0 & 0 & 2\\
0 & 1 & 0 & 2\\
0 & 0 & 1 & 2
\end{array}
\right)  \text{ by a sequence of row operations}\right) \\
&  \Longleftrightarrow\ \left(  \left(
\begin{array}
[c]{c}%
x_{1}-2\\
x_{2}-2\\
x_{3}-2
\end{array}
\right)  =\left(
\begin{array}
[c]{c}%
0\\
0\\
0
\end{array}
\right)  \right)  \ \Longleftrightarrow\ \left(  \left(
\begin{array}
[c]{c}%
x_{1}\\
x_{2}\\
x_{3}%
\end{array}
\right)  =\left(
\begin{array}
[c]{c}%
2\\
2\\
2
\end{array}
\right)  \right)  .
\end{align*}
So our linear system has the unique solution%
\[
x=\left(
\begin{array}
[c]{c}%
2\\
2\\
2
\end{array}
\right)  .
\]


Next, let us try doing the same for $\mathbb{K}=\mathbb{Z}/2$, with the
\textquotedblleft same\textquotedblright\ matrix. (It will not be literally
the same matrix, of course, since $0$ and $1$ will now mean $\left[  0\right]
_{2}$ and $\left[  1\right]  _{2}$.)

Thus, let $\mathbb{K}=\mathbb{Z}/2$, and let $A=\left(
\begin{array}
[c]{ccc}%
0 & 1 & 1\\
1 & 0 & 1\\
1 & 1 & 0
\end{array}
\right)  \in\mathbb{K}^{3\times3}$. (Here, of course, \textquotedblleft%
$0$\textquotedblright\ and \textquotedblleft$1$\textquotedblright\ mean
$\left[  0\right]  _{2}$ and $\left[  1\right]  _{2}$.) Let $b=\left(
\begin{array}
[c]{c}%
1\\
1\\
1
\end{array}
\right)  \in\mathbb{K}^{3\times1}$. We want to find a column vector
$x\in\mathbb{K}^{3\times1}$ such that $Ax=b$. This means, explicitly, to find
$x_{1},x_{2},x_{3}\in\mathbb{K}$ such that%
\[
\left\{
\begin{array}
[c]{c}%
0x_{1}+1x_{2}+1x_{3}=1;\\
1x_{1}+0x_{2}+1x_{3}=1;\\
1x_{1}+1x_{2}+0x_{3}=1.
\end{array}
\right.
\]


Can we do this? We can try as before: Augment the matrix $A$ with the column
$b$, obtaining%
\[
\left(  A\mid b\right)  =\left(
\begin{array}
[c]{cccc}%
0 & 1 & 1 & 1\\
1 & 0 & 1 & 1\\
1 & 1 & 0 & 1
\end{array}
\right)  .
\]
Now, we shall transform this matrix into reduced row echelon form by a series
of row operations:%
\begin{align*}
\left(  A\mid b\right)   &  =\left(
\begin{array}
[c]{cccc}%
0 & 1 & 1 & 1\\
1 & 0 & 1 & 1\\
1 & 1 & 0 & 1
\end{array}
\right)  \overset{\text{swap row }2\text{ with row }1}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 1\\
0 & 1 & 1 & 1\\
1 & 1 & 0 & 1
\end{array}
\right) \\
&  \overset{\text{subtract row }1\text{ from row }3}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 1\\
0 & 1 & 1 & 1\\
0 & 1 & 1 & 0
\end{array}
\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }-1=1\text{ in }%
\mathbb{Z}/2\right) \\
&  \overset{\text{subtract row }2\text{ from row }3}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 1\\
0 & 1 & 1 & 1\\
0 & 0 & 0 & 1
\end{array}
\right) \\
&  \overset{\text{subtract row }3\text{ from row }1}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 0\\
0 & 1 & 1 & 1\\
0 & 0 & 0 & 1
\end{array}
\right) \\
&  \overset{\text{subtract row }3\text{ from row }2}{\mapsto}\left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 0\\
0 & 1 & 1 & 0\\
0 & 0 & 0 & 1
\end{array}
\right)  .
\end{align*}
So for any vector $x=\left(
\begin{array}
[c]{c}%
x_{1}\\
x_{2}\\
x_{3}%
\end{array}
\right)  \in\mathbb{K}^{3\times1}$, we have the following chain of
equivalences:
\begin{align*}
&  \ \left(  Ax=b\right) \\
&  \Longleftrightarrow\ \left(  Ax-b=0_{3\times1}\right) \\
&  \Longleftrightarrow\ \left(  \left(  A\mid b\right)  \left(
\begin{array}
[c]{c}%
x_{1}\\
x_{2}\\
x_{3}\\
-1
\end{array}
\right)  =0_{3\times1}\right) \\
&  \Longleftrightarrow\ \left(  \left(
\begin{array}
[c]{cccc}%
1 & 0 & 1 & 0\\
0 & 1 & 1 & 0\\
0 & 0 & 0 & 1
\end{array}
\right)  \left(
\begin{array}
[c]{c}%
x_{1}\\
x_{2}\\
x_{3}\\
-1
\end{array}
\right)  =0_{3\times1}\right) \\
&  \Longleftrightarrow\ \left(  \left(
\begin{array}
[c]{c}%
x_{1}+x_{3}\\
x_{2}+x_{3}\\
-1
\end{array}
\right)  =\left(
\begin{array}
[c]{c}%
0\\
0\\
0
\end{array}
\right)  \right)  \ \Longleftrightarrow\ \left(  \text{false}\right)
\end{align*}
(since $-1\neq0$ in $\mathbb{K}$). So our linear system has no solution.

By the way, you could have easily seen this from the system itself:%
\[
\left\{
\begin{array}
[c]{c}%
0x_{1}+1x_{2}+1x_{3}=1;\\
1x_{1}+0x_{2}+1x_{3}=1;\\
1x_{1}+1x_{2}+0x_{3}=1.
\end{array}
\right.
\]
Adding together the three equations, we get $0=1$ (since $1+1=0$ and $1+1+1=1$
in $\mathbb{Z}/2$), which is absurd. So the system has no solution.

\textbf{Upshot:} We can do linear algebra over any field more or less in the
same as we did over real/complex numbers. But the result may depend on the field.

Let me recall a couple theorems from linear algebra that hold (with the same
proofs) over any field:

\begin{theorem}
\label{thm.field.LA-main}Let $\mathbb{K}$ be a field.

\textbf{(a)} Any matrix over $\mathbb{K}$ has a unique reduced row echelon
form (abbreviated RREF).

\textbf{(b)} If $A\in\mathbb{K}^{n\times m}$ is any matrix and $R$ is its
RREF, then the row space, kernel (= nullspace) and rank of $A$ are equal to
those of $R$. (Here, the \textit{row space}, \textit{kernel} and \textit{rank}
of a matrix are defined in the same way as for real/complex matrices.)

\textbf{(c)} If $A\in\mathbb{K}^{n\times m}$ is any matrix, and if
$b\in\mathbb{K}^{n\times1}$ is any column vector, then the equation $Ax=b$
(for an unknown column vector $x\in\mathbb{K}^{m\times1}$) can be solved using
the Gaussian elimination algorithm (e.g., by forming the augmented matrix
$\left(  A\mid b\right)  $, then transforming it into RREF, and reading off
the solutions from this RREF by the same method as you learned in Linear Algebra).

\textbf{(d)} If $A\in\mathbb{K}^{n\times m}$ is a matrix with $n<m$, then
there exists a nonzero $x\in\mathbb{K}^{m\times1}$ such that $Ax=0_{n\times1}%
$. (\textquotedblleft Nonzero\textquotedblright\ means \textquotedblleft
distinct from $0_{m\times1}$\textquotedblright; a nonzero vector can have some
zero entries.)

\textbf{(e)} Let $A\in\mathbb{K}^{n\times n}$. Then, the following are equivalent:

\begin{itemize}
\item The matrix $A$ is invertible.

\item The matrix $A$ is row-equivalent to $I_{n}$. (Two matrices are said to
be \textit{row-equivalent} if one can be transformed into the other via row
operations: swapping rows, scaling rows and adding a multiple of one row to another.)

\item The matrix $A$ is column-equivalent to $I_{n}$. (The definition of
\textquotedblleft\textit{column-equivalent}\textquotedblright\ is the same as
of \textquotedblleft row-equivalent\textquotedblright, but with columns being
used instead of rows.)

\item The RREF of $A$ is $I_{n}$.

\item The RREF of $A$ has $n$ pivots.

\item The rank of $A$ is $n$.

\item The equation $Ax=0_{n\times1}$ (for an unknown $x\in\mathbb{K}%
^{n\times1}$) has only the trivial solution (that is, $x=0_{n\times1}$).

\item For each vector $b\in\mathbb{K}^{n\times1}$, the equation $Ax=b$ has a solution.

\item For each vector $b\in\mathbb{K}^{n\times1}$, the equation $Ax=b$ has a
unique solution.

\item The columns of $A$ are linearly independent.

\item The rows of $A$ are linearly independent.

\item There is a matrix $B\in\mathbb{K}^{n\times n}$ such that $AB=I_{n}$.

\item There is a matrix $B\in\mathbb{K}^{n\times n}$ such that $BA=I_{n}$.

\item We have $\det A\neq0$. (We will later define determinants.)
\end{itemize}

(Matrices satisfying these equivalent conditions are called
\textit{nonsingular}.)
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.field.LA-main} (sketched).]I shall give references
to places where these facts are proven. Most of these places only consider
matrices with real or complex entries, but the proofs still work for an
arbitrary field $\mathbb{K}$.

\textbf{(a)} See \cite[\S 6, proof of Theorem 6.2 (a)]{Strickland} or
\cite[Proposition 3.7]{Carrel17} or \cite[Proposition 8.14]{GalQua18} for the
proof that any matrix has a RREF; see \cite[Section One.III, Theorem
2.6]{Hefferon} or \cite[Proposition 3.18]{Carrel05} or \cite[Proposition
3.12]{Carrel17} or \cite[Proposition 8.19]{GalQua18} for a proof that this
RREF is unique.

\textbf{(b)} The RREF $R$ of $A$ is obtained from $A$ by a sequence of row
operations. Thus, it suffices to show that the row space, the kernel and the
rank of a matrix are preserved under row operations. This is well-known and
simple. (See, e.g., \cite[Lemma 9.15]{Strickland} or \cite[Proposition
8.13]{GalQua18} for a proof that the row space is preserved under row
operations. The fact that the kernel and the rank are preserved under row
operations is showed in \cite[proof of Proposition 8.13]{GalQua18} as well.)

\textbf{(c)} See \cite[Method 6.9]{Strickland} or \cite[Example before
Proposition 1.26]{Knapp1} or \cite[\S 8.11]{GalQua18}.

\textbf{(d)} This is \cite[Proposition 1.26 \textbf{(d)}]{Knapp1}, and also
appears in \cite[Remark 8.9]{Strickland} (because a relation $\lambda_{1}%
v_{1}+\cdots+\lambda_{m}v_{m}=0$ between the columns $v_{1},v_{2},\ldots
,v_{m}$ of $A$ means precisely that the vector $x=\left(  v_{1},v_{2}%
,\ldots,v_{m}\right)  ^{T}\in\mathbb{K}^{m\times1}$ satisfies $Ax=0_{n\times
1}$) and in \cite[Proposition 8.17]{GalQua18}.

\textbf{(e)} The Wikipedia calls Theorem \ref{thm.field.LA-main} \textbf{(e)}
(or similar results which have some more or fewer equivalent conditions) the
\textquotedblleft%
\href{https://en.wikipedia.org/wiki/Invertible_matrix#The_invertible_matrix_theorem}{invertible
matrix theorem}\textquotedblright. Most of it is proven in \cite[Theorem
11.5]{Strickland} (for $\mathbb{K}=\mathbb{R}$ only, but the general case
works in the same way). Some parts are also proven in \cite[Theorem 1.30 and
Corollary 1.32]{Knapp1} and in \cite[Proposition 8.18]{GalQua18}.
\end{proof}

\subsubsection{What if $\mathbb{K}$ is not a field?}

Things get weird when $\mathbb{K}$ is not a field. For an example, set
$\mathbb{K}=\mathbb{Z}/26$. This is not a field, since $26$ is not prime
(after all, $26=2\cdot13$). The ring $\mathbb{Z}/26$ has been used in
classical cryptography, since its elements are in bijection with the letters
of the (modern) Roman alphabet:%
\[
0\mapsto A,\ \ \ \ \ \ \ \ \ \ 1\mapsto B,\ \ \ \ \ \ \ \ \ \ 2\mapsto
C,\ \ \ \ \ \ \ \ \ \ \ldots.
\]
For example, \href{https://en.wikipedia.org/wiki/Hill_cipher}{the \textit{Hill
cipher}} lets you encrypt a word using a $3\times3$-matrix over $\mathbb{Z}%
/26$ as a key. The idea is simple: You split the word into $3$-letter chunks;
you turn each chunk into a column vector in $\left(  \mathbb{Z}/26\right)
^{3\times1}$; and you multiply each of these columns vectors by your key
matrix. To decrypt, you would have to invert the key matrix.

So we want to know how to invert a matrix over $\mathbb{Z}/26$.

If $\mathbb{Z}/26$ was a field, you would know how to do this via Gaussian elimination.

Most of Theorem \ref{thm.field.LA-main} collapses when $\mathbb{K}$ is not a
field. For example, let $\mathbb{K}=\mathbb{Z}/26$ and%
\[
A=\left(
\begin{array}
[c]{cc}%
2 & 13\\
13 & 20
\end{array}
\right)  \in\mathbb{K}^{2\times2}.
\]
(We are abusing notation here: In truth, the entries of $A$ are not the
integers $2,13,13,20$ but rather their residue classes $\left[  2\right]
_{26},\left[  13\right]  _{26},\left[  13\right]  _{26},\left[  20\right]
_{26}$. But we shall simply write the integers instead and hope that the
reader knows what we mean.)

Is this matrix $A$ invertible?

Let us first try to find the RREF of $A$. If we would blindly follow the
Gaussian elimination algorithm, we would fail very quickly: None of the $4$
entries of $A$ has a multiplicative inverse; thus we could not transform any
entry of $A$ into $1$ by scaling a row of $A$. But we can try to loosen
Gaussian elimination by allowing more strategic row operations: Instead of
trying to get a $1$ in a pivot position immediately by scaling a row, we can
attempt to obtain a $1$ by row addition operations. For example, we can
transform our matrix $A$ above as follows:%
\begin{align*}
&  \left(
\begin{array}
[c]{cc}%
2 & 13\\
13 & 20
\end{array}
\right) \\
&  \overset{\text{subtract }6\text{ times row }1\text{ from row }2}{\mapsto
}\left(
\begin{array}
[c]{cc}%
2 & 13\\
1 & 20
\end{array}
\right) \\
&  \overset{\text{swap row }1\text{ with row }2}{\mapsto}\left(
\begin{array}
[c]{cc}%
1 & 20\\
2 & 13
\end{array}
\right) \\
&  \overset{\text{subtract }2\text{ times row }1\text{ from row }2}{\mapsto
}\left(
\begin{array}
[c]{cc}%
1 & 20\\
0 & 25
\end{array}
\right) \\
&  \overset{\text{scale row }2\text{ by }-1}{\mapsto}\left(
\begin{array}
[c]{cc}%
1 & 20\\
0 & 1
\end{array}
\right) \\
&  \overset{\text{subtract }20\text{ times row }2\text{ from row }1}{\mapsto
}\left(
\begin{array}
[c]{cc}%
1 & 0\\
0 & 1
\end{array}
\right)  =I_{2}.
\end{align*}
So our matrix $A$ does have a RREF (namely, $I_{2}$), and even is invertible!
(We can find an inverse of $A$ by computing an RREF of the block matrix
$\left(  A\mid I_{2}\right)  $; see, e.g., \cite[Method 11.11]{Strickland} for
this procedure.)

What exactly was the method behind our above row-reduction procedure? Let us
see how the first column has been transformed:%
\begin{align*}
&  \left(
\begin{array}
[c]{c}%
2\\
13
\end{array}
\right)  \overset{\text{subtract }6\text{ times row }1\text{ from row
}2}{\mapsto}\left(
\begin{array}
[c]{c}%
2\\
1
\end{array}
\right)  \overset{\text{swap row }1\text{ with row }2}{\mapsto}\left(
\begin{array}
[c]{c}%
1\\
2
\end{array}
\right) \\
&  \overset{\text{subtract }2\text{ times row }1\text{ from row }2}{\mapsto
}\left(
\begin{array}
[c]{c}%
1\\
0
\end{array}
\right)  .
\end{align*}
So what we did was progressively making the entries of the first column
smaller by subtracting a multiple of the first entry from the second entry
(and swapping the two entries, in order to move the smaller entry into the
first position). This is exactly the Euclidean algorithm! (Or, rather, it
would be the Euclidean algorithm if we had used honest integers instead of
residue classes in $\mathbb{Z}/26$.)

What happens in general? In general, when $\mathbb{K}=\mathbb{Z}/n$, the
Gaussian elimination algorithm as defined in linear algebra does not always
work. Nevertheless, a variant of it works, in which you do not directly scale
rows to turn entries into $1$, but instead \textquotedblleft
minimize\textquotedblright\ the whole column using the Euclidean algorithm as
we did with our matrix $A$ above. You will not always be able to get $1$'s in
pivot positions, because the gcd (which the Euclidean algorithm computes) may
not be $1$; thus, the result will not always be an RREF in the classical
sense, but rather something loosely resembling it.

For details, look up
\href{https://en.wikipedia.org/wiki/Smith_normal_form}{the \textit{Smith
normal form}} (e.g., in \cite[\S 113]{Elman18}). Note that for $n=0$, we have
$\mathbb{Z}/n\cong\mathbb{Z}$ (as rings), so this applies to matrices with
integer entries.

\begin{teachingnote}
\textbf{2019-04-12 lecture}
\end{teachingnote}

\subsubsection{Review of basic notions from linear algebra}

\begin{convention}
For the rest of this section, we fix a field $\mathbb{K}$. The elements of
$\mathbb{K}$ will be referred to as \textit{scalars}.
\end{convention}

In the linear algebra you have seen before, the scalars are usually real
numbers (i.e., we have $\mathbb{K}=\mathbb{R}$), but much of the theory works
in the same way for every field.

\begin{definition}
\label{def.laf.subspace-of-row}Let $n\in\mathbb{N}$. Recall that
$\mathbb{K}^{1\times n}$ is the set of all row vectors of size $n$.

A \textit{subspace} of $\mathbb{K}^{1\times n}$ means a subset $S\subseteq
\mathbb{K}^{1\times n}$ satisfying the following axioms:

\begin{itemize}
\item \textbf{(a)} We have $0_{1\times n}\in S$.

\item \textbf{(b)} If $a,b\in S$, then $a+b\in S$.

\item \textbf{(c)} If $a\in S$ and $\lambda\in\mathbb{K}$, then $\lambda a\in
S$.
\end{itemize}
\end{definition}

In other words, a subspace of $\mathbb{K}^{1\times n}$ is a subset of
$\mathbb{K}^{1\times n}$ that contains the zero vector and is closed under
addition and scaling.

Subspaces are often called \textit{vector subspaces}.

A similar definition defines subspaces of $\mathbb{K}^{n\times1}$ (column vectors).

There is a more general version of this definition, which extends it to
subspaces of arbitrary vector spaces (see Definition
\ref{def.la.submod-subspace}).

\begin{definition}
\label{def.laf.lincomb}Let $n\in\mathbb{N}$. Let $v_{1},v_{2},\ldots,v_{k}$ be
some row vectors in $\mathbb{K}^{1\times n}$.

\textbf{(a)} A \textit{linear combination} of $v_{1},v_{2},\ldots,v_{k}$ means
a row vector of the form%
\[
\lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}%
,\ \ \ \ \ \ \ \ \ \ \text{with }\lambda_{1},\lambda_{2},\ldots,\lambda_{k}%
\in\mathbb{K}.
\]


\textbf{(b)} The \textit{span} of $v_{1},v_{2},\ldots,v_{k}$ is defined to be
the subset%
\begin{align*}
&  \left\{  \lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}%
\ \mid\ \lambda_{1},\lambda_{2},\ldots,\lambda_{k}\in\mathbb{K}\right\} \\
&  =\left\{  \text{linear combinations of }v_{1},v_{2},\ldots,v_{k}\right\}
\end{align*}
of $\mathbb{K}^{1\times n}$. This span is a subspace of $\mathbb{K}^{1\times
n}$. (This is easy to check.)

\textbf{(c)} The vectors $v_{1},v_{2},\ldots,v_{k}$ are said to be
\textit{linearly independent} if the only $k$-tuple $\left(  \lambda
_{1},\lambda_{2},\ldots,\lambda_{k}\right)  \in\mathbb{K}^{k}$ satisfying
$\lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}=0_{1\times n}$ is
$\left(  \underbrace{0,0,\ldots,0}_{k\text{ times}}\right)  $.

\textbf{(d)} Let $U$ be a subspace of $\mathbb{K}^{1\times n}$. We say that
$v_{1},v_{2},\ldots,v_{k}$ form a \textit{basis} of $U$ (or, more formally,
$\left(  v_{1},v_{2},\ldots,v_{k}\right)  $ is a basis of $U$) if and only if
the vectors $v_{1},v_{2},\ldots,v_{k}$ are linearly independent and their span
is $U$.

\textbf{(e)} Let $U$ be a subspace of $\mathbb{K}^{1\times n}$. We say that
the list $\left(  v_{1},v_{2},\ldots,v_{k}\right)  $ \textit{spans} $U$ if and
only if the span of $v_{1},v_{2},\ldots,v_{k}$ is $U$. (More informally,
instead of saying \textquotedblleft the list $\left(  v_{1},v_{2},\ldots
,v_{k}\right)  $ \textit{spans} $U$\textquotedblright, we can say
\textquotedblleft the vectors $v_{1},v_{2},\ldots,v_{k}$ \textit{span}
$U$\textquotedblright; of course, this is not the same as saying that each of
these $k$ vectors on its own spans $U$.)
\end{definition}

All the terminology we have just introduced depends on $\mathbb{K}$. Whenever
the field $\mathbb{K}$ is not clear from the context, you can insert it into
this terminology to make it unambiguous: e.g., say \textquotedblleft%
$\mathbb{K}$-linear combination\textquotedblright\ instead of
\textquotedblleft linear combination\textquotedblright, and \textquotedblleft%
$\mathbb{K}$-span\textquotedblright\ instead of \textquotedblleft
span\textquotedblright.

\begin{theorem}
\label{thm.laf.basis-of-subspace}Let $n\in\mathbb{N}$. Let $U$ be a subspace
of $\mathbb{K}^{1\times n}$.

\textbf{(a)} There exists at least one basis of $U$.

\textbf{(b)} Any two bases of $U$ have the same size (= number of vectors).

\textbf{(c)} Given $k$ linearly independent vectors in $U$, and given $\ell$
vectors that span $U$, we always have $k\leq\ell$.

\textbf{(d)} Any list of $k$ linearly independent vectors in $U$ can be
extended to a basis of $U$.

\textbf{(e)} Any list of $\ell$ vectors that span $U$ can be shrunk to a basis
of $U$ (i.e., we can remove some vectors from this list to get a basis of $U$).
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.laf.basis-of-subspace} (sketched).]This all is
proven just as in standard linear algebra. Here are some specific references:

Theorem \ref{thm.laf.basis-of-subspace} \textbf{(a)} appears in
\cite[Proposition 20.3, last sentence]{Strickland}\footnote{Note that
Strickland works with column vectors in \cite[Proposition 20.3, last
sentence]{Strickland}, while our $U$ consists of row vectors. But the
arguments are the same.}, and also is a particular case of \cite[Theorem
4]{Conrad-dim}\footnote{Note that in the (otherwise excellent) note
\cite{Conrad-dim}, Conrad follows the inane convention that an empty list
$\left(  {}\right)  $ cannot be a basis. This forces him to make the unnatural
requirement \textquotedblleft$V\neq\left\{  0\right\}  $\textquotedblright\ in
\cite[Theorem 1]{Conrad-dim} and in various other places throughout his note.
You should ignore this special treatment (or, rather, non-treatment) of empty
lists when you read the note.} (applied to $V=\mathbb{K}^{1\times n}$ and
$W=U$). It also follows from \cite[Theorem 3.2.3 and Lemma 3.2.4]%
{Payne09}\footnote{Note that \cite{Payne09} (just as various other texts)
defines a basis as a set rather than a list of vectors. This is somewhat
awkward, but it is not hard to translate between the two concepts of
\textquotedblleft basis\textquotedblright.}.

Theorem \ref{thm.laf.basis-of-subspace} \textbf{(b)} is proven in
\cite[Chapter Two, Theorem III.2.5]{Hefferon}, in \cite[Corollary
1]{Conrad-dim}, in \cite[Theorem 3.11, last sentence]{GalQua18} and in
\cite[Lemma 3.2.5]{Payne09}. It also follows from \cite[Corollary 20.5
(c)]{Strickland}.

Theorem \ref{thm.laf.basis-of-subspace} \textbf{(d)} is proven in
\cite[Chapter Two, Corollary III.2.13]{Hefferon}, in \cite[Theorem
3]{Conrad-dim} (since Theorem \ref{thm.laf.basis-of-subspace} \textbf{(a)}
shows that $U$ has a basis) and \cite[Lemma 3.2.8]{Payne09} (since Theorem
\ref{thm.laf.basis-of-subspace} \textbf{(a)} shows that $U$ has a basis).

Theorem \ref{thm.laf.basis-of-subspace} \textbf{(e)} is proven in
\cite[Chapter Two, Corollary III.2.14]{Hefferon}, in \cite[Theorem
3]{Conrad-dim}, in \cite[Theorem 3.3.3]{Walker87}, in \cite[Theorem 3.11,
second sentence]{GalQua18} and in \cite[Theorem 3.2.7]{Payne09}.

Theorem \ref{thm.laf.basis-of-subspace} \textbf{(c)} follows from parts
\textbf{(b)}, \textbf{(d)} and \textbf{(e)} once you extend your list of $k$
linearly independent vectors in $U$ to a basis of $U$ and shrink your list of
$\ell$ vectors spanning $U$ to a basis of $U$. Alternatively, Theorem
\ref{thm.laf.basis-of-subspace} \textbf{(c)} follows from \cite[Proposition
3.10, last sentence]{GalQua18} or from \cite[Theorem 3.2.2]{Payne09}.
\end{proof}

Again, the same holds for column vectors.

\begin{definition}
\label{def.laf.dim-of-subspace}Let $n\in\mathbb{N}$. Let $U$ be a subspace of
$\mathbb{K}^{1\times n}$.

The \textit{dimension} of $U$ is defined to be the size of a basis of $U$.
(Parts \textbf{(a)} and \textbf{(b)} of Theorem
\ref{thm.laf.basis-of-subspace} show that this is indeed well-defined.) The
dimension of $U$ is denoted by $\dim U$.
\end{definition}

\begin{proposition}
\label{prop.laf.dim-increases}Let $n\in\mathbb{N}$. Let $U$ and $V$ be two
subspaces of $\mathbb{K}^{1\times n}$ such that $U\subseteq V$.

\textbf{(a)} We have $\dim U\leq\dim V$.

\textbf{(b)} If $\dim U=\dim V$, then $U=V$.
\end{proposition}

\begin{proof}
[Proof sketch.]Pick a basis of $U$. This basis is a list of $\dim U$ many
linearly independent vectors in $V$ (since $U\subseteq V$). Thus, Theorem
\ref{thm.laf.basis-of-subspace} \textbf{(d)} (applied to $\dim U$ and $V$
instead of $k$ and $U$) shows that this list can be extended to a basis of
$V$. The latter basis, of course, has size $\dim V$. Thus, $\dim U\leq\dim V$
(since we have extended a list of size $\dim U$ and obtained a list of size
$\dim V$). This proves Proposition \ref{prop.laf.dim-increases} \textbf{(a)}.

\textbf{(b)} Assume that $\dim U=\dim V$. We have just found a basis of $V$ by
extending a basis of $U$. In light of $\dim U=\dim V$, this extension must
have been trivial -- i.e., we must have extended our basis of $U$ by no
further vectors. This means that our basis of $U$ was already a basis of $V$
to begin with. From this, it is easy to see that $U=V$ (because the span of a
basis of $U$ is always $U$, whereas the span of a basis of $V$ is always $V$).
This proves Proposition \ref{prop.laf.dim-increases} \textbf{(b)}.
\end{proof}

Now, let us connect this with matrices:

\begin{definition}
\label{def.laf.rowspace}Let $n,m\in\mathbb{N}$. Let $A\in\mathbb{K}^{n\times
m}$ be a matrix.

\textbf{(a)} The \textit{row space} of $A$ is defined to be the span of the
rows of $A$. This is a subspace of $\mathbb{K}^{1\times m}$, and is called
$\operatorname*{Row}A$.

\textbf{(b)} The \textit{column space} of $A$ is defined to be the span of the
columns of $A$. This is a subspace of $\mathbb{K}^{n\times1}$, and is called
$\operatorname*{Col}A$.
\end{definition}

\begin{theorem}
\label{thm.laf.ranks-equal}Let $A\in\mathbb{K}^{n\times m}$ be a matrix. Then,
$\dim\operatorname*{Row}A=\dim\operatorname*{Col}A$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.laf.ranks-equal} (sketched).]One way to prove this
is to transform $A$ into RREF, and argue that both $\dim\operatorname*{Row}A$
and $\dim\operatorname*{Col}A$ equal the number of pivots in the RREF. There
are other, more abstract ways. See linear algebra textbooks for this proof:
for example, \cite[Chapter Two, Theorem III.3.11]{Hefferon} (where
$\dim\operatorname*{Row}A$ is called the \textquotedblleft row
rank\textquotedblright\ of $A$, and $\dim\operatorname*{Col}A$ is called the
\textquotedblleft column rank\textquotedblright\ of $A$).
\end{proof}

\begin{definition}
\label{def.laf.rank}Let $n,m\in\mathbb{N}$. Let $A\in\mathbb{K}^{n\times m}$
be a matrix. Theorem \ref{thm.laf.ranks-equal} shows that $\dim
\operatorname*{Row}A=\dim\operatorname*{Col}A$. This number $\dim
\operatorname*{Row}A=\dim\operatorname*{Col}A$ is called the \textit{rank} of
$A$ and is denoted by $\operatorname*{rank}A$.
\end{definition}

The following is easy to see:

\begin{proposition}
\label{prop.laf.rank-minnm}Let $n,m\in\mathbb{N}$. Let $A\in\mathbb{K}%
^{n\times m}$ be a matrix. Then, $\operatorname*{rank}A$ is an integer between
$0$ and $\min\left\{  n,m\right\}  $.
\end{proposition}

So we have seen that a matrix gives rise to two subspaces: its row space and
its column space. But there is more:

\begin{definition}
\label{def.laf.ker}Let $n,m\in\mathbb{N}$. Let $A\in\mathbb{K}^{n\times m}$ be
a matrix.

\textbf{(a)} The \textit{kernel} (or \textit{nullspace}) of $A$ is defined to
be the set of all column vectors $v\in\mathbb{K}^{m\times1}$ such that
$Av=0_{n\times1}$. This is a subspace of $\mathbb{K}^{m\times1}$, and is
called $\operatorname*{Ker}A$.

\textbf{(b)} The \textit{left kernel} (or \textit{left nullspace}) of $A$ is
defined to be the set of all row vectors $w\in\mathbb{K}^{1\times n}$ such
that $wA=0_{1\times m}$. This is a subspace of $\mathbb{K}^{1\times n}$.
\end{definition}

Altogether, we have thus found four subspaces coming out of a matrix $A$.
These are
\href{https://en.wikipedia.org/wiki/Fundamental_theorem_of_linear_algebra}{the
famous \textquotedblleft four fundamental subspaces\textquotedblright} (in
Gilbert Strang's terminology). One result that connects two of them is the
following fact, known as
\href{https://en.wikipedia.org/wiki/Rank-nullity_theorem#Matrices}{the
\textit{rank-nullity theorem}}:

\begin{theorem}
\label{thm.laf.rank-null}Let $n,m\in\mathbb{N}$. Let $A\in\mathbb{K}^{n\times
m}$ be a matrix. Then,%
\[
\operatorname*{rank}A+\dim\operatorname*{Ker}A=m.
\]

\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.laf.rank-null} (sketched).]Most textbooks state
Theorem \ref{thm.laf.rank-null} not in terms of matrices, but rather in the
(equivalent) language of linear maps. For example, this is how it is stated in
\cite[Chapter Three, Theorem II.2.14]{Hefferon} or \cite[Theorem
7.17]{Carrel05} or \cite[Corollary 2.15]{Knapp1} or \cite[Theorem
4.2.2]{Payne09}.
\end{proof}

Note that the number $\dim\operatorname*{Ker}A$ is known as the
\textit{nullity} of a matrix $A$.

\subsubsection{Linear algebra over $\mathbb{Z}/2$: \textquotedblleft button
madness\textquotedblright\ / \textquotedblleft lights out\textquotedblright}

We now discuss an old puzzle, which is known as \textquotedblleft button
madness\textquotedblright\ or \textquotedblleft lights out\textquotedblright%
\ (more precisely, these are two slightly different variants of the same
puzzle). You can try it out on
\[
\text{\url{https://bz.var.ru/comp/web/js/floor.html}}%
\]
(see also \url{https://www.win.tue.nl/~aeb/ca/madness/madrect.html} for a list
of mathematical sources on this puzzle).

One version of this puzzle gives you $16$ lamps arranged into a $4\times
4$-grid. Each lamp comes with a lightswitch; but flipping this lightswitch
toggles not just this lamp, but also its four adjacent lamps (or three or two
adjacent lamps, if the switch you have flipped is at the border of the grid).
For example, if your grid looks like this:%
\[%
\begin{tabular}
[c]{|c|c|c|c|}\hline
$1$ & $0$ & $0$ & $1$\\\hline
$0$ & $1$ & $1$ & $0$\\\hline
$0$ & $0$ & $1$ & $0$\\\hline
$1$ & $1$ & $0$ & $1$\\\hline
\end{tabular}
\ \
\]
(where an entry $1$ means a lamp turned on, and an entry $0$ means a lamp
turned off), and you flip the lightswitch in cell $\left(  2,3\right)  $ (that
is, the third cell from the left in the second row from the top), then you
obtain the grid%
\[%
\begin{tabular}
[c]{|c|c|c|c|}\hline
$1$ & $0$ & $1$ & $1$\\\hline
$0$ & $0$ & $0$ & $1$\\\hline
$0$ & $0$ & $0$ & $0$\\\hline
$1$ & $1$ & $0$ & $1$\\\hline
\end{tabular}
\ \ .
\]
(A total of $5$ lamps have changed their state: three have been turned off,
and two have been turned on.) If you then flip the lightswitch in cell
$\left(  1,3\right)  $ of this new grid, then you obtain the grid
\[%
\begin{tabular}
[c]{|c|c|c|c|}\hline
$1$ & $1$ & $0$ & $0$\\\hline
$0$ & $0$ & $1$ & $1$\\\hline
$0$ & $0$ & $0$ & $0$\\\hline
$1$ & $1$ & $0$ & $1$\\\hline
\end{tabular}
\ \ .
\]


At the beginning, all lamps are turned off. Your goal is to achieve the
opposite state (i.e., all lamps being on at the same time) by flipping a
sequence of lightswitches. Is this possible, and how? (In some versions of
this puzzle -- such as
\href{https://en.wikipedia.org/wiki/Lights_Out_(game)}{the \textquotedblleft
lights out\textquotedblright\ version} -- it's exactly the other way round:
The lights are all on initially, and you must turn them all off. Of course,
this makes no difference to the solution.)

In some versions of this puzzle, the grid is \textquotedblleft
toroidal\textquotedblright, in the sense that it is understood to wrap around
-- for example, the cells $\left(  1,4\right)  $ and $\left(  1,1\right)  $
are considered to be adjacent, and so are the cells $\left(  4,1\right)  $ and
$\left(  1,1\right)  $. We shall not consider this case here, but it can be
solved by the same method.

Of course, you can play the same game on larger grids, triangular grids, etc..
But in order to get a grip on how to solve such a puzzle, we shall first
analyze a much simpler version: the \textquotedblleft1-dimensional
version\textquotedblright\ of the puzzle.

Here is this \textquotedblleft1-dimensional version\textquotedblright: We have
$4$ lamps in a row (numbered $1,2,3,4$), each equipped with a lightswitch. The
lightswitch at lamp $i$ toggles lamp $i$, lamp $i-1$ (if it exists) and lamp
$i+1$ (if it exists). Initially, all $4$ lamps are off. Can we turn them all
on by flipping a sequence of lightswitches?

Yes, of course: we just have to flip the lightswitches at lamps $1$ and $4$.
But let us pretend that we aren't that smart, and instead try to solve the
puzzle systematically.

We model the states of our lamps by a row vector in $\left(  \mathbb{Z}%
/2\right)  ^{1\times4}$. We write a row vector $\left(
\begin{array}
[c]{cccc}%
a_{1} & a_{2} & \cdots & a_{n}%
\end{array}
\right)  $ as $\left(  a_{1},a_{2},\ldots,a_{n}\right)  $.

More precisely, we model each state by the row vector $\left(  a_{1}%
,a_{2},a_{3},a_{4}\right)  \in\left(  \mathbb{Z}/2\right)  ^{1\times4}$, where%
\[
a_{i}=%
\begin{cases}
\left[  0\right]  _{2}, & \text{if lamp }i\text{ is off};\\
\left[  1\right]  _{2}, & \text{if lamp }i\text{ is on}%
\end{cases}
=\underbrace{\left[  \underbrace{\left[  \text{lamp }i\text{ is on}\right]
}_{\text{Iverson bracket}}\right]  _{2}}_{\text{residue class}}.
\]


We shall write $0$ and $1$ for $\left[  0\right]  _{2}$ and $\left[  1\right]
_{2}$ throughout this subsection (except in Proposition \ref{prop.laf.Ac0bc0}%
), so we can rewrite this as%
\[
a_{i}=%
\begin{cases}
0, & \text{if lamp }i\text{ is off};\\
1, & \text{if lamp }i\text{ is on}%
\end{cases}
=\underbrace{\left[  \text{lamp }i\text{ is on}\right]  }_{\text{Iverson
bracket}},
\]
but keep in mind that these values are understood to be in $\mathbb{Z}/2$.

The initial state is $\left(  0,0,0,0\right)  $. The final state that we want
to achieve is $\left(  1,1,1,1\right)  $. Flipping a lightswitch corresponds
to adding a certain row vector to our state. Namely:

\begin{itemize}
\item Flipping lightswitch $1$ means adding $\left(  1,1,0,0\right)  $.

\item Flipping lightswitch $2$ means adding $\left(  1,1,1,0\right)  $.

\item Flipping lightswitch $3$ means adding $\left(  0,1,1,1\right)  $.

\item Flipping lightswitch $4$ means adding $\left(  0,0,1,1\right)  $.
\end{itemize}

\noindent Thus, flipping a lightswitch means adding the corresponding row of
the matrix%
\[
A:=\left(
\begin{array}
[c]{cccc}%
1 & 1 & 0 & 0\\
1 & 1 & 1 & 0\\
0 & 1 & 1 & 1\\
0 & 0 & 1 & 1
\end{array}
\right)  \in\left(  \mathbb{Z}/2\right)  ^{4\times4}%
\]
to our state. The reachable states are thus exactly the elements of
$\operatorname*{Row}A$, the row space of $A$.

Hence, our goal is to show that $\left(  1,1,1,1\right)  \in
\operatorname*{Row}A$.

This is quite easy for the concrete matrix $A$ above (just notice that
$\left(  1,1,1,1\right)  $ is the sum of the $1$-st and $4$-th rows of $A$);
but let us try a theoretical argument. It will rely on the following general fact:

\begin{proposition}
\label{prop.laf.Ac0bc0}Let $n,m\in\mathbb{N}$. Let $\mathbb{K}$ be any field.
Let $A\in\mathbb{K}^{n\times m}$ and $b\in\mathbb{K}^{1\times m}$. Assume the following:

\begin{statement}
\textit{Assumption 1:} If $c\in\mathbb{K}^{m\times1}$ satisfies $Ac=0$, then
$bc=0$. (Here, of course, the \textquotedblleft$0$\textquotedblright\ in
\textquotedblleft$Ac=0$\textquotedblright\ means $0_{n\times1}$.)
\end{statement}

\noindent Then, $b\in\operatorname*{Row}A$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.laf.Ac0bc0}.]Let $\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $ denote the $\left(  n+1\right)  \times m$-matrix formed from the
$n\times m$-matrix $A$ by attaching the row vector $b$ to its bottom. For
example, if $A=\left(
\begin{array}
[c]{cc}%
a_{1,1} & a_{1,2}\\
a_{2,1} & a_{2,2}%
\end{array}
\right)  $ and $b=\left(
\begin{array}
[c]{cc}%
b_{1} & b_{2}%
\end{array}
\right)  $, then $\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  =\left(
\begin{array}
[c]{cc}%
a_{1,1} & a_{1,2}\\
a_{2,1} & a_{2,2}\\
b_{1} & b_{2}%
\end{array}
\right)  $.

Theorem \ref{thm.laf.rank-null} yields $\operatorname*{rank}A+\dim
\operatorname*{Ker}A=m$. Thus,
\begin{equation}
\operatorname*{rank}A=m-\dim\operatorname*{Ker}A. \label{pf.prop.laf.Ac0bc0.1}%
\end{equation}


The same argument can be applied to the matrix $\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $ instead of $A$. We thus obtain%
\begin{equation}
\operatorname*{rank}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  =m-\dim\operatorname*{Ker}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  . \label{pf.prop.laf.Ac0bc0.2}%
\end{equation}


But each $c\in\operatorname*{Ker}A$ satisfies $Ac=0$ and thus $bc=0$ (by
Assumption 1), and therefore $c\in\operatorname*{Ker}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $ (because the \textquotedblleft row-by-column\textquotedblright%
\ nature of matrix multiplication shows that $\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  c=\left(
\begin{array}
[c]{c}%
Ac\\
bc
\end{array}
\right)  =\left(
\begin{array}
[c]{c}%
0\\
0
\end{array}
\right)  =0$). So we have $\operatorname*{Ker}A\subseteq\operatorname*{Ker}%
\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $. Also, clearly, $\operatorname*{Ker}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  \subseteq\operatorname*{Ker}A$ (because if $c\in\operatorname*{Ker}%
\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $, then $\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  c=0$, so that $0=\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  c=\left(
\begin{array}
[c]{c}%
Ac\\
bc
\end{array}
\right)  $ and thus $Ac=0$, so that $c\in\operatorname*{Ker}A$). Combining
these two relations, we obtain $\operatorname*{Ker}A=\operatorname*{Ker}%
\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $. Hence, the right hand sides of (\ref{pf.prop.laf.Ac0bc0.1}) and
(\ref{pf.prop.laf.Ac0bc0.2}) are equal. Thus, the left hand sides are equal as
well. In other words, $\operatorname*{rank}A=\operatorname*{rank}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $. In other words,%
\[
\dim\operatorname*{Row}A=\dim\operatorname*{Row}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)
\]
(since $\operatorname{rank}B=\dim\operatorname{Row}B$ for any matrix $B$). But
$\operatorname*{Row}A\subseteq\operatorname*{Row}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $ (by the definition of a row space). Combining these facts, we
obtain%
\[
\operatorname*{Row}A=\operatorname*{Row}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)
\]
(by Proposition \ref{prop.laf.dim-increases} \textbf{(b)}, applied to
$U=\operatorname*{Row}A$ and $V=\operatorname*{Row}\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  $). But the definition of a row space yields $b\in\operatorname*{Row}%
\left(
\begin{array}
[c]{c}%
A\\
b
\end{array}
\right)  =\operatorname*{Row}A$. This proves Proposition \ref{prop.laf.Ac0bc0}.
\end{proof}

Over the field $\mathbb{Z}/2$, this fact has the following consequence:

\begin{corollary}
\label{cor.laf.lights-out-diag}Let $n\in\mathbb{N}$. Let $A\in\left(
\mathbb{Z}/2\right)  ^{n\times n}$ be a symmetric matrix. (\textquotedblleft%
\textit{Symmetric}\textquotedblright\ means that the $\left(  i,j\right)  $-th
entry of $A$ equals the $\left(  j,i\right)  $-th entry of $A$ for all $i$ and
$j$. In other words, it means that $A^{T}=A$.)

Let $d$ be the diagonal of $A$, written as a row vector. (In other words, let
$d=\left(  a_{1,1},a_{2,2},\ldots,a_{n,n}\right)  $, where $a_{i,j}$ is the
$\left(  i,j\right)  $-th entry of $A$.)

Then, $d\in\operatorname*{Row}A$.
\end{corollary}

Note that Corollary \ref{cor.laf.lights-out-diag} brutally fails over fields
different from $\mathbb{Z}/2$. For example, if we allow $A$ to be a matrix in
$\mathbb{Z}^{n\times n}$ instead, then $A=\left(
\begin{array}
[c]{cc}%
1 & -1\\
-1 & 1
\end{array}
\right)  $ is symmetric but its diagonal $d=\left(  1,1\right)  $ does not
belong to $\operatorname*{Row}A$.

\begin{proof}
[Proof of Corollary \ref{cor.laf.lights-out-diag}.]Set $\mathbb{K}%
=\mathbb{Z}/2$. By Proposition \ref{prop.laf.Ac0bc0} (applied to $m=n$ and
$b=d$), it suffices to show the following:

\begin{statement}
\textit{Assumption 1:} If $c\in\mathbb{K}^{n\times1}$ satisfies $Ac=0$, then
$dc=0$.
\end{statement}

[\textit{Proof of Assumption 1:} Let $c\in\mathbb{K}^{n\times1}$ satisfy
$Ac=0$. We must prove that $dc=0$.

I claim that $dc=c^{T}Ac$.

To see this, write $c$ as $c=\left(  c_{1},c_{2},\ldots,c_{n}\right)  ^{T}$
and $A$ as $A=\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}$. Then,
expanding $c^{T}Ac$ yields%
\begin{align*}
c^{T}Ac  &  =\sum_{i,j}c_{i}a_{i,j}c_{j}=\sum_{i,j}a_{i,j}c_{i}c_{j}\\
&  =\underbrace{\sum_{i<j}a_{i,j}c_{i}c_{j}}_{\substack{=\sum_{j<i}%
a_{j,i}c_{j}c_{i}\\\text{(here, we have renamed}\\\text{the indices }i\text{
and }j\text{ as }j\text{ and }i\text{)}}}+\underbrace{\sum_{i=j}a_{i,j}%
c_{i}c_{j}}_{=\sum_{i}a_{i,i}c_{i}c_{i}}+\underbrace{\sum_{i>j}}_{=\sum_{j<i}%
}\underbrace{a_{i,j}}_{\substack{=a_{j,i}\\\text{(since }A\\\text{is
symmetric)}}}\underbrace{c_{i}c_{j}}_{=c_{j}c_{i}}\\
&  =\sum_{j<i}a_{j,i}c_{j}c_{i}+\sum_{i}a_{i,i}c_{i}c_{i}+\sum_{j<i}%
a_{j,i}c_{j}c_{i}=\underbrace{2}_{\substack{=0\\\text{(since we are}\\\text{in
}\mathbb{Z}/2\text{)}}}\sum_{j<i}a_{j,i}c_{j}c_{i}+\sum_{i}a_{i,i}c_{i}c_{i}\\
&  =\sum_{i}a_{i,i}\underbrace{c_{i}c_{i}}_{\substack{=c_{i}^{2}%
=c_{i}\\\text{(since }x^{2}=x\\\text{for all }x\in\mathbb{Z}/2\text{)}}%
}=\sum_{i}a_{i,i}c_{i}=dc
\end{align*}
(since $c=\left(  c_{1},c_{2},\ldots,c_{n}\right)  ^{T}$ and $d=\left(
a_{1,1},a_{2,2},\ldots,a_{n,n}\right)  $). So $dc=c^{T}\underbrace{Ac}%
_{=0}=c^{T}0=0$. Thus, Assumption 1 is proven.]

Corollary \ref{cor.laf.lights-out-diag} now follows.
\end{proof}

Now, why can the \textquotedblleft lights out\textquotedblright\ puzzle be solved?

We want to prove that $\left(  1,1,1,1\right)  \in\operatorname*{Row}A$ for
our matrix $A\in\left(  \mathbb{Z}/2\right)  ^{4\times4}$.

This follows from Corollary \ref{cor.laf.lights-out-diag}, since the matrix
$A$ is symmetric, and since its diagonal is $\left(  1,1,1,1\right)  $.

The same argument works for the \textquotedblleft proper\textquotedblright%
\ (2-dimensional) \textquotedblleft lights out\textquotedblright\ puzzle; we
just have to use row vectors of size $16$ (not $4$) and $16\times16$-matrices
(not $4\times4$-matrices). More generally, the same argument works for any
such puzzle on any \textquotedblleft grid\textquotedblright\ as long as:

\begin{itemize}
\item each lamp $i$ has a lightswitch which toggles at least lamp $i$;

\item if the lightswitch at lamp $i$ toggles lamp $j$, then the lightswitch at
lamp $j$ toggles lamp $i$.
\end{itemize}

\noindent These conditions guarantee that the corresponding matrix $A$ will be
symmetric and its diagonal will be $\left(  1,1,\ldots,1\right)  $ (and thus
we can apply Corollary \ref{cor.laf.lights-out-diag}).

How to find the exact sequence of flips that results in all lights being on?
This is tantamount to finding the coefficients of a linear combination of the
rows of $A$ that equals $\left(  1,1,\ldots,1\right)  $. This boils down to
solving a system of linear equations over $\mathbb{Z}/2$, which can be
achieved using Gaussian elimination.

What other states can be achieved by flipping lightswitches? Again, for each
specific grid and each specific state, this can be solved by Gaussian
elimination; but characterizing the reachable states more explicitly is a hard
problem with no unified answer. (See the link above.)

\begin{teachingnote}
\textbf{2019-04-15 lecture}
\end{teachingnote}

\subsubsection{A warning about orthogonality and positivity}

I have said above that \textquotedblleft more or less\textquotedblright\ all
linear algebra over $\mathbb{R}$ works identically over any field $\mathbb{K}%
$. There is an exception: Anything that uses positivity will break down over
some fields $\mathbb{K}$. Let me briefly telegraph what can go wrong. (Don't
worry if the things I am mentioning are not familiar to you.)

One thing that uses positivity is QR-decomposition. And indeed, not every
matrix over an arbitrary field has a QR-decomposition.

You can still define dot products and orthogonal complements of subspaces. But
it is no longer true that $\mathbb{K}^{n\times1}=U\oplus U^{\perp}$ for any
subspace $U$ of $\mathbb{K}^{n\times1}$. It can happen that $U\cap U^{\perp
}\neq\left\{  0\right\}  $. For example, there are column vectors
$v\neq0_{n\times1}$ that are orthogonal to themselves with respect to the dot
product (that is, $v^{T}v=0$).

\textbf{Example:} In $\mathbb{Z}/3$, we have%
\[
\left(
\begin{array}
[c]{c}%
1\\
1\\
1
\end{array}
\right)  ^{T}\left(
\begin{array}
[c]{c}%
1\\
1\\
1
\end{array}
\right)  =\left(  1,1,1\right)  \left(
\begin{array}
[c]{c}%
1\\
1\\
1
\end{array}
\right)  =1\cdot1+1\cdot1+1\cdot1=3=0.
\]
So the vector $\left(
\begin{array}
[c]{c}%
1\\
1\\
1
\end{array}
\right)  \in\left(  \mathbb{Z}/3\right)  ^{3\times1}$ is orthogonal to itself.

\subsection{Matrix algebra vs. coordinate-free linear algebra}

There are two common approaches to linear algebra: The first is the study of
matrices and column vectors (or row vectors); this is down-to-earth but often
clumsy and unenlightening. The second is the study of vector spaces and linear
transformations; this is more abstract but more general and often better for
conceptual understanding. The first approach is known as \textit{matrix
algebra}; the second is called \textit{coordinate-free linear algebra}.

These two approaches are closely connected: The first can be viewed as a
particular case of the second (as the column vectors of a given size $n$ form
a vector space, and any matrix defines a linear map between two such vector
spaces); the second appears more general but in reality can often be reduced
to the first (viz., theorems about vector spaces can often be proven by
\textquotedblleft picking bases\textquotedblright\ and representing linear
maps by matrices with respect to these bases). Thus, a sufficiently deep
course on linear algebra will necessarily survey both of these approaches, and
practitioners of the subject will often apply whichever approach fits a
problem better.

In the previous section, we have seen how the first approach can be
generalized from real or complex matrices to matrices over any field (and, as
far as the basics are concerned, over any commutative ring). We shall now try
this with the second approach. Over a field, the second approach turns out to
work out in pretty much the same way as over the real or complex numbers;
however, over a commutative ring, things become a lot more interesting.

\subsection{\label{sect.la.mod-def}$\mathbb{K}$-modules: the definition}

Let us begin by defining the analogue of a vector space: a \textit{module}.
Roughly speaking, a module is the same as a vector space, except that it is
over a commutative ring instead of a field:

\begin{definition}
\label{def.module.module}Let $\mathbb{K}$ be a commutative ring.

A $\mathbb{K}$\textit{-module} means a set $M$ equipped with

\begin{itemize}
\item a binary operation $+$ on $M$ (called \textquotedblleft\textit{addition}%
\textquotedblright, and not to be confused with the addition $+_{\mathbb{K}}$
of $\mathbb{K}$),

\item a map $\cdot\ :\ \mathbb{K}\times M\rightarrow M$ (called
\textquotedblleft\textit{scaling\textquotedblright}, and not to be confused
with the multiplication $\cdot_{\mathbb{K}}$ of $\mathbb{K}$), and

\item an element $0_{M}\in M$ (called \textquotedblleft\textit{zero
vector}\textquotedblright\ or \textquotedblleft\textit{zero}\textquotedblright%
, and not to be confused with the zero of $\mathbb{K}$)
\end{itemize}

\noindent satisfying the following axioms:

\begin{itemize}
\item \textbf{(a)} We have $a+b=b+a$ for all $a,b\in M$.

\item \textbf{(b)} We have $a+\left(  b+c\right)  =\left(  a+b\right)  +c$ for
all $a,b,c\in M$.

\item \textbf{(c)} We have $a+0_{M}=0_{M}+a=a$ for all $a\in M$.

\item \textbf{(d)} Each $a\in M$ has an additive inverse (i.e., there is an
$a^{\prime}\in M$ such that $a+a^{\prime}=a^{\prime}+a=0_{M}$).

\item \textbf{(e)} We have $\lambda\left(  a+b\right)  =\lambda a+\lambda b$
for all $\lambda\in\mathbb{K}$ and $a,b\in M$. Here and in the following, we
use the notation \textquotedblleft$\lambda c$\textquotedblright\ (or,
equivalently, \textquotedblleft$\lambda\cdot c$\textquotedblright) for the
image of a pair $\left(  \lambda,c\right)  \in\mathbb{K}\times M$ under the
\textquotedblleft scaling\textquotedblright\ map $\cdot$ (similarly to how we
write $ab$ for the image of a pair $\left(  a,b\right)  \in\mathbb{K}%
\times\mathbb{K}$ under the \textquotedblleft multiplication\textquotedblright%
\ map $\cdot$).

\item \textbf{(f)} We have $\left(  \lambda+\mu\right)  a=\lambda a+\mu a$ for
all $\lambda,\mu\in\mathbb{K}$ and $a\in M$.

\item \textbf{(g)} We have $0a=0_{M}$ for all $a\in M$. (Here, the
\textquotedblleft$0$\textquotedblright\ on the left hand side means the zero
of $\mathbb{K}$.)

\item \textbf{(h)} We have $\left(  \lambda\mu\right)  a=\lambda\left(  \mu
a\right)  $ for all $\lambda,\mu\in\mathbb{K}$ and $a\in M$.

\item \textbf{(i)} We have $1a=a$ for all $a\in M$.

\item \textbf{(j)} We have $\lambda\cdot0_{M}=0_{M}$ for all $\lambda
\in\mathbb{K}$.
\end{itemize}

\noindent These ten axioms are called the \textit{module axioms}.
\end{definition}

A $\mathbb{K}$-module is often called a \textquotedblleft module over
$\mathbb{K}$\textquotedblright.

The axioms \textquotedblleft$\lambda\left(  a+b\right)  =\lambda a+\lambda
b$\textquotedblright\ and \textquotedblleft$\left(  \lambda+\mu\right)
a=\lambda a+\mu a$\textquotedblright\ are known as the \textit{distributivity
laws for modules}. The axiom \textquotedblleft$\left(  \lambda\mu\right)
a=\lambda\left(  \mu a\right)  $\textquotedblright\ is known as the
\textit{associativity law for modules}.

\begin{definition}
\label{def.module.vectors}If $\mathbb{K}$ is a commutative ring and $M$ is a
$\mathbb{K}$-module, then the elements of $M$ are called \textit{vectors},
while the elements of $\mathbb{K}$ are called \textit{scalars}. If $\lambda
\in\mathbb{K}$ and $a\in M$, then $\lambda a$ (that is, the image of $\left(
\lambda,a\right)  $ under the scaling map $\cdot\ :\ \mathbb{K}\times
M\rightarrow M$) will be called the result of \textit{scaling }the vector $a$
by the scalar $\lambda$.
\end{definition}

\begin{definition}
\label{def.module.vec-sp}If $\mathbb{K}$ is a field, then $\mathbb{K}$-modules
are called $\mathbb{K}$\textit{-vector spaces}. (When $\mathbb{K}=\mathbb{R}$,
these are the usual real vector spaces known from undergraduate linear algebra classes.)
\end{definition}

\subsection{\label{sect.la.mod-exa}Examples of $\mathbb{K}$-modules}

Thus, any vector space you have seen in linear algebra is an example of a
module. Let us see some other examples:

\begin{example}
\label{exa.module.K}Let $\mathbb{K}$ be a commutative ring. Then, $\mathbb{K}$
itself is a $\mathbb{K}$-module (with the addition given by the addition
$+_{\mathbb{K}}$ of $\mathbb{K}$, and with the scaling given by the
multiplication $\cdot_{\mathbb{K}}$ of $\mathbb{K}$, and with the zero vector
given by the zero $0_{\mathbb{K}}$ of $\mathbb{K}$).
\end{example}

\begin{example}
\label{exa.module.Kn}Let $\mathbb{K}$ be a commutative ring. Let
$n\in\mathbb{N}$. Equip the set $\mathbb{K}^{n}$ (that is, the set of all
$n$-tuples of elements of $\mathbb{K}$) with entrywise addition (that is, a
binary operation $+$ on $\mathbb{K}^{n}$ defined by%
\[
\left(  a_{1},a_{2},\ldots,a_{n}\right)  +\left(  b_{1},b_{2},\ldots
,b_{n}\right)  =\left(  a_{1}+b_{1},a_{2}+b_{2},\ldots,a_{n}+b_{n}\right)
\]
for all $\left(  a_{1},a_{2},\ldots,a_{n}\right)  ,\left(  b_{1},b_{2}%
,\ldots,b_{n}\right)  \in\mathbb{K}^{n}$) and entrywise scaling (that is, a
map $\cdot:\mathbb{K}\times\mathbb{K}^{n}\rightarrow\mathbb{K}^{n}$ defined by%
\[
\lambda\left(  a_{1},a_{2},\ldots,a_{n}\right)  =\left(  \lambda a_{1},\lambda
a_{2},\ldots,\lambda a_{n}\right)
\]
for all $\lambda\in\mathbb{K}$ and $\left(  a_{1},a_{2},\ldots,a_{n}\right)
\in\mathbb{K}^{n}$) and the zero vector $\left(  0,0,\ldots,0\right)
\in\mathbb{K}^{n}$. Then, $\mathbb{K}^{n}$ becomes a $\mathbb{K}$-module.
\end{example}

\begin{example}
\label{exa.module.Knm}Let $\mathbb{K}$ be a commutative ring. Let
$n,m\in\mathbb{N}$. Equip the set $\mathbb{K}^{n\times m}$ (that is, the set
of all $n\times m$-matrices over $\mathbb{K}$) with the addition defined in
Definition \ref{def.matrix.+-} \textbf{(a)} and the scaling defined in
Definition \ref{def.matrix.+-} \textbf{(c)} and the zero vector $0_{n\times
m}$. Then, $\mathbb{K}^{n\times m}$ becomes a $\mathbb{K}$-module.
\end{example}

\begin{example}
Let $\mathbb{K}$ be a commutative ring. The one-element set $\left\{
0\right\}  $ is a $\mathbb{K}$-module (with $+$ and $\cdot$ and zero vector
defined in the only possible way). This is called the \textit{zero module}. It
is often called $0$.
\end{example}

\begin{example}
\label{exa.module.Z/n}Let $n$ be an integer. Then:

\textbf{(a)} The set $\mathbb{Z}/n$ is a $\mathbb{Z}$-module, if you equip it
with the addition and the scaling that we defined above (in Definition
\ref{def.eqrel.Z/n.op} and Definition \ref{def.eqrel.Z/n.scaling}) and with
the zero vector $\left[  0\right]  _{n}$.

\textbf{(b)} The set $n\mathbb{Z}:=\left\{  nz\ \mid\ z\in\mathbb{Z}\right\}
=\left\{  \text{all multiples of }n\right\}  $ is a $\mathbb{Z}$-module (again
equipped with the usual addition as addition, and the usual multiplication as
scaling, and the integer $0$ as zero vector).
\end{example}

\begin{example}
\label{exa.module.Q}\textbf{(a)} The set $\mathbb{Q}$ (equipped with the usual
addition, and with a scaling defined by the usual multiplication, and the zero
vector $0$) is a $\mathbb{Z}$-module.

\textbf{(b)} For every $q\in\mathbb{Q}$, the subset $q\mathbb{Z}:=\left\{
qz\ \mid\ z\in\mathbb{Z}\right\}  $ of $\mathbb{Q}$ (again equipped with the
usual $+$ and $\cdot$ and $0$) is a $\mathbb{Z}$-module. For example,
$\dfrac{1}{2}\mathbb{Z}=\left\{  \ldots,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,\ldots
\right\}  $ is a $\mathbb{Z}$-module. Note that $\dfrac{1}{2}\mathbb{Z}$ is
\textbf{not} a ring (at least not with the usual $\cdot$ as multiplication),
since $\dfrac{1}{2}\cdot\dfrac{1}{2}=\dfrac{1}{4}\notin\dfrac{1}{2}\mathbb{Z}$.

\textbf{(c)} What other $\mathbb{Z}$-modules can we find inside $\mathbb{Q}$ ?
Quite a few, it turns out. Here is a more exotic one: Let us call an integer
$n$ \textit{squarefree} if it is not divisible by any perfect square other
than $1$. It is easy to see that an integer $n$ is squarefree if and only if
$n$ is a product of \textbf{distinct} primes (or, equivalently, $v_{p}\left(
n\right)  \leq1$ for each prime $p$). Thus, the squarefree integers are
$1,2,3,5,6,7,10,11,13,\ldots$ and their negatives. Now, let $\mathbb{Q}%
_{\operatorname*{sqf}}$ be the subset%
\[
\left\{  \dfrac{a}{b}\ \mid\ a,b\in\mathbb{Z}\text{ with }b\text{
squarefree}\right\}
\]
of $\mathbb{Q}$. Then, $\mathbb{Q}_{\operatorname*{sqf}}$ (equipped with the
usual addition as addition, the usual multiplication as scaling, and the usual
$0$ as zero vector) is a $\mathbb{Z}$-module. (Check this!)
\end{example}

\subsection{\label{sect.la.cart-prod}Cartesian products of $\mathbb{K}%
$-modules}

Instead of giving further examples, let us show a way of constructing new
$\mathbb{K}$-modules from old (analogous to Definition \ref{def.ring.dirprod2}):

\begin{definition}
\label{def.module.dirprod1}Let $\mathbb{K}$ be a commutative ring. Let
$M_{1},M_{2},\ldots,M_{n}$ be $n$ many $\mathbb{K}$-modules. Consider the set
$M_{1}\times M_{2}\times\cdots\times M_{n}$, whose elements are $n$-tuples
$\left(  m_{1},m_{2},\ldots,m_{n}\right)  $ with $m_{i}\in M_{i}$.

We define a binary operation $+$ on $M_{1}\times M_{2}\times\cdots\times
M_{n}$ by%
\[
\left(  a_{1},a_{2},\ldots,a_{n}\right)  +\left(  b_{1},b_{2},\ldots
,b_{n}\right)  =\left(  a_{1}+b_{1},a_{2}+b_{2},\ldots,a_{n}+b_{n}\right)  ,
\]
and we define a \textquotedblleft scaling\textquotedblright\ map
$\cdot\ :\ \mathbb{K}\times\left(  M_{1}\times M_{2}\times\cdots\times
M_{n}\right)  \rightarrow M_{1}\times M_{2}\times\cdots\times M_{n}$ by%
\[
\lambda\cdot\left(  a_{1},a_{2},\ldots,a_{n}\right)  =\left(  \lambda
a_{1},\lambda a_{2},\ldots,\lambda a_{n}\right)  .
\]

\end{definition}

\begin{proposition}
\label{prop.module.dirprod.module}Let $\mathbb{K}$ be a commutative ring. Let
$M_{1},M_{2},\ldots,M_{n}$ be $n$ many $\mathbb{K}$-modules. The set
$M_{1}\times M_{2}\times\cdots\times M_{n}$, endowed with the operation $+$
and the map $\cdot$ we just defined and with the zero vector $\left(
0,0,\ldots,0\right)  $, is a $\mathbb{K}$-module.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.dirprod.module}.]Similar to the proof
of Proposition \ref{prop.ring.dirprod.ring}.
\end{proof}

\begin{definition}
\label{def.module.dirprod2}The $\mathbb{K}$-module $M_{1}\times M_{2}%
\times\cdots\times M_{n}$ constructed in Proposition
\ref{prop.module.dirprod.module} is called the \textit{Cartesian product} (or
\textit{direct product}) of the $\mathbb{K}$-modules $M_{1},M_{2},\ldots
,M_{n}$.
\end{definition}

The $\mathbb{K}$-module $\mathbb{K}^{n}$ introduced in Example
\ref{exa.module.Kn} is actually a particular case of Definition
\ref{def.module.dirprod2}; in fact, it is precisely the Cartesian product
$\underbrace{\mathbb{K}\times\mathbb{K}\times\cdots\times\mathbb{K}}_{n\text{
times}}$ of the $\mathbb{K}$-modules $\mathbb{K},\mathbb{K},\ldots,\mathbb{K}$
(that is, $n$ copies of the $\mathbb{K}$-module $\mathbb{K}$ defined in
Example \ref{exa.module.K}).

\subsection{\label{sect.la.rules}Features and rules}

Again, we shall follow the PEMDAS convention for addition and scaling. For
example, the expression \textquotedblleft$a+\lambda b$\textquotedblright%
\ shall mean $a+\left(  \lambda b\right)  $.

\begin{proposition}
\label{prop.module.redundant-1}Axioms \textbf{(g)} and \textbf{(j)} in
Definition \ref{def.module.module} follow from the others.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.redundant-1}.]Assume that all axioms in
Definition \ref{def.module.module} are satisfied except for axioms
\textbf{(g)} and \textbf{(j)}. We must now show that axioms \textbf{(g)} and
\textbf{(j)} are also satisfied.

\textit{Proof of axiom \textbf{(g)}:} Let $a\in M$. Then, axiom \textbf{(f)}
(applied to $\lambda=0$ and $\mu=0$) yields%
\[
\left(  0+0\right)  a=0a+0a.
\]
This rewrites as $0a=0a+0a$ (since $0+0=0$). We can cancel $0a$ from this
equation by adding an additive inverse of $0a$ to both sides (such an inverse
exists because of axiom \textbf{(d)}); we thus get $0_{M}=0a$. In other words,
$0a=0_{M}$. This proves axiom \textbf{(g)}.

The proof of axiom \textbf{(j)} is analogous, with use of axiom \textbf{(e)}
instead of axiom \textbf{(f)}. (This relies on $0_{M}+0_{M}=0_{M}$, which
follows from axiom \textbf{(c)}.)
\end{proof}

\begin{proposition}
\label{prop.module.redundant-2}Axiom \textbf{(d)} in Definition
\ref{def.module.module} follows from the others.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.redundant-2}.]Assume that all axioms in
Definition \ref{def.module.module} are satisfied except for axiom
\textbf{(d)}. We must now show that axiom \textbf{(d)} is also satisfied.

Let $a\in M$. We must prove that $a$ has an additive inverse.

Axiom \textbf{(f)} in Definition \ref{def.module.module} (applied to
$\lambda=1$ and $\mu=-1$) yields $\left(  1+\left(  -1\right)  \right)
a=\underbrace{1a}_{\substack{=a\\\text{(by axiom \textbf{(i)})}}}+\left(
-1\right)  a=a+\left(  -1\right)  a$. Hence,
\[
a+\left(  -1\right)  a=\underbrace{\left(  1+\left(  -1\right)  \right)
}_{=0}a=0a=0_{M}\ \ \ \ \ \ \ \ \ \ \left(  \text{by axiom \textbf{(g)}%
}\right)  .
\]
Also, axiom \textbf{(a)} yields $a+\left(  -1\right)  a=\left(  -1\right)
a+a$, so that $a+\left(  -1\right)  a=\left(  -1\right)  a+a=0_{M}$. Thus,
$\left(  -1\right)  a$ is an additive inverse of $a$. Hence, $a$ has an
additive inverse. Thus, axiom \textbf{(d)} is proven.
\end{proof}

Note that Proposition \ref{prop.module.redundant-1} and Proposition
\ref{prop.module.redundant-2} cannot be merged: If we omit all three axioms
\textbf{(d)}, \textbf{(g)} and \textbf{(j)}, then we cannot recover these
axioms any more. (Indeed, our proof of axiom \textbf{(d)} relied on axiom
\textbf{(g)} and vice versa.)

What can you do when you have a $\mathbb{K}$-module?

\begin{convention}
For the rest of this section, we fix a \textbf{commutative} ring $\mathbb{K}$,
and we fix a $\mathbb{K}$-module $M$. We shall denote the zero vector $0_{M}$
of $M$ by $0$. (More generally, it is common to denote the zero vector of any
$\mathbb{K}$-module by $0$ as long as you are not afraid of confusion.)
\end{convention}

Just as in a ring, elements of a module have unique additive inverses:

\begin{theorem}
\label{thm.module.inv-add.uni}Let $a\in M$. Then:

\textbf{(a)} The element $a$ has exactly one additive inverse.

\textbf{(b)} This additive inverse is $\left(  -1\right)  a$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.module.inv-add.uni}.]\textbf{(a)} Same as the proof
of Theorem \ref{thm.rings.inv-add.uni}.

\textbf{(b)} This was shown in the proof of Proposition
\ref{prop.module.redundant-2}.
\end{proof}

We can now make the following definition, which copies Definition
\ref{def.rings.inv-add-a} almost verbatim:

\begin{definition}
\label{def.module.inv-add-a}\textbf{(a)} If $a\in M$, then the additive
inverse of $a$ will be called $-a$. (This is well-defined, since Theorem
\ref{thm.module.inv-add.uni} \textbf{(a)} shows that this additive inverse is unique.)

\textbf{(b)} If $a\in M$ and $b\in M$, then we define the \textit{difference}
$a-b$ to be the element $a+\left(  -b\right)  $ of $M$. This new binary
operation $-$ on $M$ is called \textquotedblleft\textit{subtraction}%
\textquotedblright.
\end{definition}

\begin{remark}
\label{rmk.module.inv-add.generalizes}The subtraction we just defined (in
Definition \ref{def.module.inv-add-a} \textbf{(b)}) for an arbitrary
$\mathbb{K}$-module generalizes both

\begin{itemize}
\item the subtraction of matrices (when the $\mathbb{K}$-module is
$\mathbb{K}^{n\times m}$), and

\item the subtraction in $\mathbb{Z}/n$ (when $\mathbb{K}=\mathbb{Z}$ and the
$\mathbb{K}$-module is $\mathbb{Z}/n$).
\end{itemize}
\end{remark}

Remark \ref{rmk.module.inv-add.generalizes} is easy to prove, but we delay the
proof until later, since it will become even easier after Proposition
\ref{prop.module.inv-add.rules} has been proven.

Using Definition \ref{def.module.inv-add-a} \textbf{(a)}, we can rewrite
Theorem \ref{thm.module.inv-add.uni} \textbf{(b)} as follows:%
\begin{equation}
-a=\left(  -1\right)  a\ \ \ \ \ \ \ \ \ \ \text{for each }a\in M.
\label{eq.thm.module.inv-add.uni.b.rewr}%
\end{equation}


Additive inverses and subtraction satisfy certain rules that should not
surprise you:

\begin{proposition}
\label{prop.module.inv-add.rules}Let $a,b,c\in M$.

\textbf{(a)} We have $a-b=c$ if and only if $a=b+c$. (Roughly speaking, this
means that subtraction undoes addition.)

\textbf{(b)} We have $-\left(  a+b\right)  =\left(  -a\right)  +\left(
-b\right)  $.

\textbf{(c)} We have $-0=0$.

\textbf{(d)} We have $0-a=-a$.

\textbf{(e)} We have $-\left(  -a\right)  =a$.

\textbf{(f)} We have $-\left(  \lambda a\right)  =\left(  -\lambda\right)
a=\lambda\left(  -a\right)  $ for all $\lambda\in\mathbb{K}$.

\textbf{(g)} We have $a-b-c=a-\left(  b+c\right)  $. (Here and in the
following, \textquotedblleft$a-b-c$\textquotedblright\ should be read as
\textquotedblleft$\left(  a-b\right)  -c$\textquotedblright.)

\textbf{(h)} We have $\lambda\left(  b-c\right)  =\lambda b-\lambda c$ and
$\left(  \lambda-\mu\right)  a=\lambda a-\mu a$ for all $\lambda,\mu
\in\mathbb{K}$.

\textbf{(i)} We have $-\left(  a-b\right)  =b-a$.

\textbf{(j)} We have $a-\left(  -b\right)  =a+b$.

\textbf{(k)} We have $\left(  -1\right)  a=-a$. (Here, the \textquotedblleft%
$1$\textquotedblright\ on the left hand side means the unity of $\mathbb{K}$.)

\textbf{(l)} If $-a=-b$, then $a=b$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.inv-add.rules}.]Same as for Proposition
\ref{prop.rings.inv-add.rules}.
\end{proof}

Again, Proposition \ref{prop.module.inv-add.rules} shows that certain
expressions (such as \textquotedblleft$-\lambda a$\textquotedblright\ for
$\lambda\in\mathbb{K}$ and $a\in M$) are unambiguous.

\begin{proof}
[Proof of Remark \ref{rmk.module.inv-add.generalizes}.]Let us prove that the
subtraction we defined (in Definition \ref{def.module.inv-add-a} \textbf{(b)})
for an arbitrary $\mathbb{K}$-module generalizes the subtraction of matrices
(when the $\mathbb{K}$-module is $\mathbb{K}^{n\times m}$).

The rough idea of the proof is \textquotedblleft this is true, because both of
these subtractions undo the same addition\textquotedblright. Here is the
argument in detail: Let $n,m\in\mathbb{N}$. Let $M$ be the $\mathbb{K}$-module
$\mathbb{K}^{n\times m}$. Let $A,B\in M$. Our goal is then to show that the
difference $A-B$ defined as in Definition \ref{def.module.inv-add-a}
\textbf{(b)} equals the difference $A-B$ defined as in Definition
\ref{def.matrix.+-} \textbf{(b)}. Let us denote the former difference by
$D_{1}$ and the latter difference by $D_{2}$. Our goal is thus to prove that
$D_{1}=D_{2}$.

We know that $D_{1}$ is the difference $A-B$ defined as in Definition
\ref{def.module.inv-add-a} \textbf{(b)}. In other words, $A-B=D_{1}$, where
the minus sign refers to the subtraction defined in Definition
\ref{def.module.inv-add-a} \textbf{(b)}.

But Proposition \ref{prop.module.inv-add.rules} \textbf{(a)} (applied to
$a=A$, $b=B$ and $c=D_{1}$) shows that we have $A-B=D_{1}$ if and only if
$A=B+D_{1}$, where the minus sign refers to the subtraction defined in
Definition \ref{def.module.inv-add-a} \textbf{(b)}. Hence, $A=B+D_{1}$ (since
$A-B=D_{1}$). Note that the plus sign is unambiguous here: We have defined
subtraction on $M$ in two different ways (and still have to prove that these
two definitions are equivalent), but we have defined addition on $M$ only once.

But Theorem \ref{thm.matrix.rules} \textbf{(i)} (applied to $C=D_{1}$) yields
that we have the equivalence $\left(  A-B=D_{1}\right)  \ \Longleftrightarrow
\ \left(  A=B+D_{1}\right)  $, where the minus sign refers to the subtraction
defined in Definition \ref{def.matrix.+-} \textbf{(b)}. Hence, we have
$A-B=D_{1}$ (since we have $A=B+D_{1}$), where the minus sign refers to the
subtraction defined in Definition \ref{def.matrix.+-} \textbf{(b)}. In other
words, $D_{1}$ is the difference $A-B$ defined as in Definition
\ref{def.matrix.+-} \textbf{(b)}.

In other words, we have $D_{1}=D_{2}$ (since $D_{2}$ was defined to be the
difference $A-B$ defined as in Definition \ref{def.matrix.+-} \textbf{(b)}).
This is precisely what we set out to prove.

Thus, we have shown that the subtraction we defined (in Definition
\ref{def.module.inv-add-a} \textbf{(b)}) for an arbitrary $\mathbb{K}$-module
generalizes the subtraction of matrices (when the $\mathbb{K}$-module is
$\mathbb{K}^{n\times m}$). A similar argument (but using Theorem
\ref{thm.eqrel.Z/n.rules} \textbf{(i)} instead of Theorem
\ref{thm.matrix.rules} \textbf{(i)}) shows that the former subtraction
generalizes the subtraction in $\mathbb{Z}/n$ (when $\mathbb{K}=\mathbb{Z}$
and the $\mathbb{K}$-module is $\mathbb{Z}/n$). Thus, Remark
\ref{rmk.module.inv-add.generalizes} is proven.
\end{proof}

Theorem \ref{thm.rings.sum.wd} holds for the $\mathbb{K}$-module $M$ just as
it holds for the ring $\mathbb{K}$. Thus, we have a notion of finite sums of
elements of $M$; it behaves exactly like finite sums of elements of
$\mathbb{K}$ do. But Theorem \ref{thm.rings.prod.wd} has no analogue for
$\mathbb{K}$-modules. (However, you can get something similar to Theorem
\ref{thm.rings.prod.wd} \textbf{(b)} by defining finite products of the form
$\lambda_{1}\lambda_{2}\cdots\lambda_{k}a$ with $\lambda_{1},\lambda
_{2},\ldots,\lambda_{k}\in\mathbb{K}$ and $a\in M$.)

Definition \ref{def.rings.na} can be extended to modules by simply replacing
$\mathbb{K}$ with $M$:

\begin{definition}
\label{def.module.na}Let $a\in M$ and $n\in\mathbb{Z}$. Then, we define an
element $na$ of $M$ by%
\[
na=%
\begin{cases}
\underbrace{a+a+\cdots+a}_{n\text{ times}}, & \text{if }n\geq0;\\
-\left(  \underbrace{a+a+\cdots+a}_{-n\text{ times}}\right)  , & \text{if }n<0
\end{cases}
.
\]

\end{definition}

We cannot define $a^{n}$ for $a\in M$ and $n\in\mathbb{N}$.

Proposition \ref{prop.rings.Zscal.rules} has an analogue for a $\mathbb{K}%
$-module; namely, we have the following:

\begin{proposition}
\label{prop.module.na.rules}We have%
\begin{align}
\left(  n+m\right)  a  &  =na+ma\ \ \ \ \ \ \ \ \ \ \text{for all }a\in
M\text{ and }n,m\in\mathbb{Z};\\
n\left(  a+b\right)   &  =na+nb\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in
M\text{ and }n\in\mathbb{Z};\\
-\left(  na\right)   &  =\left(  -n\right)  a=n\left(  -a\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }a\in M\text{ and }n\in\mathbb{Z};\\
\left(  nm\right)  a  &  =n\left(  ma\right)  \ \ \ \ \ \ \ \ \ \ \text{for
all }a\in M\text{ and }n,m\in\mathbb{Z};\\
n\left(  \lambda a\right)   &  =\left(  n\lambda\right)  a=\lambda\left(
na\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }a\in M\text{ and }\lambda
\in\mathbb{K}\text{ and }n\in\mathbb{Z};\\
n0_{M}  &  =0_{M}\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{Z};\\
1a  &  =a\ \ \ \ \ \ \ \ \ \ \text{for all }a\in M;\\
0a  &  =0_{M}\ \ \ \ \ \ \ \ \ \ \text{for all }a\in M;\\
\left(  -1\right)  a  &  =-a\ \ \ \ \ \ \ \ \ \ \text{for all }a\in M.
\end{align}
(Here, \textquotedblleft$1$\textquotedblright\ stands for the integer
$1\in\mathbb{Z}$, not for the scalar $1\in\mathbb{K}$. Likewise, the
\textquotedblleft$0$\textquotedblright\ in \textquotedblleft$0a$%
\textquotedblright, and the \textquotedblleft$-1$\textquotedblright\ in
\textquotedblleft$\left(  -1\right)  a$\textquotedblright\ stand for
integers.) In particular, these equalities show that certain expressions (like
\textquotedblleft$nma$\textquotedblright\ and \textquotedblleft$n\lambda
a$\textquotedblright) are unambiguous.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.na.rules}.]This is analogous to the
proof of Proposition \ref{prop.rings.Zscal.rules}.
\end{proof}

\textbf{Upshot:} All the rules relating to addition that we know from rings
are still true for $\mathbb{K}$-modules. Some basic rules relating to
multiplication can be salvaged (i.e., made to work for $\mathbb{K}$-modules)
by replacing multiplication by scaling.

\subsection{\label{sect.la.submod}Submodules}

\begin{convention}
\label{conv.module.K}For the rest of Chapter \ref{chp.la}, we fix a
\textbf{commutative} ring $\mathbb{K}$, and we denote its addition,
multiplication, zero and unity by $+$, $\cdot$, $0$ and $1$.
\end{convention}

In Section \ref{sect.ring.subring}, we have defined the notion of a subring of
a ring. Similarly, we shall now define a submodule of a $\mathbb{K}$-module.
For example, the $\mathbb{Z}$-modules $q\mathbb{Z}$ and $\mathbb{Q}%
_{\operatorname*{sqf}}$ from Example \ref{exa.module.Q} will fall under this
concept. The idea is the same as for subrings: A submodule of a $\mathbb{K}%
$-module $N$ is a $\mathbb{K}$-module $M$ that is a subset of $N$ and has
\textquotedblleft the same\textquotedblright\ addition, scaling and zero
vector. Here is the formal definition (analogous to Definition
\ref{def.ring.subring}):

\begin{definition}
\label{def.la.submod}Let $M$ and $N$ be two $\mathbb{K}$-modules. We say that
$M$ is a $\mathbb{K}$\textit{-submodule} (or, for short, \textit{submodule})
of $N$ if and only if it satisfies the following four requirements:

\begin{itemize}
\item the set $M$ is a subset of $N$;

\item the addition of $M$ is a restriction of the addition of $N$ (that is, we
have $a_{1}+_{M}a_{2}=a_{1}+_{N}a_{2}$ for all $a_{1},a_{2}\in M$);

\item the scaling of $M$ is a restriction of the scaling of $N$ (that is, we
have $\lambda\cdot_{M}a=\lambda\cdot_{N}a$ for all $\lambda\in\mathbb{K}$ and
$a\in M$);

\item the zero vector of $M$ is the zero vector of $N$ (that is, we have
$0_{M}=0_{N}$).
\end{itemize}
\end{definition}

Thus, according to this definition:

\begin{itemize}
\item the $\mathbb{Z}$-modules $n\mathbb{Z}$ from Example \ref{exa.module.Z/n}
\textbf{(b)} are $\mathbb{Z}$-submodules of $\mathbb{Z}$;

\item the $\mathbb{Z}$-modules $q\mathbb{Z}$ and $\mathbb{Q}%
_{\operatorname*{sqf}}$ from Example \ref{exa.module.Q} are $\mathbb{Z}%
$-submodules of $\mathbb{Q}$;

\item every $\mathbb{K}$-module $M$ is a $\mathbb{K}$-submodule of itself.
\end{itemize}

Again, you can find examples of two $\mathbb{K}$-modules $M$ and $N$ for which
the set $M$ is a \textbf{subset} of $N$ yet the $\mathbb{K}$-module $M$ is
\textbf{not a }$\mathbb{K}$\textbf{-submodule} of $N$. For example,
$\mathbb{C}$ becomes a $\mathbb{C}$-module in the usual way (with addition
playing the role of addition, and multiplication playing the role of scaling);
but you can also define a second \textquotedblleft scaling\textquotedblright%
\ operation $\overline{\cdot}:\mathbb{C}\times\mathbb{C}\rightarrow\mathbb{C}$
by setting%
\[
\alpha\left.  \overline{\cdot}\right.  \beta=\overline{\alpha}\beta
\ \ \ \ \ \ \ \ \ \ \text{for all }\alpha,\beta\in\mathbb{C}\text{.}%
\]
Then, we can turn the set $\mathbb{C}$ into a $\mathbb{C}$-module by endowing
it with the usual addition, the unusual scaling operation $\left.
\overline{\cdot}\right.  $ and the zero vector $0$. This new $\mathbb{C}%
$-module may be called $\overline{\mathbb{C}}$, and is useful in studying
\href{https://en.wikipedia.org/wiki/Sesquilinear_form}{Hermitian forms}. The
$\mathbb{C}$-modules $\mathbb{C}$ and $\overline{\mathbb{C}}$ are equal as
sets, but neither is a $\mathbb{C}$-submodule of the other.

\begin{definition}
\label{def.la.submod-subspace}If $\mathbb{K}$ is a field, then $\mathbb{K}%
$-submodules are also known as $\mathbb{K}$\textit{-vector subspaces} (or,
short, $\mathbb{K}$\textit{-subspaces}).
\end{definition}

When we have two $\mathbb{K}$-modules $M$ and $N$ such that $M\subseteq N$ as
sets (or, more generally, such that $M$ and $N$ have elements in common), we
generally need to be careful using the symbol \textquotedblleft$+$%
\textquotedblright: This symbol may mean both the addition of $M$ and the
addition of $N$, and these additions might not be the same. Thus it is prudent
to disambiguate its meaning by attaching a subscript \textquotedblleft$_{M}%
$\textquotedblright\ or \textquotedblleft$_{N}$\textquotedblright\ to it. The
same applies to the symbols \textquotedblleft$\cdot$\textquotedblright\ and
\textquotedblleft$0$\textquotedblright\ and expressions like \textquotedblleft%
$\lambda a$\textquotedblright\ (which have an implicit scaling sign). However,
when $M$ is a $\mathbb{K}$-submodule of $N$, we do not need to take this
precaution; in this case, the meaning of expressions like \textquotedblleft%
$a+b$\textquotedblright\ does not depend on whether you read \textquotedblleft%
$+$\textquotedblright\ as the addition of $M$ or as the addition of $N$.

The following is analogous to Proposition \ref{prop.ring.subring.as-subset}:

\begin{proposition}
\label{prop.module.submod.as-subset}Let $N$ be a $\mathbb{K}$-module. Let $S$
be a subset of $N$ that satisfies the following three conditions:\footnotemark

\begin{itemize}
\item We have $0\in S$.

\item The subset $S$ is \textit{closed under addition}. (This means that all
$a,b\in S$ satisfy $a+b\in S$.)

\item The subset $S$ is \textit{closed under scaling}. (This means that all
$\lambda\in\mathbb{K}$ and $a\in S$ satisfy $\lambda a\in S$.)
\end{itemize}

Then, the set $S$ itself becomes a $\mathbb{K}$-module if we endow it with:

\begin{itemize}
\item an addition operation $+$ which is defined as the restriction of the
addition operation of the $\mathbb{K}$-module $N$;

\item a scaling map $\cdot:\mathbb{K}\times S\rightarrow S$ which is defined
as the restriction of the scaling map of the $\mathbb{K}$-module $N$,
\end{itemize}

\noindent and the zero vector $0$. Furthermore, this $\mathbb{K}$-module $S$
is a $\mathbb{K}$-submodule of $N$.
\end{proposition}

\footnotetext{In this proposition, the symbols \textquotedblleft%
$+$\textquotedblright, \textquotedblleft$\cdot$\textquotedblright\ and
\textquotedblleft$0$\textquotedblright\ mean the addition, the scaling and the
zero vector of $N$.}

\begin{proof}
[Proof of Proposition \ref{prop.module.submod.as-subset}.]Similar to the proof
of Proposition \ref{prop.ring.subring.as-subset}, except that we now need to
argue that each $a\in S$ satisfies $-a\in S$. (But this is easy: Since $S$ is
closed under scaling, we have $\left(  -1\right)  a\in S$, and thus
$-a=\left(  -1\right)  a\in S$.)
\end{proof}

\begin{definition}
\label{def.module.submod.as-subset} Let $N$ be a $\mathbb{K}$-module. Let $S$
be a subset of $N$ that satisfies the three conditions of Proposition
\ref{prop.module.submod.as-subset}. Then, we shall say that \textquotedblleft%
$S$ is a $\mathbb{K}$-submodule of $N$\textquotedblright. Technically
speaking, this is premature, since $S$ is so far just a subset of $N$ without
the structure of a $\mathbb{K}$-module; however, Proposition
\ref{prop.module.submod.as-subset} shows that there is an obvious way of
turning $S$ into a $\mathbb{K}$-module (viz.: define an operation $+$ by
restricting the corresponding operation of $N$, define a map $\cdot$
similarly, and steal the zero vector from $N$), and we shall automatically
regard $S$ as becoming a $\mathbb{K}$-module in this way (unless we say
otherwise). We say that the addition operation $+$ on $S$ (obtained by
restricting the corresponding operation on $N$) and the scaling map $\cdot$ of
$S$ and the zero vector of $S$ are \textit{inherited from }$N$.
\end{definition}

Thus, finding $\mathbb{K}$-submodules of a $\mathbb{K}$-module $N$ boils down
to finding subsets that contain its $0$ and are closed under addition and
under scaling; the module axioms don't need to be re-checked.

Thus, in particular, when $\mathbb{K}$ is a field, the vector subspaces of
$\mathbb{K}^{n\times1}$ (as in Definition \ref{def.laf.subspace-of-row}) are
precisely the $\mathbb{K}$-submodules of $\mathbb{K}^{n\times1}$. Many
examples of $\mathbb{K}$-submodules can thus be found in textbooks on linear
algebra. If $M$ is any $\mathbb{K}$-module, then both $M$ and the one-element
subset $\left\{  0_{M}\right\}  $ are $\mathbb{K}$-submodules of $M$ (this is
easily checked); the more interesting submodules are the ones that lie in
between these two extremes.

\subsection{\label{sect.la.liho}Linear maps, aka module homomorphisms}

Recall Definition \ref{def.riho.riho}. In a similar way, we define
$\mathbb{K}$\textit{-module homomorphisms}, also known as $\mathbb{K}%
$\textit{-linear maps}:

\begin{definition}
\label{def.module.moho}Let $M$ and $N$ be two $\mathbb{K}$-modules. A
$\mathbb{K}$\textit{-module homomorphism} from $M$ to $N$ means a map
$f:M\rightarrow N$ that satisfies the following three axioms:

\begin{itemize}
\item \textbf{(a)} We have $f\left(  a+b\right)  =f\left(  a\right)  +f\left(
b\right)  $ for all $a,b\in M$. (This is called \textquotedblleft$f$ respects
addition\textquotedblright\ or \textquotedblleft$f$ preserves
addition\textquotedblright.)

\item \textbf{(b)} We have $f\left(  0\right)  =0$. (This, of course, means
$f\left(  0_{M}\right)  =0_{N}$.)

\item \textbf{(c)} We have $f\left(  \lambda a\right)  =\lambda f\left(
a\right)  $ for all $\lambda\in\mathbb{K}$ and $a\in M$. (This is called
\textquotedblleft$f$ respects scaling\textquotedblright\ or \textquotedblleft%
$f$ preserves scaling\textquotedblright.)
\end{itemize}

Instead of \textquotedblleft$\mathbb{K}$-module homomorphism\textquotedblright%
, we can also say \textquotedblleft$\mathbb{K}$\textit{-linear map}%
\textquotedblright\ or just \textquotedblleft\textit{linear map}%
\textquotedblright\ (when $\mathbb{K}$ is clear).
\end{definition}

\begin{remark}
\label{rmk.module.moho.0-free}The axiom \textbf{(b)} in Definition
\ref{def.module.moho} is redundant -- it follows from axiom \textbf{(a)}.
\end{remark}

\begin{proof}
Same argument as for Remark \ref{rmk.riho.0-free}.
\end{proof}

Some authors (for example, Hefferon in \cite[Chapter Three, Definition
II.1.1]{Hefferon}, and the authors of \cite[Definition 6.1.1]{LaNaSc16}) omit
the axiom \textbf{(b)} when they define $\mathbb{K}$-linear maps. This does
not change the concept, as Remark \ref{rmk.module.moho.0-free} shows.

What are some examples of module homomorphisms?

\begin{example}
\label{exa.module.moho.id}Let $M$ be a $\mathbb{K}$-module.

\textbf{(a)} The identity map $\operatorname*{id}:M\rightarrow M$ is
$\mathbb{K}$-linear.

\textbf{(b)} For any $\lambda\in\mathbb{K}$, the map $L_{\lambda}:M\rightarrow
M,\ a\mapsto\lambda a$ is $\mathbb{K}$-linear.

\textbf{(c)} If $M=\mathbb{K}$ (specifically, the $\mathbb{K}$-module
$\mathbb{K}$ defined in Example \ref{exa.module.K}), then the maps
$L_{\lambda}$ (for $\lambda\in\mathbb{K}$) that we just defined are the only
$\mathbb{K}$-linear maps from $M$ to $M$.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.module.moho.id}.]\textbf{(b)} Let $\lambda
\in\mathbb{K}$. We must prove that the map $L_{\lambda}:M\rightarrow
M,\ a\mapsto\lambda a$ is $\mathbb{K}$-linear. Thus, we must prove that it
satisfies the three axioms \textbf{(a)}, \textbf{(b)} and \textbf{(c)} of
Definition \ref{def.module.moho}. In other words, we must prove the following:

\begin{statement}
\textit{Claim 1:} We have $L_{\lambda}\left(  a+b\right)  =L_{\lambda}\left(
a\right)  +L_{\lambda}\left(  b\right)  $ for all $a,b\in M$.

\textit{Claim 2:} We have $L_{\lambda}\left(  0\right)  =0$.

\textit{Claim 3:} We have $L_{\lambda}\left(  \mu a\right)  =\mu L_{\lambda
}\left(  a\right)  $ for all $\mu\in\mathbb{K}$ and $a\in M$. (Note that we
are using the letter \textquotedblleft$\mu$\textquotedblright\ for what was
called \textquotedblleft$\lambda$\textquotedblright\ in Definition
\ref{def.module.moho}, since the letter \textquotedblleft$\lambda
$\textquotedblright\ is already taken.)
\end{statement}

[\textit{Proof of Claim 1:} Let $a,b\in M$. Then, the definition of
$L_{\lambda}$ yields $L_{\lambda}\left(  a+b\right)  =\lambda\left(
a+b\right)  $ and $L_{\lambda}\left(  a\right)  =\lambda a$ and $L_{\lambda
}\left(  b\right)  =\lambda b$. But axiom \textbf{(e)} in Definition
\ref{def.module.module} yields $\lambda\left(  a+b\right)  =\lambda a+\lambda
b$. Hence,
\[
L_{\lambda}\left(  a+b\right)  =\lambda\left(  a+b\right)
=\underbrace{\lambda a}_{=L_{\lambda}\left(  a\right)  }+\underbrace{\lambda
b}_{=L_{\lambda}\left(  b\right)  }=L_{\lambda}\left(  a\right)  +L_{\lambda
}\left(  b\right)  .
\]
This proves Claim 1.]

[\textit{Proof of Claim 2:} We leave this proof to the reader.]

[\textit{Proof of Claim 3:} Let $\mu\in\mathbb{K}$ and $a\in M$. Now, axiom
\textbf{(h)} in Definition \ref{def.module.module} yields $\left(  \lambda
\mu\right)  a=\lambda\left(  \mu a\right)  $. The same argument (with the
roles of $\lambda$ and $\mu$ swapped) yields $\left(  \mu\lambda\right)
a=\mu\left(  \lambda a\right)  $. But $\mathbb{K}$ is commutative; thus,
$\lambda\mu=\mu\lambda$. Now, the definition of $L_{\lambda}$ yields
$L_{\lambda}\left(  a\right)  =\lambda a$. Furthermore, the definition of
$L_{\lambda}$ yields%
\[
L_{\lambda}\left(  \mu a\right)  =\lambda\left(  \mu a\right)
=\underbrace{\left(  \lambda\mu\right)  }_{=\mu\lambda}a=\left(  \mu
\lambda\right)  a=\mu\underbrace{\left(  \lambda a\right)  }_{=L_{\lambda
}\left(  a\right)  }=\mu L_{\lambda}\left(  a\right)  .
\]
This proves Claim 3.]

Thus, all three Claims 1, 2 and 3 have been proven. Hence, the map
$L_{\lambda}:M\rightarrow M,\ a\mapsto\lambda a$ is $\mathbb{K}$-linear; this
completes the proof of Example \ref{exa.module.moho.id} \textbf{(b)}.

\textbf{(a)} In Example \ref{exa.module.moho.id} \textbf{(b)}, we have defined
a map $L_{\lambda}:M\rightarrow M,\ a\mapsto\lambda a$ for each $\lambda
\in\mathbb{K}$. Applying this to $\lambda=1$, we obtain a map $L_{1}%
:M\rightarrow M,\ a\mapsto1a$. This map $L_{1}:M\rightarrow M$ is $\mathbb{K}%
$-linear (by Example \ref{exa.module.moho.id} \textbf{(b)}, applied to
$\lambda=1$). But each $a\in M$ satisfies
\begin{align*}
L_{1}\left(  a\right)   &  =1a\ \ \ \ \ \ \ \ \ \ \left(  \text{by the
definition of }L_{1}\right) \\
&  =a\ \ \ \ \ \ \ \ \ \ \left(  \text{by axiom \textbf{(i)} in Definition
\ref{def.module.module}}\right) \\
&  =\operatorname*{id}\left(  a\right)  .
\end{align*}
In other words, $L_{1}=\operatorname*{id}$. Hence, the map $\operatorname*{id}%
:M\rightarrow M$ is $\mathbb{K}$-linear (since the map $L_{1}:M\rightarrow M$
is $\mathbb{K}$-linear). This proves Example \ref{exa.module.moho.id}
\textbf{(a)}.

\textbf{(c)} Assume that $M=\mathbb{K}$ (specifically, the $\mathbb{K}$-module
$\mathbb{K}$ defined in Example \ref{exa.module.K}). We must prove that the
maps $L_{\lambda}$ (for $\lambda\in\mathbb{K}$) that we just defined are the
only $\mathbb{K}$-linear maps from $M$ to $M$. We already have shown that
these maps $L_{\lambda}$ are $\mathbb{K}$-linear (see Example
\ref{exa.module.moho.id} \textbf{(b)}); thus, it remains to prove that there
are no other $\mathbb{K}$-linear maps from $M$ to $M$. In other words, it
remains to prove that if $f$ is a $\mathbb{K}$-linear map from $M$ to $M$,
then $f=L_{\lambda}$ for some $\lambda\in\mathbb{K}$.

So let $f$ be a $\mathbb{K}$-linear map from $M$ to $M$. Set $\rho=f\left(
1\right)  $. Then, $\rho\in M=\mathbb{K}$. Thus, a map $L_{\rho}:M\rightarrow
M$ is well-defined.

Recall that our $\mathbb{K}$-module $M$ is $\mathbb{K}$ itself, and its
scaling map is exactly the multiplication operation of $\mathbb{K}$.

Now, let $a\in M$. Then, $a\in M=\mathbb{K}$, so that $a=a\cdot1$ (by the
\textquotedblleft Neutrality of one\textquotedblright\ axiom in the ring
$\mathbb{K}$). Hence,%
\begin{align*}
f\left(  a\right)   &  =f\left(  a\cdot1\right)  =a\cdot\underbrace{f\left(
1\right)  }_{=\rho}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by the axiom \textbf{(c)} in Definition \ref{def.module.moho},}\\
\text{applied to }a\text{ and }1\text{ instead of }\lambda\text{ and }a
\end{array}
\right) \\
&  =a\cdot\rho=\rho\cdot a\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since both }a\text{ and }\rho\text{ are elements of }\mathbb{K}\text{,
and since }\mathbb{K}\text{ is commutative}\\
\text{(and since the scaling map of }M\text{ is the multiplication operation
of }\mathbb{K}\text{)}%
\end{array}
\right) \\
&  =L_{\rho}\left(  a\right)
\end{align*}
(since the definition of $L_{\rho}$ yields $L_{\rho}\left(  a\right)
=\rho\cdot a$).

Now, forget that we fixed $a$. We thus have proven that $f\left(  a\right)
=L_{\rho}\left(  a\right)  $ for each $a\in M$. In other words, $f=L_{\rho}$.
Hence, $f=L_{\lambda}$ for some $\lambda\in\mathbb{K}$ (namely, for
$\lambda=\rho$). As we said, this proves Example \ref{exa.module.moho.id}
\textbf{(c)}.
\end{proof}

Next comes a less basic example:

\begin{theorem}
\label{thm.module.LA}Let $n,m\in\mathbb{N}$. Let $A\in\mathbb{K}^{n\times m}$
be an $n\times m$-matrix. Define a map%
\begin{align*}
L_{A}:\mathbb{K}^{m\times1}  &  \rightarrow\mathbb{K}^{n\times1},\\
v  &  \mapsto Av.
\end{align*}
This map $L_{A}$ is a $\mathbb{K}$-module homomorphism from $\mathbb{K}%
^{m\times1}$ to $\mathbb{K}^{n\times1}$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.module.LA}.]We just need to check that the three
axioms \textbf{(a)}, \textbf{(b)} and \textbf{(c)} in Definition
\ref{def.module.moho} are satisfied for $M=\mathbb{K}^{m\times1}$,
$N=\mathbb{K}^{n\times1}$ and $f=L_{A}$.

\textit{Proof of axiom \textbf{(a)}:} We must prove that $L_{A}\left(
a+b\right)  =L_{A}\left(  a\right)  +L_{A}\left(  b\right)  $ for all
$a,b\in\mathbb{K}^{m\times1}$. Indeed: If $a,b\in\mathbb{K}^{m\times1}$, then
we can compare the equalities%
\begin{align*}
L_{A}\left(  a+b\right)   &  =A\left(  a+b\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of }L_{A}\right) \\
&  =Aa+Ab\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.matrix.rules}
\textbf{(g)}}\right)
\end{align*}
and%
\[
\underbrace{L_{A}\left(  a\right)  }_{\substack{=Aa\\\text{(by the definition
of }L_{A}\text{)}}}+\underbrace{L_{A}\left(  b\right)  }%
_{\substack{=Ab\\\text{(by the definition of }L_{A}\text{)}}}=Aa+Ab,
\]
and thus obtain $L_{A}\left(  a+b\right)  =L_{A}\left(  a\right)
+L_{A}\left(  b\right)  $. Thus, axiom \textbf{(a)} has been verified.

The axioms \textbf{(b)} and \textbf{(c)} are proven similarly (details are
left to the reader).
\end{proof}

\begin{proposition}
\label{prop.module.f=LA}Let $n,m\in\mathbb{N}$. Each $\mathbb{K}$-module
homomorphism from $\mathbb{K}^{m\times1}$ to $\mathbb{K}^{n\times1}$ has the
form $L_{A}$ for a unique $A\in\mathbb{K}^{n\times m}$ (where $L_{A}$ is
defined as in Theorem \ref{thm.module.LA}).
\end{proposition}

We shall delay the proof of this proposition until we have shown some
auxiliary results. First, we define a specific kind of column vectors:

\begin{definition}
\label{def.module.ej}Let $m\in\mathbb{N}$. For each $j\in\left\{
1,2,\ldots,m\right\}  $, we let $e_{j}\in\mathbb{K}^{m\times1}$ be the column
vector
\[
\left(
\begin{array}
[c]{c}%
0\\
0\\
\vdots\\
0\\
1\\
0\\
0\\
\vdots\\
0
\end{array}
\right)  =\left(  0,0,\ldots,0,1,0,0,\ldots,0\right)  ^{T}%
\]
where the $1$ is at the $j$-th position. (Strictly speaking, we should denote
it by $e_{j,m}$ rather than $e_{j}$, since it depends on $m$ and not just on
$j$; but the $m$ will always be clear from the context.)

These column vectors $e_{1},e_{2},\ldots,e_{m}$ are called the
\textit{standard basis vectors} of $\mathbb{K}^{m\times1}$.
\end{definition}

For example, if $m=3$, then $e_{1}=\left(
\begin{array}
[c]{c}%
1\\
0\\
0
\end{array}
\right)  $ and $e_{2}=\left(
\begin{array}
[c]{c}%
0\\
1\\
0
\end{array}
\right)  $ and $e_{3}=\left(
\begin{array}
[c]{c}%
0\\
0\\
1
\end{array}
\right)  $.

\begin{lemma}
\label{lem.module.Aej}Let $n,m\in\mathbb{N}$. Let $A\in\mathbb{K}^{n\times m}$
be an $n\times m$-matrix.

\textbf{(a)} We have $Ae_{j}=\left(  \text{the }j\text{-th column of
}A\right)  $ for all $j\in\left\{  1,2,\ldots,m\right\}  $.

\textbf{(b)} Consider the map $L_{A}$ defined in Theorem \ref{thm.module.LA}.
Then,%
\[
L_{A}\left(  e_{j}\right)  =\left(  \text{the }j\text{-th column of }A\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }j\in\left\{  1,2,\ldots,m\right\}  .
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.module.Aej}.]\textbf{(a)} Let $j\in\left\{
1,2,\ldots,m\right\}  $. Then, $Ae_{j}$ is a column vector in $\mathbb{K}%
^{n\times1}$. For each $i\in\left\{  1,2,\ldots,n\right\}  $, we have%
\begin{align*}
&  \left(  \text{the }i\text{-th entry of the column vector }Ae_{j}\right) \\
&  =\left(  \text{the }\left(  i,1\right)  \text{-th entry of the matrix
}Ae_{j}\right) \\
&  =\sum_{k=1}^{m}\left(  \text{the }\left(  i,k\right)  \text{-th entry of
}A\right)  \cdot\underbrace{\left(  \text{the }\left(  k,1\right)  \text{-th
entry of }e_{j}\right)  }_{\substack{=%
\begin{cases}
1, & \text{if }k=j;\\
0, & \text{if }k\neq j
\end{cases}
\\\text{(by the definition of }e_{j}\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of multiplication of
matrices}\right) \\
&  =\sum_{k=1}^{m}\left(  \text{the }\left(  i,k\right)  \text{-th entry of
}A\right)  \cdot%
\begin{cases}
1, & \text{if }k=j;\\
0, & \text{if }k\neq j
\end{cases}
\\
&  =\left(  \text{the }\left(  i,j\right)  \text{-th entry of }A\right)
\cdot\underbrace{%
\begin{cases}
1, & \text{if }j=j;\\
0, & \text{if }j\neq j
\end{cases}
}_{\substack{=1\\\text{(since }j=j\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ +\sum_{\substack{k\in\left\{  1,2,\ldots,m\right\}
;\\k\neq j}}\left(  \text{the }\left(  i,k\right)  \text{-th entry of
}A\right)  \cdot\underbrace{%
\begin{cases}
1, & \text{if }k=j;\\
0, & \text{if }k\neq j
\end{cases}
}_{\substack{=0\\\text{(since }k\neq j\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=j\text{ from the sum}\right) \\
&  =\left(  \text{the }\left(  i,j\right)  \text{-th entry of }A\right)
+\underbrace{\sum_{\substack{k\in\left\{  1,2,\ldots,m\right\}  ;\\k\neq
j}}\left(  \text{the }\left(  i,k\right)  \text{-th entry of }A\right)
\cdot0}_{=0}\\
&  =\left(  \text{the }\left(  i,j\right)  \text{-th entry of }A\right)
=\left(  \text{the }i\text{-th entry of the }j\text{-th column of }A\right)  .
\end{align*}
Hence, $Ae_{j}=\left(  \text{the }j\text{-th column of }A\right)  $. This
proves Lemma \ref{lem.module.Aej} \textbf{(a)}.

\textbf{(b)} Let $j\in\left\{  1,2,\ldots,m\right\}  $. The definition of
$L_{A}$ yields%
\[
L_{A}\left(  e_{j}\right)  =Ae_{j}=\left(  \text{the }j\text{-th column of
}A\right)
\]
(by Lemma \ref{lem.module.Aej} \textbf{(a)}). This proves Lemma
\ref{lem.module.Aej} \textbf{(b)}.
\end{proof}

\begin{proposition}
\label{prop.module.f-pres-lc}Let $M$ and $N$ be two $\mathbb{K}$-modules. Let
$f:M\rightarrow N$ be a $\mathbb{K}$-linear map.

\textbf{(a)} We have $f\left(  \lambda a+\mu b\right)  =\lambda f\left(
a\right)  +\mu f\left(  b\right)  $ for all $\lambda,\mu\in\mathbb{K}$ and
$a,b\in M$.

\textbf{(b)} Let $\lambda_{1},\lambda_{2},\ldots,\lambda_{k}\in\mathbb{K}$ and
$a_{1},a_{2},\ldots,a_{k}\in M$. Then,%
\[
f\left(  \sum_{i=1}^{k}\lambda_{i}a_{i}\right)  =\sum_{i=1}^{k}\lambda
_{i}f\left(  a_{i}\right)  .
\]
(In words: $f$ \textquotedblleft preserves linear
combinations\textquotedblright.)
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.f-pres-lc}.]The map $f$ is $\mathbb{K}%
$-linear, and thus satisfies the axioms \textbf{(a)}, \textbf{(b)} and
\textbf{(c)} of Definition \ref{def.module.moho}. We shall use these axioms in
the following.

\textbf{(a)} Let $\lambda,\mu\in\mathbb{K}$ and $a,b\in M$. Then,%
\begin{align*}
f\left(  \lambda a+\mu b\right)   &  =\underbrace{f\left(  \lambda a\right)
}_{\substack{=\lambda f\left(  a\right)  \\\text{(by axiom \textbf{(c)})}%
}}+\underbrace{f\left(  \mu b\right)  }_{\substack{=\mu f\left(  b\right)
\\\text{(by axiom \textbf{(c)})}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by axiom
\textbf{(a)}}\right) \\
&  =\lambda f\left(  a\right)  +\mu f\left(  b\right)  .
\end{align*}
This proves Proposition \ref{prop.module.f-pres-lc} \textbf{(a)}.

\textbf{(b)} This is proven by induction on $k$. The induction base (i.e., the
case $k=0$) follows from axiom \textbf{(b)}; the induction step uses
Proposition \ref{prop.module.f-pres-lc} \textbf{(a)} (or axioms \textbf{(a)}
and \textbf{(c)}, if you wish). Details are left to the reader.
\end{proof}

Proposition \ref{prop.module.f-pres-lc} \textbf{(a)} has a converse:

\begin{proposition}
\label{prop.module.moho-alt}Let $M$ and $N$ be two $\mathbb{K}$-modules. Let
$f:M\rightarrow N$ be a map. Assume that
\begin{equation}
f\left(  \lambda a+\mu b\right)  =\lambda f\left(  a\right)  +\mu f\left(
b\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }\lambda,\mu\in\mathbb{K}\text{
and }a,b\in M. \label{eq.prop.module.moho-alt.ass}%
\end{equation}
Then, $f$ is $\mathbb{K}$-linear.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.moho-alt}.]We must prove that the three
axioms \textbf{(a)}, \textbf{(b)} and \textbf{(c)} of Definition
\ref{def.module.moho} are satisfied.

\textit{Proof of axiom \textbf{(a)}:} Let $a,b\in M$. Then,
(\ref{eq.prop.module.moho-alt.ass}) (applied to $\lambda=1$ and $\mu=1$)
yields $f\left(  1a+1b\right)  =1f\left(  a\right)  +1f\left(  b\right)  $.
This quickly simplifies to $f\left(  a+b\right)  =f\left(  a\right)  +f\left(
b\right)  $. Thus, axiom \textbf{(a)} has been verified.

\textit{Proof of axiom \textbf{(b)}:} Applying
(\ref{eq.prop.module.moho-alt.ass}) to $\lambda=0$, $\mu=0$, $a=0_{M}$ and
$b=0_{M}$, we obtain $f\left(  0\cdot0_{M}+0\cdot0_{M}\right)
=\underbrace{0f\left(  0_{M}\right)  }_{=0_{N}}+\underbrace{0f\left(
0_{M}\right)  }_{=0_{N}}=0_{N}$. In view of $0\cdot0_{M}+0\cdot0_{M}=0_{M}$,
we can rewrite this as $f\left(  0_{M}\right)  =0_{N}$. Thus, axiom
\textbf{(b)} has been verified.

\textit{Proof of axiom \textbf{(c)}:} Let $\lambda\in\mathbb{K}$ and $a\in M$.
Applying (\ref{eq.prop.module.moho-alt.ass}) to $\mu=0$ and $b=0_{M}$, we
obtain $f\left(  \lambda a+0\cdot0_{M}\right)  =\lambda f\left(  a\right)
+\underbrace{0f\left(  0_{M}\right)  }_{=0_{N}}=\lambda f\left(  a\right)  $.
In view of $\lambda a+\underbrace{0\cdot0_{M}}_{=0_{M}}=\lambda a+0_{M}%
=\lambda a$, this rewrites as $f\left(  \lambda a\right)  =\lambda f\left(
a\right)  $. Thus, axiom \textbf{(c)} has been verified.
\end{proof}

Some authors use the axiom (\ref{eq.prop.module.moho-alt.ass}) as their
definition of what it means for a map $f:M\rightarrow N$ between two
$\mathbb{K}$-modules $M$ and $N$ to be $\mathbb{K}$-linear. This definition is
equivalent to ours (due to Proposition \ref{prop.module.moho-alt} and
Proposition \ref{prop.module.f-pres-lc} \textbf{(a)}).

\begin{lemma}
\label{lem.module.f=g.ej-suff}Let $m\in\mathbb{N}$, and let $N$ be a
$\mathbb{K}$-module. For each $j\in\left\{  1,2,\ldots,m\right\}  $, we let
define a column vector $e_{j}\in\mathbb{K}^{m\times1}$ as in Definition
\ref{def.module.ej}.

Let $f,g:\mathbb{K}^{m\times1}\rightarrow N$ be two $\mathbb{K}$-linear maps.
Assume that $f\left(  e_{j}\right)  =g\left(  e_{j}\right)  $ for all
$j\in\left\{  1,2,\ldots,m\right\}  $. Then, $f=g$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.module.f=g.ej-suff}.]Let $v\in\mathbb{K}^{m\times1}$.
Write $v$ as $\left(  v_{1},v_{2},\ldots,v_{m}\right)  ^{T}$, where
$v_{1},v_{2},\ldots,v_{m}\in\mathbb{K}$. Then,%
\begin{align*}
v  &  =\left(  v_{1},v_{2},\ldots,v_{m}\right)  ^{T}\\
&  =\left(
\begin{array}
[c]{c}%
v_{1}\\
v_{2}\\
v_{3}\\
\vdots\\
v_{m}%
\end{array}
\right)  =\underbrace{\left(
\begin{array}
[c]{c}%
v_{1}\\
0\\
0\\
\vdots\\
0
\end{array}
\right)  }_{=v_{1}e_{1}}+\underbrace{\left(
\begin{array}
[c]{c}%
0\\
v_{2}\\
0\\
\vdots\\
0
\end{array}
\right)  }_{=v_{2}e_{2}}+\underbrace{\left(
\begin{array}
[c]{c}%
0\\
0\\
v_{3}\\
\vdots\\
0
\end{array}
\right)  }_{=v_{3}e_{3}}+\cdots+\underbrace{\left(
\begin{array}
[c]{c}%
0\\
0\\
0\\
\vdots\\
v_{m}%
\end{array}
\right)  }_{=v_{m}e_{m}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since matrices are added entrywise}%
\right) \\
&  =v_{1}e_{1}+v_{2}e_{2}+v_{3}e_{3}+\cdots+v_{m}e_{m}=\sum_{i=1}^{m}%
v_{i}e_{i}.
\end{align*}
Hence,%
\begin{align*}
f\left(  v\right)   &  =f\left(  \sum_{i=1}^{m}v_{i}e_{i}\right)  =\sum
_{i=1}^{m}v_{i}f\left(  e_{i}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
Proposition \ref{prop.module.f-pres-lc} \textbf{(b)}}\right) \\
&  =\sum_{j=1}^{m}v_{j}f\left(  e_{j}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{here, we have renamed the summation index }i\text{ as }j\right)
\end{align*}
and similarly $g\left(  v\right)  =\sum_{j=1}^{m}v_{j}g\left(  e_{j}\right)
$. Now, the right hand sides of these two equalities are equal, since we
assumed that $f\left(  e_{j}\right)  =g\left(  e_{j}\right)  $ for all
$j\in\left\{  1,2,\ldots,m\right\}  $. Hence, the left hand sides are equal,
too. In other words, $f\left(  v\right)  =g\left(  v\right)  $. Since we have
proven this for every $v\in\mathbb{K}^{m\times1}$, we thus conclude that
$f=g$. This proves Lemma \ref{lem.module.f=g.ej-suff}.
\end{proof}

We are now ready to prove Proposition \ref{prop.module.f=LA}:

\begin{proof}
[Proof of Proposition \ref{prop.module.f=LA}.]Let $f$ be a $\mathbb{K}$-module
homomorphism from $\mathbb{K}^{m\times1}$ to $\mathbb{K}^{n\times1}$. We must
prove that $f=L_{A}$ for a unique $A\in\mathbb{K}^{n\times m}$.

For each $j\in\left\{  1,2,\ldots,m\right\}  $, we let define a column vector
$e_{j}\in\mathbb{K}^{m\times1}$ as in Definition \ref{def.module.ej}.

Now, let $F$ be the $n\times m$-matrix whose columns are the $m$ column
vectors \newline$f\left(  e_{1}\right)  ,f\left(  e_{2}\right)  ,\ldots
,f\left(  e_{m}\right)  $. We claim that $f=L_{F}$.

Indeed, both $f$ and $L_{F}$ are $\mathbb{K}$-module homomorphisms from
$\mathbb{K}^{m\times1}$ to $\mathbb{K}^{n\times1}$. That is, they are
$\mathbb{K}$-linear maps from $\mathbb{K}^{m\times1}$ to $\mathbb{K}%
^{n\times1}$. Furthermore, for each $j\in\left\{  1,2,\ldots,m\right\}  $, we
have%
\begin{align*}
f\left(  e_{j}\right)   &  =\left(  \text{the }j\text{-th column of }F\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }F\right) \\
&  =L_{F}\left(  e_{j}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since Lemma \ref{lem.module.Aej} \textbf{(b)} (applied to }A=F\text{)}\\
\text{yields }L_{F}\left(  e_{j}\right)  =\left(  \text{the }j\text{-th column
of }F\right)
\end{array}
\right)  .
\end{align*}
Hence, Lemma \ref{lem.module.f=g.ej-suff} (applied to $N=\mathbb{K}^{n\times
1}$ and $g=L_{F}$) shows that $f=L_{F}$. This shows that $f=L_{A}$ for
\textbf{some} $A\in\mathbb{K}^{n\times m}$ (namely, for $A=F$).

How to prove that this $A$ is unique? The idea is that $A$ can be
reconstructed from $L_{A}$, because $\left(  \text{the }j\text{-th column of
}A\right)  =L_{A}\left(  e_{j}\right)  $ for each $j\in\left\{  1,2,\ldots
,m\right\}  $ (by Lemma \ref{lem.module.Aej} \textbf{(b)}).
\end{proof}

\begin{teachingnote}
\textbf{2019-04-17 lecture}
\end{teachingnote}

\begin{definition}
\label{def.module.Hom}Let $M$ and $N$ be two $\mathbb{K}$-modules.

\textbf{(a)} Let $\operatorname*{Hom}\left(  M,N\right)  $ be the set of all
$\mathbb{K}$-module homomorphisms (= linear maps) from $M$ to $N$. We shall
now turn this set into a $\mathbb{K}$-module.

\textbf{(b)} We define an addition $+$ on $\operatorname*{Hom}\left(
M,N\right)  $ as follows: If $f,g\in\operatorname*{Hom}\left(  M,N\right)  $,
then $f+g\in\operatorname*{Hom}\left(  M,N\right)  $ is defined by%
\[
\left(  f+g\right)  \left(  v\right)  =f\left(  v\right)  +g\left(  v\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }v\in M.
\]
(That is, the addition is pointwise. This is well-defined by Proposition
\ref{prop.module.Hom.wd} \textbf{(a)} below.)

\textbf{(c)} We define a scaling $\cdot$ on $\operatorname*{Hom}\left(
M,N\right)  $ as follows: If $\lambda\in\mathbb{K}$ and $f\in
\operatorname*{Hom}\left(  M,N\right)  $, then $\lambda f\in
\operatorname*{Hom}\left(  M,N\right)  $ is defined by%
\[
\left(  \lambda f\right)  \left(  v\right)  =\lambda\cdot f\left(  v\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }v\in M.
\]
(That is, the scaling is pointwise. This is well-defined by Proposition
\ref{prop.module.Hom.wd} \textbf{(b)} below.)

\textbf{(d)} We define a map $0_{M\rightarrow N}:M\rightarrow N$ by setting
\[
0_{M\rightarrow N}\left(  v\right)  =0\ \ \ \ \ \ \ \ \ \ \text{for all }v\in
M.
\]


\textbf{(e)} We equip $\operatorname*{Hom}\left(  M,N\right)  $ with the
addition $+$, the scaling $\cdot$ and the zero vector $0_{M\rightarrow N}$ we
have just defined. This yields a $\mathbb{K}$-module (by Proposition
\ref{prop.module.Hom.wd} \textbf{(d)} below).
\end{definition}

\begin{proposition}
\label{prop.module.Hom.wd}\textbf{(a)} The addition $+$ defined in Definition
\ref{def.module.Hom} \textbf{(b)} is well-defined (i.e., we have
$f+g\in\operatorname*{Hom}\left(  M,N\right)  $ for all $f,g\in
\operatorname*{Hom}\left(  M,N\right)  $).

\textbf{(b)} The scaling $\cdot$ defined in Definition \ref{def.module.Hom}
\textbf{(c)} is well-defined (i.e., we have $\lambda f\in\operatorname*{Hom}%
\left(  M,N\right)  $ for all $\lambda\in\mathbb{K}$ and $f\in
\operatorname*{Hom}\left(  M,N\right)  $).

\textbf{(c)} The map $0_{M\rightarrow N}$ defined in Definition
\ref{def.module.Hom} \textbf{(d)} belongs to $\operatorname*{Hom}\left(
M,N\right)  $.

\textbf{(d)} The set $\operatorname*{Hom}\left(  M,N\right)  $, equipped with
the addition $+$, the scaling $\cdot$ and the zero vector $0_{M\rightarrow N}%
$, is a $\mathbb{K}$-module.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.Hom.wd}.]\textbf{(a)} Let
$f,g\in\operatorname*{Hom}\left(  M,N\right)  $. We must prove that
$f+g\in\operatorname*{Hom}\left(  M,N\right)  $. In other words, we must prove
that $f+g$ is a $\mathbb{K}$-module homomorphism from $M$ to $N$ (by the
definition of $\operatorname*{Hom}\left(  M,N\right)  $). In other words, we
must prove that the map $f+g$ is $\mathbb{K}$-linear (because a $\mathbb{K}%
$-module homomorphism is the same as a $\mathbb{K}$-linear map).

We know two ways of proving that a given map (between two $\mathbb{K}%
$-modules) is $\mathbb{K}$-linear: One way is by checking the three axioms in
Definition \ref{def.module.moho}; the other is through Proposition
\ref{prop.module.moho-alt}. Of course, these two ways boil down to the same
thing, but the second one tends to give a shorter proof. So let us go with the
second one.

Fix $\lambda,\mu\in\mathbb{K}$ and $a,b\in M$. We shall prove that $\left(
f+g\right)  \left(  \lambda a+\mu b\right)  =\lambda\left(  f+g\right)
\left(  a\right)  +\mu\left(  f+g\right)  \left(  b\right)  $.

We have $f\in\operatorname*{Hom}\left(  M,N\right)  $. In other words, $f$ is
a $\mathbb{K}$-module homomorphism from $M$ to $N$ (by the definition of
$\operatorname*{Hom}\left(  M,N\right)  $). In other words, the map
$f:M\rightarrow N$ is $\mathbb{K}$-linear. Thus, Proposition
\ref{prop.module.f-pres-lc} \textbf{(a)} yields $f\left(  \lambda a+\mu
b\right)  =\lambda f\left(  a\right)  +\mu f\left(  b\right)  $. The same
argument (applied to $g$ instead of $f$) yields $g\left(  \lambda a+\mu
b\right)  =\lambda g\left(  a\right)  +\mu g\left(  b\right)  $. Now, the
definition of $f+g$ yields $\left(  f+g\right)  \left(  a\right)  =f\left(
a\right)  +g\left(  a\right)  $ and $\left(  f+g\right)  \left(  b\right)
=f\left(  b\right)  +g\left(  b\right)  $ and $\left(  f+g\right)  \left(
\lambda a+\mu b\right)  =f\left(  \lambda a+\mu b\right)  +g\left(  \lambda
a+\mu b\right)  $. Hence,%
\begin{align*}
\left(  f+g\right)  \left(  \lambda a+\mu b\right)   &  =\underbrace{f\left(
\lambda a+\mu b\right)  }_{=\lambda f\left(  a\right)  +\mu f\left(  b\right)
}+\underbrace{g\left(  \lambda a+\mu b\right)  }_{=\lambda g\left(  a\right)
+\mu g\left(  b\right)  }\\
&  =\lambda f\left(  a\right)  +\underbrace{\mu f\left(  b\right)  +\lambda
g\left(  a\right)  }_{\substack{=\lambda g\left(  a\right)  +\mu f\left(
b\right)  \\\text{(by axiom \textbf{(a)} in}\\\text{Definition
\ref{def.module.module})}}}+\mu g\left(  b\right) \\
&  =\lambda f\left(  a\right)  +\lambda g\left(  a\right)  +\mu f\left(
b\right)  +\mu g\left(  b\right)  .
\end{align*}
Comparing this with%
\begin{align*}
\lambda\underbrace{\left(  f+g\right)  \left(  a\right)  }_{=f\left(
a\right)  +g\left(  a\right)  }+\mu\underbrace{\left(  f+g\right)  \left(
b\right)  }_{=f\left(  b\right)  +g\left(  b\right)  }  &
=\underbrace{\lambda\left(  f\left(  a\right)  +g\left(  a\right)  \right)
}_{\substack{=\lambda f\left(  a\right)  +\lambda g\left(  a\right)
\\\text{(by axiom \textbf{(e)} in}\\\text{Definition \ref{def.module.module}%
)}}}+\underbrace{\mu\left(  f\left(  b\right)  +g\left(  b\right)  \right)
}_{\substack{=\mu f\left(  b\right)  +\mu g\left(  b\right)  \\\text{(by axiom
\textbf{(e)} in}\\\text{Definition \ref{def.module.module})}}}\\
&  =\lambda f\left(  a\right)  +\lambda g\left(  a\right)  +\mu f\left(
b\right)  +\mu g\left(  b\right)  ,
\end{align*}
we obtain $\left(  f+g\right)  \left(  \lambda a+\mu b\right)  =\lambda\left(
f+g\right)  \left(  a\right)  +\mu\left(  f+g\right)  \left(  b\right)  $.

Now, forget that we fixed $\lambda,\mu$ and $a,b$. We thus have shown that%
\[
\left(  f+g\right)  \left(  \lambda a+\mu b\right)  =\lambda\left(
f+g\right)  \left(  a\right)  +\mu\left(  f+g\right)  \left(  b\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }\lambda,\mu\in\mathbb{K}\text{ and }a,b\in
M.
\]
Hence, Proposition \ref{prop.module.moho-alt} (applied to $f+g$ instead of
$f$) shows that $f+g$ is $\mathbb{K}$-linear. As we know, this completes the
proof of Proposition \ref{prop.module.Hom.wd} \textbf{(a)}.

\textbf{(b)} The proof of Proposition \ref{prop.module.Hom.wd} \textbf{(b)} is
analogous to the above proof of Proposition \ref{prop.module.Hom.wd}
\textbf{(a)}. The details are left to the reader. (For notational reasons, I
recommend renaming the variable $\lambda$ as $\nu$ in the statement
\textquotedblleft$\lambda f\in\operatorname*{Hom}\left(  M,N\right)  $ for all
$\lambda\in\mathbb{K}$ and $f\in\operatorname*{Hom}\left(  M,N\right)
$\textquotedblright, since otherwise the letter \textquotedblleft$\lambda
$\textquotedblright\ would stand for two different things.)

\textbf{(c)} The proof of Proposition \ref{prop.module.Hom.wd} \textbf{(c)} is
analogous to the above proof of Proposition \ref{prop.module.Hom.wd}
\textbf{(a)}. Again, the reader can easily fill in the details.

\textbf{(d)} This proof is a series of straightforward verifications: We have
to prove that $\operatorname*{Hom}\left(  M,N\right)  $ satisfies all the ten
module axioms from Definition \ref{def.module.module} (with $M$ replaced by
$\operatorname*{Hom}\left(  M,N\right)  $). I will only show the proof of
axiom \textbf{(e)}:

[\textit{Proof of axiom \textbf{(e)}:} Let $\lambda\in\mathbb{K}$ and
$a,b\in\operatorname*{Hom}\left(  M,N\right)  $. We need to prove that
$\lambda\left(  a+b\right)  =\lambda a+\lambda b$.

Fix $v\in M$. Then, the definition of the map $a+b$ yields $\left(
a+b\right)  \left(  v\right)  =a\left(  v\right)  +b\left(  v\right)  $.
Likewise, the definition of the map $\lambda a+\lambda b$ yields
\[
\left(  \lambda a+\lambda b\right)  \left(  v\right)  =\underbrace{\left(
\lambda a\right)  \left(  v\right)  }_{\substack{=\lambda\cdot a\left(
v\right)  \\\text{(by the definition}\\\text{of the map }\lambda a\text{)}%
}}+\underbrace{\left(  \lambda b\right)  \left(  v\right)  }%
_{\substack{=\lambda\cdot b\left(  v\right)  \\\text{(by the definition}%
\\\text{of the map }\lambda b\text{)}}}=\lambda\cdot a\left(  v\right)
+\lambda\cdot b\left(  v\right)  .
\]
But the definition of the map $\lambda\left(  a+b\right)  $ yields%
\[
\left(  \lambda\left(  a+b\right)  \right)  \left(  v\right)  =\lambda
\cdot\underbrace{\left(  a+b\right)  \left(  v\right)  }_{=a\left(  v\right)
+b\left(  v\right)  }=\lambda\cdot\left(  a\left(  v\right)  +b\left(
v\right)  \right)  =\lambda\cdot a\left(  v\right)  +\lambda\cdot b\left(
v\right)
\]
(because $N$ is a $\mathbb{K}$-module, and thus satisfies the ten module
axioms, in particular axiom \textbf{(e)}). Comparing these two equalities, we
obtain $\left(  \lambda\left(  a+b\right)  \right)  \left(  v\right)  =\left(
\lambda a+\lambda b\right)  \left(  v\right)  $.

Now, forget that we fixed $v$. We thus have proven that $\left(
\lambda\left(  a+b\right)  \right)  \left(  v\right)  =\left(  \lambda
a+\lambda b\right)  \left(  v\right)  $ for each $v\in M$. In other words, we
have $\lambda\left(  a+b\right)  =\lambda a+\lambda b$. Thus, axiom
\textbf{(e)} (with $M$ replaced by $\operatorname*{Hom}\left(  M,N\right)  $)
is proven.]

The remaining nine module axioms can be proven similarly (and the reader will
have no trouble doing so). Thus, Proposition \ref{prop.module.Hom.wd}
\textbf{(d)} follows.
\end{proof}

\begin{proposition}
\label{prop.module.Hom.compose}Let $M$, $N$ and $P$ be three $\mathbb{K}%
$-modules. Let $f:M\rightarrow N$ and $g:N\rightarrow P$ be two $\mathbb{K}%
$-module homomorphisms. Then, the composition $g\circ f:M\rightarrow P$ is
also a $\mathbb{K}$-module homomorphism.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.Hom.compose}.]This is straightforward
(and very similar to the proof of Proposition \ref{prop.riho.compose}). We
leave the details to the reader.
\end{proof}

Note the analogy between Proposition \ref{prop.module.Hom.compose} and
Proposition \ref{prop.riho.compose}.

We shall follow PEMDAS-style conventions when writing expressions involving
addition and composition of $\mathbb{K}$-linear maps (where we treat
composition as a multiplication-like operation). For example, the expression
\textquotedblleft$f\circ h+g\circ h$\textquotedblright\ (where $f,g,h$ are
three $\mathbb{K}$-linear maps) is to be understood as $\left(  f\circ
h\right)  +\left(  g\circ h\right)  $.

The following rules hold for addition, multiplication and scaling of module
homomorphisms (similarly to Theorem \ref{thm.matrix.rules}):

\begin{theorem}
\label{thm.module.Hom.rules}Let $N,M,P,Q$ be $\mathbb{K}$-modules.

\textbf{(a)} We have $f+g=g+f$ for any $f,g\in\operatorname*{Hom}\left(
M,N\right)  $.

\textbf{(b)} We have $f+\left(  g+h\right)  =\left(  f+g\right)  +h$ for any
$f,g,h\in\operatorname*{Hom}\left(  M,N\right)  $.

\textbf{(c)} We have $f+0_{M\rightarrow N}=0_{M\rightarrow N}+f=f$ for any
$f\in\operatorname*{Hom}\left(  M,N\right)  $.

\textbf{(d)} We have $f\circ\operatorname*{id}\nolimits_{M}=\operatorname*{id}%
\nolimits_{N}\circ f=f$ for any $f\in\operatorname*{Hom}\left(  M,N\right)  $.

\textbf{(e)} In general, we \textbf{do not} have $f\circ g=g\circ f$. In fact,
it can happen that one of $f\circ g$ and $g\circ f$ is defined and the other
is not; but even if both are defined, they can be distinct.

\textbf{(f)} We have $f\circ\left(  g\circ h\right)  =\left(  f\circ g\right)
\circ h$ for any $f\in\operatorname*{Hom}\left(  P,Q\right)  $, $g\in
\operatorname*{Hom}\left(  N,P\right)  $ and $h\in\operatorname*{Hom}\left(
M,N\right)  $.

\textbf{(g)} We have $f\circ\left(  g+h\right)  =f\circ g+f\circ h$ for any
$f\in\operatorname*{Hom}\left(  N,P\right)  $ and $g,h\in\operatorname*{Hom}%
\left(  M,N\right)  $.

We have $\left(  f+g\right)  \circ h=f\circ h+g\circ h$ for any $f,g\in
\operatorname*{Hom}\left(  N,P\right)  $ and $h\in\operatorname*{Hom}\left(
M,N\right)  $.

\textbf{(h)} We have $f\circ0_{P\rightarrow M}=0_{P\rightarrow N}$ and
$0_{N\rightarrow P}\circ f=0_{M\rightarrow P}$ for any $f\in
\operatorname*{Hom}\left(  M,N\right)  $.

\textbf{(j)} We have $r\left(  f+g\right)  =rf+rg$ for any $r\in\mathbb{K}$
and $f,g\in\operatorname*{Hom}\left(  M,N\right)  $.

\textbf{(k)} We have $\left(  r+s\right)  f=rf+sf$ for any $r,s\in\mathbb{K}$
and $f\in\operatorname*{Hom}\left(  M,N\right)  $.

\textbf{(l)} We have $r\left(  sf\right)  =\left(  rs\right)  f$ for any
$r,s\in\mathbb{K}$ and $f\in\operatorname*{Hom}\left(  M,N\right)  $.

\textbf{(m)} We have $r\left(  f\circ g\right)  =\left(  rf\right)  \circ
g=f\circ\left(  rg\right)  $ for any $r\in\mathbb{K}$ and $f\in
\operatorname*{Hom}\left(  N,P\right)  $ and $g\in\operatorname*{Hom}\left(
M,N\right)  $.

\textbf{(o)} We have $1f=f$ for any $f\in\operatorname*{Hom}\left(
M,N\right)  $.
\end{theorem}

\noindent(The above list is skipping a few letters since we have not defined
subtraction yet; nevertheless, subtraction exists and satisfies the
appropriate rules. See below for the details.)

\begin{proof}
[Proof of Theorem \ref{thm.module.Hom.rules}.]Most of these claims are trivial
and hold not just for $\mathbb{K}$-linear maps, but for arbitrary maps. Only
the first part of \textbf{(g)}, the first part of \textbf{(h)}, and the second
equality sign in \textbf{(m)} do not hold for arbitrary maps. So let us prove
the first part of \textbf{(g)} (and leave the rest to the reader):

Let $f\in\operatorname*{Hom}\left(  N,P\right)  $ and $g,h\in
\operatorname*{Hom}\left(  M,N\right)  $. We must prove that%
\[
f\circ\left(  g+h\right)  =f\circ g+f\circ h.
\]


So let $v\in M$. The map $f:N\rightarrow P$ is $\mathbb{K}$-linear (because
$f\in\operatorname*{Hom}\left(  N,P\right)  $). The definition of $g+h$ yields
$\left(  g+h\right)  \left(  v\right)  =g\left(  v\right)  +h\left(  v\right)
$. Now, comparing%
\begin{align*}
\left(  f\circ\left(  g+h\right)  \right)  \left(  v\right)   &  =f\left(
\underbrace{\left(  g+h\right)  \left(  v\right)  }_{=g\left(  v\right)
+h\left(  v\right)  }\right)  =f\left(  g\left(  v\right)  +h\left(  v\right)
\right) \\
&  =f\left(  g\left(  v\right)  \right)  +f\left(  h\left(  v\right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }f\text{ is }\mathbb{K}\text{-linear}%
\right)
\end{align*}
with%
\[
\left(  f\circ g+f\circ h\right)  \left(  v\right)  =\underbrace{\left(
f\circ g\right)  \left(  v\right)  }_{=f\left(  g\left(  v\right)  \right)
}+\underbrace{\left(  f\circ h\right)  \left(  v\right)  }_{=f\left(  h\left(
v\right)  \right)  }=f\left(  g\left(  v\right)  \right)  +f\left(  h\left(
v\right)  \right)  ,
\]
we obtain $\left(  f\circ\left(  g+h\right)  \right)  \left(  v\right)
=\left(  f\circ g+f\circ h\right)  \left(  v\right)  $. Since we have proven
this for \textbf{all} $v\in M$, we thus conclude that $f\circ\left(
g+h\right)  =f\circ g+f\circ h$. This finishes the proof of the first half of
\textbf{(g)}.

The rest is equally straightforward.
\end{proof}

So far, we have not defined a subtraction operation $-$ on
$\operatorname*{Hom}\left(  M,N\right)  $ (where $M$ and $N$ are two
$\mathbb{K}$-modules). But this does not mean that such an operation does not
exist; we simply don't want to waste our time defining it \textquotedblleft
manually\textquotedblright\ when we can trivially obtain it from general
principles. Namely: We know that $\operatorname*{Hom}\left(  M,N\right)  $ is
a $\mathbb{K}$-module, but Definition \ref{def.module.inv-add-a} shows that
every $\mathbb{K}$-module automatically has a subtraction operation. Thus, we
get a subtraction operation on $\operatorname*{Hom}\left(  M,N\right)  $ for
free. This subtraction is precisely the pointwise subtraction: i.e., it is
given by%
\begin{align}
\left(  f-g\right)  \left(  v\right)   &  =f\left(  v\right)  -g\left(
v\right) \label{eq.module.Hom.-.ptwise}\\
&  \ \ \ \ \ \ \ \ \ \ \text{for all }f,g\in\operatorname*{Hom}\left(
M,N\right)  \text{ and }v\in M\nonumber
\end{align}
\footnote{\textit{Proof of (\ref{eq.module.Hom.-.ptwise}):} Let $f,g\in
\operatorname*{Hom}\left(  M,N\right)  $ and $v\in M$. Then, $f-g$ has the
property that $f=\left(  f-g\right)  +g$ (by Proposition
\ref{prop.module.inv-add.rules} \textbf{(a)}). Applying both sides of this
equality to $v$, we obtain%
\[
f\left(  v\right)  =\left(  \left(  f-g\right)  +g\right)  \left(  v\right)
=\left(  f-g\right)  \left(  v\right)  +g\left(  v\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }\left(  f-g\right)
+g\right)  ;
\]
but this yields $\left(  f-g\right)  \left(  v\right)  =f\left(  v\right)
-g\left(  v\right)  $. This proves (\ref{eq.module.Hom.-.ptwise}).}.

Proposition \ref{prop.module.inv-add.rules} shows that the subtraction
operation on $\operatorname*{Hom}\left(  M,N\right)  $ (for arbitrary
$\mathbb{K}$-modules $M$ and $N$) has almost all the properties that one would
expect. The only rule that we do not automatically obtain from these general
principles is%
\[
-\left(  f\circ g\right)  =\left(  -f\right)  \circ g=f\circ\left(  -g\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }f\in\operatorname*{Hom}\left(  N,P\right)
\text{ and }g\in\operatorname*{Hom}\left(  M,N\right)
\]
(where $M$, $N$ and $P$ are three $\mathbb{K}$-modules). But this rule is
easily verified by direct comparison (using (\ref{eq.module.Hom.-.ptwise})).

\begin{corollary}
\label{cor.module.End-ring}Let $M$ be a $\mathbb{K}$-module. The set
$\operatorname*{Hom}\left(  M,M\right)  $ of all $\mathbb{K}$-linear maps from
$M$ to $M$ (endowed with the addition $+$, the multiplication $\circ$, the
zero $0_{M\rightarrow M}$ and the unity $\operatorname*{id}\nolimits_{M}$) is
a ring. This ring is called the \textit{endomorphism ring} of $M$, and is
denoted by $\operatorname*{End}M$; its elements (i.e., the $\mathbb{K}$-linear
maps $M\rightarrow M$) are called the \textit{endomorphisms} of $M$.
\end{corollary}

So the multiplication of the ring $\operatorname*{End}M$ is composition of
maps. This ring $\operatorname*{End}M$ is, in general, not commutative.

Note that $\operatorname*{End}M=\operatorname*{Hom}\left(  M,M\right)  $ as
sets, and the additions of $\operatorname*{End}M$ and of $\operatorname*{Hom}%
\left(  M,M\right)  $ are the same. But $\operatorname*{End}M$ is a ring (thus
has no scaling), whereas $\operatorname*{Hom}\left(  M,M\right)  $ is a
$\mathbb{K}$-module (thus has no multiplication).

\subsection{$\mathbb{K}$-algebras}

There is a notion which combines both the structure of a ring and the
structure of a $\mathbb{K}$-module (so it has both multiplication and
scaling); this is the notion of a $\mathbb{K}$\textit{-algebra}. It is defined
as follows:

\begin{definition}
\label{def.K-alg.K-alg.short-def}A $\mathbb{K}$\textit{-algebra} is a set $M$
endowed with two binary operations $+$ and $\cdot$ (called \textquotedblleft%
\textit{addition}\textquotedblright\ and \textquotedblleft%
\textit{multiplication}\textquotedblright) as well as a scaling map
$\cdot:\mathbb{K}\times M\rightarrow M$ (not to be confused with the
multiplication map, which is also denoted by $\cdot$) and two elements $0,1\in
M$ that satisfy all the ring axioms (with $\mathbb{K}$ replaced by $M$) as
well as all the module axioms (where the zero vector $0_{M}$ is taken to be
the element $0\in M$) and also the following axiom:

\begin{itemize}
\item \textbf{Scale-invariance of multiplication:} We have $\lambda\left(
ab\right)  =\left(  \lambda a\right)  \cdot b=a\cdot\left(  \lambda b\right)
$ for all $\lambda\in\mathbb{K}$ and $a,b\in M$. Here, as usual, we omit the
\textquotedblleft$\cdot$\textquotedblright\ sign both for the multiplication
operation $\cdot$ (that is, we write \textquotedblleft$uv$\textquotedblright%
\ for \textquotedblleft$u\cdot v$\textquotedblright\ when $u,v\in M$) and for
the scaling map $\cdot$ (that is, we write \textquotedblleft$\lambda
u$\textquotedblright\ for \textquotedblleft$\lambda\cdot u$\textquotedblright%
\ when $\lambda\in\mathbb{K}$ and $u\in M$).
\end{itemize}
\end{definition}

It seems somewhat confusing that both the multiplication map $M\times
M\rightarrow M$ and the scaling map $\mathbb{K}\times M\rightarrow M$ are
denoted by the same symbol $\cdot$; but in practice, this does not cause any
trouble, since it is (almost) always clear from the context which one is being
applied (just check if the first argument belongs to $M$ or to $\mathbb{K}$).

So, roughly speaking, a $\mathbb{K}$\textit{-algebra} is a $\mathbb{K}$-module
that is also a ring, with the same addition and the same zero, and satisfying
the \textquotedblleft Scale-invariance of multiplication\textquotedblright%
\ axiom. In other words, you get the definition of a $\mathbb{K}$-algebra by
throwing the definitions of a ring and of a $\mathbb{K}$-module together,
requiring the two additions $+$ to be the same map, requiring the zero of the
ring to coincide with the zero vector of the $\mathbb{K}$-module, and
requiring the multiplication to be \textquotedblleft nice to the
scaling\textquotedblright\ (in the sense that the \textquotedblleft
Scale-invariance of multiplication\textquotedblright\ axiom holds).

Examples of $\mathbb{K}$-algebras include the following:

\begin{itemize}
\item The commutative ring $\mathbb{K}$ itself is a $\mathbb{K}$-algebra (with
both multiplication and scaling being the usual multiplication $\cdot$ of
$\mathbb{K}$).

\item If $M$ is any $\mathbb{K}$-module, then the endomorphism ring
$\operatorname*{End}M$ becomes a $\mathbb{K}$-algebra. (Its multiplication is
composition of maps, whereas its scaling is the scaling on
$\operatorname*{Hom}\left(  M,M\right)  $.)

\item The matrix ring $\mathbb{K}^{n\times n}$ is a $\mathbb{K}$-algebra for
any $n\in\mathbb{N}$.

\item The ring $\mathbb{C}$ is an $\mathbb{R}$-algebra.

\item The ring $\mathbb{R}$ is a $\mathbb{Q}$-algebra.

\item More generally: If a commutative ring $\mathbb{K}$ is a subring of a
commutative ring $\mathbb{L}$, then $\mathbb{L}$ becomes a $\mathbb{K}%
$-algebra in a natural way\footnote{Namely:
\par
\begin{itemize}
\item We define the scaling of the $\mathbb{K}$-module $\mathbb{L}$ to be the
restriction of the multiplication of the ring $\mathbb{L}$ to $\mathbb{K}%
\times\mathbb{L}$. (Thus, $\lambda\cdot a=\lambda\cdot a$ for all $\lambda
\in\mathbb{K}$ and $a\in\mathbb{L}$, where the \textquotedblleft$\cdot
$\textquotedblright\ sign on the left hand side stands for scaling and where
the \textquotedblleft$\cdot$\textquotedblright\ sign on the right hand side
stands for multiplication.)
\par
\item We define the zero vector of $\mathbb{L}$ to be the zero of the ring
$\mathbb{L}$.
\end{itemize}
}.

\item The polynomial ring $\mathbb{K}\left[  x\right]  $ (introduced in
Definition \ref{def.pol.polyring}) is a $\mathbb{K}$-algebra.
\end{itemize}

Particularly common are the $\mathbb{Z}$-algebras: In fact, every ring
$\mathbb{K}$ is a $\mathbb{Z}$-algebra in a natural way! To see this, we just
need to equip every ring $\mathbb{K}$ with a scaling map $\cdot:\mathbb{Z}%
\times\mathbb{K}\rightarrow\mathbb{K}$ that satisfies the module axioms and
the \textquotedblleft Scale-invariance of multiplication\textquotedblright%
\ axiom. This is done as follows:

\begin{example}
\label{exa.K-alg.rings-are-Zalgs}Let $\mathbb{K}$ be any ring. Consider the
map $\cdot:\mathbb{Z}\times\mathbb{K}\rightarrow\mathbb{K}$ sending each pair
$\left(  n,a\right)  \in\mathbb{Z}\times\mathbb{K}$ to the element
$na\in\mathbb{K}$ defined in Definition \ref{def.rings.na}. (This map $\cdot$
is not the multiplication operation of $\mathbb{K}$ (unless $\mathbb{K}%
=\mathbb{Z}$), but we still use the same notation for it, since both of these
maps are \textquotedblleft multiplications\textquotedblright\ in a wide
sense.) Then, the set $\mathbb{K}$, equipped with the binary operations $+$
and $\cdot$ (the multiplication operation of $\mathbb{K}$), the scaling map
$\cdot$ we just defined, and the elements $0_{\mathbb{K}}$ and $1_{\mathbb{K}%
}$ is a $\mathbb{Z}$-algebra.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.K-alg.rings-are-Zalgs}.]We must prove that
$\mathbb{K}$ satisfies the ring axioms, the module axioms and the
\textquotedblleft Scale-invariance of multiplication\textquotedblright\ axiom
(but we need to be careful, since the roles of the $\mathbb{K}$ and the $M$ in
Definition \ref{def.K-alg.K-alg.short-def} are now being played by
$\mathbb{Z}$ and $\mathbb{K}$). Let us do this:

\begin{itemize}
\item The ring axioms are clearly satisfied, since $\mathbb{K}$ is a ring.

\item The module axioms are satisfied. In fact, the axioms \textbf{(a)},
\textbf{(b)}, \textbf{(c)} and \textbf{(d)} in Definition
\ref{def.module.module} are satisfied because $\mathbb{K}$ is a ring; the
axiom \textbf{(e)} follows from (\ref{eq.prop.rings.Zscal.rules.n(a+b)}); the
axiom \textbf{(f)} follows from (\ref{eq.prop.rings.Zscal.rules.(n+m)a}); the
axiom \textbf{(g)} follows from (\ref{eq.prop.rings.Zscal.rules.0a}); the
axiom \textbf{(h)} follows from (\ref{eq.prop.rings.Zscal.rules.nma}); the
axiom \textbf{(i)} follows from (\ref{eq.prop.rings.Zscal.rules.1a}); the
axiom \textbf{(j)} follows from (\ref{eq.prop.rings.Zscal.rules.n0}).

\item The \textquotedblleft Scale-invariance of
multiplication\textquotedblright\ axiom is satisfied, because of
(\ref{eq.prop.rings.Zscal.rules.nab}).
\end{itemize}

\noindent Thus, $\mathbb{K}$ is a $\mathbb{Z}$-algebra. This proves Example
\ref{exa.K-alg.rings-are-Zalgs}.
\end{proof}

\begin{convention}
\label{conv.K-alg.forget-coerce}If $M$ is a $\mathbb{K}$-algebra, then $M$
automatically becomes a ring (by forgetting the scaling map) and a
$\mathbb{K}$-module (by forgetting the multiplication operation and the unity,
and declaring the element $0$ to be the zero vector). We shall automatically
treat any $\mathbb{K}$-algebra both as a ring and as a $\mathbb{K}$-module
when needed: For example, if $M$ and $N$ are two $\mathbb{K}$-algebras, and we
speak of a \textquotedblleft ring homomorphism from $M$ to $N$%
\textquotedblright, then we mean a ring homomorphism from the ring $M$ to the
ring $N$, where $M$ and $N$ become rings in the way we just explained.
\end{convention}

There is also a notion of a $\mathbb{K}$\textit{-subalgebra} of a $\mathbb{K}%
$-algebra, which can be easily defined as follows:

\begin{definition}
\label{def.K-alg.K-subalg}Let $A$ and $B$ be two $\mathbb{K}$-algebras. We say
that $A$ is a $\mathbb{K}$\textit{-subalgebra} (or, for short,
\textit{subalgebra}) of $B$ if and only if it satisfies the following six requirements:

\begin{itemize}
\item the set $A$ is a subset of $B$;

\item the addition of $A$ is a restriction of the addition of $B$ (that is, we
have $a_{1}+_{A}a_{2}=a_{1}+_{B}a_{2}$ for all $a_{1},a_{2}\in A$);

\item the multiplication of $A$ is a restriction of the multiplication of $B$
(that is, we have $a_{1}\cdot_{A}a_{2}=a_{1}\cdot_{B}a_{2}$ for all
$a_{1},a_{2}\in A$);

\item the zero of $A$ is the zero of $B$ (that is, we have $0_{A}=0_{B}$);

\item the unity of $A$ is the unity of $B$ (that is, we have $1_{A}=1_{B}$);

\item the scaling of $A$ is a restriction of the scaling of $B$ (that is, we
have $\lambda\cdot_{A}a=\lambda\cdot_{B}a$ for all $\lambda\in\mathbb{K}$ and
$a\in A$).
\end{itemize}

Equivalently, $A$ is a $\mathbb{K}$-subalgebra of $B$ if and only if $A$ is
simultaneously a subring of $B$ and a $\mathbb{K}$-submodule of $B$. (Here, we
are treating $\mathbb{K}$-algebras as rings and as $\mathbb{K}$-modules, as
explained in Convention \ref{conv.K-alg.forget-coerce}.)
\end{definition}

Similarly, there is a notion of a $\mathbb{K}$-algebra homomorphism:

\begin{definition}
\label{def.K-alg.hom}Let $A$ and $B$ be two $\mathbb{K}$-algebras. A
$\mathbb{K}$\textit{-algebra homomorphism} from $A$ to $B$ means a map
$f:A\rightarrow B$ that is simultaneously a ring homomorphism from $A$ to $B$
and a $\mathbb{K}$-module homomorphism from $A$ to $B$. (That is, it means a
map $f:A\rightarrow B$ that respects addition, respects multiplication,
respects scaling, sends $0_{A}$ to $0_{B}$, and sends $1_{A}$ to $1_{B}$.)
\end{definition}

\begin{definition}
We say that a $\mathbb{K}$-algebra is \textit{commutative} if the underlying
ring is commutative (i.e., if we have $ab=ba$ for each two elements $a$ and
$b$ of this $\mathbb{K}$-algebra).
\end{definition}

The following property of $\mathbb{K}$-algebras is easy to check but quite useful:

\begin{proposition}
\label{prop.K-alg.prods-scal}Let $A$ be a $\mathbb{K}$-algebra. Let
$k\in\mathbb{N}$.

\textbf{(a)} Any $\lambda_{1},\lambda_{2},\ldots,\lambda_{k}\in\mathbb{K}$ and
$a_{1},a_{2},\ldots,a_{k}\in A$ satisfy%
\[
\left(  \lambda_{1}a_{1}\right)  \left(  \lambda_{2}a_{2}\right)
\cdots\left(  \lambda_{k}a_{k}\right)  =\left(  \lambda_{1}\lambda_{2}%
\cdots\lambda_{k}\right)  \left(  a_{1}a_{2}\cdots a_{k}\right)  .
\]


\textbf{(b)} Any $\lambda\in\mathbb{K}$ and $a\in A$ satisfy $\left(  \lambda
a\right)  ^{k}=\lambda^{k}a^{k}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.K-alg.prods-scal}.]\textbf{(a)} This can
easily be proven by induction on $k$. (The induction base boils down to the
obvious fact that $1_{A}=1_{\mathbb{K}}\cdot1_{A}$. The induction step uses
the identity
\[
\left(  \lambda a\right)  \left(  \mu b\right)  =\left(  \lambda\mu\right)
\left(  ab\right)  \ \ \ \ \ \ \ \ \ \ \text{for all }\lambda,\mu\in
\mathbb{K}\text{ and }a,b\in A;
\]
this identity can be easily proven using \textquotedblleft Scale-invariance of
multiplication\textquotedblright\ and axiom \textbf{(h)} from Definition
\ref{def.module.module}.)

\textbf{(b)} This is a particular case of Proposition
\ref{prop.K-alg.prods-scal} \textbf{(a)}.
\end{proof}

\subsection{\label{sect.la.modiso}Module isomorphisms}

In analogy to Definition \ref{def.riiso.riiso}, we define:

\begin{definition}
\label{def.modiso.modiso}Let $M$ and $N$ be two $\mathbb{K}$-modules. Let
$f:M\rightarrow N$ be a map. Then, $f$ is called a $\mathbb{K}$\textit{-module
isomorphism} if and only if $f$ is invertible (i.e., bijective) and both $f$
and $f^{-1}$ are $\mathbb{K}$-module homomorphisms.
\end{definition}

\begin{example}
\label{exa.modiso.id}Let $M$ be a $\mathbb{K}$-module. The identity map
$\operatorname*{id}:M\rightarrow M$ is a $\mathbb{K}$-module isomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.modiso.id}.]We already know that the map
$\operatorname*{id}:M\rightarrow M$ is a $\mathbb{K}$-module homomorphism.
Furthermore, it is invertible, and its inverse $\operatorname*{id}%
\nolimits^{-1}$ is $\operatorname*{id}$ itself. Hence, this inverse
$\operatorname*{id}\nolimits^{-1}$ is also a $\mathbb{K}$-module homomorphism
(since $\operatorname*{id}$ is a $\mathbb{K}$-module homomorphism). Thus, the
map $\operatorname*{id}$ is invertible and both $\operatorname*{id}$ and
$\operatorname*{id}\nolimits^{-1}$ are $\mathbb{K}$-module homomorphisms. In
other words, $\operatorname*{id}$ is a $\mathbb{K}$-module isomorphism (by
Definition \ref{def.modiso.modiso}). This proves Example \ref{exa.modiso.id}.
\end{proof}

More generally:

\begin{example}
\label{exa.modho.incl}Let $M$ be a $\mathbb{K}$-submodule of a $\mathbb{K}%
$-module $N$. Let $\iota:M\rightarrow N$ be the map that sends each $a\in M$
to $a$ itself. (This map is called the \textit{inclusion map} from $M$ to $N$.)

\textbf{(a)} Then, the map $\iota$ is a $\mathbb{K}$-module homomorphism.

\textbf{(b)} It is an isomorphism if and only if $M=N$.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.modho.incl}.]LTTR.
\end{proof}

Proposition \ref{prop.riiso.invertible} has an analogue for $\mathbb{K}%
$-module isomorphisms:

\begin{proposition}
\label{prop.modiso.invertible}Let $M$ and $N$ be two $\mathbb{K}$-modules. Let
$f:M\rightarrow N$ be an invertible $\mathbb{K}$-module homomorphism. Then,
$f$ is a $\mathbb{K}$-module isomorphism.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.modiso.invertible}.]Similar to the proof of
Proposition \ref{prop.riiso.invertible}.
\end{proof}

The Chinese Remainder Theorem already brought us an example of a ring
isomorphism (Example \ref{exa.riiso.CRT}); we can also turn it into an example
of a module isomorphism:

\begin{example}
\label{exa.modiso.CRT}Let $m$ and $n$ be two coprime positive integers. Then,
$\left(  \mathbb{Z}/m\right)  \times\left(  \mathbb{Z}/n\right)  $ is a
$\mathbb{Z}$-module (according to Definition \ref{def.module.dirprod2}).
Theorem \ref{thm.eqrel.CRT2} says that the map%
\begin{align*}
S_{m,n}:\mathbb{Z}/\left(  mn\right)   &  \rightarrow\left(  \mathbb{Z}%
/m\right)  \times\left(  \mathbb{Z}/n\right)  ,\\
\alpha &  \mapsto\left(  \pi_{mn,m}\left(  \alpha\right)  ,\pi_{mn,n}\left(
\alpha\right)  \right)
\end{align*}
is well-defined and is a bijection. This map $S_{m,n}$ is furthermore a
$\mathbb{Z}$-module isomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.modiso.CRT}.]Similar to the proof of Example
\ref{exa.riiso.CRT}.
\end{proof}

\begin{definition}
\label{def.modiso.isomorphic}Let $M$ and $N$ be two $\mathbb{K}$-modules. We
say that the $\mathbb{K}$-modules $M$ and $N$ are \textit{isomorphic} if there
exists a $\mathbb{K}$-module isomorphism $f:M\rightarrow N$.

We write \textquotedblleft$M\cong N$ (as $\mathbb{K}$%
-modules)\textquotedblright\ to say that the $\mathbb{K}$-modules $M$ and $N$
are isomorphic.
\end{definition}

Keep in mind that one and the same symbol can stand both for a ring and for a
$\mathbb{K}$-module. Thus, when saying something like \textquotedblleft$M\cong
N$\textquotedblright, you should clarify whether you mean \textquotedblleft%
$M\cong N$ (as rings)\textquotedblright\ or \textquotedblleft$M\cong N$ (as
$\mathbb{K}$-modules)\textquotedblright. For example, $\mathbb{C}$ and
$\mathbb{R}\times\mathbb{R}$ are both rings and $\mathbb{R}$%
-modules\footnote{Indeed:
\par
\begin{itemize}
\item The set $\mathbb{C}$ becomes an $\mathbb{R}$-module by defining scaling
as multiplication (and addition as addition, and the zero vector as $0$),
whereas
\par
\item the set $\mathbb{R}\times\mathbb{R}$ becomes an $\mathbb{R}$-module
according to Definition \ref{def.module.dirprod2} (so its scaling is defined
entrywise: that is, $\lambda\left(  u,v\right)  =\left(  \lambda u,\lambda
v\right)  $ for all $\lambda\in\mathbb{R}$ and $\left(  u,v\right)
\in\mathbb{R}\times\mathbb{R}$).
\end{itemize}
}. We do have $\mathbb{C}\cong\mathbb{R}\times\mathbb{R}$ as $\mathbb{R}%
$-modules, but we don't have $\mathbb{C}\cong\mathbb{R}\times\mathbb{R}$ as
rings (since $\mathbb{C}$ is a field, but $\mathbb{R}\times\mathbb{R}$ is not
a field). So an unqualified statement like \textquotedblleft$\mathbb{C}%
\cong\mathbb{R}\times\mathbb{R}$\textquotedblright\ would be dangerous.

\begin{example}
\label{exa.modiso.mat.transp}Let $n,m\in\mathbb{N}$. Then, the map%
\begin{align*}
\mathbb{K}^{n\times m}  &  \rightarrow\mathbb{K}^{m\times n},\\
A  &  \mapsto A^{T}%
\end{align*}
is a $\mathbb{K}$-module isomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.modiso.mat.transp}.]By Proposition
\ref{prop.modiso.invertible}, it suffices to prove that this map is
$\mathbb{K}$-linear and invertible. The $\mathbb{K}$-linearity follows from
the formulas%
\begin{align*}
\left(  A+B\right)  ^{T}  &  =A^{T}+B^{T};\\
\left(  0_{n\times m}\right)  ^{T}  &  =0_{m\times n};\\
\left(  \lambda A\right)  ^{T}  &  =\lambda A^{T},
\end{align*}
which hold for arbitrary $A,B\in\mathbb{K}^{n\times m}$ and $\lambda
\in\mathbb{K}$ (see \cite[Exercise 6.5]{detnotes}). The invertibility follows
by constructing its inverse, which is the map%
\begin{align*}
\mathbb{K}^{m\times n}  &  \rightarrow\mathbb{K}^{n\times m},\\
A  &  \mapsto A^{T}.
\end{align*}

\end{proof}

\begin{example}
\label{exa.modiso.vec.col=tup}Let $n\in\mathbb{N}$. Then, the map%
\begin{align*}
\mathbb{K}^{n\times1}  &  \rightarrow\mathbb{K}^{n},\\
\left(
\begin{array}
[c]{c}%
a_{1}\\
a_{2}\\
\vdots\\
a_{n}%
\end{array}
\right)   &  \mapsto\left(  a_{1},a_{2},\ldots,a_{n}\right)
\end{align*}
is a $\mathbb{K}$-module isomorphism.
\end{example}

\begin{proof}
Easy.
\end{proof}

The previous two examples show that%
\[
\mathbb{K}^{1\times n}\cong\mathbb{K}^{n\times1}\cong\mathbb{K}^{n}%
\ \ \ \ \ \ \ \ \ \ \text{as }\mathbb{K}\text{-modules.}%
\]


\begin{example}
\label{exa.modiso.mat.vec}Let $n,m\in\mathbb{N}$. Then, we define a map%
\begin{align*}
\operatorname*{vec}:\mathbb{K}^{n\times m}  &  \rightarrow\mathbb{K}^{nm},\\
\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq m}  &  \mapsto\left(
a_{1,1},a_{1,2},\ldots,a_{1,m},a_{2,1},a_{2,2},\ldots,a_{2,m},\ldots
,a_{n,1},a_{n,2},\ldots,a_{n,m}\right)  .
\end{align*}
For example, if $n=2$ and $m=3$, then%
\[
\operatorname*{vec}\left(
\begin{array}
[c]{ccc}%
a & b & c\\
d & e & f
\end{array}
\right)  =\left(  a,b,c,d,e,f\right)  .
\]
This map $\operatorname*{vec}$ is called \textit{row reading} or \textit{row
vectorization}.

This map $\operatorname*{vec}$ is a $\mathbb{K}$-module isomorphism.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.modiso.mat.vec}.]The map $\operatorname*{vec}$ is
$\mathbb{K}$-linear (since addition and scaling are defined entrywise on both
$\mathbb{K}^{n\times m}$ and $\mathbb{K}^{nm}$) and invertible. Thus,
Proposition \ref{prop.modiso.invertible} shows that it is a $\mathbb{K}%
$-module isomorphism.
\end{proof}

\begin{example}
\label{exa.modiso.scal-lam}Let $M$ be any $\mathbb{K}$-module. Let $\lambda
\in\mathbb{K}$. Define the map
\begin{align*}
L_{\lambda}:M  &  \rightarrow M,\\
a  &  \mapsto\lambda a.
\end{align*}
(This is called \textquotedblleft scaling by $\lambda$\textquotedblright.) As
we know from Example \ref{exa.module.moho.id} \textbf{(b)}, this map
$L_{\lambda}$ is $\mathbb{K}$-linear, i.e., a $\mathbb{K}$-module
homomorphism. When is it an isomorphism?

\textbf{(a)} If $\lambda\in\mathbb{K}$ is invertible, then $L_{\lambda}$ is a
$\mathbb{K}$-module isomorphism.

\textbf{(b)} If $M=\mathbb{K}$ and $L_{\lambda}$ is a $\mathbb{K}$-module
isomorphism, then $\lambda$ is invertible.

\textbf{(c)} If $\mathbb{K}=\mathbb{Z}$ and $M=\mathbb{Z}/n$ for some integer
$n$, then $L_{\lambda}$ is a $\mathbb{K}$-module isomorphism whenever
$\lambda\perp n$.
\end{example}

\begin{proof}
[Proof of Example \ref{exa.modiso.scal-lam}.]\textbf{(a)} If $\lambda
\in\mathbb{K}$ is invertible, then the map $L_{\lambda^{-1}}$ is inverse to
$L_{\lambda}$. (Actually, we have rules like $L_{\lambda\mu}=L_{\lambda}\circ
L_{\mu}$ and $L_{\lambda+\mu}=L_{\lambda}+L_{\mu}$; see Remark
\ref{rmk.modhom.KtoEnd} below.)

\textbf{(b)} LTTR.

\textbf{(c)} Let $\mathbb{K}=\mathbb{Z}$ and $M=\mathbb{Z}/n$ for some integer
$n$. Assume that $\lambda\perp n$. Then, $\lambda$ has a modular inverse $\mu$
modulo $n$. It is now easy to check that the map $L_{\mu}$ is inverse to
$L_{\lambda}$; thus, $L_{\lambda}$ is invertible and therefore a $\mathbb{K}%
$-module isomorphism (since we already know that $L_{\lambda}$ is a
$\mathbb{K}$-module homomorphism).
\end{proof}

\begin{remark}
\label{rmk.modhom.KtoEnd}Fix any $\mathbb{K}$-module $M$. Then, the map%
\begin{align*}
\mathbb{K}  &  \rightarrow\operatorname*{End}M,\\
\lambda &  \mapsto L_{\lambda}%
\end{align*}
is a ring homomorphism.
\end{remark}

\begin{proof}
Straightforward.
\end{proof}

We talked for a while about the meaning and use of ring isomorphisms. The same
can be said about $\mathbb{K}$-module isomorphisms. So, in particular, two
isomorphic $\mathbb{K}$-modules can be viewed as being \textquotedblleft the
same $\mathbb{K}$-module up to renaming its elements\textquotedblright, and
any property of one can be transferred to the other. For example, two
isomorphic $\mathbb{K}$-modules must have the same size; their endomorphism
rings must be isomorphic; etc.

\begin{proposition}
\label{prop.modiso.mat-Hom}Let $n,m\in\mathbb{N}$. The map%
\begin{align*}
\mathbb{K}^{n\times m}  &  \rightarrow\operatorname*{Hom}\left(
\mathbb{K}^{m\times1},\mathbb{K}^{n\times1}\right)  ,\\
A  &  \mapsto L_{A}%
\end{align*}
(where $L_{A}$ is defined as in Theorem \ref{thm.module.LA}) is a $\mathbb{K}%
$-module isomorphism.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.modiso.mat-Hom}.]This map is $\mathbb{K}%
$-linear (due to easily proven statements like $L_{A+B}=L_{A}+L_{B}$ and
$L_{\lambda A}=\lambda L_{A}$) and invertible (since Proposition
\ref{prop.module.f=LA} shows that it is bijective).
\end{proof}

So $\mathbb{K}^{n\times m}\cong\operatorname*{Hom}\left(  \mathbb{K}%
^{m\times1},\mathbb{K}^{n\times1}\right)  $ as $\mathbb{K}$-modules whenever
$n,m\in\mathbb{N}$. This means that $\mathbb{K}$\textbf{-linear maps between
}$\mathbb{K}^{m\times1}$\textbf{ and }$\mathbb{K}^{n\times1}$ \textbf{are
\textquotedblleft the same as\textquotedblright\ }$n\times m$%
\textbf{-matrices}. This says that the \textquotedblleft
matrix\textquotedblright\ way of doing linear algebra can be embedded into the
\textquotedblleft$\mathbb{K}$-module\textquotedblright\ way of doing linear algebra.

Multiplication of matrices is directly connected to composition of linear maps:

\begin{proposition}
\label{prop.module.LAB}Let $n,m,p\in\mathbb{N}$. Let $A\in\mathbb{K}^{n\times
m}$ and $B\in\mathbb{K}^{m\times p}$. Then, $L_{AB}=L_{A}\circ L_{B}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.module.LAB}.]For any $C\in\mathbb{K}%
^{p\times1}$, we have $L_{AB}\left(  C\right)  =\left(  L_{A}\circ
L_{B}\right)  \left(  C\right)  $ (this follows by comparing the equalities
$L_{AB}\left(  C\right)  =\left(  AB\right)  C=ABC$ and $\left(  L_{A}\circ
L_{B}\right)  \left(  C\right)  =L_{A}\left(  L_{B}\left(  C\right)  \right)
=A\left(  BC\right)  =ABC$).
\end{proof}

\begin{corollary}
\label{cor.modiso.mat-End}Let $n\in\mathbb{N}$. The map%
\begin{align*}
\mathbb{K}^{n\times n}  &  \rightarrow\operatorname*{End}\left(
\mathbb{K}^{n\times1}\right)  ,\\
A  &  \mapsto L_{A}%
\end{align*}
(where $L_{A}$ is defined as in Theorem \ref{thm.module.LA} for $m=n$) is a
ring isomorphism.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.modiso.mat-End}.]This map respects addition
(since $L_{A+B}=L_{A}+L_{B}$ for all $A,B\in\mathbb{K}^{n\times n}$) and
respects multiplication (by Proposition \ref{prop.module.LAB}); furthermore,
it sends the zero matrix $0_{n\times n}$ to the zero map $0\in
\operatorname*{End}\left(  \mathbb{K}^{n\times1}\right)  $ (this is easy to
see) and sends the identity matrix $I_{n}$ to the identity endomorphism
$\operatorname*{id}\in\operatorname*{End}\left(  \mathbb{K}^{n\times1}\right)
$ (this follows from observing that $I_{n}C=C$ for each $C\in\mathbb{K}%
^{n\times1}$). Hence, it is a ring homomorphism. Furthermore, it is
invertible\footnote{The easiest way to see this is to notice that it is the
same map as the map from Proposition \ref{prop.modiso.mat-Hom} (applied to
$m=n$), because $\operatorname*{End}\left(  \mathbb{K}^{n\times1}\right)
=\operatorname*{Hom}\left(  \mathbb{K}^{n\times1},\mathbb{K}^{n\times
1}\right)  $ as sets. Hence, the invertibility of this map follows from
Proposition \ref{prop.modiso.mat-Hom}.}. Thus, it is a ring isomorphism (by
Proposition \ref{prop.riiso.invertible}).
\end{proof}

\begin{teachingnote}
\textbf{2019-04-19 lecture}
\end{teachingnote}

\subsection{Linear independence, spans, bases}

Now, let us generalize Definition \ref{def.laf.lincomb} to arbitrary
$\mathbb{K}$-modules (where $\mathbb{K}$ is still an arbitrary commutative ring):

\begin{definition}
\label{def.module.lincomb} Let $M$ be a $\mathbb{K}$-module. Let $v_{1}%
,v_{2},\ldots,v_{k}$ be some vectors in $M$.

\textbf{(a)} A \textit{linear combination} of $v_{1},v_{2},\ldots,v_{k}$ means
a vector of the form%
\begin{equation}
\lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}%
,\ \ \ \ \ \ \ \ \ \ \text{with }\lambda_{1},\lambda_{2},\ldots,\lambda_{k}%
\in\mathbb{K}. \label{eq.def.module.lincomb.a.lc}%
\end{equation}


\textbf{(b)} The \textit{span} of $v_{1},v_{2},\ldots,v_{k}$ is defined to be
the subset%
\begin{align*}
&  \left\{  \lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}%
\ \mid\ \lambda_{1},\lambda_{2},\ldots,\lambda_{k}\in\mathbb{K}\right\} \\
&  =\left\{  \text{linear combinations of }v_{1},v_{2},\ldots,v_{k}\right\}
\end{align*}
of $M$. This span is a $\mathbb{K}$-submodule of $M$. (This is easy to check.)

\textbf{(c)} The vectors $v_{1},v_{2},\ldots,v_{k}$ are said to be
\textit{linearly independent} if the only $k$-tuple $\left(  \lambda
_{1},\lambda_{2},\ldots,\lambda_{k}\right)  \in\mathbb{K}^{k}$ satisfying
$\lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}=0$ is $\left(
\underbrace{0,0,\ldots,0}_{k\text{ times}}\right)  $.

\textbf{(d)} Let $U$ be a $\mathbb{K}$-submodule of $M$. We say that
$v_{1},v_{2},\ldots,v_{k}$ form a \textit{basis} of $U$ (or, more formally,
$\left(  v_{1},v_{2},\ldots,v_{k}\right)  $ is a basis of $U$) if and only if
the vectors $v_{1},v_{2},\ldots,v_{k}$ are linearly independent and their span
is $U$.

\textbf{(e)} Let $U$ be a $\mathbb{K}$-submodule of $M$. We say that the list
$\left(  v_{1},v_{2},\ldots,v_{k}\right)  $ \textit{spans} $U$ if and only if
the span of $v_{1},v_{2},\ldots,v_{k}$ is $U$. (More informally, instead of
saying \textquotedblleft the list $\left(  v_{1},v_{2},\ldots,v_{k}\right)  $
\textit{spans} $U$\textquotedblright, we can say \textquotedblleft the vectors
$v_{1},v_{2},\ldots,v_{k}$ \textit{span} $U$\textquotedblright; of course,
this is not the same as saying that each of these $k$ vectors on its own spans
$U$.)

\textbf{(f)} All the terminology we have just introduced depends on
$\mathbb{K}$. Whenever the ring $\mathbb{K}$ is not clear from the context,
you can insert it into this terminology to make it unambiguous: e.g., say
\textquotedblleft$\mathbb{K}$-linear combination\textquotedblright\ instead of
\textquotedblleft linear combination\textquotedblright, and \textquotedblleft%
$\mathbb{K}$-span\textquotedblright\ instead of \textquotedblleft
span\textquotedblright.
\end{definition}

The following proposition gives an equivalent criterion for a list of vectors
to be a basis of a $\mathbb{K}$-module:

\begin{proposition}
\label{prop.module.basis-unique} Let $M$ be a $\mathbb{K}$-module. Let
$v_{1},v_{2},\ldots,v_{k}$ be some vectors in $M$. Then, $\left(  v_{1}%
,v_{2},\ldots,v_{k}\right)  $ is a basis of $M$ if and only if each vector in
$M$ can be \textbf{uniquely} written in the form
(\ref{eq.def.module.lincomb.a.lc}).\footnotemark
\end{proposition}

\footnotetext{We say that a vector $v\in M$ can be \textbf{uniquely} written
in the form (\ref{eq.def.module.lincomb.a.lc}) if there is a \textbf{unique}
$k$-tuple $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{k}\right)
\in\mathbb{K}^{k}$ satisfying $v=\lambda_{1}v_{1}+\lambda_{2}v_{2}%
+\cdots+\lambda_{k}v_{k}$.}

\begin{proof}
[Proof of Proposition \ref{prop.module.basis-unique}.]The following proof is
long, but not much is happening in it (and you may already have seen this
argument in a good Linear Algebra class).

$\Longrightarrow:$ Assume that $\left(  v_{1},v_{2},\ldots,v_{k}\right)  $ is
a basis of $M$. We must prove that each vector in $M$ can be \textbf{uniquely}
written in the form (\ref{eq.def.module.lincomb.a.lc}).

We have assumed that $\left(  v_{1},v_{2},\ldots,v_{k}\right)  $ is a basis of
$M$. In other words, the vectors $v_{1},v_{2},\ldots,v_{k}$ are linearly
independent and their span is $M$ (by the definition of \textquotedblleft
basis\textquotedblright).

Now, let $v\in M$ be any vector. Then, $v$ lies in $M$. In other words, $v$
lies in the span of the vectors $v_{1},v_{2},\ldots,v_{k}$ (since the span of
these vectors $v_{1},v_{2},\ldots,v_{k}$ is $M$). In other words,%
\[
v\in\left\{  \lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}%
\ \mid\ \lambda_{1},\lambda_{2},\ldots,\lambda_{k}\in\mathbb{K}\right\}
\]
(by the definition of the span). In other words, $v$ can be written in the
form (\ref{eq.def.module.lincomb.a.lc}). We shall now show that this way of
writing $v$ is unique.

Let $\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{k}\right)  $ and $\left(
\beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $ be two $k$-tuples $\left(
\lambda_{1},\lambda_{2},\ldots,\lambda_{k}\right)  \in\mathbb{K}^{k}$
satisfying $v=\lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}$. We
will show that $\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{k}\right)
=\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $.

Indeed, $\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{k}\right)  $ is a
$k$-tuple $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{k}\right)
\in\mathbb{K}^{k}$ satisfying $v=\lambda_{1}v_{1}+\lambda_{2}v_{2}%
+\cdots+\lambda_{k}v_{k}$. In other words, $\left(  \alpha_{1},\alpha
_{2},\ldots,\alpha_{k}\right)  $ is a $k$-tuple of elements of $\mathbb{K}$
such that $v=\alpha_{1}v_{1}+\alpha_{2}v_{2}+\cdots+\alpha_{k}v_{k}$.
Similarly, $\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $ is a
$k$-tuple of elements of $\mathbb{K}$ such that $v=\beta_{1}v_{1}+\beta
_{2}v_{2}+\cdots+\beta_{k}v_{k}$. Now, multiple uses of the distributivity law
yield%
\begin{align}
&  \left(  \alpha_{1}-\beta_{1}\right)  v_{1}+\left(  \alpha_{2}-\beta
_{2}\right)  v_{2}+\cdots+\left(  \alpha_{k}-\beta_{k}\right)  v_{k}%
\nonumber\\
&  =\left(  \alpha_{1}v_{1}-\beta_{1}v_{1}\right)  +\left(  \alpha_{2}%
v_{2}-\beta_{2}v_{2}\right)  +\cdots+\left(  \alpha_{k}v_{k}-\beta_{k}%
v_{k}\right) \nonumber\\
&  =\underbrace{\left(  \alpha_{1}v_{1}+\alpha_{2}v_{2}+\cdots+\alpha_{k}%
v_{k}\right)  }_{=v}-\underbrace{\left(  \beta_{1}v_{1}+\beta_{2}v_{2}%
+\cdots+\beta_{k}v_{k}\right)  }_{=v}\nonumber\\
&  =v-v=0. \label{pf.prop.module.basis-unique.1}%
\end{align}
But the only $k$-tuple $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda
_{k}\right)  \in\mathbb{K}^{k}$ satisfying $\lambda_{1}v_{1}+\lambda_{2}%
v_{2}+\cdots+\lambda_{k}v_{k}=0$ is $\left(  \underbrace{0,0,\ldots
,0}_{k\text{ times}}\right)  $ (since the vectors $v_{1},v_{2},\ldots,v_{k}$
are linearly independent). Hence, the $k$-tuple $\left(  \alpha_{1}-\beta
_{1},\alpha_{2}-\beta_{2},\ldots,\alpha_{k}-\beta_{k}\right)  \in
\mathbb{K}^{k}$ must be $\left(  \underbrace{0,0,\ldots,0}_{k\text{ times}%
}\right)  $ (since this $k$-tuple satisfies
(\ref{pf.prop.module.basis-unique.1})). In other words, $\alpha_{i}-\beta
_{i}=0$ for each $i\in\left\{  1,2,\ldots,k\right\}  $. In other words,
$\alpha_{i}=\beta_{i}$ for each $i\in\left\{  1,2,\ldots,k\right\}  $. In
other words, $\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{k}\right)  =\left(
\beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $.

Now, forget that we fixed $\left(  \alpha_{1},\alpha_{2},\ldots,\alpha
_{k}\right)  $ and $\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $. We
thus have shown that if $\left(  \alpha_{1},\alpha_{2},\ldots,\alpha
_{k}\right)  $ and $\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $ are
two $k$-tuples $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{k}\right)
\in\mathbb{K}^{k}$ satisfying $v=\lambda_{1}v_{1}+\lambda_{2}v_{2}%
+\cdots+\lambda_{k}v_{k}$, then $\left(  \alpha_{1},\alpha_{2},\ldots
,\alpha_{k}\right)  =\left(  \beta_{1},\beta_{2},\ldots,\beta_{k}\right)  $.
In other words, there is at most one such $k$-tuple. In other words, $v$ can
be written in the form (\ref{eq.def.module.lincomb.a.lc}) in at most one way.
Thus, $v$ can be \textbf{uniquely} written in the form
(\ref{eq.def.module.lincomb.a.lc}) (because we have previously shown that $v$
can be written in this from). This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Proposition
\ref{prop.module.basis-unique}.

$\Longleftarrow:$ Assume that each vector in $M$ can be \textbf{uniquely}
written in the form (\ref{eq.def.module.lincomb.a.lc}). We must prove that
$\left(  v_{1},v_{2},\ldots,v_{k}\right)  $ is a basis of $M$.

We have assumed that each vector in $M$ can be \textbf{uniquely} written in
the form (\ref{eq.def.module.lincomb.a.lc}). Thus, in particular, each vector
in $M$ can be written in this form. In other words, for each $v\in M$, there
exist $\lambda_{1},\lambda_{2},\ldots,\lambda_{k}\in\mathbb{K}$ such that
$v=\lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}$. In other words,
each $v\in M$ is a linear combination of the vectors $v_{1},v_{2},\ldots
,v_{k}$. In other words, each $v\in M$ belongs to the span of the vectors
$v_{1},v_{2},\ldots,v_{k}$ (by the definition of a span). In other words, $M$
is a subset of the span of the vectors $v_{1},v_{2},\ldots,v_{k}$. Hence, the
span of the vectors $v_{1},v_{2},\ldots,v_{k}$ is $M$ (since this span is
clearly a subset of $M$).

On the other hand, we have assumed that each vector in $M$ can be
\textbf{uniquely} written in the form (\ref{eq.def.module.lincomb.a.lc}).
Thus, if $v\in M$, then $v$ can be \textbf{uniquely} written in this form;
thus, in particular, any two ways of writing $v$ in this form must be
identical. In other words, if $v\in M$, and if $\left(  \alpha_{1},\alpha
_{2},\ldots,\alpha_{k}\right)  $ and $\left(  \beta_{1},\beta_{2},\ldots
,\beta_{k}\right)  $ are two $k$-tuples $\left(  \lambda_{1},\lambda
_{2},\ldots,\lambda_{k}\right)  \in\mathbb{K}^{k}$ satisfying $v=\lambda
_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}$, then
\begin{equation}
\left(  \alpha_{1},\alpha_{2},\ldots,\alpha_{k}\right)  =\left(  \beta
_{1},\beta_{2},\ldots,\beta_{k}\right)  .
\label{pf.prop.module.basis-unique.6}%
\end{equation}


Now, let us prove that the vectors $v_{1},v_{2},\ldots,v_{k}$ are linearly
independent. Indeed, let $\left(  \rho_{1},\rho_{2},\ldots,\rho_{k}\right)
\in\mathbb{K}^{k}$ be a $k$-tuple satisfying $\rho_{1}v_{1}+\rho_{2}%
v_{2}+\cdots+\rho_{k}v_{k}=0$. We shall show that $\left(  \rho_{1},\rho
_{2},\ldots,\rho_{k}\right)  =\left(  \underbrace{0,0,\ldots,0}_{k\text{
times}}\right)  $.

We notice that $\left(  \rho_{1},\rho_{2},\ldots,\rho_{k}\right)  $ and
$\left(  \underbrace{0,0,\ldots,0}_{k\text{ times}}\right)  $ are two
$k$-tuples $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{k}\right)
\in\mathbb{K}^{k}$ satisfying $0=\lambda_{1}v_{1}+\lambda_{2}v_{2}%
+\cdots+\lambda_{k}v_{k}$ (since $\rho_{1}v_{1}+\rho_{2}v_{2}+\cdots+\rho
_{k}v_{k}=0$ and $0v_{1}+0v_{2}+\cdots+0v_{k}=0$). Hence,
(\ref{pf.prop.module.basis-unique.6}) (applied to $v=0$, $\left(  \alpha
_{1},\alpha_{2},\ldots,\alpha_{k}\right)  =\left(  \rho_{1},\rho_{2}%
,\ldots,\rho_{k}\right)  $ and $\left(  \beta_{1},\beta_{2},\ldots,\beta
_{k}\right)  =\left(  \underbrace{0,0,\ldots,0}_{k\text{ times}}\right)  $)
yields
\[
\left(  \rho_{1},\rho_{2},\ldots,\rho_{k}\right)  =\left(
\underbrace{0,0,\ldots,0}_{k\text{ times}}\right)  .
\]


Now, forget that we fixed $\left(  \rho_{1},\rho_{2},\ldots,\rho_{k}\right)
$. We thus have shown that if $\left(  \rho_{1},\rho_{2},\ldots,\rho
_{k}\right)  \in\mathbb{K}^{k}$ is any $k$-tuple satisfying $\rho_{1}%
v_{1}+\rho_{2}v_{2}+\cdots+\rho_{k}v_{k}=0$, then $\left(  \rho_{1},\rho
_{2},\ldots,\rho_{k}\right)  =\left(  \underbrace{0,0,\ldots,0}_{k\text{
times}}\right)  $. In other words, the only $k$-tuple $\left(  \lambda
_{1},\lambda_{2},\ldots,\lambda_{k}\right)  \in\mathbb{K}^{k}$ satisfying
$\lambda_{1}v_{1}+\lambda_{2}v_{2}+\cdots+\lambda_{k}v_{k}=0$ is $\left(
\underbrace{0,0,\ldots,0}_{k\text{ times}}\right)  $. In other words, the
vectors $v_{1},v_{2},\ldots,v_{k}$ are linearly independent (by the definition
of \textquotedblleft linearly independent\textquotedblright).

Now we know that the vectors $v_{1},v_{2},\ldots,v_{k}$ are linearly
independent and their span is $M$. In other words, $\left(  v_{1},v_{2}%
,\ldots,v_{k}\right)  $ is a basis of $M$ (by the definition of
\textquotedblleft basis\textquotedblright). This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Proposition
\ref{prop.module.basis-unique}.
\end{proof}

\begin{definition}
\label{def.module.fingen} Let $M$ be a $\mathbb{K}$-module. Then, we say that
$M$ is \textit{finitely generated} if there exists a $k\in\mathbb{N}$ and $k$
vectors $v_{1},v_{2},\ldots,v_{k}$ that span $M$.
\end{definition}

Finitely generated $\mathbb{K}$-modules are a generalization of
finite-dimensional $\mathbb{K}$-vector spaces. A classical result from linear
algebra says the following:

\begin{theorem}
\label{thm.module.vs-has-basis} If $\mathbb{K}$ is a field, then every
finitely generated $\mathbb{K}$-module (= $\mathbb{K}$-vector space) has a basis.
\end{theorem}

\begin{proof}
See \cite[Theorem 1]{Conrad-dim}, for example.\footnote{Note that in the
(otherwise excellent) note \cite{Conrad-dim}, Conrad follows the inane
convention that an empty list $\left(  {}\right)  $ cannot be a basis. This
forces him to make the unnatural requirement \textquotedblleft$V\neq\left\{
0\right\}  $\textquotedblright\ in \cite[Theorem 1]{Conrad-dim}. You should
ignore this special treatment (or, rather, non-treatment) of empty lists when
you read the note.}
\end{proof}

A version of Theorem \ref{thm.module.vs-has-basis} exists for vector spaces
that are not finitely generated; however, stating it would require us to
define a more general notion of ``basis'' that would allow for infinite bases
(and even then, this version would require the Axiom of Choice).

Theorem \ref{thm.module.vs-has-basis} fails horribly when $\mathbb{K}$ is not
a field. For example, the $\mathbb{Z}$-module $\mathbb{Z}/2$ has no basis.
Indeed, the only $\mathbb{Z}$-linearly independent list of vectors in
$\mathbb{Z}/2$ is the empty list $\left(  {}\right)  $, since any vector in
$\mathbb{Z}/2$ becomes $0$ when scaled by the nonzero integer $2$. More
generally, if $\mathbb{K}$ is not a field, then there is a $\mathbb{K}$-module
spanned by a single vector that has no basis.

Submodules of $\mathbb{K}^{1\times n}$ fare only somewhat better than
arbitrary $\mathbb{K}$-modules in terms of having bases. It can be shown that
every $\mathbb{Z}$-submodule of $\mathbb{Z}^{1\times n}$ (or, more generally,
of a $\mathbb{Z}$-module that has a basis) must have a basis; thus, Theorem
\ref{thm.laf.basis-of-subspace} \textbf{(a)} does hold for $\mathbb{K}%
=\mathbb{Z}$. Theorem \ref{thm.laf.basis-of-subspace} \textbf{(a)} also holds
for $\mathbb{K}=\mathbb{Z}\left[  i\right]  $. (These facts are particular
cases of \cite[Theorem 2.1]{Conrad-subPID}.) However, Theorem
\ref{thm.laf.basis-of-subspace} \textbf{(a)} does not hold for $\mathbb{K}%
=\mathbb{Z}\left[  \sqrt{-3}\right]  $ or for $\mathbb{K}=\mathbb{Z}/4$; in
both of these cases, we can find $\mathbb{K}$-submodules \textbf{of
}$\mathbb{K}$\textbf{ itself} that have no basis\footnote{If $\mathbb{K}%
=\mathbb{Z}/4$, then this is easy: Just take the $\mathbb{K}$-submodule
$2\mathbb{K}=\left\{  \left[  0\right]  _{4},\left[  2\right]  _{4}\right\}  $
of $\mathbb{K}$; it has no basis, since scaling by $2$ sends all of its
elements to $0$.
\par
If $\mathbb{K}=\mathbb{Z}\left[  \sqrt{-3}\right]  $, then the subset
$\left\{  a+b\sqrt{-3}\mid a,b\in\mathbb{Z}\text{ satisfying }a\equiv
b\mod 2\right\}  $ of $\mathbb{K}$ is a $\mathbb{K}$-submodule having no
basis. This is closely connected to the fact that division with remainder and
unique factorization into primes do not work in the ring $\mathbb{Z}\left[
\sqrt{-3}\right]  $.}.

Thus, Theorem \ref{thm.laf.basis-of-subspace} \textbf{(a)} becomes false when
$\mathbb{K}$ is allowed to be an arbitrary ring. The same can be said of parts
\textbf{(d)} and \textbf{(e)} of Theorem \ref{thm.laf.basis-of-subspace};
indeed, they become false even for $\mathbb{K}=\mathbb{Z}$, $n=1$ and
$U=\mathbb{Z}^{1\times1}$. Here are examples of their failure (where, for the
sake of simplicity, we are working not in the $\mathbb{Z}$-module
$\mathbb{Z}^{1\times1}$, but in the $\mathbb{Z}$-module $\mathbb{Z}$, which is
isomorphic to it):

\begin{itemize}
\item The $1$-element list $\left(  2\right)  $ of vectors in the $\mathbb{Z}%
$-module $\mathbb{Z}$ (consisting of just the single vector $2\in\mathbb{Z}$)
is $\mathbb{Z}$-linearly independent (because if $\lambda_{1}\in\mathbb{Z}$
satisfies $\lambda_{1}\cdot2=0$, then $\lambda_{1}=0$); but you cannot extend
it to a basis of $\mathbb{Z}$ (since adding any further vector to it would
break linear independence). Thus, Theorem \ref{thm.laf.basis-of-subspace}
\textbf{(d)} fails for $\mathbb{K}=\mathbb{Z}$, $n=1$ and $U=\mathbb{Z}%
^{1\times1}$.

\item The integers $2$ and $3$ are coprime. Hence, Bezout's theorem says that
$1$ is a $\mathbb{Z}$-linear combination of $2$ and $3$. (This can be proven
more directly: $1=1\cdot3+\left(  -1\right)  \cdot2$.) This entails that
\textbf{every} integer is a $\mathbb{Z}$-linear combination of $2$ and $3$. In
other words, the span of the $2$-element list $\left(  2,3\right)  $ of
vectors in $\mathbb{Z}$ is $\mathbb{Z}$. But neither of these two vectors
alone suffices: The span of the $1$-element list $\left(  2\right)  $ is just
$\left\{  \text{multiples of }2\right\}  $, whereas the span of the
$1$-element list $\left(  3\right)  $ is just $\left\{  \text{multiples of
}3\right\}  $. So the $2$-element list $\left(  2,3\right)  $ spans the
$\mathbb{Z}$-module $\mathbb{Z}$, but cannot be \textquotedblleft
shrunk\textquotedblright\ to a basis of $\mathbb{Z}$. Therefore, Theorem
\ref{thm.laf.basis-of-subspace} \textbf{(e)} fails for $\mathbb{K}=\mathbb{Z}%
$, $n=1$ and $U=\mathbb{Z}^{1\times1}$.
\end{itemize}

Does Theorem \ref{thm.laf.basis-of-subspace} \textbf{(b)} survive the
generalization from fields to commutative rings? Literally speaking, the
answer is \textquotedblleft no\textquotedblright. Indeed, if $\mathbb{K}$ is
the zero ring, then there is only one $\mathbb{K}$-module (namely, $\left\{
0\right\}  $), but it has bases of all sizes (indeed, for each $n\in
\mathbb{N}$, the $n$-element list $\left(  0,0,\ldots,0\right)  $ is a basis
of this $\mathbb{K}$-module). So two bases of this module can have different sizes.

However, surprisingly, this turns out to be the only counterexample for
Theorem \ref{thm.laf.basis-of-subspace} \textbf{(b)}! More precisely, Theorem
\ref{thm.laf.basis-of-subspace} \textbf{(b)} holds whenever the ring
$\mathbb{K}$ has more than one element. More generally, we have:

\begin{theorem}
\label{thm.module.rank-welldef} Let $\mathbb{K}$ be a commutative ring with
$\left\vert \mathbb{K}\right\vert >1$. Let $U$ be a $\mathbb{K}$-module. Then,
any two bases of $U$ have the same size.
\end{theorem}

This is much harder to prove than the analogue for fields! There is an
argument using determinants.

More generally, Theorem \ref{thm.laf.basis-of-subspace} \textbf{(c)} also
holds over commutative rings $\mathbb{K}$ such that $\left\vert \mathbb{K}%
\right\vert >1$.

These results and counterexamples illustrate the fact that $\mathbb{K}%
$-modules (where $\mathbb{K}$ is a commutative ring) are a much richer
structure than just $\mathbb{K}^{n\times1}$'s for $n\in\mathbb{N}$.

\subsection{\label{sect.la.ker}$\mathbb{K}$-submodules from linear maps}

We defined the kernel of a matrix; we can similarly define the kernel of a
linear map, and a slightly more general notion:

\begin{proposition}
\label{prop.modhom.ker} Let $\mathbb{K}$ be a commutative ring. Let $M$ and
$N$ be two $\mathbb{K}$-modules. Let $f:M\rightarrow N$ be a $\mathbb{K}%
$-module homomorphism (i.e., a $\mathbb{K}$-linear map).

\textbf{(a)} The set%
\[
\left\{  v\in M\ \mid\ f\left(  v\right)  =0\right\}
\]
is a $\mathbb{K}$-submodule of $M$. This set is called the \textit{kernel} of
$f$, and is written $\operatorname*{Ker}f$ (or $\ker f$).

\textbf{(b)} Let $V$ be a $\mathbb{K}$-submodule of $N$. Then, the set%
\[
\left\{  v\in M\ \mid\ f\left(  v\right)  \in V\right\}
\]
is a $\mathbb{K}$-submodule of $M$. This set is called the \textit{preimage of
$V$ under $f$}, and is written $f^{-1}\left(  V\right)  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.modhom.ker}.]\textbf{(b)} Let us denote the
subset $\left\{  v\in M\ \mid\ f\left(  v\right)  \in V\right\}  $ of $M$ by
$f^{-1}\left(  V\right)  $. We must prove that this subset $f^{-1}\left(
V\right)  $ is a $\mathbb{K}$-submodule of $M$.

According to Definition \ref{def.module.submod.as-subset}, we can achieve this
by proving that this subset contains $0$, is closed under addition and is
closed under scaling.

Let us first prove that it contains $0$. Indeed, since $f$ is $\mathbb{K}%
$-linear, we have $f\left(  0\right)  =0\in V$ (since $V$ is a $\mathbb{K}%
$-submodule of $N$). Thus, $0\in f^{-1}\left(  V\right)  $ (by the definition
of $f^{-1}\left(  V\right)  $). In other words, the subset $f^{-1}\left(
V\right)  $ contains $0$.

Next, let us show that $f^{-1}\left(  V\right)  $ is closed under addition.
Indeed, let $a,b\in f^{-1}\left(  V\right)  $; we must then prove that $a+b\in
f^{-1}\left(  V\right)  $.

From $a\in f^{-1}\left(  V\right)  $, we obtain $f\left(  a\right)  \in V$ (by
the definition of $f^{-1}\left(  V\right)  $). Similarly, $f\left(  b\right)
\in V$. But $V$ is a $\mathbb{K}$-submodule of $N$ and therefore closed under
addition; hence, from $f\left(  a\right)  \in V$ and $f\left(  b\right)  \in
V$, we conclude that $f\left(  a\right)  +f\left(  b\right)  \in V$. But the
map $f$ is $\mathbb{K}$-linear; thus, $f\left(  a+b\right)  =f\left(
a\right)  +f\left(  b\right)  \in V$. In other words, $a+b\in f^{-1}\left(
V\right)  $ (by the definition of $f^{-1}\left(  V\right)  $).

Now, forget that we fixed $a,b$. We thus have proven that all $a,b\in
f^{-1}\left(  V\right)  $ satisfy $a+b\in f^{-1}\left(  V\right)  $. In other
words, the subset $f^{-1}\left(  V\right)  $ is closed under addition.

A similar argument shows that $f^{-1}\left(  V\right)  $ is closed under scaling.

Thus, $f^{-1}\left(  V\right)  $ is a $\mathbb{K}$-submodule of $M$ (according
to Definition \ref{def.module.submod.as-subset}). This proves Proposition
\ref{prop.modhom.ker} \textbf{(b)}.

\textbf{(a)} It is easy to see that the one-element set $\left\{
0_{N}\right\}  $ is a $\mathbb{K}$-submodule of $N$ (since $0_{N}+0_{N}=0_{N}$
and $\lambda\cdot0_{N}=0_{N}$ for each $\lambda\in\mathbb{K}$). Hence,
Proposition \ref{prop.modhom.ker} \textbf{(b)} (applied to $V=\left\{
0_{N}\right\}  $) yields that the set $\left\{  v\in M\ \mid\ f\left(
v\right)  \in\left\{  0_{N}\right\}  \right\}  $ is a $\mathbb{K}$-submodule
of $M$. But this set is precisely $\left\{  v\in M\ \mid\ f\left(  v\right)
=0\right\}  $ (since the condition \textquotedblleft$f\left(  v\right)
\in\left\{  0_{N}\right\}  $\textquotedblright\ on a vector $v\in M$ is
equivalent to \textquotedblleft$f\left(  v\right)  =0$\textquotedblright).
Hence, we conclude that $\left\{  v\in M\ \mid\ f\left(  v\right)  =0\right\}
$ is a $\mathbb{K}$-submodule of $M$. This proves Proposition
\ref{prop.modhom.ker} \textbf{(a)}.
\end{proof}

A second way to construct $\mathbb{K}$-submodules out of linear maps
generalizes the column space of a matrix:

\begin{proposition}
\label{prop.modhom.im} Let $\mathbb{K}$ be a commutative ring. Let $M$ and $N$
be two $\mathbb{K}$-modules. Let $f:M\rightarrow N$ be a $\mathbb{K}$-module
homomorphism (i.e., a $\mathbb{K}$-linear map).

\textbf{(a)} The set $f\left(  M\right)  =\left\{  f\left(  v\right)
\ \mid\ v\in M\right\}  $ is a $\mathbb{K}$-submodule of $N$. This is called
the \textit{image} of $f$.

\textbf{(b)} Let $U$ be a $\mathbb{K}$-submodule of $M$. Then, the set
$f\left(  U\right)  =\left\{  f\left(  v\right)  \ \mid\ v\in U\right\}  $ is
a $\mathbb{K}$-submodule of $N$. This is called the \textit{image of }%
$U$\textit{ under }$f$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.modhom.im}.]This is somewhat similar to the
proof of Proposition \ref{prop.modhom.ker}, and left to the reader.
\end{proof}

How do the kernel and the image of a linear map generalize the kernel and the
column space of a matrix? Again, this comes from the correspondence between
matrices and linear maps:

\begin{remark}
\label{rmk.modhom.ker=ker} Let $\mathbb{K}$ be a commutative ring. Let
$n,m\in\mathbb{N}$. Let $A\in\mathbb{K}^{n\times m}$ be an $n\times m$-matrix.
Consider the $\mathbb{K}$-linear map $L_{A}$ defined in Theorem
\ref{thm.module.LA}. Then:

\textbf{(a)} The kernel of the map $L_{A}$ is the kernel of the matrix $A$.

\textbf{(b)} The image of the map $L_{A}$ is the column space of the matrix
$A$.

(Here, we are defining the kernel and the column space of a matrix as we did
in Definition \ref{def.laf.ker} and Definition \ref{def.laf.rowspace}, but
without requiring $\mathbb{K}$ to be a field.)
\end{remark}

\begin{proof}
[Proof of Remark \ref{rmk.modhom.ker=ker}.]Follows directly from the definitions.
\end{proof}

The reader may wonder, after we have stressed certain parallels between rings
and $\mathbb{K}$-modules a few times, whether kernels and images can be
defined for ring homomorphisms in the same way as we have defined them for
$\mathbb{K}$-module homomorphisms. The answer is \textquotedblleft
yes\textquotedblright, of course (after all, rings also have a $0$, just as
modules do), but the outcome is perhaps somewhat surprising. First, let us
show the analogue of Proposition \ref{prop.modhom.im} for rings:

\begin{proposition}
\label{prop.rihom.im} Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. Let
$f:\mathbb{K}\rightarrow\mathbb{L}$ be a ring homomorphism.

\textbf{(a)} The set $f\left(  \mathbb{K}\right)  =\left\{  f\left(  v\right)
\ \mid\ v\in\mathbb{K}\right\}  $ is a subring of $\mathbb{L}$. This is called
the \textit{image} of $f$.

\textbf{(b)} Let $\mathbb{U}$ be a subring of $\mathbb{K}$. Then, the set
$f\left(  \mathbb{U}\right)  =\left\{  f\left(  v\right)  \ \mid
\ v\in\mathbb{U}\right\}  $ is a subring of $\mathbb{L}$. This is called the
\textit{image of }$\mathbb{U}$\textit{ under }$f$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.rihom.im}.]This is similar to the proof of
Proposition \ref{prop.modhom.im}.
\end{proof}

Next, we can define the kernel of a ring homomorphism by imitating Proposition
\ref{prop.modhom.ker}; but this kernel will almost never be a subring (as it
will almost never contain $1$). Instead, it will be a special sort of subset
of $\mathbb{K}$: a so-called \textit{ideal}. Let us define ideals:

\begin{definition}
\label{def.ring.ideal}Let $\mathbb{K}$ be a ring. An \textit{ideal} of
$\mathbb{K}$ is defined to be a subset $I$ of $\mathbb{K}$ that satisfies the
following four conditions:

\begin{itemize}
\item The subset $I$ is closed under addition (i.e., we have $a+b\in I$ for
all $a\in I$ and $b\in I$).

\item The subset $I$ contains $0_{\mathbb{K}}$.

\item We have $\lambda a\in I$ for all $\lambda\in\mathbb{K}$ and $a\in I$.

\item We have $a\lambda\in I$ for all $\lambda\in\mathbb{K}$ and $a\in I$.
\end{itemize}
\end{definition}

It is easy to see that any ring $\mathbb{K}$ is an ideal of itself;
furthermore, the $1$-element subset $\left\{  0_{\mathbb{K}}\right\}  $ of
$\mathbb{K}$ is an ideal of $\mathbb{K}$ as well. But there can be many
further ideals:

\begin{example}
\label{exa.ring.ideal.princ}Let $\mathbb{K}$ be a commutative ring. Let
$u\in\mathbb{K}$. Then, the subset%
\[
u\mathbb{K}:=\left\{  uz\ \mid\ z\in\mathbb{K}\right\}
\]
of $\mathbb{K}$ is an ideal of $\mathbb{K}$. Such an ideal is called a
\textit{principal ideal}. Note that $\left\{  0_{\mathbb{K}}\right\}  $ is a
principal ideal (since $\left\{  0_{\mathbb{K}}\right\}  =0\mathbb{K}$), and
$\mathbb{K}$ itself is a principal ideal (since $\mathbb{K}=1\mathbb{K}$).

Let us see what this results in for some specific rings $\mathbb{K}$:

\begin{itemize}
\item The principal ideals of the ring $\mathbb{Z}$ are the subsets
$n\mathbb{Z}=\left\{  nz\ \mid\ z\in\mathbb{Z}\right\}  =\left\{  \text{all
multiples of }n\right\}  $ with $n\in\mathbb{Z}$. For example, $2\mathbb{Z}%
=\left\{  \text{all even numbers}\right\}  $ is an ideal of $\mathbb{Z}$. It
is not hard to show that all ideals of $\mathbb{Z}$ are principal ideals.

\item It can also be shown that all ideals of $\mathbb{Z}\left[  i\right]  $
are principal ideals. The same holds for $\mathbb{D}$ (the ring of dual
numbers), for $\mathbb{Z}\left[  \sqrt{-2}\right]  $ (the ring of
\textquotedblleft$2$-Gaussian integers\textquotedblright), and $\mathbb{Q}%
\left[  x\right]  $ (the ring of polynomials with rational coefficients, to be
formally defined in Definition \ref{def.pol.polyring} below).

\item However, there exist some rings that have non-principal ideals as well.
For example, if $\mathbb{K}$ is the ring $\mathbb{Z}\left[  \sqrt{-3}\right]
$, then the subset $\left\{  a+b\sqrt{-3}\mid a,b\in\mathbb{Z}\text{
satisfying }a\equiv b\mod 2\right\}  $ of $\mathbb{K}$ is an ideal but not a
principal ideal. For another example, if $\mathbb{K}$ is the ring
$\mathbb{Z}\left[  x\right]  $ (the ring of polynomials with integer
coefficients, to be formally defined in Definition \ref{def.pol.polyring}
below), then the subset of $\mathbb{K}$ consisting of all polynomials with
even constant term is an ideal but not a principal ideal.
\end{itemize}
\end{example}

When $\mathbb{K}$ is a commutative ring, the third and fourth conditions in
Definition \ref{def.ring.ideal} actually say the same thing (because $\lambda
a=a\lambda$ for all $\lambda\in\mathbb{K}$ and $a\in\mathbb{K}$). From this,
it is not hard to see the following:

\begin{proposition}
\label{prop.ring.ideal.commutative-submod}Let $\mathbb{K}$ be a commutative
ring. Then, an ideal of $\mathbb{K}$ is the same thing as a $\mathbb{K}%
$-submodule of $\mathbb{K}$. (Remember that $\mathbb{K}$ itself is a
$\mathbb{K}$-module!).
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ring.ideal.commutative-submod}.]LTTR.
\end{proof}

Now, we can state an analogue of Proposition \ref{prop.modhom.ker} is the following:

\begin{proposition}
\label{prop.rihom.ker} Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. Let
$f:\mathbb{K}\rightarrow\mathbb{L}$ be a ring homomorphism.

\textbf{(a)} The set%
\[
\left\{  v\in\mathbb{K}\ \mid\ f\left(  v\right)  =0\right\}
\]
is an ideal of $\mathbb{K}$. This set is called the \textit{kernel} of $f$,
and is written $\operatorname*{Ker}f$ (or $\ker f$).

\textbf{(b)} Let $V$ be an ideal of $\mathbb{L}$. Then, the set%
\[
\left\{  v\in\mathbb{K}\ \mid\ f\left(  v\right)  \in V\right\}
\]
is an ideal of $\mathbb{K}$. This set is called the \textit{preimage of $V$
under $f$}, and is written $f^{-1}\left(  V\right)  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.rihom.ker}.]LTTR.
\end{proof}

So the kernel of a ring homomorphism is always an ideal. (And conversely,
every ideal can be written as the kernel of a ring homomorphism; this will
follow from Proposition \ref{thm.quot.ring/ideal.wd} \textbf{(g)} further below.)

Kernels can also help in checking whether a ring homomorphism or a module
homomorphism is injective. To wit, for ring homomorphisms, the following
criterion for injectivity holds:

\begin{proposition}
\label{prop.rihom.ker.inj} Let $\mathbb{K}$ and $\mathbb{L}$ be two rings. Let
$f:\mathbb{K}\rightarrow\mathbb{L}$ be a ring homomorphism. Then, $f$ is
injective if and only if $\operatorname*{Ker}f=\left\{  0_{\mathbb{K}%
}\right\}  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.rihom.ker.inj}.]$\Longrightarrow:$ Assume that
$f$ is injective. We must prove that $\operatorname*{Ker}f=\left\{
0_{\mathbb{K}}\right\}  $.

Recall that $f$ is a ring homomorphism. Thus, $f\left(  0\right)  =0$ (by the
definition of a ring homomorphism).

Let $a\in\operatorname*{Ker}f$. Then, $a\in\operatorname*{Ker}f=\left\{
v\in\mathbb{K}\ \mid\ f\left(  v\right)  =0\right\}  $ (by the definition of
$\operatorname*{Ker}f$). In other words, $a\in\mathbb{K}$ and $f\left(
a\right)  =0$. Comparing this with $f\left(  0\right)  =0$, we obtain
$f\left(  a\right)  =f\left(  0\right)  $. Since $f$ is injective, we can thus
conclude that $a=0=0_{\mathbb{K}}\in\left\{  0_{\mathbb{K}}\right\}  $.

Now, forget that we fixed $a$. We thus have proven that $a\in\left\{
0_{\mathbb{K}}\right\}  $ for each $a\in\operatorname*{Ker}f$. In other words,
$\operatorname*{Ker}f\subseteq\left\{  0_{\mathbb{K}}\right\}  $.

On the other hand, $f\left(  0_{\mathbb{K}}\right)  =f\left(  0\right)  =0$,
so that $0_{\mathbb{K}}\in\operatorname*{Ker}f$ (by the definition of
$\operatorname*{Ker}f$), so that $\left\{  0_{\mathbb{K}}\right\}
\subseteq\operatorname*{Ker}f$. Combining this with $\operatorname*{Ker}%
f\subseteq\left\{  0_{\mathbb{K}}\right\}  $, we obtain $\operatorname*{Ker}%
f=\left\{  0_{\mathbb{K}}\right\}  $. This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Proposition
\ref{prop.rihom.ker.inj}.

$\Longleftarrow:$ Assume that $\operatorname*{Ker}f=\left\{  0_{\mathbb{K}%
}\right\}  $. We must prove that $f$ is injective.

Let $a$ and $b$ be two elements of $\mathbb{K}$ satisfying $f\left(  a\right)
=f\left(  b\right)  $. Then, Proposition \ref{prop.riho.subtract} \textbf{(c)}
yields $f\left(  a-b\right)  =f\left(  a\right)  -f\left(  b\right)  =0$
(since $f\left(  a\right)  =f\left(  b\right)  $). Hence, $a-b\in\mathbb{K}$
and $f\left(  a-b\right)  =0$. In other words, $a-b\in\operatorname*{Ker}f$
(by the definition of $\operatorname*{Ker}f$). Thus, $a-b\in
\operatorname*{Ker}f=\left\{  0_{\mathbb{K}}\right\}  $, so that
$a-b=0_{\mathbb{K}}$ and thus $a=b$.

Now, forget that we fixed $a$ and $b$. We thus have shown that if $a$ and $b$
are two elements of $\mathbb{K}$ satisfying $f\left(  a\right)  =f\left(
b\right)  $, then $a=b$. In other words, the map $f$ is injective. This proves
the \textquotedblleft$\Longleftarrow$\textquotedblright\ direction of
Proposition \ref{prop.rihom.ker.inj}.
\end{proof}

An analogous statement holds for $\mathbb{K}$-module homomorphisms:

\begin{proposition}
\label{prop.modhom.ker.inj} Let $M$ and $N$ be two $\mathbb{K}$-modules. Let
$f:M\rightarrow N$ be a $\mathbb{K}$-module homomorphism (i.e., a $\mathbb{K}%
$-linear map). Then, $f$ is injective if and only if $\operatorname*{Ker}%
f=\left\{  0_{M}\right\}  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.modhom.ker.inj}.]This is proven analogously to
Proposition \ref{prop.rihom.ker.inj}; the main difference is that instead of
applying Proposition \ref{prop.riho.subtract} \textbf{(c)}, we have to apply
the analogue of Proposition \ref{prop.riho.subtract} \textbf{(c)} for
$\mathbb{K}$-module homomorphisms (which we have not stated, but is proven in
the same way).
\end{proof}

A curious (and useful) consequence of Proposition \ref{prop.rihom.ker.inj} is
the following property of fields:

\begin{corollary}
\label{cor.rihom.from-field-inj}Let $\mathbb{K}$ be a field, and let
$\mathbb{L}$ be a ring such that $\mathbb{L}$ is not trivial (i.e., we have
$\left\vert \mathbb{L}\right\vert >1$). Let $f:\mathbb{K}\rightarrow
\mathbb{L}$ be a ring homomorphism. Then, $f$ is injective.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.rihom.from-field-inj}.]Due to Proposition
\ref{prop.rihom.ker.inj}, it suffices to show that $\operatorname*{Ker}%
f=\left\{  0_{\mathbb{K}}\right\}  $. So let us prove this.

Let $a\in\operatorname*{Ker}f$. Thus, $a\in\mathbb{K}$ and $f\left(  a\right)
=0$ (by the definition of $\operatorname*{Ker}f$). We are going to prove that
$a=0_{\mathbb{K}}$.

Indeed, assume the contrary. Thus, $a\neq0_{\mathbb{K}}$. Hence, the element
$a$ of $\mathbb{K}$ is nonzero. But every nonzero element of $\mathbb{K}$ is
invertible (since $\mathbb{K}$ is a field). Hence, $a$ is invertible (since
$a$ is a nonzero element of $\mathbb{K}$). Thus, Proposition
\ref{prop.riho.subtract} \textbf{(b)} shows that $f\left(  a\right)
\in\mathbb{L}$ is also invertible, and that we have $f\left(  a^{-1}\right)
=\left(  f\left(  a\right)  \right)  ^{-1}$.

Thus, comparing $f\left(  a\right)  \cdot\left(  f\left(  a\right)  \right)
^{-1}=1_{\mathbb{L}}$ with $\underbrace{f\left(  a\right)  }_{=0}\cdot\left(
f\left(  a\right)  \right)  ^{-1}=0$, we obtain $1_{\mathbb{L}}=0$. Hence,
each $b\in\mathbb{L}$ satisfies $b=b\cdot\underbrace{1_{\mathbb{L}}}_{=0}%
=0\in\left\{  0\right\}  $. Thus, $\mathbb{L}\subseteq\left\{  0\right\}  $,
so that $\left\vert \mathbb{L}\right\vert \leq\left\vert \left\{  0\right\}
\right\vert =1$. This contradicts $\left\vert \mathbb{L}\right\vert >1$. This
contradiction shows that our assumption is wrong. Hence, $a=0_{\mathbb{K}}$ is
proven. Therefore, $a\in\left\{  0_{\mathbb{K}}\right\}  $.

Now, forget that we fixed $a$. We thus have shown that $a\in\left\{
0_{\mathbb{K}}\right\}  $ for each $a\in\operatorname*{Ker}f$. In other words,
$\operatorname*{Ker}f\subseteq\left\{  0_{\mathbb{K}}\right\}  $. From this,
we can easily deduce that $\operatorname*{Ker}f=\left\{  0_{\mathbb{K}%
}\right\}  $ (by the same argument that we used in our proof of the
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction of Proposition
\ref{prop.rihom.ker.inj}). Thus, Proposition \ref{prop.rihom.ker.inj} shows
that $f$ is injective. This proves Corollary \ref{cor.rihom.from-field-inj}.
\end{proof}

\section{\label{chp.pol}Polynomials and formal power series}

\subsection{\label{sect.pol.motiv}Motivation}

Back in our proof of Theorem \ref{thm.binom.vandermonde}, we have used a vague
notion of polynomials. Let us try and formalize this notion. While at that, we
shall also try to generalize it from polynomials with rational coefficients to
polynomials with coefficients in an arbitrary commutative ring.

The most \textquotedblleft naive\textquotedblright\ notion of polynomials is
that of a polynomial function:

\begin{definition}
\label{def.pol.polfun} Let $\mathbb{K}$ be a commutative ring. A function
$f:\mathbb{K}\rightarrow\mathbb{K}$ is said to be a \textit{polynomial
function} if there exist some elements $a_{0},a_{1},\ldots,a_{n}\in\mathbb{K}$
such that every $u\in\mathbb{K}$ satisfies%
\[
f\left(  u\right)  =a_{0}u^{0}+a_{1}u^{1}+\cdots+a_{n}u^{n}.
\]

\end{definition}

For example, the function
\[
\mathbb{R}\rightarrow\mathbb{R},\qquad u\mapsto6u^{3}-\dfrac{1}{2}u+\sqrt{3}%
\]
is a polynomial function.

Definition \ref{def.pol.polfun} has its uses. In particular, when you are
working with real or complex numbers, it is sufficient for most of what you
would want from a polynomial. (This is why numerous authors, particularly with
backgrounds in analysis, simply define a polynomial to be a polynomial
function.) But when we want polynomials with coefficients from other rings,
this definition starts showing weaknesses. In what sense?

Here is an example. In Section \ref{sect.ring.hunting1}, we constructed a
field with $4$ elements by adjoining a $j$ satisfying $j^{2}=j+1$ to
$\mathbb{Z}/2$. In other words, we adjoined a root of ``the polynomial $x^{2}
- x - 1$'' (whatever this may mean) to $\mathbb{Z} / 2$. It would be helpful
to generalize this: How can we adjoin a root of a polynomial to a ring? In
particular, if we can do this with polynomials of higher degree than $2$, we
may hope to be able to construct larger finite fields. For example, how do we
find a field of size $8$ ? We would hope to get it by adjoining to
$\mathbb{Z}/2$ a root of a degree-$3$ polynomial.

So we need a notion of polynomials over $\mathbb{Z}/2$, and we need there to
be infinitely many of them, ideally at least one of each degree. With
polynomial functions, we cannot get this. In fact, there are only $4$
functions from $\mathbb{Z}/2$ to $\mathbb{Z}/2$.

Even for our above construction of a field with $4$ elements, polynomial
functions are not suited. In fact, the polynomial function%
\[
\mathbb{Z}/2\rightarrow\mathbb{Z}/2,\ \ \ \ \ \ \ \ \ \ x\mapsto x^{2}-x-1
\]
is actually just the constant-$1$ function. So when we adjoined a root of this
polynomial, did we just adjoin a root of $1$ ? Hardly. (A root of $1$ would be
a $j$ satisfying $1=0$; \textquotedblleft adjoining\textquotedblright\ such a
thing would yield the zero ring, not a field with $4$ elements.)

The moral of the story for now is that when we adjoin a root of a polynomial
to a field, we certainly are not adjoining a root of a polynomial function. So
we have at least one reason to want a concept of polynomials that is finer
than that of polynomial functions.

Here is another reason: Polynomial functions from $\mathbb{K}$ to $\mathbb{K}$
can only be applied to elements of $\mathbb{K}$ (because they are defined as
functions from $\mathbb{K}$), but we want a notion of polynomials that can be
applied to more general things (such as square matrices or other polynomials).

For example, in linear algebra, it is extremely useful to apply polynomials to
square matrices. With polynomial functions, this makes no sense: A polynomial
function over $\mathbb{R}$ is defined only on $\mathbb{R}$, so how can you
apply it to a $2\times2$-matrix? Once again, the discrepancy becomes the most
obvious over a finite field: The two polynomial functions $\mathbb{Z}%
/2\rightarrow\mathbb{Z}/2,\ x\mapsto x^{2}$ and $\mathbb{Z}/2\rightarrow
\mathbb{Z}/2,\ x\mapsto x$ are identical (since $x^{2}=x$ for all
$x\in\mathbb{Z}/2$); but the matrix $A=\left(
\begin{array}
[c]{cc}%
0 & 1\\
0 & 0
\end{array}
\right)  \in\left(  \mathbb{Z}/2\right)  ^{2\times2}$ does not satisfy
$A^{2}=A$. So if there was a way to apply these two identical polynomial
functions to $A$, then we should obtain two different results, which is
absurd. Thus, it makes no sense to apply a polynomial function $\mathbb{Z}%
/2\rightarrow\mathbb{Z}/2$ to a square matrix over $\mathbb{Z}/2$.

Hence, we need a finer definition of a polynomial which doesn't just remember
its values on the elements of $\mathbb{K}$, but remembers all its
coefficients. So we need to bake the coefficients into the definition.

We already gave a hint of such a definition in Subsection
\ref{subsect.ent.vandermonde}, where we said that a polynomial (in $1$
variable $x$, with rational coefficients) is an \textquotedblleft
expression\textquotedblright\ (whatever this means) of the form $a_{k}%
x^{k}+a_{k-1}x^{k-1}+\cdots+a_{0}$, where $a_{k},a_{k-1},\ldots,a_{0}$ are
(fixed) rational numbers and where $x$ is an \textquotedblleft
indeterminate\textquotedblright\ (a symbol that itself does not stand for a
number, but we can substitute a number for). This was vague (what exactly is
an \textquotedblleft expression\textquotedblright?) but a step in the right
direction. We can, of course, generalize this informal definition to an
arbitrary commutative ring $\mathbb{K}$ by replacing \textquotedblleft
rational numbers\textquotedblright\ by \textquotedblleft elements of
$\mathbb{K}$\textquotedblright. But how do we make the notion of
\textquotedblleft expression\textquotedblright\ rigorous?

The idea is to forget (at first) about the specific form of the expression
$a_{k}x^{k}+a_{k-1}x^{k-1}+\cdots+a_{0}$ and simply store the coefficients
$a_{0},a_{1},\ldots,a_{k}$ appearing in it in a list.

For example, let us consider polynomials of degree $\leq1$ over $\mathbb{R}$.
These always have the form $a_{0}+a_{1}x$ (with $a_{0},a_{1}\in\mathbb{R}$),
so we can simply define them as \textbf{pairs} $\left(  a_{0},a_{1}\right)  $
of real numbers $a_{0}$ and $a_{1}$. (This is analogous to Definition
\ref{def.CC.CC}, where we defined complex numbers as pairs of real numbers
rather than trying to treat them as \textquotedblleft expressions involving
$i$\textquotedblright.) Next, we define an addition operation $+$ on
polynomials of degree $\leq1$ by setting%
\[
\left(  a_{0},a_{1}\right)  +\left(  b_{0},b_{1}\right)  =\left(  a_{0}%
+b_{0},a_{1}+b_{1}\right)  ,
\]
which of course imitates the informal computation%
\[
\left(  a_{0}+a_{1}x\right)  +\left(  b_{0}+b_{1}x\right)  =\left(
a_{0}+b_{0}\right)  +\left(  a_{1}+b_{1}\right)  x.
\]
Furthermore, we define a multiplication on these polynomials by setting%
\[
\left(  a_{0},a_{1}\right)  \cdot\left(  b_{0},b_{1}\right)  =\left(
a_{0}b_{0},a_{0}b_{1}+a_{1}b_{0},a_{1}b_{1}\right)  ,
\]
which imitates the \textquotedblleft FOIL\textquotedblright\ rule%
\[
\left(  a_{0}+a_{1}x\right)  \cdot\left(  b_{0}+b_{1}x\right)  =a_{0}%
b_{0}+\left(  a_{0}b_{1}+a_{1}b_{0}\right)  x+a_{1}b_{1}x^{2}.
\]
However, this multiplication yields a triple, not a pair, so it is not a
binary operation. So our polynomials of degree $\leq1$ do not form a ring;
their multiplication takes us out of their set.

We can likewise consider polynomials of degree $\leq2$, which can be defined
as triples $\left(  a_{0},a_{1},a_{2}\right)  $, but then multiplication
yields a $5$-tuple rather than a triple.

More generally: For each $n\in\mathbb{N}$, we can define polynomials of degree
$\leq n$ as $\left(  n+1\right)  $-tuples $\left(  a_{0},a_{1},\ldots
,a_{n}\right)  $, and define addition and multiplication on them, but the
multiplication will result in $\left(  2n+1\right)  $-tuples rather than
$\left(  n+1\right)  $-tuples.

Hence, if we want to define polynomials in such a way that they form a ring,
we should define them not as pairs or triples or $\left(  n+1\right)
$-tuples, but rather as infinite sequences. In other words, we should define a
polynomial as an infinite sequence $\left(  a_{0},a_{1},a_{2},\ldots\right)
$, which will encode the \textquotedblleft expression\textquotedblright%
\ $a_{0}+a_{1}x+a_{2}x^{2}+\cdots$. However, not every sequence stands for a
polynomial; after all, we want polynomials to be \textbf{finite} expressions,
so the sum $a_{0}+a_{1}x+a_{2}x^{2}+\cdots$ needs to be finite (in the sense
that all but finitely many of its addends are $0$) in order for it to qualify
as a polynomial. Thus, our polynomials should be defined as infinite sequences
$\left(  a_{0},a_{1},a_{2},\ldots\right)  $ that have only finitely many
nonzero entries.

An upside of this strategy is that with such a definition, we get a second
object for free: the \textit{formal power series}. Those are just going to be
\textbf{all} infinite sequences $\left(  a_{0},a_{1},a_{2},\ldots\right)  $,
including the ones that have infinitely many nonzero entries. We will see that
the same rules by which we define addition and multiplication of polynomials
can be used to define these operations on formal power series.

\subsection{The definition of formal power series and polynomials}

Let us now explicitly state the definitions we have been working towards. We
shall only define polynomials (and formal power series) in $1$ indeterminate;
there is a version that involves multiple indeterminates, but for now we
restrict ourselves to one.

\begin{convention}
For the rest of this chapter, we fix a commutative ring $\mathbb{K}$.
\end{convention}

\begin{definition}
\label{def.pol.pol}\textbf{(a)} A \textit{formal power series} (in $1$
indeterminate over $\mathbb{K}$) is defined to be a sequence $\left(
a_{0},a_{1},a_{2},\ldots\right)  =\left(  a_{n}\right)  _{n\in\mathbb{N}}%
\in\mathbb{K}^{\mathbb{N}}$ of elements of $\mathbb{K}$.

We abbreviate the words \textquotedblleft formal power
series\textquotedblright\ as \textquotedblleft\textit{FPS}\textquotedblright.

We let $\mathbb{K}\left[  \left[  x\right]  \right]  $ be the set of all FPSs.

\textbf{(b)} A \textit{polynomial} (in $1$ indeterminate over $\mathbb{K}$) is
defined to be an FPS $\left(  a_{0},a_{1},a_{2},\ldots\right)  $ such that%
\[
\text{all but finitely many }i\in\mathbb{N}\text{ satisfy }a_{i}=0
\]
(that is, only finitely many $i\in\mathbb{N}$ satisfy $a_{i}\neq0$).

We let $\mathbb{K}\left[  x\right]  $ be the set of all polynomials.
\end{definition}

So far, our FPSs are just sequences, with no other meaning. We will later see
why they can be viewed as \textquotedblleft power series\textquotedblright,
what the $x$ in \textquotedblleft$\mathbb{K}\left[  \left[  x\right]  \right]
$\textquotedblright\ means, and why we can write a sequence $\left(
a_{0},a_{1},a_{2},\ldots\right)  $ as $a_{0}+a_{1}x+a_{2}x^{2}+\cdots$.

First, let us give two examples to illustrate the above definition:

\begin{example}
In this example, let $\mathbb{K}=\mathbb{Z}$.

\textbf{(a)} The sequence $\left(  1,2,3,4,5,\ldots\right)  $ is an FPS, but
not a polynomial. We will later write this FPS as $1+2x+3x^{2}+4x^{3}%
+5x^{4}+\cdots$.

\textbf{(b)} The sequence $\left(  3,0,2,5,\underbrace{0,0,0,0,\ldots
}_{\text{zeroes}}\right)  $ is a polynomial. We will later write this
polynomial as $3+2x^{2}+5x^{3}$.
\end{example}

\begin{teachingnote}
\textbf{2019-04-22 lecture}
\end{teachingnote}

\begin{definition}
\label{def.pol.K-alg}The goal of this definition is to make $\mathbb{K}\left[
\left[  x\right]  \right]  $ into a $\mathbb{K}$-algebra.

\textbf{(a)} We define a binary operation $+$ (called \textit{addition}) on
$\mathbb{K}\left[  \left[  x\right]  \right]  $ by%
\[
\left(  a_{0},a_{1},a_{2},\ldots\right)  +\left(  b_{0},b_{1},b_{2}%
,\ldots\right)  =\left(  a_{0}+b_{0},a_{1}+b_{1},a_{2}+b_{2},\ldots\right)  .
\]
(That is, we define an entrywise addition.)

\textbf{(b)} We define a scaling map $\cdot:\mathbb{K}\times\mathbb{K}\left[
\left[  x\right]  \right]  \rightarrow\mathbb{K}\left[  \left[  x\right]
\right]  $ by%
\[
\lambda\left(  a_{0},a_{1},a_{2},\ldots\right)  =\left(  \lambda a_{0},\lambda
a_{1},\lambda a_{2},\ldots\right)  .
\]
(That is, we define an entrywise scaling.)

\textbf{(c)} We define a binary operation $\cdot$ (called
\textit{multiplication}) on $\mathbb{K}\left[  \left[  x\right]  \right]  $ by%
\[
\left(  a_{0},a_{1},a_{2},\ldots\right)  \cdot\left(  b_{0},b_{1},b_{2}%
,\ldots\right)  =\left(  c_{0},c_{1},c_{2},\ldots\right)  ,
\]
where
\[
c_{n}=\sum_{i=0}^{n}a_{i}b_{n-i}=\sum_{\substack{i,j\in\mathbb{N}%
;\\i+j=n}}a_{i}b_{j}=a_{0}b_{n}+a_{1}b_{n-1}+\cdots+a_{n}b_{0}%
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}.
\]


\textbf{(d)} For each $a\in\mathbb{K}$, we define an FPS $\underline{a}%
\in\mathbb{K}\left[  \left[  x\right]  \right]  $ by
\[
\underline{a}=\left(  a,\underbrace{0,0,0,\ldots}_{\text{zeroes}}\right)  .
\]
This is called a \textit{constant} FPS.
\end{definition}

For example,%
\begin{align}
\left(  0,1,2,3,4,\ldots\right)  +\left(  1,1,1,1,1,\ldots\right)   &
=\left(  1,2,3,4,5,\ldots\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\nonumber\\
\left(  1,1,1,1,1,\ldots\right)  +\left(  1,1,1,1,1,\ldots\right)   &
=\left(  2,2,2,2,2,\ldots\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\nonumber\\
8\cdot\left(  1,1,1,1,1,\ldots\right)   &  =\left(  8,8,8,8,8,\ldots\right)
\ \ \ \ \ \ \ \ \ \ \text{and}\nonumber\\
\left(  1,1,1,1,1,\ldots\right)  \cdot\left(  1,1,1,1,1,\ldots\right)   &
=\left(  1,2,3,4,5,\ldots\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\nonumber\\
\left(  1,-1,\underbrace{0,0,0,\ldots}_{\text{zeroes}}\right)  \cdot\left(
1,1,1,1,1,\ldots\right)   &  =\left(  1,\underbrace{0,0,0,\ldots
}_{\text{zeroes}}\right)  =\underline{1}. \label{eq.pol.FPS.ex5}%
\end{align}


\begin{theorem}
\label{thm.pol.K-alg}\textbf{(a)} Equip the set $\mathbb{K}\left[  \left[
x\right]  \right]  $ with the addition $+$ defined in Definition
\ref{def.pol.K-alg} \textbf{(a)}, the multiplication $\cdot$ defined in
Definition \ref{def.pol.K-alg} \textbf{(c)}, the scaling $\cdot$ defined in
Definition \ref{def.pol.K-alg} \textbf{(b)}, the zero $\underline{0}$ and the
unity $\underline{1}$. Then, $\mathbb{K}\left[  \left[  x\right]  \right]  $
is a $\mathbb{K}$-algebra, a commutative ring and a $\mathbb{K}$-module.

\textbf{(b)} The subtraction $-$ that comes from the $\mathbb{K}$-algebra
structure on $\mathbb{K}\left[  \left[  x\right]  \right]  $ is entrywise; in
other words, any two FPSs $\left(  a_{0},a_{1},a_{2},\ldots\right)  $ and
$\left(  b_{0},b_{1},b_{2},\ldots\right)  $ satisfy%
\[
\left(  a_{0},a_{1},a_{2},\ldots\right)  -\left(  b_{0},b_{1},b_{2}%
,\ldots\right)  =\left(  a_{0}-b_{0},a_{1}-b_{1},a_{2}-b_{2},\ldots\right)  .
\]


\textbf{(c)} We have
\[
\lambda\mathbf{a}=\underline{\lambda}\cdot\mathbf{a}%
\ \ \ \ \ \ \ \ \ \ \text{for each }\lambda\in\mathbb{K}\text{ and }%
\mathbf{a}\in\mathbb{K}\left[  \left[  x\right]  \right]  .
\]


\textbf{(d)} Consider the map
\begin{align*}
\iota:\mathbb{K}  &  \rightarrow\mathbb{K}\left[  \left[  x\right]  \right]
,\\
a  &  \mapsto\underline{a}%
\end{align*}
(sending each element $a\in\mathbb{K}$ to the corresponding constant FPS
$\underline{a}=\left(  a,\underbrace{0,0,0,\ldots}_{\text{zeroes}}\right)  $).
This map $\iota$ is a $\mathbb{K}$-algebra homomorphism\footnotemark.
\end{theorem}

\footnotetext{Recall that the notion of a $\mathbb{K}$-algebra homomorphism
was introduced in Definition \ref{def.K-alg.hom}; it means \textquotedblleft
map that is a ring homomorphism and a $\mathbb{K}$-module homomorphism at the
same time\textquotedblright.}

Before we outline a proof of this theorem, let us introduce a helpful notation
(used often in enumerative combinatorics):

\begin{definition}
\label{def.pol.coeff}Let $n\in\mathbb{N}$. Let $\mathbf{a}=\left(  a_{0}%
,a_{1},a_{2},\ldots\right)  \in\mathbb{K}\left[  \left[  x\right]  \right]  $.
Then, we define an element $\left[  x^{n}\right]  \mathbf{a}\in\mathbb{K}$ by%
\[
\left[  x^{n}\right]  \mathbf{a}=a_{n}.
\]
This element $\left[  x^{n}\right]  \mathbf{a}$ is called \textit{the
coefficient of }$x^{n}$ \textit{in }$\mathbf{a}$, or the $n$\textit{-th
coefficient} of $\mathbf{a}$. (The letter \textquotedblleft$x$%
\textquotedblright\ is so far considered just as a symbolic part of this
notation, with no standalone meaning.)
\end{definition}

Be careful with this notation: What you would normally call \textquotedblleft
the first entry\textquotedblright\ of the sequence $\left(  a_{0},a_{1}%
,a_{2},\ldots\right)  $ is called its $0$-th (not $1$-st) coefficient.

\begin{example}
We have $\left[  x^{0}\right]  \left(  1,2,3,4,5,\ldots\right)  =1$ and
$\left[  x^{3}\right]  \left(  1,2,3,4,5,\ldots\right)  =4$.
\end{example}

Definition \ref{def.pol.coeff} has a tautological consequence: Each FPS
$\mathbf{a}$ satisfies%
\begin{equation}
\mathbf{a}=\left(  \left[  x^{0}\right]  \mathbf{a},\left[  x^{1}\right]
\mathbf{a},\left[  x^{2}\right]  \mathbf{a},\ldots\right)  .
\label{eq.pol.fps-a=()}%
\end{equation}
Thus, an FPS $\mathbf{a}$ is uniquely determined by its coefficients $\left[
x^{0}\right]  \mathbf{a},\left[  x^{1}\right]  \mathbf{a},\left[
x^{2}\right]  \mathbf{a},\ldots$. Hence, if two FPSs $\mathbf{a}$ and
$\mathbf{b}$ satisfy $\left[  x^{n}\right]  \mathbf{a}=\left[  x^{n}\right]
\mathbf{b}$ for all $n\in\mathbb{N}$, then $\mathbf{a}=\mathbf{b}$.

The definition of the sum of two FPSs (Definition \ref{def.pol.K-alg}
\textbf{(a)}) rewrites as follows:%
\begin{equation}
\left[  x^{n}\right]  \left(  \mathbf{a}+\mathbf{b}\right)  =\left[
x^{n}\right]  \mathbf{a}+\left[  x^{n}\right]  \mathbf{b}%
\ \ \ \ \ \ \ \ \ \ \text{for all }\mathbf{a},\mathbf{b}\in\mathbb{K}\left[
\left[  x\right]  \right]  \text{ and }n\in\mathbb{N}.
\label{eq.pol.fps-sum.1}%
\end{equation}
(Here, the expression \textquotedblleft$\left[  x^{n}\right]  \mathbf{a}%
+\left[  x^{n}\right]  \mathbf{b}$\textquotedblright\ should be read as
\textquotedblleft$\left(  \left[  x^{n}\right]  \mathbf{a}\right)  +\left(
\left[  x^{n}\right]  \mathbf{b}\right)  $\textquotedblright.) Furthermore,
the definition of scaling on FPSs (Definition \ref{def.pol.K-alg}
\textbf{(b)}) rewrites as follows:%
\begin{equation}
\left[  x^{n}\right]  \left(  \lambda\mathbf{a}\right)  =\lambda\cdot\left[
x^{n}\right]  \mathbf{a}\ \ \ \ \ \ \ \ \ \ \text{for all }\lambda
\in\mathbb{K}\text{ and }\mathbf{a}\in\mathbb{K}\left[  \left[  x\right]
\right]  \text{ and }n\in\mathbb{N}. \label{eq.pol.fps-scal.1}%
\end{equation}
Moreover, the definition of the product of two FPSs (Definition
\ref{def.pol.K-alg} \textbf{(c)}) rewrites as follows:%
\begin{align}
\left[  x^{n}\right]  \left(  \mathbf{ab}\right)   &  =\sum_{i=0}^{n}\left(
\left[  x^{i}\right]  \mathbf{a}\right)  \cdot\left(  \left[  x^{n-i}\right]
\mathbf{b}\right) \label{eq.pol.fps-mul.1}\\
&  =\sum_{\substack{i,j\in\mathbb{N};\\i+j=n}}\left(  \left[  x^{i}\right]
\mathbf{a}\right)  \cdot\left(  \left[  x^{j}\right]  \mathbf{b}\right)
\label{eq.pol.fps-mul.2}\\
&  =\left(  \left[  x^{0}\right]  \mathbf{a}\right)  \cdot\left(  \left[
x^{n}\right]  \mathbf{b}\right)  +\left(  \left[  x^{1}\right]  \mathbf{a}%
\right)  \cdot\left(  \left[  x^{n-1}\right]  \mathbf{b}\right)
+\cdots+\left(  \left[  x^{n}\right]  \mathbf{a}\right)  \cdot\left(  \left[
x^{0}\right]  \mathbf{b}\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \text{for all }\mathbf{a},\mathbf{b}\in\mathbb{K}%
\left[  \left[  x\right]  \right]  \text{ and }n\in\mathbb{N}.\nonumber
\end{align}
Thus, any $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  \left[  x\right]
\right]  $ and $n\in\mathbb{N}$ satisfy%
\begin{align}
\left[  x^{n}\right]  \left(  \mathbf{ab}\right)   &  =\sum_{i=0}^{n}\left(
\left[  x^{i}\right]  \mathbf{a}\right)  \cdot\left(  \left[  x^{n-i}\right]
\mathbf{b}\right) \nonumber\\
&  =\sum_{j=0}^{n}\left(  \left[  x^{n-j}\right]  \mathbf{a}\right)
\cdot\left(  \left[  x^{j}\right]  \mathbf{b}\right)  \label{eq.pol.fps-mul.5}%
\end{align}
(here, we have substituted $n-j$ for $i$ in the sum). Applying
(\ref{eq.pol.fps-mul.1}) to $n=0$, we conclude that%
\begin{align}
\left[  x^{0}\right]  \left(  \mathbf{ab}\right)   &  =\sum_{i=0}^{0}\left(
\left[  x^{i}\right]  \mathbf{a}\right)  \cdot\left(  \left[  x^{0-i}\right]
\mathbf{b}\right)  =\left(  \left[  x^{0}\right]  \mathbf{a}\right)
\cdot\left(  \left[  x^{0-0}\right]  \mathbf{b}\right) \nonumber\\
&  =\left(  \left[  x^{0}\right]  \mathbf{a}\right)  \cdot\left(  \left[
x^{0}\right]  \mathbf{b}\right)  \label{eq.pol.fps-mul.x0ab}%
\end{align}
for all $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  \left[  x\right]  \right]
$. (But of course, $\left[  x^{n}\right]  \left(  \mathbf{ab}\right)  $ is not
generally equal to $\left(  \left[  x^{n}\right]  \mathbf{a}\right)
\cdot\left(  \left[  x^{n}\right]  \mathbf{b}\right)  $ when $n>0$.)

Finally, using the Iverson bracket notation (introduced in Exercise
\ref{exe.binom.legendre}), we can rewrite the definition of the constant FPSs
$\underline{a}$ (Definition \ref{def.pol.K-alg} \textbf{(d)}) as follows:%
\begin{align}
\left[  x^{n}\right]  \left(  \underline{a}\right)   &  =%
\begin{cases}
a, & \text{if }n=0;\\
0, & \text{if }n\neq0
\end{cases}
\label{eq.pol.fps-cst.1}\\
&  =\underbrace{%
\begin{cases}
1, & \text{if }n=0;\\
0, & \text{if }n\neq0
\end{cases}
}_{=\left[  n=0\right]  }\cdot a\nonumber\\
&  =\left[  n=0\right]  \cdot a\ \ \ \ \ \ \ \ \ \ \text{for all }%
a\in\mathbb{K}\text{ and }n\in\mathbb{N}. \label{eq.pol.fps-cst.3}%
\end{align}


We are now ready to prove Theorem \ref{thm.pol.K-alg}:

\begin{proof}
[Proof of Theorem \ref{thm.pol.K-alg}.]\textbf{(c)} Let $\lambda\in\mathbb{K}$
and $\mathbf{a}\in\mathbb{K}\left[  \left[  x\right]  \right]  $. We must
prove that $\lambda\mathbf{a}=\underline{\lambda}\cdot\mathbf{a}$.

Recall that $\underline{\lambda}=\left(  \lambda,0,0,0,0,\ldots\right)  $,
where all entries beyond the first one are zeroes. In other words,%
\[
\left[  x^{0}\right]  \underline{\lambda}=\lambda,
\]
and%
\begin{equation}
\left[  x^{n}\right]  \underline{\lambda}=0\ \ \ \ \ \ \ \ \ \ \text{for each
positive integer }n. \label{pf.thm.pol.K-alg.c.1}%
\end{equation}


Now, let $n\in\mathbb{N}$. Then, (\ref{eq.pol.fps-mul.1}) (applied to
$\underline{\lambda}$ and $\mathbf{a}$ instead of $\mathbf{a}$ and
$\mathbf{b}$) yields%
\begin{align*}
\left[  x^{n}\right]  \left(  \underline{\lambda}\cdot\mathbf{a}\right)   &
=\sum_{i=0}^{n}\left(  \left[  x^{i}\right]  \underline{\lambda}\right)
\cdot\left(  \left[  x^{n-i}\right]  \mathbf{a}\right) \\
&  =\underbrace{\left(  \left[  x^{0}\right]  \underline{\lambda}\right)
}_{=\lambda}\cdot\underbrace{\left(  \left[  x^{n-0}\right]  \mathbf{a}%
\right)  }_{=\left[  x^{n}\right]  \mathbf{a}}+\sum_{i=1}^{n}%
\underbrace{\left(  \left[  x^{i}\right]  \underline{\lambda}\right)
}_{\substack{=0\\\text{(by (\ref{pf.thm.pol.K-alg.c.1}),}\\\text{applied to
}i\text{ instead of }n\text{)}}}\cdot\left(  \left[  x^{n-i}\right]
\mathbf{a}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}i=0\text{ from the sum}\right) \\
&  =\lambda\cdot\left[  x^{n}\right]  \mathbf{a}+\underbrace{\sum_{i=1}%
^{n}0\cdot\left(  \left[  x^{n-i}\right]  \mathbf{a}\right)  }_{=0}%
=\lambda\cdot\left[  x^{n}\right]  \mathbf{a}=\left[  x^{n}\right]  \left(
\lambda\mathbf{a}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.pol.fps-scal.1})}\right)  .
\end{align*}
Since we have proven this for each $n\in\mathbb{N}$, we conclude that
$\underline{\lambda}\cdot\mathbf{a}=\lambda\mathbf{a}$. This proves Theorem
\ref{thm.pol.K-alg} \textbf{(c)}.

\textbf{(a)} We need to verify:

\begin{itemize}
\item the ring axioms,

\item the module axioms,

\item the \textquotedblleft Scale-invariance of
multiplication\textquotedblright\ axiom from Definition
\ref{def.K-alg.K-alg.short-def};

\item the \textquotedblleft Commutativity of multiplication\textquotedblright\ axiom.
\end{itemize}

Most of these verifications are easy and straightforward.\footnote{Theorem
\ref{thm.pol.K-alg} \textbf{(c)} helps in proving the \textquotedblleft
Annihilation\textquotedblright\ and \textquotedblleft neutrality of
one\textquotedblright\ axioms.} Let us only check associativity of
multiplication (since this is the hardest one):

Let $\mathbf{a},\mathbf{b},\mathbf{c}\in\mathbb{K}\left[  \left[  x\right]
\right]  $. We must prove that $\mathbf{a}\left(  \mathbf{bc}\right)  =\left(
\mathbf{ab}\right)  \mathbf{c}$. In order to do so, we shall prove that
$\left[  x^{n}\right]  \left(  \mathbf{a}\left(  \mathbf{bc}\right)  \right)
=\left[  x^{n}\right]  \left(  \left(  \mathbf{ab}\right)  \mathbf{c}\right)
$ for each $n\in\mathbb{N}$. (This is sufficient, because an FPS is uniquely
determined by its coefficients.)

Let $n\in\mathbb{N}$. Consider the two equalities%
\begin{align*}
\left[  x^{n}\right]  \left(  \mathbf{a}\left(  \mathbf{bc}\right)  \right)
&  =\sum_{i=0}^{n}\left(  \left[  x^{i}\right]  \mathbf{a}\right)
\cdot\underbrace{\left(  \left[  x^{n-i}\right]  \left(  \mathbf{bc}\right)
\right)  }_{\substack{=\sum_{j=0}^{n-i}\left(  \left[  x^{n-i-j}\right]
\mathbf{b}\right)  \cdot\left(  \left[  x^{j}\right]  \mathbf{c}\right)
\\\text{(by (\ref{eq.pol.fps-mul.5}), applied to }n-j\text{, }\mathbf{b}\text{
and }\mathbf{c}\\\text{instead of }n\text{, }\mathbf{a}\text{ and }%
\mathbf{b}\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.pol.fps-mul.1}), applied to
}\mathbf{bc}\text{ instead of }\mathbf{b}\right) \\
&  =\sum_{i=0}^{n}\left(  \left[  x^{i}\right]  \mathbf{a}\right)  \cdot
\sum_{j=0}^{n-i}\left(  \left[  x^{n-i-j}\right]  \mathbf{b}\right)
\cdot\left(  \left[  x^{j}\right]  \mathbf{c}\right) \\
&  =\sum_{i=0}^{n}\sum_{j=0}^{n-i}\left(  \left[  x^{i}\right]  \mathbf{a}%
\right)  \cdot\left(  \left[  x^{n-i-j}\right]  \mathbf{b}\right)
\cdot\left(  \left[  x^{j}\right]  \mathbf{c}\right)
\end{align*}
and%
\begin{align*}
\left[  x^{n}\right]  \left(  \left(  \mathbf{ab}\right)  \mathbf{c}\right)
&  =\sum_{j=0}^{n}\underbrace{\left(  \left[  x^{n-j}\right]  \left(
\mathbf{ab}\right)  \right)  }_{\substack{=\sum_{i=0}^{n-j}\left(  \left[
x^{i}\right]  \mathbf{a}\right)  \cdot\left(  \left[  x^{n-j-i}\right]
\mathbf{b}\right)  \\\text{(by (\ref{eq.pol.fps-mul.1}), applied to
}n-j\\\text{instead of }n\text{)}}}\cdot\left(  \left[  x^{j}\right]
\mathbf{c}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.pol.fps-mul.5}), applied to
}\mathbf{ab}\text{ and }\mathbf{c}\text{ instead of }\mathbf{a}\text{ and
}\mathbf{b}\right) \\
&  =\sum_{j=0}^{n}\sum_{i=0}^{n-j}\left(  \left[  x^{i}\right]  \mathbf{a}%
\right)  \cdot\left(  \left[  x^{n-j-i}\right]  \mathbf{b}\right)
\cdot\left(  \left[  x^{j}\right]  \mathbf{c}\right)  .
\end{align*}
The right hand sides of these two equalities are equal, since we have the
following equality of summation signs:
\begin{equation}
\sum_{i=0}^{n}\sum_{j=0}^{n-i}=\sum_{\substack{i,j\in\mathbb{N};\\i+j\leq
n}}=\sum_{j=0}^{n}\sum_{i=0}^{n-j} \label{pf.thm.pol.K-alg.a.assoc.s=s=s}%
\end{equation}
\footnote{An \textquotedblleft equality of summation signs\textquotedblright%
\ is a statement of the form \textquotedblleft$A=B$\textquotedblright, where
$A$ and $B$ are \textquotedblleft summation operators\textquotedblright%
\ (i.e., summation signs or compositions of several summation signs). It has
to be understood as claiming that the summation signs $A$ and $B$ have
\textquotedblleft the same effect\textquotedblright\ (i.e., whatever family of
elements of $\mathbb{K}$ you apply them to, you will get the same result by
applying $A$ as you will get by applying $B$). For instance, the equality
(\ref{pf.thm.pol.K-alg.a.assoc.s=s=s}) is claiming that if $a_{i,j}$ is an
element of $\mathbb{K}$ for each pair $\left(  i,j\right)  \in\mathbb{N}^{2}$
satisfying $i+j\leq n$, then%
\[
\sum_{i=0}^{n}\sum_{j=0}^{n-i}a_{i,j}=\sum_{\substack{i,j\in\mathbb{N}%
;\\i+j\leq n}}a_{i,j}=\sum_{j=0}^{n}\sum_{i=0}^{n-j}a_{i,j}.
\]
(And this is fairly easy to prove: The first equality sign follows from
\begin{align*}
\sum_{\substack{i,j\in\mathbb{N};\\i+j\leq n}}a_{i,j}  &  =\sum_{i\in
\mathbb{N}}\sum_{\substack{j\in\mathbb{N};\\i+j\leq n}}a_{i,j}=\sum_{i=0}%
^{n}\underbrace{\sum_{\substack{j\in\mathbb{N};\\i+j\leq n}}}_{=\sum
_{j=0}^{n-i}}a_{i,j}+\sum_{i=n+1}^{\infty}\underbrace{\sum_{\substack{j\in
\mathbb{N};\\i+j\leq n}}a_{i,j}}_{\substack{=\left(  \text{empty sum}\right)
\\\text{(since there exists no }j\in\mathbb{N}\\\text{satisfying }i+j\leq
n\text{ (because }i>n\text{))}}}\\
&  =\sum_{i=0}^{n}\sum_{j=0}^{n-i}a_{i,j}+\sum_{i=n+1}^{\infty}%
\underbrace{\left(  \text{empty sum}\right)  }_{=0}=\sum_{i=0}^{n}\sum
_{j=0}^{n-i}a_{i,j}+\underbrace{\sum_{i=n+1}^{\infty}0}_{=0}=\sum_{i=0}%
^{n}\sum_{j=0}^{n-i}a_{i,j}.
\end{align*}
The second equality sign follows from a similar argument, but with the roles
of $i$ and $j$ swapped.)} (and since we have $n-i-j=n-j-i$ for all
$i,j\in\mathbb{N}$). Thus, the left hand sides of these two equalities are
equal as well. In other words, $\left[  x^{n}\right]  \left(  \mathbf{a}%
\left(  \mathbf{bc}\right)  \right)  =\left[  x^{n}\right]  \left(  \left(
\mathbf{ab}\right)  \mathbf{c}\right)  $.

Forget that we fixed $n$. Thus, we have shown that $\left[  x^{n}\right]
\left(  \mathbf{a}\left(  \mathbf{bc}\right)  \right)  =\left[  x^{n}\right]
\left(  \left(  \mathbf{ab}\right)  \mathbf{c}\right)  $ for each
$n\in\mathbb{N}$. In other words, $\mathbf{a}\left(  \mathbf{bc}\right)
=\left(  \mathbf{ab}\right)  \mathbf{c}$.

Thus, associativity of multiplication is proven for $\mathbb{K}\left[  \left[
x\right]  \right]  $. All the remaining axioms to be proven are easier but
follow from similar reasoning. The \textquotedblleft Existence of additive
inverses\textquotedblright\ axiom follows by recognizing $\left(
-a_{0},-a_{1},-a_{2},\ldots\right)  $ as the additive inverse of the FPS
$\left(  a_{0},a_{1},a_{2},\ldots\right)  $. Thus, Theorem \ref{thm.pol.K-alg}
\textbf{(a)} is proven.

\textbf{(b)} This follows easily from the fact (noticed in the proof of part
\textbf{(a)}) that \newline$\left(  -a_{0},-a_{1},-a_{2},\ldots\right)  $ is
the additive inverse of any FPS $\left(  a_{0},a_{1},a_{2},\ldots\right)  $.

\textbf{(d)} We need to prove that%
\[
\underline{a}+\underline{b}=\underline{a+b}\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \underline{a}\cdot\underline{b}=\underline{ab}%
\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{K},
\]
that $\lambda\underline{a}=\underline{\lambda a}$ for all $\lambda
\in\mathbb{K}$ and $a\in\mathbb{K}$, and that $\underline{0}=0_{\mathbb{K}%
\left[  \left[  x\right]  \right]  }$ and $\underline{1}=1_{\mathbb{K}\left[
\left[  x\right]  \right]  }$. Most of these claims follow easily from the
definitions. The $\underline{a}\cdot\underline{b}=\underline{ab}$ claim
follows easily from Theorem \ref{thm.pol.K-alg} \textbf{(c)} (applied to
$\lambda=a$ and $\mathbf{a}=\underline{b}$).
\end{proof}

\begin{convention}
\label{conv.pol.embed-FPS}From now on, we shall identify each $a\in\mathbb{K}$
with the FPS $\underline{a}=\left(  a,0,0,0,\ldots\right)  \in\mathbb{K}%
\left[  \left[  x\right]  \right]  $.
\end{convention}

This identification is harmless, due to Theorem \ref{thm.pol.K-alg}
\textbf{(d)} and to the fact that the map
\begin{align*}
\iota:\mathbb{K}  &  \rightarrow\mathbb{K}\left[  \left[  x\right]  \right]
,\\
a  &  \mapsto\underline{a}%
\end{align*}
is injective (since $a=\left[  x^{0}\right]  \left(  \underline{a}\right)  $
for all $a\in\mathbb{K}$). Note that if $a\in\mathbb{K}$, then the FPS
$\underline{a}$ is actually a polynomial (since $\underline{a}=\left(
a,0,0,0,0,\ldots\right)  $ has at most one nonzero entry), i.e., belongs to
$\mathbb{K}\left[  x\right]  $.

The identification we have made in Convention \ref{conv.pol.embed-FPS} turns
$\mathbb{K}$ into a subset of $\mathbb{K}\left[  \left[  x\right]  \right]  $,
and more precisely into a $\mathbb{K}$-subalgebra of $\mathbb{K}\left[
\left[  x\right]  \right]  $ (by Theorem \ref{thm.pol.K-alg} \textbf{(d)}).

Theorem \ref{thm.pol.K-alg} shows that $\mathbb{K}\left[  \left[  x\right]
\right]  $ is a $\mathbb{K}$-algebra and a commutative ring, so that
differences, powers, finite sums, and finite products of FPSs are
well-defined. But more can be said. Indeed, sometimes, infinite sums of FPSs
make sense. For example, it is reasonable to write%
\begin{align*}
&  \left(  1,1,1,1,1,\ldots\right) \\
+  &  \left(  0,1,1,1,1,\ldots\right) \\
+  &  \left(  0,0,1,1,1,\ldots\right) \\
+  &  \left(  0,0,0,1,1,\ldots\right) \\
+  &  \left(  0,0,0,0,1,\ldots\right) \\
+  &  \cdots\\
=  &  \left(  1,2,3,4,5,\ldots\right)  ,
\end{align*}
even though the sum on the left hand side has infinitely many
nonzero\footnote{As usual, \textquotedblleft nonzero\textquotedblright\ means
\textquotedblleft different from $0_{\mathbb{K}\left[  \left[  x\right]
\right]  }=\left(  0,0,0,0,\ldots\right)  $\textquotedblright.} addends! The
addition of $\mathbb{K}\left[  \left[  x\right]  \right]  $ is entrywise, so
it stands to reason that infinite sums of FPSs should be defined entrywise as
well, and whenever such entrywise sums are well-defined, it makes sense to
call them the sum of the FPSs. Thus, we make the following definition:

\begin{definition}
\label{def.pol.summable}A (possibly infinite) family $\left(  \mathbf{a}%
_{i}\right)  _{i\in I}$ of FPSs (where $I$ is an arbitrary set) is called
\textit{summable} if for each $n\in\mathbb{N}$, the following requirement
holds:%
\begin{equation}
\text{only finitely many }i\in I\text{ satisfy }\left[  x^{n}\right]  \left(
\mathbf{a}_{i}\right)  \neq0. \label{eq.def.pol.summable.cond}%
\end{equation}
In this case, the \textit{sum} $\sum_{i\in I}\mathbf{a}_{i}$ of the family
$\left(  \mathbf{a}_{i}\right)  _{i\in I}$ is defined as the FPS whose
coefficients are given by%
\[
\left[  x^{n}\right]  \left(  \sum_{i\in I}\mathbf{a}_{i}\right)  =\sum_{i\in
I}\left[  x^{n}\right]  \left(  \mathbf{a}_{i}\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}.
\]
(The sum on the right hand side of this equality is well-defined in
$\mathbb{K}$, since it is a sum with only finitely many nonzero addends.)
\end{definition}

We notice that the condition (\ref{eq.def.pol.summable.cond}) is \textbf{not}
equivalent to saying \textquotedblleft infinitely many $i\in I$ satisfy
$\left[  x^{n}\right]  \left(  \mathbf{a}_{i}\right)  =0$\textquotedblright.

\begin{fineprint}
\begin{remark}
If you work in constructive logic, you should read the condition
(\ref{eq.def.pol.summable.cond}) as \textquotedblleft all but finitely many
$i\in I$ satisfy $\left[  x^{n}\right]  \left(  \mathbf{a}_{i}\right)
=0$\textquotedblright\ (that is, \textquotedblleft there exists a finite
subset $S$ of $I$ such that each $i\in I\setminus S$ satisfies $\left[
x^{n}\right]  \left(  \mathbf{a}_{i}\right)  =0$\textquotedblright).
\end{remark}
\end{fineprint}

\begin{proposition}
\label{prop.pol.summable.rules}Sums of summable families of FPSs satisfy the
usual rules for summation, as long as all families involved are summable. For example:

\begin{itemize}
\item If $\left(  \mathbf{a}_{i}\right)  _{i\in I}$ and $\left(
\mathbf{b}_{i}\right)  _{i\in I}$ are two summable families of FPSs, then the
family $\left(  \mathbf{a}_{i}+\mathbf{b}_{i}\right)  _{i\in I}$ is summable
as well and its sum is%
\[
\sum_{i\in I}\left(  \mathbf{a}_{i}+\mathbf{b}_{i}\right)  =\sum_{i\in
I}\mathbf{a}_{i}+\sum_{i\in I}\mathbf{b}_{i}.
\]


\item If $\left(  \mathbf{a}_{i}\right)  _{i\in I}$ is a summable family of
FPSs, and if $J$ is a subset of $I$, then the families $\left(  \mathbf{a}%
_{i}\right)  _{i\in J}$ and $\left(  \mathbf{a}_{i}\right)  _{i\in I\setminus
J}$ are summable as well and we have%
\[
\sum_{i\in I}\mathbf{a}_{i}=\sum_{i\in J}\mathbf{a}_{i}+\sum_{i\in I\setminus
J}\mathbf{a}_{i}.
\]


\item The family $\left(  0\right)  _{i\in I}$ (where $0$ stands for the FPS
$0_{\mathbb{K}\left[  \left[  x\right]  \right]  }$) is always summable (no
matter how large $I$ is), and its sum is $\sum_{i\in I}0=0$.

\item If $\left(  \mathbf{a}_{i,j}\right)  _{\left(  i,j\right)  \in I\times
J}$ is a summable family of FPSs indexed by \textbf{pairs} $\left(
i,j\right)  \in I\times J$, then%
\begin{equation}
\sum_{i\in I}\sum_{j\in J}\mathbf{a}_{i,j}=\sum_{\left(  i,j\right)  \in
I\times J}\mathbf{a}_{i,j}=\sum_{j\in J}\sum_{i\in I}\mathbf{a}_{i,j}.
\label{eq.prop.pol.summable.rules.fubini-full}%
\end{equation}

\end{itemize}
\end{proposition}

\Needspace{12cm}

\begin{remark}
\textbf{Caveat:} The equality (\ref{eq.prop.pol.summable.rules.fubini-full})
implies, in particular, that the summation signs $\sum_{i\in I}$ and
$\sum_{j\in J}$ can be interchanged. However, the condition that the family
$\left(  \mathbf{a}_{i,j}\right)  _{\left(  i,j\right)  \in I\times J}$ is
summable is needed for this! If we drop this condition, and merely require the
(weaker!) condition that all the families $\left(  \mathbf{a}_{i,j}\right)
_{j\in J}$ (for each fixed $i$), $\left(  \mathbf{a}_{i,j}\right)  _{i\in I}$
(for each fixed $j$), $\left(  \sum_{j\in J}\mathbf{a}_{i,j}\right)  _{i\in
I}$ and $\left(  \sum_{i\in I}\mathbf{a}_{i,j}\right)  _{j\in J}$ are
summable, then the equality%
\begin{equation}
\sum_{i\in I}\sum_{j\in J}\mathbf{a}_{i,j}=\sum_{j\in J}\sum_{i\in
I}\mathbf{a}_{i,j} \label{eq.prop.pol.summable.rules.fubini-LR}%
\end{equation}
\textbf{may be false}. For an example where it is false, consider the family
$\left(  \mathbf{a}_{i,j}\right)  _{\left(  i,j\right)  \in I\times J}$ with
$I=\left\{  1,2,3,\ldots\right\}  $ and $J=\left\{  1,2,3,\ldots\right\}  $
and $\mathbf{a}_{i,j}$ given by the following table:%
\[%
\begin{tabular}
[c]{|c||c|c|c|c|c|c|}\hline
$\mathbf{a}_{i,j}$ & $1$ & $2$ & $3$ & $4$ & $5$ & $\cdots$\\\hline\hline
$1$ & $1$ & $-1$ &  &  &  & $\cdots$\\\hline
$2$ & $\phantom{-1}$ & $1$ & $-1$ &  &  & $\cdots$\\\hline
$3$ &  &  & $1$ & $-1$ &  & $\cdots$\\\hline
$4$ &  &  &  & $1$ & $-1$ & $\cdots$\\\hline
$5$ &  &  &  &  & $1$ & $\cdots$\\\hline
$\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\ddots
$\\\hline
\end{tabular}
\ \ \
\]
(where all the entries not shown are $0$). Note that the elements of this
family belong to $\mathbb{K}$, and thus can be considered as FPSs via
Convention \ref{conv.pol.embed-FPS}. For this specific family $\left(
\mathbf{a}_{i,j}\right)  _{\left(  i,j\right)  \in I\times J}$, the equality
(\ref{eq.prop.pol.summable.rules.fubini-LR}) rewrites as $0=1$, which is not a
good sign. But this does not contradict the rule
(\ref{eq.prop.pol.summable.rules.fubini-full}), since the family $\left(
\mathbf{a}_{i,j}\right)  _{\left(  i,j\right)  \in I\times J}$ is not summable
(it contains infinitely many $1$'s).

The upshot of this caveat is that if you want to interchange two summation
signs as in (\ref{eq.prop.pol.summable.rules.fubini-LR}), you must check not
only that the sums involved are all well-defined, but also that the sum
$\sum_{\left(  i,j\right)  \in I\times J}\mathbf{a}_{i,j}$ is well-defined
(i.e., the family $\left(  \mathbf{a}_{i,j}\right)  _{\left(  i,j\right)  \in
I\times J}$ is summable). This is automatically satisfied when the sets $I$
and $J$ are finite, but in the case of infinite sets can be a serious
restriction as we have just seen.
\end{remark}

\begin{proof}
[Proof of Proposition \ref{prop.pol.summable.rules} (sketched).]This is boring
yet fairly straightforward: Each of these rules can be derived from the
analogous rule for \textbf{finite} sums, once you fix an $n\in\mathbb{N}$ and
look at the $x^{n}$-coefficients on both sides of the rule.

\begin{fineprint}
For example, let us prove the rule
(\ref{eq.prop.pol.summable.rules.fubini-full}). Assume that $\left(
\mathbf{a}_{i,j}\right)  _{\left(  i,j\right)  \in I\times J}$ is a summable
family of FPSs indexed by \textbf{pairs} $\left(  i,j\right)  \in I\times J$.
Fix $n\in\mathbb{N}$. Then, only finitely many $\left(  i,j\right)  \in
I\times J$ satisfy $\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)
\neq0$ (since the family $\left(  \mathbf{a}_{i,j}\right)  _{\left(
i,j\right)  \in I\times J}$ is summable). In other words, there exists a
finite subset $S$ of $I\times J$ such that
\begin{equation}
\text{all }\left(  i,j\right)  \in\left(  I\times J\right)  \setminus S\text{
satisfy }\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  =0.
\label{pf.prop.pol.summable.rules.fubini-full.S}%
\end{equation}
Consider this $S$. (Note that $S$ can depend on $n$.)

Let $I^{\prime}$ be the subset $\left\{  i\ \mid\ \left(  i,j\right)  \in
S\right\}  $ of $I$. Let $J^{\prime}$ be the subset $\left\{  j\ \mid\ \left(
i,j\right)  \in S\right\}  $ of $J$. Both of these subsets $I^{\prime}$ and
$J^{\prime}$ are finite (since $S$ is finite). Moreover, $I^{\prime}\times
J^{\prime}\subseteq I\times J$ (since $I^{\prime}\subseteq I$ and $J^{\prime
}\subseteq J$) and $S\subseteq I^{\prime}\times J^{\prime}$%
\ \ \ \ \footnote{\textit{Proof.} Let $s\in S$. Then, $s\in S\subseteq I\times
J$; thus, we can write $s$ in the form $s=\left(  u,v\right)  $ for some $u\in
I$ and $v\in J$. Consider these $u$ and $v$. We have $\left(  u,v\right)
=s\in S$. Hence, $u$ has the form $i$ for some $\left(  i,j\right)  \in S$
(namely, for $\left(  i,j\right)  =\left(  u,v\right)  $). Thus, $u\in\left\{
i\ \mid\ \left(  i,j\right)  \in S\right\}  =I^{\prime}$ (since $I^{\prime}$
was defined as $\left\{  i\ \mid\ \left(  i,j\right)  \in S\right\}  $).
Similarly, $v\in J^{\prime}$. From $u\in I^{\prime}$ and $v\in J^{\prime}$, we
obtain $\left(  u,v\right)  \in I^{\prime}\times J^{\prime}$. Hence,
$s=\left(  u,v\right)  \in I^{\prime}\times J^{\prime}$.
\par
Now, forget that we fixed $s$. We thus have shown that $s\in I^{\prime}\times
J^{\prime}$ for each $s\in S$. In other words, $S\subseteq I^{\prime}\times
J^{\prime}$.}. Thus, if a pair $\left(  i,j\right)  \in I\times J$ satisfies
$\left(  i,j\right)  \notin I^{\prime}\times J^{\prime}$, then it must also
satisfy $\left(  i,j\right)  \notin S$\ \ \ \ \footnote{since otherwise, it
would satisfy $\left(  i,j\right)  \in S\subseteq I^{\prime}\times J^{\prime}%
$, which would contradict $\left(  i,j\right)  \notin I^{\prime}\times
J^{\prime}$} and therefore $\left(  i,j\right)  \in\left(  I\times J\right)
\setminus S$ (since $\left(  i,j\right)  \in I\times J$ and $\left(
i,j\right)  \notin S$) and therefore
\begin{equation}
\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  =0
\label{pf.prop.pol.summable.rules.fubini-full.0}%
\end{equation}
(by (\ref{pf.prop.pol.summable.rules.fubini-full.S})).

The sets $I^{\prime}$ and $J^{\prime}$ are finite. Hence, Fubini's theorem for
finite sums (see, e.g., \cite[\S 1.4.2, \textquotedblleft Fubini's
theorem\textquotedblright]{detnotes}) yields%
\begin{equation}
\sum_{i\in I^{\prime}}\sum_{j\in J^{\prime}}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  =\sum_{\left(  i,j\right)  \in I^{\prime}\times
J^{\prime}}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  =\sum_{j\in
J^{\prime}}\sum_{i\in I^{\prime}}\left[  x^{n}\right]  \left(  \mathbf{a}%
_{i,j}\right)  . \label{pf.prop.pol.summable.rules.fubini-full.1}%
\end{equation}


The sum $\sum_{\left(  i,j\right)  \in I\times J}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  $ is well-defined (since only finitely many $\left(
i,j\right)  \in I\times J$ satisfy $\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  \neq0$). Hence,
\begin{align}
\sum_{\left(  i,j\right)  \in I\times J}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)   &  =\underbrace{\sum_{\substack{\left(  i,j\right)
\in I\times J;\\\left(  i,j\right)  \in I^{\prime}\times J^{\prime}}%
}}_{\substack{=\sum_{\left(  i,j\right)  \in I^{\prime}\times J^{\prime}%
}\\\text{(since }I^{\prime}\times J^{\prime}\subseteq I\times J\text{)}%
}}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  +\sum
_{\substack{\left(  i,j\right)  \in I\times J;\\\left(  i,j\right)  \notin
I^{\prime}\times J^{\prime}}}\underbrace{\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  }_{\substack{=0\\\text{(by
(\ref{pf.prop.pol.summable.rules.fubini-full.0}))}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }\left(  i,j\right)  \in I\times J\text{ satisfies either
}\left(  i,j\right)  \in I^{\prime}\times J^{\prime}\\
\text{or }\left(  i,j\right)  \notin I^{\prime}\times J^{\prime}\text{ (but
never both at the same time)}%
\end{array}
\right) \nonumber\\
&  =\sum_{\left(  i,j\right)  \in I^{\prime}\times J^{\prime}}\left[
x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  +\underbrace{\sum
_{\substack{\left(  i,j\right)  \in I\times J;\\\left(  i,j\right)  \notin
I^{\prime}\times J^{\prime}}}0}_{=0}=\sum_{\left(  i,j\right)  \in I^{\prime
}\times J^{\prime}}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)
\nonumber\\
&  =\sum_{i\in I^{\prime}}\sum_{j\in J^{\prime}}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  \label{pf.prop.pol.summable.rules.fubini-full.2}%
\end{align}
(by (\ref{pf.prop.pol.summable.rules.fubini-full.1})).

Moreover, if $i\in I$, then the sum $\sum_{j\in J}\left[  x^{n}\right]
\left(  \mathbf{a}_{i,j}\right)  $ is well-defined and satisfies%
\begin{equation}
\sum_{j\in J}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)
=\sum_{j\in J^{\prime}}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)
. \label{pf.prop.pol.summable.rules.fubini-full.ins}%
\end{equation}


[\textit{Proof:} Let $i\in I$. If $j\in J$ satisfies $j\notin J^{\prime}$,
then $\left(  i,j\right)  \notin I^{\prime}\times J^{\prime}$ (since $j\notin
J^{\prime}$) and thus $\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)
=0$ (by (\ref{pf.prop.pol.summable.rules.fubini-full.0})). Thus, all but
finitely many $j\in J$ satisfy $\left[  x^{n}\right]  \left(  \mathbf{a}%
_{i,j}\right)  =0$ (since all but finitely many $j\in J$ satisfy $j\notin
J^{\prime}$ (because the set $J^{\prime}$ is finite)). In other words, only
finitely many $j\in J$ satisfy $\left[  x^{n}\right]  \left(  \mathbf{a}%
_{i,j}\right)  \neq0$. Therefore, the sum $\sum_{j\in J}\left[  x^{n}\right]
\left(  \mathbf{a}_{i,j}\right)  $ is well-defined (having only finitely many
nonzero addends). Moreover, each $j\in J$ satisfies either $j\in J^{\prime}$
or $j\notin J^{\prime}$ (but not both at once); thus,%
\begin{align*}
\sum_{j\in J}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)   &
=\underbrace{\sum_{\substack{j\in J;\\j\in J^{\prime}}}}_{\substack{=\sum
_{j\in J^{\prime}}\\\text{(since }J^{\prime}\subseteq J\text{)}}}\left[
x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  +\sum_{\substack{j\in
J;\\j\notin J^{\prime}}}\underbrace{\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  }_{\substack{=0\\\text{(by
(\ref{pf.prop.pol.summable.rules.fubini-full.0}) (since }j\notin J^{\prime
}\\\text{leads to }\left(  i,j\right)  \notin I^{\prime}\times J^{\prime
}\text{))}}}=\sum_{j\in J^{\prime}}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  +\underbrace{\sum_{\substack{j\in J;\\j\notin
J^{\prime}}}0}_{=0}\\
&  =\sum_{j\in J^{\prime}}\left[  x^{n}\right]  \left(  \mathbf{a}%
_{i,j}\right)  .
\end{align*}
This proves (\ref{pf.prop.pol.summable.rules.fubini-full.ins}).]

Furthermore, if $i\in I$ satisfies $i\notin I^{\prime}$, then
\[
\sum_{j\in J}\underbrace{\left[  x^{n}\right]  \left(  \mathbf{a}%
_{i,j}\right)  }_{\substack{=0\\\text{(by
(\ref{pf.prop.pol.summable.rules.fubini-full.0}) (since }i\notin I^{\prime
}\\\text{leads to }\left(  i,j\right)  \notin I^{\prime}\times J^{\prime
}\text{))}}}=\sum_{j\in J}0=0.
\]
Thus, all but finitely many $i\in I$ satisfy $\sum_{j\in J}\left[
x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  =0$ (since all but finitely
many $i\in I$ satisfy $i\notin I^{\prime}$ (because the set $I^{\prime}$ is
finite)). In other words, only finitely many $i\in I$ satisfy $\sum_{j\in
J}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  \neq0$. Therefore,
the sum $\sum_{i\in I}\sum_{j\in J}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  $ is well-defined (having only finitely many nonzero
addends). Moreover, each $i\in I$ satisfies either $i\in I^{\prime}$ or
$i\notin I^{\prime}$ (but not both at once); thus,%
\begin{align*}
\sum_{i\in I}\sum_{j\in J}\left[  x^{n}\right]  \left(  \mathbf{a}%
_{i,j}\right)   &  =\underbrace{\sum_{\substack{i\in I;\\i\in I^{\prime}}%
}}_{\substack{=\sum_{i\in I^{\prime}}\\\text{(since }I^{\prime}\subseteq
I\text{)}}}\underbrace{\sum_{j\in J}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  }_{\substack{=\sum_{j\in J^{\prime}}\left[
x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  \\\text{(by
(\ref{pf.prop.pol.summable.rules.fubini-full.ins}))}}}+\sum_{\substack{i\in
I;\\i\notin I^{\prime}}}\sum_{j\in J}\underbrace{\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  }_{\substack{=0\\\text{(by
(\ref{pf.prop.pol.summable.rules.fubini-full.0}) (since }i\notin I^{\prime
}\\\text{leads to }\left(  i,j\right)  \notin I^{\prime}\times J^{\prime
}\text{))}}}\\
&  =\sum_{i\in I^{\prime}}\sum_{j\in J^{\prime}}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  +\underbrace{\sum_{\substack{i\in I;\\i\notin
I^{\prime}}}\sum_{j\in J}0}_{=0}=\sum_{i\in I^{\prime}}\sum_{j\in J^{\prime}%
}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  .
\end{align*}
Comparing this with (\ref{pf.prop.pol.summable.rules.fubini-full.2}), we
obtain%
\begin{equation}
\sum_{i\in I}\sum_{j\in J}\left[  x^{n}\right]  \left(  \mathbf{a}%
_{i,j}\right)  =\sum_{\left(  i,j\right)  \in I\times J}\left[  x^{n}\right]
\left(  \mathbf{a}_{i,j}\right)  .
\label{pf.prop.pol.summable.rules.fubini-full.left-at}%
\end{equation}


Now, forget that we fixed $n$. We thus have proven the equality
(\ref{pf.prop.pol.summable.rules.fubini-full.left-at}) for each $n\in
\mathbb{N}$. We have also proven that all the sums appearing in this equality
are well-defined (having only finitely many nonzero addends).

It is now easy to see that for each $i\in I$, the family $\left(
\mathbf{a}_{i,j}\right)  _{j\in J}$ of FPSs is
summable\footnote{\textit{Proof.} Fix $i\in I$. For each $n\in\mathbb{N}$, the
sum $\sum_{j\in J}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  $ has
only finitely many nonzero addends (as we have proven above). In other words,
for each $n\in\mathbb{N}$, only finitely many $j\in J$ satisfy $\left[
x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  \neq0$. In other words, the
family $\left(  \mathbf{a}_{i,j}\right)  _{j\in J}$ of FPSs is summable (by
the definition of \textquotedblleft summable\textquotedblright).}, and
therefore the sum $\sum_{j\in J}\mathbf{a}_{i,j}$ is well-defined. Moreover,
the family $\left(  \sum_{j\in J}\mathbf{a}_{i,j}\right)  _{i\in I}$ of FPSs
is summable\footnote{\textit{Proof.} For each $n\in\mathbb{N}$, only finitely
many $i\in I$ satisfy $\sum_{j\in J}\left[  x^{n}\right]  \left(
\mathbf{a}_{i,j}\right)  \neq0$ (as we have proven above). In other words, for
each $n\in\mathbb{N}$, only finitely many $i\in I$ satisfy $\left[
x^{n}\right]  \left(  \sum_{j\in J}\mathbf{a}_{i,j}\right)  \neq0$ (since
$\left[  x^{n}\right]  \left(  \sum_{j\in J}\mathbf{a}_{i,j}\right)
=\sum_{j\in J}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  $). In
other words, the family $\left(  \sum_{j\in J}\mathbf{a}_{i,j}\right)  _{i\in
I}$ of FPSs is summable (by the definition of \textquotedblleft
summable\textquotedblright).}. Hence, the sum $\sum_{i\in I}\sum_{j\in
J}\mathbf{a}_{i,j}$ is well-defined. Finally, recall that the sum of a
summable family of FPSs is defined entrywise; thus, for each $n\in\mathbb{N}$,
we have%
\begin{align*}
\left[  x^{n}\right]  \left(  \sum_{i\in I}\sum_{j\in J}\mathbf{a}%
_{i,j}\right)   &  =\sum_{i\in I}\underbrace{\left[  x^{n}\right]  \left(
\sum_{j\in J}\mathbf{a}_{i,j}\right)  }_{=\sum_{j\in J}\left[  x^{n}\right]
\left(  \mathbf{a}_{i,j}\right)  }=\sum_{i\in I}\sum_{j\in J}\left[
x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)  =\sum_{\left(  i,j\right)  \in
I\times J}\left[  x^{n}\right]  \left(  \mathbf{a}_{i,j}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.pol.summable.rules.fubini-full.left-at})}\right) \\
&  =\left[  x^{n}\right]  \left(  \sum_{\left(  i,j\right)  \in I\times
J}\mathbf{a}_{i,j}\right)  .
\end{align*}
In other words, each entry of the FPS $\sum_{i\in I}\sum_{j\in J}%
\mathbf{a}_{i,j}$ equals the corresponding entry of the FPS $\sum_{\left(
i,j\right)  \in I\times J}\mathbf{a}_{i,j}$. Thus, these two FPSs are
identical. In other words, $\sum_{i\in I}\sum_{j\in J}\mathbf{a}_{i,j}%
=\sum_{\left(  i,j\right)  \in I\times J}\mathbf{a}_{i,j}$. This proves the
first equality sign of (\ref{eq.prop.pol.summable.rules.fubini-full}). The
second equality sign of (\ref{eq.prop.pol.summable.rules.fubini-full}) is
proven similarly (but with the roles of $I$ and $J$ interchanged).
\end{fineprint}
\end{proof}

We shall use standard notations for infinite sums over certain subsets of
$\mathbb{Z}$. For instance, the summation sign \textquotedblleft$\sum
_{i=0}^{\infty}$\textquotedblright\ shall mean \textquotedblleft$\sum
_{i\in\mathbb{N}}$\textquotedblright; more generally, if $a\in\mathbb{Z}$,
then the summation sign \textquotedblleft$\sum_{i=a}^{\infty}$%
\textquotedblright\ shall mean \textquotedblleft$\sum_{i\in\left\{
a,a+1,a+2,\ldots\right\}  }$\textquotedblright. Also, the summation sign
\textquotedblleft$\sum_{i>0}$\textquotedblright\ shall mean \textquotedblleft%
$\sum_{i=1}^{\infty}$\textquotedblright, which is the same as
\textquotedblleft$\sum_{i\in\left\{  1,2,3,\ldots\right\}  }$%
\textquotedblright.

\begin{definition}
\label{def.pol.x}We let $x$ denote the FPS $\left(
0,1,\underbrace{0,0,0,0,\ldots}_{\text{zeroes}}\right)  $.
\end{definition}

Thus, we have%
\begin{align}
\left[  x^{1}\right]  x  &  =1,\ \ \ \ \ \ \ \ \ \ \text{and}%
\label{eq.pol.fps-x.0-1}\\
\left[  x^{n}\right]  x  &  =0\ \ \ \ \ \ \ \ \ \ \text{for all }%
n\in\mathbb{N}\text{ satisfying }n\neq1. \label{eq.pol.fps-x.0-2}%
\end{align}
In other words, for all $n\in\mathbb{N}$, we have%
\begin{align}
\left[  x^{n}\right]  x  &  =%
\begin{cases}
1, & \text{if }n=1;\\
0, & \text{if }n\neq1
\end{cases}
\label{eq.pol.fps-x.1}\\
&  =\underbrace{%
\begin{cases}
1, & \text{if }n=1;\\
0, & \text{if }n\neq1
\end{cases}
}_{=\left[  n=1\right]  }\cdot1_{\mathbb{K}}=\left[  n=1\right]
\cdot1_{\mathbb{K}} \label{eq.pol.fps-x.2}%
\end{align}
(using the Iverson bracket notation).

\begin{lemma}
\label{lem.pol.x-shift}Let $\left(  a_{0},a_{1},a_{2},\ldots\right)
\in\mathbb{K}\left[  \left[  x\right]  \right]  $ be an FPS. Then,%
\[
x\left(  a_{0},a_{1},a_{2},\ldots\right)  =\left(  0,a_{0},a_{1},a_{2}%
,\ldots\right)  .
\]

\end{lemma}

In other words, Lemma \ref{lem.pol.x-shift} says that multiplying an FPS by
$x$ shifts all entries of the FPS to the right by $1$ step, while filling the
now-empty $0$-th slot with a $0$.

\begin{proof}
[Proof of Lemma \ref{lem.pol.x-shift}.]We have $x=\left(
0,1,\underbrace{0,0,0,0,\ldots}_{\text{zeroes}}\right)  $ and therefore%
\[
x\left(  a_{0},a_{1},a_{2},\ldots\right)  =\left(
0,1,\underbrace{0,0,0,0,\ldots}_{\text{zeroes}}\right)  \left(  a_{0}%
,a_{1},a_{2},\ldots\right)  =\left(  0,a_{0},a_{1},a_{2},\ldots\right)  ,
\]
where the last equality sign can easily be obtained from the definition of the
multiplication on $\mathbb{K}\left[  \left[  x\right]  \right]  $.

Here is a more rigorous way of writing down this argument: Applying
(\ref{eq.pol.fps-x.0-2}) to $n=0$, we find $\left[  x^{0}\right]  x=0$ (since
$0\neq1$). Applying (\ref{eq.pol.fps-mul.1}) to $n=0$, $\mathbf{a}=x$ and
$\mathbf{b}=\left(  a_{0},a_{1},a_{2},\ldots\right)  $, we obtain%
\begin{align*}
\left[  x^{0}\right]  \left(  x\left(  a_{0},a_{1},a_{2},\ldots\right)
\right)   &  =\sum_{i=0}^{0}\left(  \left[  x^{i}\right]  x\right)
\cdot\left(  \left[  x^{0-i}\right]  \left(  a_{0},a_{1},a_{2},\ldots\right)
\right) \\
&  =\underbrace{\left(  \left[  x^{0}\right]  x\right)  }_{=0}\cdot\left(
\left[  x^{0-0}\right]  \left(  a_{0},a_{1},a_{2},\ldots\right)  \right)  =0.
\end{align*}
In other words, the first entry of the sequence $x\left(  a_{0},a_{1}%
,a_{2},\ldots\right)  $ is $0$. Moreover, if $n$ is a positive integer, then
(\ref{eq.pol.fps-mul.1}) (applied to $\mathbf{a}=x$ and $\mathbf{b}=\left(
a_{0},a_{1},a_{2},\ldots\right)  $) yields%
\begin{align*}
&  \left[  x^{n}\right]  \left(  x\left(  a_{0},a_{1},a_{2},\ldots\right)
\right) \\
&  =\sum_{i=0}^{n}\left(  \left[  x^{i}\right]  x\right)  \cdot
\underbrace{\left(  \left[  x^{n-i}\right]  \left(  a_{0},a_{1},a_{2}%
,\ldots\right)  \right)  }_{\substack{=a_{n-i}\\\text{(by the definition of
}\left[  x^{n-i}\right]  \mathbf{a}\text{ for }\mathbf{a}\in\mathbb{K}\left[
\left[  x\right]  \right]  \text{)}}}=\sum_{i=0}^{n}\left(  \left[
x^{i}\right]  x\right)  \cdot a_{n-i}\\
&  =\underbrace{\left(  \left[  x^{1}\right]  x\right)  }%
_{\substack{=1\\\text{(by (\ref{eq.pol.fps-x.0-1}))}}}\cdot a_{n-1}%
+\sum_{\substack{i\in\left\{  0,1,\ldots,n\right\}  ;\\i\neq1}%
}\underbrace{\left(  \left[  x^{i}\right]  x\right)  }%
_{\substack{=0\\\text{(by (\ref{eq.pol.fps-x.0-2}) (applied}\\\text{to
}i\text{ instead of }n\text{), since }i\neq1\text{)}}}\cdot a_{n-i}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split off the addend for }i=1\\
\text{from the sum, since }1\in\left\{  0,1,\ldots,n\right\}
\end{array}
\right) \\
&  =a_{n-1}+\underbrace{\sum_{\substack{i\in\left\{  0,1,\ldots,n\right\}
;\\i\neq1}}0\cdot a_{n-i}}_{=0}=a_{n-1}.
\end{align*}
In other words, the entries of the sequence $x\left(  a_{0},a_{1},a_{2}%
,\ldots\right)  $ after the first entry are $a_{0},a_{1},a_{2},\ldots$. Since
we already know that the first entry of this sequence is $0$, we thus conclude
that%
\[
x\left(  a_{0},a_{1},a_{2},\ldots\right)  =\left(  0,a_{0},a_{1},a_{2}%
,\ldots\right)  .
\]
Thus, Lemma \ref{lem.pol.x-shift} is proven.
\end{proof}

\begin{proposition}
\label{prop.pol.xk}For each $k\in\mathbb{N}$, we have%
\[
x^{k}=\left(  \underbrace{0,0,\ldots,0}_{k\text{ zeroes}}%
,1,\underbrace{0,0,0,0,\ldots}_{\text{zeroes}}\right)  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.pol.xk}.]Induction on $k$. The induction base
follows by observing that $x^{0}=1_{\mathbb{K}\left[  \left[  x\right]
\right]  }=\underline{1}=\left(  1,0,0,0,\ldots\right)  $.

The induction step uses Lemma \ref{lem.pol.x-shift} and the equality
$x^{k}=xx^{k-1}$ (which holds for all $k>0$).
\end{proof}

Proposition \ref{prop.pol.xk} can be restated as follows:%
\begin{equation}
\left[  x^{n}\right]  \left(  x^{k}\right)  =%
\begin{cases}
1, & \text{if }n=k;\\
0, & \text{if }n\neq k
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for all }n,k\in\mathbb{N}.
\label{eq.prop.pol.xk.rest}%
\end{equation}


\begin{corollary}
\label{cor.pol.FPS-as-sum}Let $\left(  a_{0},a_{1},a_{2},\ldots\right)
\in\mathbb{K}\left[  \left[  x\right]  \right]  $ be any FPS. Then, the family
$\left(  a_{k}x^{k}\right)  _{k\in\mathbb{N}}$ is summable, so that the sum
$\sum_{k\in\mathbb{N}}a_{k}x^{k}$ is well-defined. Moreover,
\[
\left(  a_{0},a_{1},a_{2},\ldots\right)  =a_{0}+a_{1}x+a_{2}x^{2}+a_{3}%
x^{3}+\cdots=\sum_{k\in\mathbb{N}}a_{k}x^{k}.
\]

\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.pol.FPS-as-sum}.]For each $k\in\mathbb{N}$, we
have%
\[
x^{k}=\left(  \underbrace{0,0,\ldots,0}_{k\text{ zeroes}}%
,1,\underbrace{0,0,0,0,\ldots}_{\text{zeroes}}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.pol.xk}}\right)
\]
and thus%
\begin{align}
a_{k}x^{k}  &  =a_{k}\left(  \underbrace{0,0,\ldots,0}_{k\text{ zeroes}%
},1,\underbrace{0,0,0,0,\ldots}_{\text{zeroes}}\right) \nonumber\\
&  =\left(  \underbrace{a_{k}\cdot0,a_{k}\cdot0,\ldots,a_{k}\cdot0}_{k\text{
times}},a_{k}\cdot1,\underbrace{a_{k}\cdot0,a_{k}\cdot0,a_{k}\cdot0,a_{k}%
\cdot0,\ldots}_{\infty\text{ times}}\right) \nonumber\\
&  =\left(  \underbrace{0,0,\ldots,0}_{k\text{ zeroes}},a_{k}%
,\underbrace{0,0,0,0,\ldots}_{\text{zeroes}}\right)
\label{pf.cor.pol.FPS-as-sum.akxk=}%
\end{align}
(since $a_{k}\cdot0=0$ and $a_{k}\cdot1=a_{k}$). Hence, for any $k\in
\mathbb{N}$ and $n\in\mathbb{N}$, we have $\left[  x^{n}\right]  \left(
a_{k}x^{k}\right)  =0$ unless $k=n$. Thus, for each $n\in\mathbb{N}$, only
finitely many $k\in\mathbb{N}$ satisfy $\left[  x^{n}\right]  \left(
a_{k}x^{k}\right)  \neq0$ (namely, only $k=n$ can satisfy this). In other
words, the family $\left(  a_{k}x^{k}\right)  _{k\in\mathbb{N}}$ is summable
(by the definition of \textquotedblleft summable\textquotedblright). Hence,
the sum $\sum_{k\in\mathbb{N}}a_{k}x^{k}$ is well-defined. Let us now compute
this sum:
\begin{align*}
&  \sum_{k\in\mathbb{N}}\underbrace{a_{k}x^{k}}_{\substack{=\left(
\underbrace{0,0,\ldots,0}_{k\text{ zeroes}},a_{k},\underbrace{0,0,0,0,\ldots
}_{\text{zeroes}}\right)  \\\text{(by (\ref{pf.cor.pol.FPS-as-sum.akxk=}))}%
}}\\
=  &  \sum_{k\in\mathbb{N}}\left(  \underbrace{0,0,\ldots,0}_{k\text{ zeroes}%
},a_{k},\underbrace{0,0,0,0,\ldots}_{\text{zeroes}}\right) \\
=  &  \left(  a_{0},0,0,0,0,\ldots\right) \\
+  &  \left(  0,a_{1},0,0,0,\ldots\right) \\
+  &  \left(  0,0,a_{2},0,0,\ldots\right) \\
+  &  \left(  0,0,0,a_{3},0,\ldots\right) \\
+  &  \cdots\\
=  &  \left(  a_{0},a_{1},a_{2},a_{3},\ldots\right)
\end{align*}
(since addition of FPSs is entrywise). Therefore,%
\begin{align*}
\left(  a_{0},a_{1},a_{2},\ldots\right)   &  =\sum_{k\in\mathbb{N}}a_{k}%
x^{k}=a_{0}x^{0}+a_{1}x^{1}+a_{2}x^{2}+a_{3}x^{3}+\cdots\\
&  =a_{0}+a_{1}x+a_{2}x^{2}+a_{3}x^{3}+\cdots
\end{align*}
(since $a_{0}\underbrace{x^{0}}_{=1}=a_{0}$ and $a_{1}\underbrace{x^{1}}%
_{=x}=a_{1}x$). Combining these, we conclude that Corollary
\ref{cor.pol.FPS-as-sum} holds.
\end{proof}

So now we are justified in computing \textquotedblleft
formally\textquotedblright\ with FPSs as if they were infinite sums of powers
of $x$ times scalars, because we have now constructed a ring with an actual
element $x$ in it and we have shown that these infinite sums are well-defined
and just encode the sequences of their coefficients. This is the rigorous
answer to the question \textquotedblleft what is an indeterminate in a
polynomial or FPS\textquotedblright. This also explains why we refer to the
entries of an FPS $\left(  a_{0},a_{1},a_{2},\ldots\right)  $ as its
\textquotedblleft coefficients\textquotedblright.

\begin{exercise}
\label{exe.pol.coeff-shift}Let $\mathbf{b}\in\mathbb{K}\left[  \left[
x\right]  \right]  $ and $u,v\in\mathbb{N}$. Prove the following:

\textbf{(a)} If $u\geq v$, then $\left[  x^{u}\right]  \left(  x^{v}%
\mathbf{b}\right)  =\left[  x^{u-v}\right]  \mathbf{b}$.

\textbf{(b)} If $u<v$, then $\left[  x^{u}\right]  \left(  x^{v}%
\mathbf{b}\right)  =0$.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.pol.coeff-shift}.]\textbf{(a)} Assume that
$u\geq v$. Then, $v\leq u$, so that $v\in\left\{  0,1,\ldots,u\right\}  $
(since $v\in\mathbb{N}$). Now, (\ref{eq.pol.fps-mul.1}) (applied to $n=u$ and
$\mathbf{a}=x^{v}$) yields%
\begin{align*}
\left[  x^{u}\right]  \left(  x^{v}\mathbf{b}\right)   &  =\sum_{i=0}%
^{u}\underbrace{\left(  \left[  x^{i}\right]  \left(  x^{v}\right)  \right)
}_{\substack{=%
\begin{cases}
1, & \text{if }i=v;\\
0, & \text{if }i\neq v
\end{cases}
\\\text{(by (\ref{eq.prop.pol.xk.rest}), applied to }n=i\text{ and
}k=v\text{)}}}\cdot\left(  \left[  x^{u-i}\right]  \mathbf{b}\right)
=\sum_{i=0}^{u}%
\begin{cases}
1, & \text{if }i=v;\\
0, & \text{if }i\neq v
\end{cases}
\cdot\left(  \left[  x^{u-i}\right]  \mathbf{b}\right) \\
&  =\underbrace{%
\begin{cases}
1, & \text{if }v=v;\\
0, & \text{if }v\neq v
\end{cases}
}_{\substack{=1\\\text{(since }v=v\text{)}}}\cdot\left(  \left[
x^{u-v}\right]  \mathbf{b}\right)  +\sum_{\substack{i\in\left\{
0,1,\ldots,u\right\}  ;\\i\neq v}}\underbrace{%
\begin{cases}
1, & \text{if }i=v;\\
0, & \text{if }i\neq v
\end{cases}
}_{\substack{=0\\\text{(since }i\neq v\text{)}}}\cdot\left(  \left[
x^{u-i}\right]  \mathbf{b}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split off the addend for }i=v\text{ from the sum,}\\
\text{since }v\in\left\{  0,1,\ldots,u\right\}
\end{array}
\right) \\
&  =\left[  x^{u-v}\right]  \mathbf{b}+\underbrace{\sum_{\substack{i\in
\left\{  0,1,\ldots,u\right\}  ;\\i\neq v}}0\cdot\left(  \left[
x^{u-i}\right]  \mathbf{b}\right)  }_{=0}=\left[  x^{u-v}\right]  \mathbf{b}.
\end{align*}
This solves Exercise \ref{exe.pol.coeff-shift} \textbf{(a)}.

\textbf{(b)} Assume that $u<v$. Then, each $i\in\left\{  0,1,\ldots,u\right\}
$ satisfies $i\neq v$ (since each $i\in\left\{  0,1,\ldots,u\right\}  $
satisfies $i\leq u<v$ and thus $i\neq v$) and therefore%
\begin{equation}%
\begin{cases}
1, & \text{if }i=v;\\
0, & \text{if }i\neq v
\end{cases}
=0. \label{sol.pol.coeff-shift.b.1}%
\end{equation}
Now, (\ref{eq.pol.fps-mul.1}) (applied to $n=u$ and $\mathbf{a}=x^{v}$) yields%
\begin{align*}
\left[  x^{u}\right]  \left(  x^{v}\mathbf{b}\right)   &  =\sum_{i=0}%
^{u}\underbrace{\left(  \left[  x^{i}\right]  \left(  x^{v}\right)  \right)
}_{\substack{=%
\begin{cases}
1, & \text{if }i=v;\\
0, & \text{if }i\neq v
\end{cases}
\\\text{(by (\ref{eq.prop.pol.xk.rest}), applied to }n=i\text{ and
}k=v\text{)}}}\cdot\left(  \left[  x^{u-i}\right]  \mathbf{b}\right)
=\sum_{i=0}^{u}\underbrace{%
\begin{cases}
1, & \text{if }i=v;\\
0, & \text{if }i\neq v
\end{cases}
}_{\substack{=0\\\text{(by (\ref{sol.pol.coeff-shift.b.1}))}}}\cdot\left(
\left[  x^{u-i}\right]  \mathbf{b}\right) \\
&  =\sum_{i=0}^{u}0\cdot\left(  \left[  x^{u-i}\right]  \mathbf{b}\right)  =0.
\end{align*}
This solves Exercise \ref{exe.pol.coeff-shift} \textbf{(b)}.
\end{proof}
\end{fineprint}

\begin{teachingnote}
\textbf{2019-04-24 lecture}
\end{teachingnote}

\subsection{\label{sect.FPS.inv}Inverses in the ring $\mathbb{K}\left[
\left[  x\right]  \right]  $}

\subsubsection{\label{subsect.FPS.inv.crit}The invertibility criterion for
power series}

The equation (\ref{eq.pol.FPS.ex5}) is not just an example of multiplying two
FPSs. It is also an example of a multiplicative inverse in the ring
$\mathbb{K}\left[  \left[  x\right]  \right]  $. Indeed, we can rewrite it as%
\[
\left(  1-x\right)  \cdot\left(  1+x+x^{2}+x^{3}+\cdots\right)  =\underline{1}%
\]
(since $\left(  1,-1,\underbrace{0,0,0,\ldots}_{\text{zeroes}}\right)  =1-x$
and $\left(  1,1,1,1,1,\ldots\right)  =1+x+x^{2}+x^{3}+\cdots$). Since the
ring $\mathbb{K}\left[  \left[  x\right]  \right]  $ is commutative, we also
have $\left(  1-x\right)  \cdot\left(  1+x+x^{2}+x^{3}+\cdots\right)  =\left(
1+x+x^{2}+x^{3}+\cdots\right)  \cdot\left(  1-x\right)  $. Thus,%
\[
\left(  1-x\right)  \cdot\left(  1+x+x^{2}+x^{3}+\cdots\right)  =\left(
1+x+x^{2}+x^{3}+\cdots\right)  \cdot\left(  1-x\right)  =\underline{1}.
\]
Since $\underline{1}$ is the unity $1_{\mathbb{K}\left[  \left[  x\right]
\right]  }$ of the ring $\mathbb{K}\left[  \left[  x\right]  \right]  $, we
thus conclude that the FPS $1+x+x^{2}+x^{3}+\cdots$ is a multiplicative
inverse of $1-x$. Thus, the FPS $1-x$ is invertible, and its multiplicative
inverse is%
\[
\dfrac{1}{1-x}=1+x+x^{2}+x^{3}+\cdots.
\]
This, of course, looks exactly like the well-known geometric series formula
from analysis, which states that $\dfrac{1}{1-r}=1+r+r^{2}+r^{3}+\cdots$ for
each real $r\in\left(  -1,1\right)  $. But keep in mind that our $x$ is an
indeterminate over an arbitrary commutative ring, while the $r$ in the latter
formula is a real number between $-1$ and $1$; there are ways to transfer
identities between these two worlds, but they are not a-priori the same.

Thus we have seen that $1-x$ is an invertible FPS. Let us ask a more general
question: When is an FPS invertible? Quite often, as it turns out:

\begin{theorem}
\label{thm.pol.FPS-inv}Let $\mathbf{a}\in\mathbb{K}\left[  \left[  x\right]
\right]  $. Then, $\mathbf{a}$ is invertible (in the ring $\mathbb{K}\left[
\left[  x\right]  \right]  $) if and only if the coefficient $\left[
x^{0}\right]  \mathbf{a}$ is invertible in $\mathbb{K}$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.pol.FPS-inv}.]$\Longrightarrow:$ Assume that
$\mathbf{a}$ is invertible (in the ring $\mathbb{K}\left[  \left[  x\right]
\right]  $). We must prove that the coefficient $\left[  x^{0}\right]
\mathbf{a}$ is invertible in $\mathbb{K}$.

The FPS $\mathbf{a}^{-1}$ is well-defined (since $\mathbf{a}$ is invertible)
and satisfies $\mathbf{aa}^{-1}=1_{\mathbb{K}\left[  \left[  x\right]
\right]  }=\underline{1}$. But (\ref{eq.pol.fps-mul.x0ab}) (applied to
$\mathbf{b}=\mathbf{a}^{-1}$) yields%
\[
\left[  x^{0}\right]  \left(  \mathbf{aa}^{-1}\right)  =\left(  \left[
x^{0}\right]  \mathbf{a}\right)  \cdot\left(  \left[  x^{0}\right]  \left(
\mathbf{a}^{-1}\right)  \right)  .
\]
Hence,%
\[
\left(  \left[  x^{0}\right]  \mathbf{a}\right)  \cdot\left(  \left[
x^{0}\right]  \left(  \mathbf{a}^{-1}\right)  \right)  =\left[  x^{0}\right]
\left(  \underbrace{\mathbf{aa}^{-1}}_{=\underline{1}}\right)  =\left[
x^{0}\right]  \underline{1}=1.
\]
Thus, the element $\left[  x^{0}\right]  \left(  \mathbf{a}^{-1}\right)  $ of
$\mathbb{K}$ is a multiplicative inverse of $\left[  x^{0}\right]  \mathbf{a}$
(since $\mathbb{K}$ is commutative, so we only need to check the product in
one order). Therefore, the element $\left[  x^{0}\right]  \mathbf{a}$ of
$\mathbb{K}$ has a multiplicative inverse, i.e., is invertible. This proves
the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction of Theorem
\ref{thm.pol.FPS-inv}.

$\Longleftarrow:$ Assume that the coefficient $\left[  x^{0}\right]
\mathbf{a}$ is invertible in $\mathbb{K}$. We must prove that $\mathbf{a}$ is
invertible (in the ring $\mathbb{K}\left[  \left[  x\right]  \right]  $).

Write the FPS $\mathbf{a}$ in the form $\mathbf{a}=\left(  a_{0},a_{1}%
,a_{2},\ldots\right)  $ with $a_{0},a_{1},a_{2},\ldots\in\mathbb{K}$. Then,
the definition of $\left[  x^{0}\right]  \mathbf{a}$ yields $\left[
x^{0}\right]  \mathbf{a}=a_{0}$. Hence, $a_{0}$ is invertible in $\mathbb{K}$
(since $\left[  x^{0}\right]  \mathbf{a}$ is invertible in $\mathbb{K}$).
Thus, we can divide elements of $\mathbb{K}$ by $a_{0}$.

Now, we want to find a multiplicative inverse $\mathbf{b}$ of $\mathbf{a}$ in
$\mathbb{K}\left[  \left[  x\right]  \right]  $.

Let $\mathbf{b}=\left(  b_{0},b_{1},b_{2},\ldots\right)  \in\mathbb{K}\left[
\left[  x\right]  \right]  $. We want to see when $\mathbf{b}$ is a
multiplicative inverse of $\mathbf{a}$.

From $\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)  $ and $\mathbf{b}%
=\left(  b_{0},b_{1},b_{2},\ldots\right)  $, we obtain%
\begin{align}
\mathbf{ab}  &  =\left(  a_{0},a_{1},a_{2},\ldots\right)  \left(  b_{0}%
,b_{1},b_{2},\ldots\right) \nonumber\\
&  =\left(  a_{0}b_{0},\ \ \ a_{0}b_{1}+a_{1}b_{0},\ \ \ a_{0}b_{2}+a_{1}%
b_{1}+a_{2}b_{0},\ \ \ a_{0}b_{3}+a_{1}b_{2}+a_{2}b_{1}+a_{3}b_{0}%
,\ \ \ \ldots\right)  \label{pf.thm.pol.FPS-inv.denn.1}%
\end{align}
(by the definition of the product of two FPSs). On the other hand, the
definition of $\underline{1}$ yields%
\begin{equation}
\underline{1}=\left(  1,0,0,0,0,\ldots\right)  .
\label{pf.thm.pol.FPS-inv.denn.2}%
\end{equation}


Now, by the definition of a multiplicative inverse, we have the following
chain of logical equivalences:%
\begin{align}
&  \ \left(  \mathbf{b}\text{ is a multiplicative inverse of }\mathbf{a}%
\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \mathbf{ab}=\mathbf{ba}=1_{\mathbb{K}\left[
\left[  x\right]  \right]  }\right)  \ \Longleftrightarrow\ \left(
\mathbf{ab}=\mathbf{ba}=\underline{1}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }1_{\mathbb{K}\left[  \left[  x\right]  \right]  }=\underline{1}%
\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \mathbf{ab}=\underline{1}\right)
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }\mathbf{ab}=\mathbf{ba}\text{ holds automatically}\\
\text{(because }\mathbb{K}\left[  \left[  x\right]  \right]  \text{ is
commutative)}%
\end{array}
\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \left(  a_{0}b_{0},\ \ \ a_{0}b_{1}+a_{1}%
b_{0},\ \ \ a_{0}b_{2}+a_{1}b_{1}+a_{2}b_{0},\ \ \ a_{0}b_{3}+a_{1}b_{2}%
+a_{2}b_{1}+a_{3}b_{0},\ \ \ \ldots\right)  \right. \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left.  =\left(  1,0,0,0,0,\ldots
\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.pol.FPS-inv.denn.1}) and (\ref{pf.thm.pol.FPS-inv.denn.2}%
)}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \left\{
\begin{array}
[c]{l}%
a_{0}b_{0}=1;\\
a_{0}b_{1}+a_{1}b_{0}=0;\\
a_{0}b_{2}+a_{1}b_{1}+a_{2}b_{0}=0;\\
a_{0}b_{3}+a_{1}b_{2}+a_{2}b_{1}+a_{3}b_{0}=0;\\
\ldots\ldots\ldots\ldots
\end{array}
\right.  \right)  . \label{pf.thm.pol.FPS-inv.denn.equivalence}%
\end{align}
But if we treat the coefficients $b_{0},b_{1},b_{2},\ldots$ as
unknowns\footnote{while $a_{0},a_{1},a_{2},\ldots$, of course, remain givens},
then the statement%
\begin{equation}
\left\{
\begin{array}
[c]{l}%
a_{0}b_{0}=1;\\
a_{0}b_{1}+a_{1}b_{0}=0;\\
a_{0}b_{2}+a_{1}b_{1}+a_{2}b_{0}=0;\\
a_{0}b_{3}+a_{1}b_{2}+a_{2}b_{1}+a_{3}b_{0}=0;\\
\ldots\ldots\ldots\ldots
\end{array}
\right.  \label{pf.thm.pol.FPS-inv.denn.linsys}%
\end{equation}
is a system of infinitely many linear equations in these unknowns, and this
system can be solved recursively by elimination (thanks to the fact that
$a_{0}$ is invertible!) as follows:

\begin{itemize}
\item First, solve the first equation $a_{0}b_{0}=1$ for $b_{0}$, thus
obtaining a unique value of $b_{0}$ (namely, $a_{0}^{-1}$).

\item Next, solve the second equation $a_{0}b_{1}+a_{1}b_{0}=0$ for $b_{1}$,
thus obtaining a unique value of $b_{1}$ (namely, $-a_{0}^{-1}\left(
a_{1}b_{0}\right)  $).

\item Next, solve the third equation $a_{0}b_{2}+a_{1}b_{1}+a_{2}b_{0}=0$ for
$b_{2}$, thus obtaining a unique value of $b_{2}$ (namely, $-a_{0}^{-1}\left(
a_{1}b_{1}+a_{2}b_{0}\right)  $).

\item And so on, obtaining a value for each of $b_{0},b_{1},b_{2},\ldots$ eventually.
\end{itemize}

\noindent We thus have found a sequence $\left(  b_{0},b_{1},b_{2}%
,\ldots\right)  $ of elements of $\mathbb{K}$ satisfying the statement
(\ref{pf.thm.pol.FPS-inv.denn.linsys}). Now, define the FPS $\mathbf{b}$ to be
this sequence. Then, the statement (\ref{pf.thm.pol.FPS-inv.denn.linsys})
holds. In other words, $\mathbf{b}$ is a multiplicative inverse of
$\mathbf{a}$ (because of the equivalence
(\ref{pf.thm.pol.FPS-inv.denn.equivalence})). Thus, the FPS $\mathbf{a}$ has a
multiplicative inverse (namely, $\mathbf{b}$). In other words, $\mathbf{a}$ is
invertible (in the ring $\mathbb{K}\left[  \left[  x\right]  \right]  $). This
proves the \textquotedblleft$\Longleftarrow$\textquotedblright\ direction of
Theorem \ref{thm.pol.FPS-inv}.
\end{proof}

\subsubsection{Newton's binomial formula}

In Definition \ref{def.CC.CC.power-}, we have defined negative powers (i.e.,
powers of the form $\alpha^{n}$ with $n$ being a negative integer) of any
nonzero complex number $\alpha$. All that we needed from $\alpha$ in that
definition was that $\alpha$ has a multiplicative inverse $\alpha^{-1}$. Thus,
we can straightforwardly extend this definition to any invertible element
$\alpha$ of any ring:

\begin{definition}
\label{def.ring.power-}Let $\mathbb{L}$ be a ring. Let $\alpha\in\mathbb{L}$
be invertible. For any negative $n\in\mathbb{Z}$, we define an element
$\alpha^{n}\in\mathbb{L}$ (called the $n$\textit{-th power of }$\alpha$) by
$\alpha^{n}=\left(  \alpha^{-1}\right)  ^{-n}$. (This is well-defined, since
$\left(  \alpha^{-1}\right)  ^{-n}$ is already defined by Definition
\ref{def.rings.pow} (because $n$ is negative and thus $-n\in\mathbb{N}$).)
\end{definition}

When the ring $\mathbb{L}$ is commutative, the powers of its elements satisfy
the same rules as the powers of complex numbers (see Proposition
\ref{prop.CC.CC.power-rules}), except that we have to replace
\textquotedblleft nonzero\textquotedblright\ by \textquotedblleft
invertible\textquotedblright\ (since negative powers are defined only for
invertible elements of $\mathbb{L}$). For example, if $\mathbb{L}$ is a
commutative ring, then%
\[
\left(  \alpha\beta\right)  ^{n}=\alpha^{n}\beta^{n}%
\ \ \ \ \ \ \ \ \ \ \text{for all invertible }\alpha,\beta\in\mathbb{L}\text{
and all }n\in\mathbb{Z}.
\]


We can apply this to $\mathbb{L}=\mathbb{K}\left[  \left[  x\right]  \right]
$ (which is a commutative ring). Recall that the FPS $1-x$ is invertible, and
its multiplicative inverse is
\[
\dfrac{1}{1-x}=1+x+x^{2}+x^{3}+\cdots=\sum_{k\in\mathbb{N}}x^{k}.
\]
A similar argument shows that the FPS $1+x$ is invertible, and its
multiplicative inverse is
\[
\dfrac{1}{1+x}=1-x+x^{2}-x^{3}\pm\cdots=\sum_{k\in\mathbb{N}}\left(
-1\right)  ^{k}x^{k}.
\]
Thus, negative powers of $1+x$ are well-defined. We can explicitly compute not
just the multiplicative inverse of $1+x$ (as we just did), but also all powers
of $1+x$. As far as the nonnegative powers are concerned (that is, $\left(
1+x\right)  ^{u}$ for $u\in\mathbb{N}$), this can easily be done by the
binomial formula, and the result can be written either as $\sum_{k=0}%
^{u}\dbinom{u}{k}x^{k}$ or as the infinite sum $\sum_{k\in\mathbb{N}}%
\dbinom{u}{k}x^{k}$. (The second sum differs from the first sum only in the
presence of addends for $k>u$; but all these addends are $0$, and thus do not
actually affect the sum.) Interestingly, however, the formula%
\[
\left(  1+x\right)  ^{u}=\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}%
\]
is also valid for negative integers $u$ -- even though there is no binomial
formula for negative exponents any more! This result is called
\textit{Newton's (generalized) binomial theorem for integers}; let us state it
as follows:

\begin{theorem}
\label{thm.pol.binom-newton}\textbf{(a)} The FPS $1+x$ is invertible (in
$\mathbb{K}\left[  \left[  x\right]  \right]  $). Thus, $\left(  1+x\right)
^{u}$ is defined for each $u\in\mathbb{Z}$ (by Definition
\ref{def.ring.power-}).

\textbf{(b)} In the ring $\mathbb{K}\left[  \left[  x\right]  \right]  $, we
have%
\[
\left(  1+x\right)  ^{u}=\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}%
\ \ \ \ \ \ \ \ \ \ \text{for each }u\in\mathbb{Z}.
\]
In particular, the sum $\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}$ is
well-defined (i.e., the family $\left(  \dbinom{u}{k}x^{k}\right)
_{k\in\mathbb{N}}$ is summable) for each $u\in\mathbb{Z}$.
\end{theorem}

To prove this, we begin by showing a simple corollary of the binomial formula:

\begin{lemma}
\label{lem.binom.psgu}Let $u\in\mathbb{N}$. Let $\mathbb{K}$ be any ring, and
let $a\in\mathbb{K}$. Then,
\[
\left(  1+a\right)  ^{u}=\sum_{k\in\mathbb{N}}\dbinom{u}{k}a^{k}.
\]
(Here, the sum $\sum_{k\in\mathbb{N}}\dbinom{u}{k}a^{k}$ is well-defined,
since it has only finitely many nonzero addends.)
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.psgu}.]For each $k\in\left\{
u+1,u+2,u+3,\ldots\right\}  $, we have $k\geq u+1>u$ and thus%
\begin{equation}
\dbinom{u}{k}=0 \label{pf.lem.binom.psgu.1}%
\end{equation}
(by Theorem \ref{thm.binom.k>n0}, applied to $n=u$). Hence, all of the addends
of the sum $\sum_{k\in\mathbb{N}}\dbinom{u}{k}a^{k}$ with $k\geq u+1$ are $0$.
Therefore, this sum has only finitely many nonzero addends, and thus is well-defined.

Now, $a\cdot1=a=1\cdot a$. Hence, (\ref{eq.prop.rings.pow.rules.c.binom})
(applied to $b=1$ and $n=u$) yields
\[
\left(  a+1\right)  ^{u}=\sum_{k=0}^{u}\dbinom{u}{k}a^{k}\underbrace{1^{u-k}%
}_{=1}=\sum_{k=0}^{u}\dbinom{u}{k}a^{k}.
\]
Thus,%
\[
\left(  \underbrace{1+a}_{=a+1}\right)  ^{u}=\left(  a+1\right)  ^{u}%
=\sum_{k=0}^{u}\dbinom{u}{k}a^{k}.
\]
Comparing this with%
\[
\sum_{k\in\mathbb{N}}\dbinom{u}{k}a^{k}=\sum_{k=0}^{u}\dbinom{u}{k}a^{k}%
+\sum_{k=u+1}^{\infty}\underbrace{\dbinom{u}{k}}_{\substack{=0\\\text{(by
(\ref{pf.lem.binom.psgu.1}))}}}a^{k}=\sum_{k=0}^{u}\dbinom{u}{k}%
a^{k}+\underbrace{\sum_{k=u+1}^{\infty}0a^{k}}_{=0}=\sum_{k=0}^{u}\dbinom
{u}{k}a^{k},
\]
we obtain $\left(  1+a\right)  ^{u}=\sum_{k\in\mathbb{N}}\dbinom{u}{k}a^{k}$.
This proves Lemma \ref{lem.binom.psgu}.
\end{proof}

Lemma \ref{lem.binom.psgu} easily implies that Theorem
\ref{thm.pol.binom-newton} \textbf{(b)} holds for $u\in\mathbb{N}$; but
proving Theorem \ref{thm.pol.binom-newton} \textbf{(b)} for negative integers
$u$ requires more work. Here is ours:

\begin{proof}
[Proof of Theorem \ref{thm.pol.binom-newton}.]Let $u\in\mathbb{Z}$. Define
$N_{u}$ to be the FPS%
\[
\left(  \dbinom{u}{0},\dbinom{u}{1},\dbinom{u}{2},\ldots\right)  \in
\mathbb{K}\left[  \left[  x\right]  \right]  .
\]
(To be more precise, we mean the FPS $\left(  \dbinom{u}{0}\cdot1_{\mathbb{K}%
},\dbinom{u}{1}\cdot1_{\mathbb{K}},\dbinom{u}{2}\cdot1_{\mathbb{K}}%
,\ldots\right)  $, because the binomial coefficients $\dbinom{u}{0},\dbinom
{u}{1},\dbinom{u}{2},\ldots$ by themselves are integers, not elements of
$\mathbb{K}$. But we shall abuse notation and drop the \textquotedblleft%
$\cdot1_{\mathbb{K}}$\textquotedblright; thus, if $r$ is any integer, then we
will also denote the corresponding element $r\cdot1_{\mathbb{K}}$ of
$\mathbb{K}$ by $r$, as long as it is clear from the context that we mean an
element of $\mathbb{K}$.)

Corollary \ref{cor.pol.FPS-as-sum} (applied to $a_{i}=\dbinom{u}{i}$) shows
that the family $\left(  \dbinom{u}{k}x^{k}\right)  _{k\in\mathbb{N}}$ is
summable, so that the sum $\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}$ is
well-defined, and furthermore%
\[
\left(  \dbinom{u}{0},\dbinom{u}{1},\dbinom{u}{2},\ldots\right)  =\dbinom
{u}{0}+\dbinom{u}{1}x+\dbinom{u}{2}x^{2}+\dbinom{u}{3}x^{3}+\cdots=\sum
_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}.
\]
Thus,%
\begin{equation}
N_{u}=\left(  \dbinom{u}{0},\dbinom{u}{1},\dbinom{u}{2},\ldots\right)
=\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}. \label{pf.thm.pol.binom-newton.1}%
\end{equation}


Now, forget that we fixed $u$. Thus, for each $u\in\mathbb{Z}$, we have
defined an FPS $N_{u}$ and showed that it satisfies
(\ref{pf.thm.pol.binom-newton.1}), and, in particular, the sum $\sum
_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}$ is well-defined (i.e., the family
$\left(  \dbinom{u}{k}x^{k}\right)  _{k\in\mathbb{N}}$ is summable).

Next, let us prove the following:

\begin{statement}
\textit{Claim 1:} We have $N_{n}=\left(  1+x\right)  N_{n-1}$ for each
$n\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 1:} Let $n\in\mathbb{Z}$. Then,
(\ref{pf.thm.pol.binom-newton.1}) (applied to $u=n-1$) yields $N_{n-1}%
=\sum_{k\in\mathbb{N}}\dbinom{n-1}{k}x^{k}$. Multiplying both sides of this
equality with $1+x$, we find
\begin{align}
\left(  1+x\right)  N_{n-1}  &  =\left(  1+x\right)  \sum_{k\in\mathbb{N}%
}\dbinom{n-1}{k}x^{k}\nonumber\\
&  =\sum_{k\in\mathbb{N}}\dbinom{n-1}{k}x^{k}+x\sum_{k\in\mathbb{N}}%
\dbinom{n-1}{k}x^{k}. \label{pf.thm.pol.binom-newton.3}%
\end{align}
But%
\begin{align*}
x\sum_{k\in\mathbb{N}}\dbinom{n-1}{k}x^{k}  &  =\sum_{k\in\mathbb{N}}%
\dbinom{n-1}{k}xx^{k}=\sum_{k=1}^{\infty}\dbinom{n-1}{k-1}\underbrace{xx^{k-1}%
}_{=x^{k}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }k-1\text{ for
}k\text{ in the sum}\right) \\
&  =\sum_{k=1}^{\infty}\dbinom{n-1}{k-1}x^{k}.
\end{align*}
Comparing this with%
\begin{align*}
\sum_{k\in\mathbb{N}}\dbinom{n-1}{k-1}x^{k}  &  =\underbrace{\dbinom{n-1}%
{0-1}}_{\substack{=0\\\text{(by Definition \ref{def.binom.binom}
\textbf{(b)},}\\\text{since }0-1=-1\notin\mathbb{N}\text{)}}}x^{0}+\sum
_{k=1}^{\infty}\dbinom{n-1}{k-1}x^{k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=0\text{ from the sum}\right) \\
&  =\sum_{k=1}^{\infty}\dbinom{n-1}{k-1}x^{k},
\end{align*}
we obtain%
\[
x\sum_{k\in\mathbb{N}}\dbinom{n-1}{k}x^{k}=\sum_{k\in\mathbb{N}}\dbinom
{n-1}{k-1}x^{k}.
\]
Thus, (\ref{pf.thm.pol.binom-newton.3}) becomes%
\begin{align*}
\left(  1+x\right)  N_{n-1}  &  =\sum_{k\in\mathbb{N}}\dbinom{n-1}{k}%
x^{k}+\underbrace{x\sum_{k\in\mathbb{N}}\dbinom{n-1}{k}x^{k}}_{=\sum
_{k\in\mathbb{N}}\dbinom{n-1}{k-1}x^{k}}=\sum_{k\in\mathbb{N}}\dbinom{n-1}%
{k}x^{k}+\sum_{k\in\mathbb{N}}\dbinom{n-1}{k-1}x^{k}\\
&  =\sum_{k\in\mathbb{N}}\underbrace{\left(  \dbinom{n-1}{k}+\dbinom{n-1}%
{k-1}\right)  }_{\substack{=\dbinom{n}{k}\\\text{(by Theorem
\ref{thm.binom.rec})}}}x^{k}=\sum_{k\in\mathbb{N}}\dbinom{n}{k}x^{k}.
\end{align*}
Comparing this with%
\[
N_{n}=\sum_{k\in\mathbb{N}}\dbinom{n}{k}x^{k}\ \ \ \ \ \ \ \ \ \ \left(
\text{by (\ref{pf.thm.pol.binom-newton.1}), applied to }u=n\right)  ,
\]
we obtain $N_{n}=\left(  1+x\right)  N_{n-1}$. This proves Claim 1.]

Also, (\ref{pf.thm.pol.binom-newton.1}) (applied to $u=0$) yields%
\begin{align*}
N_{0}  &  =\sum_{k\in\mathbb{N}}\dbinom{0}{k}x^{k}=\underbrace{\dbinom{0}{0}%
}_{=1}\underbrace{x^{0}}_{=1_{\mathbb{K}\left[  \left[  x\right]  \right]  }%
}+\sum_{k=1}^{\infty}\underbrace{\dbinom{0}{k}}_{\substack{=0\\\text{(by
Theorem \ref{thm.binom.k>n0}}\\\text{(applied to }n=0\text{), since
}k>0\text{)}}}x^{k}=1_{\mathbb{K}\left[  \left[  x\right]  \right]
}+\underbrace{\sum_{k=1}^{\infty}0x^{k}}_{=0}\\
&  =1_{\mathbb{K}\left[  \left[  x\right]  \right]  }.
\end{align*}
But Claim 1 (applied to $n=0$) yields $N_{0}=\left(  1+x\right)
N_{0-1}=\left(  1+x\right)  N_{-1}$. Hence, $\left(  1+x\right)  N_{-1}%
=N_{0}=1_{\mathbb{K}\left[  \left[  x\right]  \right]  }$, so that
$N_{-1}\left(  1+x\right)  =\left(  1+x\right)  N_{-1}=1_{\mathbb{K}\left[
\left[  x\right]  \right]  }$. Thus, $\left(  1+x\right)  N_{-1}=N_{-1}\left(
1+x\right)  =1_{\mathbb{K}\left[  \left[  x\right]  \right]  }$. In other
words, the FPS $N_{-1}$ is a multiplicative inverse of $1+x$. Hence, the FPS
$1+x$ has a multiplicative inverse, i.e., is invertible. This proves Theorem
\ref{thm.pol.binom-newton} \textbf{(a)}.

Next, we claim the following:

\begin{statement}
\textit{Claim 2:} We have $\left(  1+x\right)  ^{-n}=N_{-n}$ for each
$n\in\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 2:} We shall prove Claim 2 by induction on $n$:

\textit{Induction base:} We have $\left(  1+x\right)  ^{-0}=\left(
1+x\right)  ^{0}=1_{\mathbb{K}\left[  \left[  x\right]  \right]  }=N_{-0}$
(since $N_{-0}=N_{0}=1_{\mathbb{K}\left[  \left[  x\right]  \right]  }$). In
other words, Claim 2 holds for $n=0$. This completes the induction base.

\textit{Induction step:} Let $m\in\mathbb{N}$. Assume that Claim 2 holds for
$n=m$. We must prove that Claim 2 holds for $n=m+1$.

We have assumed that Claim 2 holds for $n=m$. In other words, we have $\left(
1+x\right)  ^{-m}=N_{-m}$.

But Claim 1 (applied to $n=-m$) yields%
\[
N_{-m}=\left(  1+x\right)  N_{-m-1}=\left(  1+x\right)  N_{-\left(
m+1\right)  }=N_{-\left(  m+1\right)  }\cdot\left(  1+x\right)  .
\]
But $-\left(  m+1\right)  =\left(  -m\right)  +\left(  -1\right)  $, so that%
\begin{align*}
\left(  1+x\right)  ^{-\left(  m+1\right)  }  &  =\left(  1+x\right)
^{\left(  -m\right)  +\left(  -1\right)  }=\underbrace{\left(  1+x\right)
^{-m}}_{\substack{=N_{-m}\\=N_{-\left(  m+1\right)  }\cdot\left(  1+x\right)
}}\cdot\left(  1+x\right)  ^{-1}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the basic rules of exponents}\right)
\\
&  =N_{-\left(  m+1\right)  }\cdot\underbrace{\left(  1+x\right)  \cdot\left(
1+x\right)  ^{-1}}_{=1_{\mathbb{K}\left[  \left[  x\right]  \right]  }%
}=N_{-\left(  m+1\right)  }.
\end{align*}
In other words, Claim 2 holds for $n=m+1$. This completes the induction step.
Thus, Claim 2 is proven by induction.]

\textbf{(b)} Let $u\in\mathbb{Z}$. We have already checked that the sum
$\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}$ is well-defined (i.e., the family
$\left(  \dbinom{u}{k}x^{k}\right)  _{k\in\mathbb{N}}$ is summable). It
remains to prove that $\left(  1+x\right)  ^{u}=\sum_{k\in\mathbb{N}}%
\dbinom{u}{k}x^{k}$.

We are in one of the following two cases:

\textit{Case 1:} We have $u\geq0$.

\textit{Case 2:} We have $u<0$.

Let us first consider Case 1. In this case, we have $u\geq0$. Thus,
$u\in\mathbb{N}$. Hence, Lemma \ref{lem.binom.psgu} (applied to $\mathbb{K}%
\left[  \left[  x\right]  \right]  $ and $x$ instead of $\mathbb{K}$ and $a$)
yields
\[
\left(  1+x\right)  ^{u}=\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}.
\]
Thus, Theorem \ref{thm.pol.binom-newton} \textbf{(b)} is proven in Case 1.

Let us now consider Case 2. In this case, we have $u<0$. Hence, $-u>0$, so
that $-u\in\mathbb{N}$ (since $u\in\mathbb{Z}$). Thus, Claim 2 (applied to
$n=-u$) yields
\[
\left(  1+x\right)  ^{-\left(  -u\right)  }=N_{-\left(  -u\right)  }%
=N_{u}=\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}\ \ \ \ \ \ \ \ \ \ \left(
\text{by (\ref{pf.thm.pol.binom-newton.1})}\right)  .
\]
In view of $-\left(  -u\right)  =u$, this rewrites as%
\[
\left(  1+x\right)  ^{u}=\sum_{k\in\mathbb{N}}\dbinom{u}{k}x^{k}.
\]
Thus, Theorem \ref{thm.pol.binom-newton} \textbf{(b)} is proven in Case 2.

We have now proven Theorem \ref{thm.pol.binom-newton} \textbf{(b)} in both
Cases 1 and 2. Hence, Theorem \ref{thm.pol.binom-newton} \textbf{(b)} always holds.
\end{proof}

\subsection{Polynomials and their degrees}

\begin{teachingnote}
This section does a crappy job at explaining degrees at thrice the length such
an explanation should take. Some of this can be amended by banishing arguments
into exercises, but this is probably not enough on its own. Some of it is
unavoidable for lack of a good language for constructive logic. What about the rest?
\end{teachingnote}

Recall that polynomials have been defined as a special case of FPSs: Namely, a
polynomial is just an FPS with only finitely many nonzero entries (=
coefficients). But polynomials are, in many ways, better behaved than
arbitrary FPSs; in particular, polynomials (unlike FPSs) can be evaluated at
elements of $\mathbb{K}$ (by plugging these elements for the \textquotedblleft%
$x$\textquotedblright\ in the polynomial), and even at more general things,
whereas FPSs don't (in general).

We shall now study polynomials in more detail. To that aim, it helps to look a
bit closer and define some smaller classes of polynomials. Namely, we know
that each polynomial has only finitely many nonzero coefficients; we can thus
ask what its last nonzero coefficient is. This leads to the following definition:

\begin{definition}
\label{def.pol.deg}\textbf{(a)} For each $n\in\mathbb{Z}$, we define a subset
$\mathbb{K}\left[  x\right]  _{\leq n}$ of $\mathbb{K}\left[  \left[
x\right]  \right]  $ by%
\begin{align}
\mathbb{K}\left[  x\right]  _{\leq n}  &  =\left\{  \left(  a_{0},a_{1}%
,a_{2},\ldots\right)  \in\mathbb{K}\left[  \left[  x\right]  \right]
\ \mid\ a_{k}=0\text{ for all }k>n\right\} \label{eq.def.pol.deg.a.1}\\
&  =\left\{  \mathbf{a}\in\mathbb{K}\left[  \left[  x\right]  \right]
\ \mid\ \left[  x^{k}\right]  \mathbf{a}=0\text{ for all }k>n\right\}  .
\label{eq.def.pol.deg.a.2}%
\end{align}
(Here, of course, \textquotedblleft for all $k>n$\textquotedblright\ means
\textquotedblleft for all $k\in\mathbb{N}$ satisfying $k>n$\textquotedblright.)

\textbf{(b)} Let $\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)  $ be a
polynomial. Then, all but finitely many $i\in\mathbb{N}$ satisfy $a_{i}=0$ (by
the definition of a polynomial); in other words, only finitely many
$i\in\mathbb{N}$ satisfy $a_{i}\neq0$. The \textit{degree} of $\mathbf{a}$ is
defined to be the largest $i\in\mathbb{N}$ such that $a_{i}\neq0$. (If no such
$i$ exists, then we define it to be $-\infty$, which is a symbolic quantity
that is understood to be smaller than every integer and to satisfy $\left(
-\infty\right)  +m=-\infty$ for all $m$.)

The degree of the polynomial $\mathbf{a}$ will be denoted $\deg\mathbf{a}$.
\end{definition}

\begin{example}
\label{exa.pol.deg.1}\textbf{(a)} We have%
\begin{align*}
\mathbb{K}\left[  x\right]  _{\leq0}  &  =\left\{  \left(  a_{0},a_{1}%
,a_{2},\ldots\right)  \in\mathbb{K}\left[  \left[  x\right]  \right]
\ \mid\ a_{k}=0\text{ for all }k>0\right\} \\
&  =\left\{  \left(  a_{0},a_{1},a_{2},\ldots\right)  \in\mathbb{K}\left[
\left[  x\right]  \right]  \ \mid\ a_{1}=a_{2}=a_{3}=\cdots=0\right\} \\
&  =\left\{  \left(  a_{0},\underbrace{0,0,0,\ldots}_{\text{zeroes}}\right)
\ \mid\ a_{0}\in\mathbb{K}\right\} \\
&  =\left\{  \left(  a,\underbrace{0,0,0,\ldots}_{\text{zeroes}}\right)
\ \mid\ a\in\mathbb{K}\right\} \\
&  =\left\{  \underline{a}\ \mid\ a\in\mathbb{K}\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  a,\underbrace{0,0,0,\ldots
}_{\text{zeroes}}\right)  =\underline{a}\text{ for each }a\in\mathbb{K}%
\right)  .
\end{align*}
This is the set of all constant FPSs; these are also known as the
\textit{constant polynomials}. Convention \ref{conv.pol.embed-FPS} lets us
identify these constant polynomials to the elements of $\mathbb{K}$; thus,
$\mathbb{K}\left[  x\right]  _{\leq0}$ simply is $\mathbb{K}$.

\textbf{(b)} We have%
\begin{align*}
\mathbb{K}\left[  x\right]  _{\leq1}  &  =\left\{  \left(  a_{0},a_{1}%
,a_{2},\ldots\right)  \in\mathbb{K}\left[  \left[  x\right]  \right]
\ \mid\ a_{k}=0\text{ for all }k>1\right\} \\
&  =\left\{  \left(  a_{0},a_{1},a_{2},\ldots\right)  \in\mathbb{K}\left[
\left[  x\right]  \right]  \ \mid\ a_{2}=a_{3}=a_{4}=\cdots=0\right\} \\
&  =\left\{  \left(  a_{0},a_{1},\underbrace{0,0,0,\ldots}_{\text{zeroes}%
}\right)  \ \mid\ a_{0},a_{1}\in\mathbb{K}\right\} \\
&  =\left\{  a_{0}+a_{1}x\ \mid\ a_{0},a_{1}\in\mathbb{K}\right\}  .
\end{align*}
The elements of this set are called the \textit{linear polynomials} (at least
in one sense of this word).

\textbf{(c)} If $n\in\mathbb{Z}$ is negative, then%
\begin{align*}
\mathbb{K}\left[  x\right]  _{\leq n}  &  =\left\{  \left(  a_{0},a_{1}%
,a_{2},\ldots\right)  \in\mathbb{K}\left[  \left[  x\right]  \right]
\ \mid\ a_{k}=0\text{ for all }k>n\right\} \\
&  =\left\{  \left(  a_{0},a_{1},a_{2},\ldots\right)  \in\mathbb{K}\left[
\left[  x\right]  \right]  \ \mid\ a_{0}=a_{1}=a_{2}=\cdots=0\right\} \\
&  =\left\{  \left(  0,0,0,\ldots\right)  \right\}  =\left\{  \underline{0}%
\right\}  .
\end{align*}


\textbf{(d)} The FPS $\left(  3,0,2,5,\underbrace{0,0,0,0,\ldots
}_{\text{zeroes}}\right)  $ is a polynomial of degree $3$.
\end{example}

Parts \textbf{(a)} and \textbf{(b)} of Definition \ref{def.pol.deg} are
essentially two different ways to look at the same thing (viz., at what point
the coefficients of a polynomial become $0$); the precise relation is captured
by the following lemma:

\begin{lemma}
\label{lem.pol.deg}Let $n\in\mathbb{Z}$. Let $\mathbf{a}\in\mathbb{K}\left[
\left[  x\right]  \right]  $ be an FPS. Then:

\textbf{(a)} We have the following equivalence:%
\[
\left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}\right)
\ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \mathbf{a}=0\text{ for
all }k>n\right)  .
\]


\textbf{(b)} We have the following equivalence:%
\[
\left(  \mathbf{a}\text{ is a polynomial of degree }\leq n\right)
\ \Longleftrightarrow\ \left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq
n}\right)  .
\]

\end{lemma}

Note that $n$ is allowed to be negative in Lemma \ref{lem.pol.deg}; in this
case, Lemma \ref{lem.pol.deg} \textbf{(b)} is simply saying that $\mathbf{a}$
is a polynomial of degree $-\infty$ if and only if all its coefficients
$a_{0},a_{1},a_{2},\ldots$ are $0$ (because the only negative degree that a
polynomial can have is $-\infty$).

Lemma \ref{lem.pol.deg} is an easy consequence of Definition \ref{def.pol.deg}%
, but the proof grows long on paper:

\begin{proof}
[Proof of Lemma \ref{lem.pol.deg}.]\textbf{(a)} This follows directly from
(\ref{eq.def.pol.deg.a.2}).

\textbf{(b)} Write the FPS $\mathbf{a}$ in the form $\mathbf{a}=\left(
a_{0},a_{1},a_{2},\ldots\right)  $. Then, we have the following equivalence:%
\begin{equation}
\left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}\right)
\ \Longleftrightarrow\ \left(  a_{k}=0\text{ for all }k>n\right)
\label{pf.lem.pol.deg.eq1}%
\end{equation}
(by (\ref{eq.def.pol.deg.a.1})).

Now, we shall prove the equivalence
\begin{equation}
\left(  \mathbf{a}\text{ is a polynomial of degree }\leq n\right)
\ \Longleftrightarrow\ \left(  a_{k}=0\text{ for all }k>n\right)  .
\label{pf.lem.pol.deg.eq2}%
\end{equation}


In order to do so, let us prove the \textquotedblleft$\Longrightarrow
$\textquotedblright\ and \textquotedblleft$\Longleftarrow$\textquotedblright%
\ directions of the equivalence (\ref{pf.lem.pol.deg.eq2}) separately:

$\Longrightarrow:$ Assume that $\mathbf{a}$ is a polynomial of degree $\leq
n$. We must prove that \newline$\left(  a_{k}=0\text{ for all }k>n\right)  $.

If all $i\in\mathbb{N}$ satisfy $a_{i}=0$, then this is clearly satisfied.
Thus, WLOG assume that not all $i\in\mathbb{N}$ satisfy $a_{i}=0$. Hence,
there exists an $i\in\mathbb{N}$ such that $a_{i}\neq0$. Moreover, there exist
only finitely many such $i$ (since $\mathbf{a}$ is a polynomial). Thus, there
exists a \textbf{largest} such $i$ (since a finite nonempty set of integers
always has a largest element). Let $d$ denote this largest $i$. Then, $d$ is
the degree of $\mathbf{a}$ (since this is how the degree of $\mathbf{a}$ was
defined). Thus, $d\leq n$ (since $\mathbf{a}$ is a polynomial of degree $\leq
n$). In other words, $n\geq d$.

But $d$ is the largest $i\in\mathbb{N}$ such that $a_{i}\neq0$. Thus, every
larger $i\in\mathbb{N}$ must satisfy $a_{i}=0$. In other words, we have
$a_{i}=0$ for all $i>d$. Hence, $a_{i}=0$ for all $i>n$ (because if $i>n$,
then $i>n\geq d$). Renaming the index $i$ as $k$ in this statement, we obtain
$\left(  a_{k}=0\text{ for all }k>n\right)  $. This proves the
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction of the
equivalence (\ref{pf.lem.pol.deg.eq2}).

$\Longleftarrow:$ Assume that $\left(  a_{k}=0\text{ for all }k>n\right)  $.
We must prove that $\mathbf{a}$ is a polynomial of degree $\leq n$.

If all $i\in\mathbb{N}$ satisfy $a_{i}=0$, then this is clearly satisfied
(because in this case, the degree of $\mathbf{a}$ is defined to be $-\infty$,
and we have $-\infty\leq n$). Thus, WLOG assume that not all $i\in\mathbb{N}$
satisfy $a_{i}=0$. In other words, there exists some $i\in\mathbb{N}$ such
that $a_{i}\neq0$.

We have assumed that $a_{k}=0$ for all $k>n$. Renaming the index $k$ as $i$ in
this statement, we obtain $\left(  a_{i}=0\text{ for all }i>n\right)  $.
Hence, all but finitely many $i\in\mathbb{N}$ satisfy $a_{i}=0$ (since all but
finitely many $i\in\mathbb{N}$ satisfy $i>n$). In other words, $\mathbf{a}$ is
a polynomial (by the definition of a polynomial).

The set $\left\{  i\in\mathbb{N}\ \mid\ a_{i}\neq0\right\}  $ is finite (since
all but finitely many $i\in\mathbb{N}$ satisfy $a_{i}=0$) and nonempty (since
there exists some $i\in\mathbb{N}$ such that $a_{i}\neq0$). Thus, it has a
largest element (since a finite nonempty set of integers always has a largest
element). Let $d$ denote this largest $i$. Then, $d$ is the degree of
$\mathbf{a}$ (since this is how the degree of $\mathbf{a}$ was defined).
Moreover, $d$ is an $i\in\mathbb{N}$ satisfying $a_{i}\neq0$ (since $d$
belongs to the set $\left\{  i\in\mathbb{N}\ \mid\ a_{i}\neq0\right\}  $). In
other words, $d\in\mathbb{N}$ and $a_{d}\neq0$. If we had $d>n$, then we would
have $a_{d}=0$ (since $a_{k}=0$ for all $k>n$), which would contradict
$a_{d}\neq0$. Hence, we cannot have $d>n$. Thus, we have $d\leq n$. In other
words, the degree of $\mathbf{a}$ is $\leq n$ (since $d$ is the degree of
$\mathbf{a}$). Thus, $\mathbf{a}$ is a polynomial of degree $\leq n$. This
proves the \textquotedblleft$\Longleftarrow$\textquotedblright\ direction of
the equivalence (\ref{pf.lem.pol.deg.eq2}).

We have now proven both directions of the equivalence
(\ref{pf.lem.pol.deg.eq2}); thus, this equivalence holds. Now, the equivalence
(\ref{pf.lem.pol.deg.eq2}) becomes%
\[
\left(  \mathbf{a}\text{ is a polynomial of degree }\leq n\right)
\ \Longleftrightarrow\ \left(  a_{k}=0\text{ for all }k>n\right)
\ \Longleftrightarrow\ \left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq
n}\right)
\]
(by (\ref{pf.lem.pol.deg.eq1})). This proves Lemma \ref{lem.pol.deg}
\textbf{(b)}.
\end{proof}

\begin{fineprint}
\begin{remark}
\label{rmk.pol.deg-bad}If you work in constructive logic, then Lemma
\ref{lem.pol.deg} \textbf{(b)} cannot be proven. In fact, in constructive
logic, you cannot prove that each polynomial has a well-defined degree (since
you cannot generally prove that each $i\in\mathbb{N}$ satisfies either
$a_{i}=0$ or $a_{i}\neq0$). Thus, the notion of \textquotedblleft the degree
of a polynomial\textquotedblright\ is not well-behaved in constructive
mathematics. It is also not well-behaved in other ways -- e.g., it is not
preserved by ring homomorphisms, and leads to nuisances when $\mathbb{K}$ is a
trivial ring, as witnessed in Theorem \ref{thm.pol.deg-basics} \textbf{(d)}
below. Thus, I shall avoid this notion wherever I can help it, and instead use
the notion of $\mathbb{K}\left[  x\right]  _{\leq n}$ (where $n\in\mathbb{Z}%
$). This is a bit less familiar but hopefully more \textquotedblleft
philosophically right\textquotedblright\ (while being essentially equivalent
to the notion of degree under classical logic, because of Lemma
\ref{lem.pol.deg} \textbf{(b)}). (The notion of a degree does become useful
again when $\mathbb{K}$ is a field, but I will first study a more general setup.)
\end{remark}
\end{fineprint}

Corollary \ref{cor.pol.FPS-as-sum} has shown that we can write each FPS as an
infinite sum; likewise, we can write each polynomial as a finite sum:

\begin{theorem}
\label{thm.pol.pol-as-sum}Let $n\in\mathbb{Z}$. Let $\left(  a_{0},a_{1}%
,a_{2},\ldots\right)  \in\mathbb{K}\left[  x\right]  _{\leq n}$. Then,%
\[
\left(  a_{0},a_{1},a_{2},\ldots\right)  =a_{0}+a_{1}x+a_{2}x^{2}+\cdots
+a_{n}x^{n}=\sum_{k=0}^{n}a_{k}x^{k}.
\]

\end{theorem}

Note that $n$ is allowed to be negative in Theorem \ref{thm.pol.pol-as-sum};
in this case, the sum $\sum_{k=0}^{n}a_{k}x^{k}$ is empty (and thus equals
$0_{\mathbb{K}\left[  \left[  x\right]  \right]  }$), and this should not be
surprising (because in this case, we have $\left(  a_{0},a_{1},a_{2}%
,\ldots\right)  \in\mathbb{K}\left[  x\right]  _{\leq n}=\left\{
\underline{0}\right\}  $ (by Example \ref{exa.pol.deg.1} \textbf{(c)}), so
that $\left(  a_{0},a_{1},a_{2},\ldots\right)  =\underline{0}=\left(
\text{empty sum}\right)  $).

\begin{proof}
[Proof of Theorem \ref{thm.pol.pol-as-sum}.]We have $\left(  a_{0},a_{1}%
,a_{2},\ldots\right)  \in\mathbb{K}\left[  x\right]  _{\leq n}$. Equivalently,%
\begin{equation}
a_{k}=0\ \ \ \ \ \ \ \ \ \ \text{for all }k>n \label{pf.thm.pol.pol-as-sum.=0}%
\end{equation}
(indeed, this is equivalent to $\left(  a_{0},a_{1},a_{2},\ldots\right)
\in\mathbb{K}\left[  x\right]  _{\leq n}$, because of
(\ref{eq.def.pol.deg.a.1})). Now, Corollary \ref{cor.pol.FPS-as-sum} yields%
\begin{align*}
\left(  a_{0},a_{1},a_{2},\ldots\right)   &  =\sum_{k\in\mathbb{N}}a_{k}%
x^{k}=\sum_{k=0}^{n}a_{k}x^{k}+\sum_{k=n+1}^{\infty}\underbrace{a_{k}%
}_{\substack{=0\\\text{(by (\ref{pf.thm.pol.pol-as-sum.=0}))}}}x^{k}%
=\sum_{k=0}^{n}a_{k}x^{k}+\underbrace{\sum_{k=n+1}^{\infty}0x^{k}}_{=0}\\
&  =\sum_{k=0}^{n}a_{k}x^{k}=a_{0}x^{0}+a_{1}x^{1}+a_{2}x^{2}+\cdots
+a_{n}x^{n}\\
&  =a_{0}+a_{1}x+a_{2}x^{2}+\cdots+a_{n}x^{n}%
\end{align*}
(since $a_{0}\underbrace{x^{0}}_{=1}=a_{0}$ and $a_{1}\underbrace{x^{1}}%
_{=x}=a_{1}x$). This proves Theorem \ref{thm.pol.pol-as-sum}.
\end{proof}

\begin{exercise}
\label{exe.pol.deg-red}Let $n\in\mathbb{N}$. Let $\mathbf{a}\in\mathbb{K}%
\left[  x\right]  _{\leq n}$. Prove the following:

\textbf{(a)} If $\left[  x^{n}\right]  \mathbf{a}=0$, then $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  _{\leq n-1}$.

\textbf{(b)} If $\left[  x^{n}\right]  \mathbf{a}\neq0$, then $\deg
\mathbf{a}=n$.

\textbf{(c)} We have $\deg\mathbf{a} = n$ if and only if $\left[
x^{n}\right]  \mathbf{a}\neq0$.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.pol.deg-red}.]Lemma \ref{lem.pol.deg}
\textbf{(a)} shows that we have the equivalence \newline$\left(  \mathbf{a}%
\in\mathbb{K}\left[  x\right]  _{\leq n}\right)  \ \Longleftrightarrow
\ \left(  \left[  x^{k}\right]  \mathbf{a}=0\text{ for all }k>n\right)  $.
Hence, we have
\begin{equation}
\left[  x^{k}\right]  \mathbf{a}=0\text{ for all }k>n
\label{sol.pol.deg-red.1}%
\end{equation}
(since we have $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$).

\textbf{(a)} Assume that $\left[  x^{n}\right]  \mathbf{a}=0$. The equality
$\left[  x^{k}\right]  \mathbf{a}=0$ holds for all $k>n$ (by
(\ref{sol.pol.deg-red.1})), but also holds for $k=n$ (since $\left[
x^{n}\right]  \mathbf{a}=0$). Hence, this equality holds for all $k\geq n$. In
other words, it holds for all $k>n-1$ (since the $k\in\mathbb{N}$ satisfying
$k\geq n$ are precisely the $k\in\mathbb{N}$ satisfying $k>n-1$). Thus, we
have proven that $\left[  x^{k}\right]  \mathbf{a}=0$ for all $k>n-1$.

But Lemma \ref{lem.pol.deg} \textbf{(a)} (applied to $n-1$ instead of $n$)
shows that we have the equivalence $\left(  \mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n-1}\right)  \ \Longleftrightarrow\ \left(  \left[
x^{k}\right]  \mathbf{a}=0\text{ for all }k>n-1\right)  $. Hence, we have
$\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n-1}$ (since we have $\left[
x^{k}\right]  \mathbf{a}=0$ for all $k>n-1$). This solves Exercise
\ref{exe.pol.deg-red} \textbf{(a)}.

\textbf{(b)} Assume that $\left[  x^{n}\right]  \mathbf{a}\neq0$. Then, we
have $\left[  x^{n}\right]  \mathbf{a}\neq0$, but $\left[  x^{k}\right]
\mathbf{a}=0$ for all $k>n$ (by (\ref{sol.pol.deg-red.1})). Hence, $n$ is the
\textbf{largest} $i\in\mathbb{N}$ satisfying $\left[  x^{i}\right]
\mathbf{a}\neq0$.

But $\mathbf{a}=\left(  \left[  x^{0}\right]  \mathbf{a},\left[  x^{1}\right]
\mathbf{a},\left[  x^{2}\right]  \mathbf{a},\ldots\right)  $. Hence, the
degree of the polynomial $\mathbf{a}$ is the largest $i\in\mathbb{N}$
satisfying $\left[  x^{i}\right]  \mathbf{a}\neq0$ (because this is how the
degree of $\mathbf{a}$ was defined). Thus, this degree is $n$ (since we have
shown that $n$ is the largest $i\in\mathbb{N}$ satisfying $\left[
x^{i}\right]  \mathbf{a}\neq0$). In other words, $\deg\mathbf{a}=n$. This
solves Exercise \ref{exe.pol.deg-red} \textbf{(b)}.

\textbf{(c)} $\Longleftarrow$: The ``$\Longleftarrow$'' direction of Exercise
\ref{exe.pol.deg-red} \textbf{(c)} follows immediately from Exercise
\ref{exe.pol.deg-red} \textbf{(b)}.

$\Longrightarrow$: Assume that $\deg\mathbf{a}=n$. We must prove that $\left[
x^{n}\right]  \mathbf{a}\neq0$.

Indeed, assume the contrary. Thus, $\left[  x^{n}\right]  \mathbf{a}=0$.
Hence, Exercise \ref{exe.pol.deg-red} \textbf{(a)} yields $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  _{\leq n-1}$. But Lemma \ref{lem.pol.deg}
\textbf{(b)} (applied to $n-1$ instead of $n$) yields the equivalence%
\[
\left(  \mathbf{a}\text{ is a polynomial of degree }\leq n-1\right)
\ \Longleftrightarrow\ \left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq
n-1}\right)  .
\]
Hence, $\mathbf{a}$ is a polynomial of degree $\leq n-1$ (since we have
$\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n-1}$). Thus, $\deg
\mathbf{a}\leq n-1<n$. This contradicts $\deg\mathbf{a}=n$. This contradiction
shows that our assumption was wrong. Hence, $\left[  x^{n}\right]
\mathbf{a}\neq0$. This solves the \textquotedblleft$\Longrightarrow
$\textquotedblright\ direction of Exercise \ref{exe.pol.deg-red} \textbf{(c)}.
\end{proof}
\end{fineprint}

Next, let us prove some basic properties of $\mathbb{K}\left[  x\right]
_{\leq n}$:

\begin{lemma}
\label{lem.pol.addition}Let $n\in\mathbb{Z}$.

\textbf{(a)} We have $\underline{0}\in\mathbb{K}\left[  x\right]  _{\leq n}$.

\textbf{(b)} If $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq
n}$, then $\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq n}$.

\textbf{(c)} If $\lambda\in\mathbb{K}$ and $\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}$, then $\lambda\mathbf{a}\in\mathbb{K}\left[  x\right]
_{\leq n}$.

\textbf{(d)} The subset $\mathbb{K}\left[  x\right]  _{\leq n}$ of
$\mathbb{K}\left[  \left[  x\right]  \right]  $ is a $\mathbb{K}$-submodule of
$\mathbb{K}\left[  \left[  x\right]  \right]  $.

\textbf{(e)} Any finite sum of elements of $\mathbb{K}\left[  x\right]  _{\leq
n}$ belongs to $\mathbb{K}\left[  x\right]  _{\leq n}$.

\textbf{(f)} If $i\in\mathbb{N}$ satisfies $i\leq n$, then $x^{i}\in
\mathbb{K}\left[  x\right]  _{\leq n}$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.pol.addition}.]\textbf{(b)} Let $\mathbf{a}%
,\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq n}$.

Lemma \ref{lem.pol.deg} \textbf{(a)} shows that we have the equivalence%
\[
\left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}\right)
\ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \mathbf{a}=0\text{ for
all }k>n\right)  .
\]
Hence, we have%
\begin{equation}
\left[  x^{k}\right]  \mathbf{a}=0\text{ for all }k>n
\label{pf.lem.pol.addition.b.1}%
\end{equation}
(since $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$). Similarly,%
\begin{equation}
\left[  x^{k}\right]  \mathbf{b}=0\text{ for all }k>n.
\label{pf.lem.pol.addition.b.2}%
\end{equation}


Now, for each $k\in\mathbb{N}$ satisfying $k>n$, we have%
\begin{align*}
\left[  x^{k}\right]  \left(  \mathbf{a}+\mathbf{b}\right)   &
=\underbrace{\left[  x^{k}\right]  \mathbf{a}}_{\substack{=0\\\text{(by
(\ref{pf.lem.pol.addition.b.1}))}}}+\underbrace{\left[  x^{k}\right]
\mathbf{b}}_{\substack{=0\\\text{(by (\ref{pf.lem.pol.addition.b.2}))}%
}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.pol.fps-sum.1})}\right) \\
&  =0+0=0.
\end{align*}
In other words, $\left[  x^{k}\right]  \left(  \mathbf{a}+\mathbf{b}\right)
=0$ for all $k>n$. But Lemma \ref{lem.pol.deg} \textbf{(a)} (applied to
$\mathbf{a}+\mathbf{b}$ instead of $\mathbf{a}$) shows that we have the
equivalence%
\[
\left(  \mathbf{a}+\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq n}\right)
\ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \left(  \mathbf{a}%
+\mathbf{b}\right)  =0\text{ for all }k>n\right)  .
\]
Thus, $\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq n}$ (since
$\left[  x^{k}\right]  \left(  \mathbf{a}+\mathbf{b}\right)  =0$ for all
$k>n$). This proves Lemma \ref{lem.pol.addition} \textbf{(b)}.

\textbf{(a)} This is trivial.

\textbf{(c)} This is like Lemma \ref{lem.pol.addition} \textbf{(b)}, but easier.

\textbf{(d)} The subset $\mathbb{K}\left[  x\right]  _{\leq n}$ of
$\mathbb{K}\left[  \left[  x\right]  \right]  $ contains the zero vector
$\underline{0}$ (by Lemma \ref{lem.pol.addition} \textbf{(a)}) and is closed
under addition (by Lemma \ref{lem.pol.addition} \textbf{(b)}) and closed under
scaling (by Lemma \ref{lem.pol.addition} \textbf{(c)}). Hence, it is a
$\mathbb{K}$-submodule of $\mathbb{K}\left[  \left[  x\right]  \right]  $.
This proves Lemma \ref{lem.pol.addition} \textbf{(d)}.

\textbf{(e)} This follows from Lemma \ref{lem.pol.addition} \textbf{(d)}. (A
more down-to-earth way to prove this is to proceed by induction on the size of
the sum; the induction base uses Lemma \ref{lem.pol.addition} \textbf{(a)},
while the induction step uses Lemma \ref{lem.pol.addition} \textbf{(b)}.)

\textbf{(f)} Let $i\in\mathbb{N}$ be such that $i\leq n$. We must prove that
$x^{i}\in\mathbb{K}\left[  x\right]  _{\leq n}$.

Lemma \ref{lem.pol.deg} \textbf{(a)} (applied to $\mathbf{a}=x^{i}$) shows
that we have the equivalence%
\[
\left(  x^{i}\in\mathbb{K}\left[  x\right]  _{\leq n}\right)
\ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \left(  x^{i}\right)
=0\text{ for all }k>n\right)  .
\]
Thus, it remains to show that $\left[  x^{k}\right]  \left(  x^{i}\right)  =0$
for all $k>n$. So let us fix a $k\in\mathbb{N}$ satisfying $k>n$. Then,
$k>n\geq i$ (since $i\leq n$). Hence, (\ref{eq.prop.pol.xk.rest}) (applied to
$k$ and $i$ instead of $n$ and $k$) yields $\left[  x^{k}\right]  \left(
x^{i}\right)  =0$. This is precisely what we wanted to show. Hence, Lemma
\ref{lem.pol.addition} \textbf{(f)} is proven.
\end{proof}

Lemma \ref{lem.pol.addition} yields the following converse of Theorem
\ref{thm.pol.pol-as-sum}:

\begin{exercise}
\label{exe.pol.sum-as-pol}Let $n\in\mathbb{Z}$. Let $a_{0},a_{1},\ldots
,a_{n}\in\mathbb{K}$. Prove that $\sum_{k=0}^{n}a_{k}x^{k}\in\mathbb{K}\left[
x\right]  _{\leq n}$.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.pol.sum-as-pol}.]If $k\in\left\{
0,1,\ldots,n\right\}  $, then $x^{k}\in\mathbb{K}\left[  x\right]  _{\leq n}$
(by Lemma \ref{lem.pol.addition} \textbf{(f)}, applied to $i=k$) and therefore
$a_{k}x^{k}\in\mathbb{K}\left[  x\right]  _{\leq n}$ (by Lemma
\ref{lem.pol.addition} \textbf{(c)}, applied to $\lambda=a_{k}$ and
$\mathbf{a}=x^{k}$). Hence, $\sum_{k=0}^{n}a_{k}x^{k}$ is a finite sum of
elements of $\mathbb{K}\left[  x\right]  _{\leq n}$. Because of Lemma
\ref{lem.pol.addition} \textbf{(e)}, this entails that $\sum_{k=0}^{n}%
a_{k}x^{k}$ belongs to $\mathbb{K}\left[  x\right]  _{\leq n}$. This solves
Exercise \ref{exe.pol.sum-as-pol}.
\end{proof}
\end{fineprint}

Combining Lemma \ref{lem.pol.addition} with Exercise \ref{exe.pol.deg-red}
\textbf{(a)}, we obtain a simple fact: If two polynomials in $\mathbb{K}%
\left[  x\right]  _{\leq n}$ have the same coefficient of $x^{n}$, then their
difference belongs to $\mathbb{K}\left[  x\right]  _{\leq n-1}$ (since the
subtraction \textquotedblleft cancels their leading terms\textquotedblright%
\footnote{I am putting this in quotation marks because I am trying to avoid
the notion of \textquotedblleft leading term\textquotedblright. (The
\textit{leading term} of a nonzero polynomial $\mathbf{a}=a_{0}+a_{1}%
x+a_{2}x^{2}+\cdots+a_{n}x^{n}$ of degree $n$ is defined to be $a_{n}x^{n}$.
But beware that if $\mathbf{a}=a_{0}+a_{1}x+a_{2}x^{2}+\cdots+a_{n}x^{n}$ is
merely in $\mathbb{K}\left[  x\right]  _{\leq n}$, then $\deg\mathbf{a}$ may
be smaller than $n$, in which case its leading term is not $a_{n}x^{n}$ but
rather $a_{i}x^{i}$ for $i=\deg\mathbf{a}$. Thus there is a discrepancy
between the definition of \textquotedblleft leading term\textquotedblright%
\ and what we typically want to say when we use this word.)}). This fact is
highly useful in induction proofs (specifically, it helps prove properties of
polynomials by induction on the degree of a polynomial); let us state it as an exercise:

\begin{exercise}
\label{exe.pol.leading-cancel}Let $n\in\mathbb{N}$. Let $\mathbf{a}%
,\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq n}$ be such that $\left[
x^{n}\right]  \mathbf{a}=\left[  x^{n}\right]  \mathbf{b}$. Then,
$\mathbf{a}-\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq n-1}$.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.pol.leading-cancel}.]Lemma
\ref{lem.pol.addition} \textbf{(c)} (applied to $-1$ and $\mathbf{b}$ instead
of $\lambda$ and $\mathbf{a}$) shows that $\left(  -1\right)  \mathbf{b}%
\in\mathbb{K}\left[  x\right]  _{\leq n}$. Hence, Lemma \ref{lem.pol.addition}
\textbf{(b)} (applied to $\left(  -1\right)  \mathbf{b}$ instead of
$\mathbf{b}$) shows that $\mathbf{a}+\left(  -1\right)  \mathbf{b}%
\in\mathbb{K}\left[  x\right]  _{\leq n}$. Moreover, (\ref{eq.pol.fps-sum.1})
(applied to $\left(  -1\right)  \mathbf{b}$ instead of $\mathbf{b}$) shows
that%
\[
\left[  x^{n}\right]  \left(  \mathbf{a}+\left(  -1\right)  \mathbf{b}\right)
=\underbrace{\left[  x^{n}\right]  \mathbf{a}}_{=\left[  x^{n}\right]
\mathbf{b}}+\underbrace{\left[  x^{n}\right]  \left(  \left(  -1\right)
\mathbf{b}\right)  }_{\substack{=\left(  -1\right)  \cdot\left[  x^{n}\right]
\mathbf{b}\\\text{(by (\ref{eq.pol.fps-scal.1}), applied to }-1\text{ and
}\mathbf{b}\\\text{instead of }\lambda\text{ and }\mathbf{a}\text{)}}}=\left[
x^{n}\right]  \mathbf{b}+\left(  -1\right)  \cdot\left[  x^{n}\right]
\mathbf{b}=0.
\]
Hence, Exercise \ref{exe.pol.deg-red} \textbf{(a)} (applied to $\mathbf{a}%
+\left(  -1\right)  \mathbf{b}$ instead of $\mathbf{a}$) yields $\mathbf{a}%
+\left(  -1\right)  \mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq n-1}$. In
view of
\[
\mathbf{a}-\mathbf{b}=\mathbf{a}+\underbrace{\left(  -\mathbf{b}\right)
}_{\substack{=\left(  -1\right)  \mathbf{b}\\\text{(by
(\ref{eq.thm.module.inv-add.uni.b.rewr}), applied to }M=\mathbb{K}\left[
\left[  x\right]  \right]  \\\text{and }a=\mathbf{b}\text{)}}}=\mathbf{a}%
+\left(  -1\right)  \mathbf{b},
\]
this rewrites as $\mathbf{a}-\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq
n-1}$. This solves Exercise \ref{exe.pol.leading-cancel}.
\end{proof}
\end{fineprint}

\begin{theorem}
\label{thm.pol.pol-basics}\textbf{(a)} If $u\in\mathbb{Z}$ and $v\in
\mathbb{Z}$ satisfy $u\leq v$, then $\mathbb{K}\left[  x\right]  _{\leq
u}\subseteq\mathbb{K}\left[  x\right]  _{\leq v}$.

\textbf{(b)} If $n\in\mathbb{Z}$, then $\mathbb{K}\left[  x\right]  _{\leq n}$
is a $\mathbb{K}$-submodule of $\mathbb{K}\left[  x\right]  $.

\textbf{(c)} If $\mathbf{a}\in\mathbb{K}\left[  x\right]  $, then there exists
some $n\in\mathbb{N}$ such that $\mathbf{a}\in\mathbb{K}\left[  x\right]
_{\leq n}$.

\textbf{(d)} If $a\in\mathbb{K}$, then $\underline{a}\in\mathbb{K}\left[
x\right]  _{\leq0}$.

\textbf{(e)} We have $x\in\mathbb{K}\left[  x\right]  _{\leq1}$.

\textbf{(f)} Let $n\in\mathbb{N}$ and $m\in\mathbb{N}$. Let $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  _{\leq n}$ and $\mathbf{b}\in\mathbb{K}\left[
x\right]  _{\leq m}$. Then, $\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[
x\right]  _{\leq\max\left\{  n,m\right\}  }$ and $\mathbf{ab}\in
\mathbb{K}\left[  x\right]  _{\leq n+m}$.
\end{theorem}

We shall prove Theorem \ref{thm.pol.pol-basics} in Exercise
\ref{exe.pol.pol-basics} below. The hardest part of this theorem is the claim
$\mathbf{ab}\in\mathbb{K}\left[  x\right]  _{\leq n+m}$ in its part
\textbf{(f)}; we can strengthen this part as follows:

\begin{lemma}
\label{lem.pol.deg(ab)}Let $n,m\in\mathbb{N}$. Let $\mathbf{a}\in
\mathbb{K}\left[  x\right]  _{\leq n}$ and $\mathbf{b}\in\mathbb{K}\left[
x\right]  _{\leq m}$. Then:

\textbf{(a)} We have $\left[  x^{n+i}\right]  \left(  \mathbf{ab}\right)
=\left(  \left[  x^{n}\right]  \mathbf{a}\right)  \cdot\left(  \left[
x^{i}\right]  \mathbf{b}\right)  $ for each integer $i\geq m$.

\textbf{(b)} We have $\mathbf{ab}\in\mathbb{K}\left[  x\right]  _{\leq n+m}$.

\textbf{(c)} We have $\left[  x^{n+m}\right]  \left(  \mathbf{ab}\right)
=\left(  \left[  x^{n}\right]  \mathbf{a}\right)  \cdot\left(  \left[
x^{m}\right]  \mathbf{b}\right)  $.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.pol.deg(ab)}.]Lemma \ref{lem.pol.deg} \textbf{(a)}
shows that we have the equivalence%
\[
\left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}\right)
\ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \mathbf{a}=0\text{ for
all }k>n\right)  .
\]
Hence, we have%
\begin{equation}
\left[  x^{k}\right]  \mathbf{a}=0\text{ for all }k>n
\label{pf.lem.pol.deg(ab).ak=0}%
\end{equation}
(since $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$). Similarly,%
\begin{equation}
\left[  x^{k}\right]  \mathbf{b}=0\text{ for all }k>m.
\label{pf.lem.pol.deg(ab).bk=0}%
\end{equation}


\textbf{(a)} Let $i$ be an integer such that $i\geq m$. Thus, $i\geq m\geq0$.
For each $j\in\left\{  0,1,\ldots,i-1\right\}  $, we have $j\leq i-1<i$ and
thus $n+i-\underbrace{j}_{<i}>n+i-i=n$ and thus%
\begin{equation}
\left[  x^{n+i-j}\right]  \mathbf{a}=0 \label{pf.lem.pol.deg(ab).a.1}%
\end{equation}
(by (\ref{pf.lem.pol.deg(ab).ak=0}), applied to $k=n+i-j$). For each
$j\in\left\{  i+1,i+2,\ldots,n+i\right\}  $, we have $j\geq i+1>i\geq m$ and
thus%
\begin{equation}
\left[  x^{j}\right]  \mathbf{b}=0 \label{pf.lem.pol.deg(ab).a.2}%
\end{equation}
(by (\ref{pf.lem.pol.deg(ab).bk=0}), applied to $k=j$).

The equality (\ref{eq.pol.fps-mul.5}) (applied to $n+i$ instead of $n$) yields%
\begin{align*}
\left[  x^{n+i}\right]  \left(  \mathbf{ab}\right)   &  =\sum_{j=0}%
^{n+i}\left(  \left[  x^{n+i-j}\right]  \mathbf{a}\right)  \cdot\left(
\left[  x^{j}\right]  \mathbf{b}\right) \\
&  =\sum_{j=0}^{i}\left(  \left[  x^{n+i-j}\right]  \mathbf{a}\right)
\cdot\left(  \left[  x^{j}\right]  \mathbf{b}\right)  +\sum_{j=i+1}%
^{n+i}\left(  \left[  x^{n+i-j}\right]  \mathbf{a}\right)  \cdot
\underbrace{\left(  \left[  x^{j}\right]  \mathbf{b}\right)  }%
_{\substack{=0\\\text{(by (\ref{pf.lem.pol.deg(ab).a.2}))}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }0\leq i\leq n+i\right) \\
&  =\sum_{j=0}^{i}\left(  \left[  x^{n+i-j}\right]  \mathbf{a}\right)
\cdot\left(  \left[  x^{j}\right]  \mathbf{b}\right)  +\underbrace{\sum
_{j=i+1}^{n+i}\left(  \left[  x^{n+i-j}\right]  \mathbf{a}\right)  \cdot
0}_{=0}\\
&  =\sum_{j=0}^{i}\left(  \left[  x^{n+i-j}\right]  \mathbf{a}\right)
\cdot\left(  \left[  x^{j}\right]  \mathbf{b}\right) \\
&  =\sum_{j=0}^{i-1}\underbrace{\left(  \left[  x^{n+i-j}\right]
\mathbf{a}\right)  }_{\substack{=0\\\text{(by (\ref{pf.lem.pol.deg(ab).a.1}%
))}}}\cdot\left(  \left[  x^{j}\right]  \mathbf{b}\right)
+\underbrace{\left(  \left[  x^{n+i-i}\right]  \mathbf{a}\right)  }_{=\left[
x^{n}\right]  \mathbf{a}}\cdot\left(  \left[  x^{i}\right]  \mathbf{b}\right)
\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}j=i\text{ from the sum}\right) \\
&  =\underbrace{\sum_{j=0}^{i-1}0\cdot\left(  \left[  x^{j}\right]
\mathbf{b}\right)  }_{=0}+\left(  \left[  x^{n}\right]  \mathbf{a}\right)
\cdot\left(  \left[  x^{i}\right]  \mathbf{b}\right)  =\left(  \left[
x^{n}\right]  \mathbf{a}\right)  \cdot\left(  \left[  x^{i}\right]
\mathbf{b}\right)  .
\end{align*}
This proves Lemma \ref{lem.pol.deg(ab)} \textbf{(a)}.

\textbf{(b)} Let $k\in\mathbb{N}$ be such that $k>n+m$. Hence, $k-n>m\geq0$,
so that $k-n\in\mathbb{N}$. Thus, (\ref{pf.lem.pol.deg(ab).bk=0}) (applied to
$k-n$ instead of $k$) yields $\left[  x^{k-n}\right]  \mathbf{b}=0$ (since
$k-n>m$).

Again, we have $k-n>m$; thus, Lemma \ref{lem.pol.deg(ab)} \textbf{(a)}
(applied to $i=k-n$) yields
\[
\left[  x^{n+\left(  k-n\right)  }\right]  \left(  \mathbf{ab}\right)
=\left(  \left[  x^{n}\right]  \mathbf{a}\right)  \cdot\underbrace{\left(
\left[  x^{k-n}\right]  \mathbf{b}\right)  }_{=0}=0.
\]
In other words, $\left[  x^{k}\right]  \left(  \mathbf{ab}\right)  =0$ (since
$n+\left(  k-n\right)  =k$).

Now, forget that we fixed $k$. Thus we have seen that $\left[  x^{k}\right]
\left(  \mathbf{ab}\right)  =0$ for all $k>n+m$.

But Lemma \ref{lem.pol.deg} \textbf{(a)} (applied to $n+m$ and $\mathbf{ab}$
instead of $n$ and $\mathbf{a}$) shows that we have the equivalence
\[
\left(  \mathbf{ab}\in\mathbb{K}\left[  x\right]  _{\leq n+m}\right)
\ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \left(  \mathbf{ab}%
\right)  =0\text{ for all }k>n+m\right)  .
\]
Hence, $\mathbf{ab}\in\mathbb{K}\left[  x\right]  _{\leq n+m}$ (since $\left[
x^{k}\right]  \left(  \mathbf{ab}\right)  =0$ for all $k>n+m$). This proves
Lemma \ref{lem.pol.deg(ab)} \textbf{(b)}.

\textbf{(c)} This follows from applying Lemma \ref{lem.pol.deg(ab)}
\textbf{(a)} to $i=m$.
\end{proof}

\begin{exercise}
\label{exe.pol.pol-basics}Prove Theorem \ref{thm.pol.pol-basics}.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Proof of Theorem \ref{thm.pol.pol-basics}.]\textbf{(a)} Let $u\in\mathbb{Z}$
and $v\in\mathbb{Z}$ be such that $u\leq v$. Let $\mathbf{a}\in\mathbb{K}%
\left[  x\right]  _{\leq u}$. We shall prove that $\mathbf{a}\in
\mathbb{K}\left[  x\right]  _{\leq v}$.

We have $u\leq v$, thus $v\geq u$. Lemma \ref{lem.pol.deg} \textbf{(a)}
(applied to $n=u$) shows that we have the equivalence%
\[
\left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq u}\right)
\ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \mathbf{a}=0\text{ for
all }k>u\right)  .
\]
Hence, we have $\left[  x^{k}\right]  \mathbf{a}=0$ for all $k>u$ (since
$\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq u}$). Therefore, $\left[
x^{k}\right]  \mathbf{a}=0$ for all $k>v$ (since each $k\in\mathbb{N}$
satisfying $k>v$ must also satisfy $k>v\geq u$).

But Lemma \ref{lem.pol.deg} \textbf{(a)} (applied to $n=v$) shows that we have
the equivalence $\left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq
v}\right)  \ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \mathbf{a}%
=0\text{ for all }k>v\right)  $. Hence, we have $\mathbf{a}\in\mathbb{K}%
\left[  x\right]  _{\leq v}$ (since we have $\left[  x^{k}\right]
\mathbf{a}=0$ for all $k>v$).

Now, forget that we fixed $\mathbf{a}$. We thus have shown that $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  _{\leq v}$ for each $\mathbf{a}\in
\mathbb{K}\left[  x\right]  _{\leq u}$. In other words, $\mathbb{K}\left[
x\right]  _{\leq u}\subseteq\mathbb{K}\left[  x\right]  _{\leq v}$. This
proves Theorem \ref{thm.pol.pol-basics} \textbf{(a)}.

\textbf{(b)} Let $n\in\mathbb{Z}$. Let $\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}$. We shall show that $\mathbf{a}\in\mathbb{K}\left[
x\right]  $.

Write the FPS $\mathbf{a}$ as $\mathbf{a}=\left(  a_{0},a_{1},a_{2}%
,\ldots\right)  $. Thus, $\left(  a_{0},a_{1},a_{2},\ldots\right)
=\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$. According to
(\ref{eq.def.pol.deg.a.1}), this means that $a_{k}=0$ for all $k>n$. Renaming
$k$ as $i$ in this statement, we conclude the following: $a_{i}=0$ for all
$i>n$. Hence, all but finitely many $i\in\mathbb{N}$ satisfy $a_{i}=0$ (since
all but finitely many $i\in\mathbb{N}$ satisfy $i>n$). In other words, the FPS
$\left(  a_{0},a_{1},a_{2},\ldots\right)  $ is a polynomial (by the definition
of a polynomial). In other words, $\mathbf{a}$ is a polynomial (since
$\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)  $). In other words,
$\mathbf{a}\in\mathbb{K}\left[  x\right]  $ (since $\mathbb{K}\left[
x\right]  $ is the set of all polynomials).

Forget that we fixed $\mathbf{a}$. We thus have shown that $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  $ for each $\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}$. In other words, $\mathbb{K}\left[  x\right]  _{\leq n}$
is a subset of $\mathbb{K}\left[  x\right]  $.

Furthermore, this subset $\mathbb{K}\left[  x\right]  _{\leq n}$ contains the
zero vector $\underline{0}$ (by Lemma \ref{lem.pol.addition} \textbf{(a)}) and
is closed under addition (by Lemma \ref{lem.pol.addition} \textbf{(b)}) and
closed under scaling (by Lemma \ref{lem.pol.addition} \textbf{(c)}). Hence, it
is a $\mathbb{K}$-submodule of $\mathbb{K}\left[  x\right]  $. This proves
Theorem \ref{thm.pol.pol-basics} \textbf{(b)}.

\textbf{(c)} Let $\mathbf{a}\in\mathbb{K}\left[  x\right]  $. In other words,
$\mathbf{a}$ is a polynomial (since $\mathbb{K}\left[  x\right]  $ is the set
of all polynomials).

Write the FPS $\mathbf{a}$ as $\mathbf{a}=\left(  a_{0},a_{1},a_{2}%
,\ldots\right)  $. Then, $\left(  a_{0},a_{1},a_{2},\ldots\right)
=\mathbf{a}$ is a polynomial. In other words, all but finitely many
$i\in\mathbb{N}$ satisfy $a_{i}=0$ (by the definition of a polynomial). In
other words, there is a finite subset $S$ of $\mathbb{N}$ such that%
\begin{equation}
\text{every }i\in\mathbb{N}\setminus S\text{ satisfies }a_{i}=0.
\label{pf.thm.pol.pol-basics.c.1}%
\end{equation}
Consider this $S$.

The subset $S\cup\left\{  0\right\}  $ of $\mathbb{N}$ is finite (since it is
the union of the two finite sets $S$ and $\left\{  0\right\}  $) and nonempty
(since it contains $0$); thus, it has a maximum (since any finite nonempty
subset of $\mathbb{N}$ is finite). Let $n$ be this maximum. Then,
\begin{equation}
\text{every }t\in S\cup\left\{  0\right\}  \text{ satisfies }n\geq t
\label{pf.thm.pol.pol-basics.c.2}%
\end{equation}
(since $n$ is the maximum of $S\cup\left\{  0\right\}  $).

If $k\in\mathbb{N}$ satisfies $k>n$, then $a_{k}=0$%
\ \ \ \ \footnote{\textit{Proof.} Let $k\in\mathbb{N}$ be such that $k>n$. We
must prove that $a_{k}=0$.
\par
If we had $k\in S$, then we would have $k\in S\subseteq S\cup\left\{
0\right\}  $ and therefore $n\geq k$ (by (\ref{pf.thm.pol.pol-basics.c.2}),
applied to $t=k$); but this would contradict $k>n$. Hence, we cannot have
$k\in S$. Thus, $k\notin S$. Combining this with $k\in\mathbb{N}$, we obtain
$k\in\mathbb{N}\setminus S$. Hence, (\ref{pf.thm.pol.pol-basics.c.1}) (applied
to $i=k$) yields $a_{k}=0$. Qed.}. In other words, $\left(  a_{k}=0\text{ for
all }k>n\right)  $. In view of (\ref{eq.def.pol.deg.a.1}), this rewrites as
$\left(  a_{0},a_{1},a_{2},\ldots\right)  \in\mathbb{K}\left[  x\right]
_{\leq n}$. Thus, $\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)
\in\mathbb{K}\left[  x\right]  _{\leq n}$.

Hence, we have found an $n\in\mathbb{N}$ such that $\mathbf{a}\in
\mathbb{K}\left[  x\right]  _{\leq n}$. Thus, such an $n$ exists. This proves
Theorem \ref{thm.pol.pol-basics} \textbf{(c)}.

\textbf{(d)} Lemma \ref{lem.pol.addition} \textbf{(f)} (applied to $i=0$ and
$n=0$) yields $x^{0}\in\mathbb{K}\left[  x\right]  _{\leq0}$. Thus, Lemma
\ref{lem.pol.addition} \textbf{(c)} (applied to $n=0$, $\lambda=a$ and
$\mathbf{a}=x^{0}$) yields $ax^{0}\in\mathbb{K}\left[  x\right]  _{\leq0}$.
But%
\[
a\underbrace{x^{0}}_{=1_{\mathbb{\mathbb{K}}\left[  \left[  x\right]  \right]
}=\underline{1}}=a\underline{1}=a\left(  1,\underbrace{0,0,0,\ldots
}_{\text{zeroes}}\right)  =\left(  a,\underbrace{0,0,0,\ldots}_{\text{zeroes}%
}\right)  =\underline{a}.
\]
Thus, $\underline{a}=ax^{0}\in\mathbb{K}\left[  x\right]  _{\leq0}$. This
proves Theorem \ref{thm.pol.pol-basics} \textbf{(d)}.

\textbf{(e)} Lemma \ref{lem.pol.addition} \textbf{(f)} (applied to $i=1$ and
$n=1$) yields $x^{1}\in\mathbb{K}\left[  x\right]  _{\leq1}$. Thus,
$x=x^{1}\in\mathbb{K}\left[  x\right]  _{\leq1}$. This proves Theorem
\ref{thm.pol.pol-basics} \textbf{(e)}.

\textbf{(f)} Let $j=\max\left\{  n,m\right\}  $. Then, $n\leq\max\left\{
n,m\right\}  =j$ and similarly $m\leq j$.

But Theorem \ref{thm.pol.pol-basics} \textbf{(a)} (applied to $u=n$ and $v=j$)
yields $\mathbb{K}\left[  x\right]  _{\leq n}\subseteq\mathbb{K}\left[
x\right]  _{\leq j}$ (since $n\leq j$). Hence, $\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}\subseteq\mathbb{K}\left[  x\right]  _{\leq j}$. Similarly,
$\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq j}$. Hence, Lemma
\ref{lem.pol.addition} \textbf{(b)} (applied to $j$ instead of $n$) yields
$\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq j}=\mathbb{K}%
\left[  x\right]  _{\leq\max\left\{  n,m\right\}  }$ (since $j=\max\left\{
n,m\right\}  $). Furthermore, Lemma \ref{lem.pol.deg(ab)} \textbf{(b)} yields
$\mathbf{ab}\in\mathbb{K}\left[  x\right]  _{\leq n+m}$. Thus, Theorem
\ref{thm.pol.pol-basics} \textbf{(f)} is proven.
\end{proof}
\end{fineprint}

\begin{corollary}
\label{cor.pol.pol-subal}\textbf{(a)} The subset $\mathbb{K}\left[  x\right]
$ of $\mathbb{K}\left[  \left[  x\right]  \right]  $ is a $\mathbb{K}%
$-subalgebra of $\mathbb{K}\left[  \left[  x\right]  \right]  $.

\textbf{(b)} We have $x\in\mathbb{K}\left[  x\right]  $.

\textbf{(c)} We have
\[
\mathbb{K}\left[  x\right]  =\bigcup_{n\in\mathbb{N}}\mathbb{K}\left[
x\right]  _{\leq n}.
\]
Here, $\bigcup_{n\in\mathbb{N}}\mathbb{K}\left[  x\right]  _{\leq n}$ means
the union of the sets $\mathbb{K}\left[  x\right]  _{\leq n}$ over all
$n\in\mathbb{N}$ (in other words,%
\begin{align*}
\bigcup_{n\in\mathbb{N}}\mathbb{K}\left[  x\right]  _{\leq n}  &
=\mathbb{K}\left[  x\right]  _{\leq0}\cup\mathbb{K}\left[  x\right]  _{\leq
1}\cup\mathbb{K}\left[  x\right]  _{\leq2}\cup\cdots\\
&  =\left\{  \mathbf{a}\ \mid\ \text{there exists some }n\in\mathbb{N}\text{
such that }\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}\right\}  \text{
).}%
\end{align*}

\end{corollary}

\begin{exercise}
\label{exe.pol.pol-subal}Prove Corollary \ref{cor.pol.pol-subal}.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Proof of Corollary \ref{cor.pol.pol-subal}.]Theorem \ref{thm.pol.pol-basics}
\textbf{(b)} (applied to $n=1$) yields that $\mathbb{K}\left[  x\right]
_{\leq1}$ is a $\mathbb{K}$-submodule of $\mathbb{K}\left[  x\right]  $. Thus,
$\mathbb{K}\left[  x\right]  _{\leq1}\subseteq\mathbb{K}\left[  x\right]  $.
But Theorem \ref{thm.pol.pol-basics} \textbf{(e)} yields $x\in\mathbb{K}%
\left[  x\right]  _{\leq1}\subseteq\mathbb{K}\left[  x\right]  $. This proves
Corollary \ref{cor.pol.pol-subal} \textbf{(b)}.

\textbf{(a)} Theorem \ref{thm.pol.pol-basics} \textbf{(b)} (applied to $n=0$)
yields that $\mathbb{K}\left[  x\right]  _{\leq0}$ is a $\mathbb{K}$-submodule
of $\mathbb{K}\left[  x\right]  $. Thus, $\mathbb{K}\left[  x\right]  _{\leq
0}\subseteq\mathbb{K}\left[  x\right]  $.

Theorem \ref{thm.pol.pol-basics} \textbf{(e)} yields $\underline{0}%
\in\mathbb{K}\left[  x\right]  _{\leq0}\subseteq\mathbb{K}\left[  x\right]  $
and $\underline{1}\in\mathbb{K}\left[  x\right]  _{\leq0}\subseteq
\mathbb{K}\left[  x\right]  $.

Now, let $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  $. Then, there
exists some $n\in\mathbb{N}$ such that $\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}$ (by Theorem \ref{thm.pol.pol-basics} \textbf{(c)}).
Similarly, there exists some $m\in\mathbb{N}$ such that $\mathbf{b}%
\in\mathbb{K}\left[  x\right]  _{\leq m}$. Consider these $n$ and $m$.

Theorem \ref{thm.pol.pol-basics} \textbf{(f)} yields that $\mathbf{a}%
+\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq\max\left\{  n,m\right\}  }$
and $\mathbf{ab}\in\mathbb{K}\left[  x\right]  _{\leq n+m}$. But Theorem
\ref{thm.pol.pol-basics} \textbf{(b)} (applied to $\max\left\{  n,m\right\}  $
instead of $n$) yields that $\mathbb{K}\left[  x\right]  _{\leq\max\left\{
n,m\right\}  }$ is a $\mathbb{K}$-submodule of $\mathbb{K}\left[  x\right]  $.
Thus, $\mathbb{K}\left[  x\right]  _{\leq\max\left\{  n,m\right\}  }%
\subseteq\mathbb{K}\left[  x\right]  $. Hence,%
\begin{equation}
\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq\max\left\{
n,m\right\}  }\subseteq\mathbb{K}\left[  x\right]  .
\label{pf.cor.pol.pol-subal.a+b}%
\end{equation}
Furthermore, Theorem \ref{thm.pol.pol-basics} \textbf{(b)} (applied to $n+m$
instead of $n$) yields that $\mathbb{K}\left[  x\right]  _{\leq n+m}$ is a
$\mathbb{K}$-submodule of $\mathbb{K}\left[  x\right]  $. Thus, $\mathbb{K}%
\left[  x\right]  _{\leq n+m}\subseteq\mathbb{K}\left[  x\right]  $. Hence,%
\begin{equation}
\mathbf{ab}\in\mathbb{K}\left[  x\right]  _{\leq n+m}\subseteq\mathbb{K}%
\left[  x\right]  . \label{pf.cor.pol.pol-subal.ab}%
\end{equation}


Now, forget that we fixed $\mathbf{a}$ and $\mathbf{b}$. We thus have proven
(\ref{pf.cor.pol.pol-subal.a+b}) and (\ref{pf.cor.pol.pol-subal.ab}) for every
$\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  $.

Thus, in particular, $\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[  x\right]  $
for every $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  $. In other
words, the subset $\mathbb{K}\left[  x\right]  $ of $\mathbb{K}\left[  \left[
x\right]  \right]  $ is closed under addition.

Furthermore, $\mathbf{ab}\in\mathbb{K}\left[  x\right]  $ for every
$\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  $ (since we have proven
(\ref{pf.cor.pol.pol-subal.ab}) for every $\mathbf{a},\mathbf{b}\in
\mathbb{K}\left[  x\right]  $). In other words, the subset $\mathbb{K}\left[
x\right]  $ of $\mathbb{K}\left[  \left[  x\right]  \right]  $ is closed under multiplication.

If $\lambda\in\mathbb{K}$ and if $\mathbf{a}\in\mathbb{K}\left[  x\right]  $,
then $\lambda\mathbf{a}\in\mathbb{K}\left[  x\right]  $%
\ \ \ \ \footnote{\textit{Proof.} Let $\lambda\in\mathbb{K}$ and let
$\mathbf{a}\in\mathbb{K}\left[  x\right]  $. We must prove that $\lambda
\mathbf{a}\in\mathbb{K}\left[  x\right]  $.
\par
There exists some $n\in\mathbb{N}$ such that $\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}$ (by Theorem \ref{thm.pol.pol-basics} \textbf{(c)}).
Consider this $n$. Then, Lemma \ref{lem.pol.addition} \textbf{(c)} yields
$\lambda\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$. On the other
hand, Theorem \ref{thm.pol.pol-basics} \textbf{(b)} yields that $\mathbb{K}%
\left[  x\right]  _{\leq n}$ is a $\mathbb{K}$-submodule of $\mathbb{K}\left[
x\right]  $. Thus, $\mathbb{K}\left[  x\right]  _{\leq n}\subseteq
\mathbb{K}\left[  x\right]  $. Hence, $\lambda\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}\subseteq\mathbb{K}\left[  x\right]  $. Qed.}. In other
words, the subset $\mathbb{K}\left[  x\right]  $ of $\mathbb{K}\left[  \left[
x\right]  \right]  $ is closed under scaling.

The subset $\mathbb{K}\left[  x\right]  $ of $\mathbb{K}\left[  \left[
x\right]  \right]  $ contains $0_{\mathbb{K}\left[  \left[  x\right]  \right]
}$ (since $0_{\mathbb{K}\left[  \left[  x\right]  \right]  }=\underline{0}%
\in\mathbb{K}\left[  x\right]  $) and is closed under addition and closed
under scaling. Thus, this subset $\mathbb{K}\left[  x\right]  $ is a
$\mathbb{K}$-submodule of $\mathbb{K}\left[  \left[  x\right]  \right]  $.

The subset $\mathbb{K}\left[  x\right]  $ of $\mathbb{K}\left[  \left[
x\right]  \right]  $ contains $0_{\mathbb{K}\left[  \left[  x\right]  \right]
}$ and contains $1_{\mathbb{K}\left[  \left[  x\right]  \right]  }$ (since
$1_{\mathbb{K}\left[  \left[  x\right]  \right]  }=\underline{1}\in
\mathbb{K}\left[  x\right]  $) and is closed under addition and closed under
multiplication. Thus, this subset $\mathbb{K}\left[  x\right]  $ is a subring
of $\mathbb{K}\left[  \left[  x\right]  \right]  $.

Now, the subset $\mathbb{K}\left[  x\right]  $ is both a subring and a
$\mathbb{K}$-submodule of $\mathbb{K}\left[  \left[  x\right]  \right]  $. In
other words, $\mathbb{K}\left[  x\right]  $ is a $\mathbb{K}$-subalgebra of
$\mathbb{K}\left[  \left[  x\right]  \right]  $. This proves Corollary
\ref{cor.pol.pol-subal} \textbf{(a)}.

\textbf{(c)} If $n\in\mathbb{N}$, then $\mathbb{K}\left[  x\right]  _{\leq n}$
is a $\mathbb{K}$-submodule of $\mathbb{K}\left[  x\right]  $ (by Theorem
\ref{thm.pol.pol-basics} \textbf{(b)}), and thus satisfies $\mathbb{K}\left[
x\right]  _{\leq n}\subseteq\mathbb{K}\left[  x\right]  $. Hence,%
\begin{equation}
\bigcup_{n\in\mathbb{N}}\underbrace{\mathbb{K}\left[  x\right]  _{\leq n}%
}_{\subseteq\mathbb{K}\left[  x\right]  }\subseteq\bigcup_{n\in\mathbb{N}%
}\mathbb{K}\left[  x\right]  \subseteq\mathbb{K}\left[  x\right]  .
\label{pf.cor.pol.pol-subal.c.1}%
\end{equation}


On the other hand, let $\mathbf{a}\in\mathbb{K}\left[  x\right]  $. Then,
Theorem \ref{thm.pol.pol-basics} \textbf{(c)} shows that there exists some
$n\in\mathbb{N}$ such that $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq
n}$. In other words, we have $\mathbf{a}\in\bigcup_{n\in\mathbb{N}}%
\mathbb{K}\left[  x\right]  _{\leq n}$. Now, forget that we fixed $\mathbf{a}%
$. We thus have shown that $\mathbf{a}\in\bigcup_{n\in\mathbb{N}}%
\mathbb{K}\left[  x\right]  _{\leq n}$ for each $\mathbf{a}\in\mathbb{K}%
\left[  x\right]  $. In other words, $\mathbb{K}\left[  x\right]
\subseteq\bigcup_{n\in\mathbb{N}}\mathbb{K}\left[  x\right]  _{\leq n}$.
Combining this with (\ref{pf.cor.pol.pol-subal.c.1}), we obtain $\mathbb{K}%
\left[  x\right]  =\bigcup_{n\in\mathbb{N}}\mathbb{K}\left[  x\right]  _{\leq
n}$. This proves Corollary \ref{cor.pol.pol-subal} \textbf{(c)}.
\end{proof}
\end{fineprint}

\begin{definition}
\label{def.pol.polyring}Corollary \ref{cor.pol.pol-subal} \textbf{(a)} yields
that $\mathbb{K}\left[  x\right]  $ is a $\mathbb{K}$-algebra. This
$\mathbb{K}$-algebra is called the \textit{polynomial ring over }$\mathbb{K}$
\textit{in the indeterminate }$x$ (or the \textit{algebra of polynomials in
}$x$ \textit{over }$\mathbb{K}$).
\end{definition}

\begin{exercise}
\label{exe.pol.basis}Let $n\in\left\{  -1,0,1,\ldots\right\}  $. Theorem
\ref{thm.pol.pol-basics} \textbf{(b)} shows that $\mathbb{K}\left[  x\right]
_{\leq n}$ is a $\mathbb{K}$-submodule of $\mathbb{K}\left[  x\right]  $.
Prove that the list $\left(  x^{0},x^{1},\ldots,x^{n}\right)  $ is a basis of
this $\mathbb{K}$-submodule $\mathbb{K}\left[  x\right]  _{\leq n}$. (See
Definition \ref{def.module.lincomb} \textbf{(d)} for the definition of a basis
of a $\mathbb{K}$-submodule.)
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.pol.basis}.]Each $i\in\left\{  0,1,\ldots
,n\right\}  $ satisfies $i\in\mathbb{N}$ and $i\leq n$ (since $i\in\left\{
0,1,\ldots,n\right\}  $) and thus $x^{i}\in\mathbb{K}\left[  x\right]  _{\leq
n}$ (by Lemma \ref{lem.pol.addition} \textbf{(f)}). In other words, the $n+1$
vectors $x^{0},x^{1},\ldots,x^{n}$ all belong to $\mathbb{K}\left[  x\right]
_{\leq n}$.

Hence, Proposition \ref{prop.module.basis-unique} (applied to $\mathbb{K}%
\left[  x\right]  _{\leq n}$, $n+1$ and $\left(  x^{0},x^{1},\ldots
,x^{n}\right)  $ instead of $M$, $k$ and $\left(  v_{1},v_{2},\ldots
,v_{k}\right)  $) shows that $\left(  x^{0},x^{1},\ldots,x^{n}\right)  $ is a
basis of $\mathbb{K}\left[  x\right]  _{\leq n}$ if and only if each vector in
$\mathbb{K}\left[  x\right]  _{\leq n}$ can be \textbf{uniquely} written in
the form
\begin{equation}
\lambda_{1}x^{0}+\lambda_{2}x^{1}+\cdots+\lambda_{n+1}x^{n}%
,\ \ \ \ \ \ \ \ \ \ \text{with }\lambda_{1},\lambda_{2},\ldots,\lambda
_{n+1}\in\mathbb{K}. \label{sol.pol.basis.form}%
\end{equation}
We are now going to prove that each vector in $\mathbb{K}\left[  x\right]
_{\leq n}$ can be uniquely written in this form.

Indeed, let $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$. We are going
to show that $\mathbf{a}$ can be uniquely written in the form
(\ref{sol.pol.basis.form}). In order to show this, we must prove the following
two claims:

\begin{statement}
\textit{Claim 1:} There exists \textbf{at least} one $\left(  n+1\right)
$-tuple $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{n+1}\right)
\in\mathbb{K}^{n+1}$ such that $\mathbf{a}=\lambda_{1}x^{0}+\lambda_{2}%
x^{1}+\cdots+\lambda_{n+1}x^{n}$.
\end{statement}

\begin{statement}
\textit{Claim 2:} There exists \textbf{at most} one $\left(  n+1\right)
$-tuple $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{n+1}\right)
\in\mathbb{K}^{n+1}$ such that $\mathbf{a}=\lambda_{1}x^{0}+\lambda_{2}%
x^{1}+\cdots+\lambda_{n+1}x^{n}$.
\end{statement}

[\textit{Proof of Claim 1:} Write the FPS $\mathbf{a}$ in the form
$\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)  $. Then, $\left(
a_{0},a_{1},a_{2},\ldots\right)  =\mathbf{a}\in\mathbb{K}\left[  x\right]
_{\leq n}$. Hence, Theorem \ref{thm.pol.pol-as-sum} shows that
\[
\left(  a_{0},a_{1},a_{2},\ldots\right)  =a_{0}+a_{1}x+a_{2}x^{2}+\cdots
+a_{n}x^{n}=\sum_{k=0}^{n}a_{k}x^{k}.
\]
Thus,
\[
\mathbf{a}=\sum_{k=0}^{n}a_{k}x^{k}=a_{0}x^{0}+a_{1}x^{1}+\cdots+a_{n}x^{n}.
\]
Thus, there exists \textbf{at least} one $\left(  n+1\right)  $-tuple $\left(
\lambda_{1},\lambda_{2},\ldots,\lambda_{n+1}\right)  \in\mathbb{K}^{n+1}$ such
that $\mathbf{a}=\lambda_{1}x^{0}+\lambda_{2}x^{1}+\cdots+\lambda_{n+1}x^{n}$
(namely, $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{n+1}\right)
=\left(  a_{0},a_{1},\ldots,a_{n}\right)  $). This proves Claim 1.]

[\textit{Proof of Claim 2:} Let $\left(  u_{0},u_{1},\ldots,u_{n}\right)  $
and $\left(  v_{0},v_{1},\ldots,v_{n}\right)  $ be two $\left(  n+1\right)
$-tuples $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{n+1}\right)
\in\mathbb{K}^{n+1}$ such that $\mathbf{a}=\lambda_{1}x^{0}+\lambda_{2}%
x^{1}+\cdots+\lambda_{n+1}x^{n}$. We shall show that $\left(  u_{0}%
,u_{1},\ldots,u_{n}\right)  =\left(  v_{0},v_{1},\ldots,v_{n}\right)  $.

Indeed, $\left(  u_{0},u_{1},\ldots,u_{n}\right)  $ is an $\left(  n+1\right)
$-tuple $\left(  \lambda_{1},\lambda_{2},\ldots,\lambda_{n+1}\right)
\in\mathbb{K}^{n+1}$ such that $\mathbf{a}=\lambda_{1}x^{0}+\lambda_{2}%
x^{1}+\cdots+\lambda_{n+1}x^{n}$. In other words, $\left(  u_{0},u_{1}%
,\ldots,u_{n}\right)  $ is an $\left(  n+1\right)  $-tuple in $\mathbb{K}%
^{n+1}$ and satisfies $\mathbf{a}=u_{0}x^{0}+u_{1}x^{1}+\cdots+u_{n}x^{n}$.
Extend this $\left(  n+1\right)  $-tuple to an infinite sequence $\left(
u_{0},u_{1},u_{2},\ldots\right)  $ by setting%
\begin{equation}
u_{k}=0\ \ \ \ \ \ \ \ \ \ \text{for all integers }k>n.
\label{sol.pol.basis.C2.pf.1}%
\end{equation}
Then, $\left(  u_{0},u_{1},u_{2},\ldots\right)  $ is an FPS. Corollary
\ref{cor.pol.FPS-as-sum} (applied to $a_{i}=u_{i}$) thus shows that the family
$\left(  u_{k}x^{k}\right)  _{k\in\mathbb{N}}$ is summable, so that the sum
$\sum_{k\in\mathbb{N}}u_{k}x^{k}$ is well-defined, and moreover,
\[
\left(  u_{0},u_{1},u_{2},\ldots\right)  =u_{0}+u_{1}x+u_{2}x^{2}+u_{3}%
x^{3}+\cdots=\sum_{k\in\mathbb{N}}u_{k}x^{k}.
\]
Hence,%
\begin{align*}
\left(  u_{0},u_{1},u_{2},\ldots\right)   &  =\sum_{k\in\mathbb{N}}u_{k}%
x^{k}=\sum_{k=0}^{n}u_{k}x^{k}+\sum_{k=n+1}^{\infty}\underbrace{u_{k}%
}_{\substack{=0\\\text{(by (\ref{sol.pol.basis.C2.pf.1}),}\\\text{since }k\geq
n+1>n\text{)}}}x^{k}\\
&  =\sum_{k=0}^{n}u_{k}x^{k}+\underbrace{\sum_{k=n+1}^{\infty}0x^{k}}%
_{=0}=\sum_{k=0}^{n}u_{k}x^{k}=u_{0}x^{0}+u_{1}x^{1}+\cdots+u_{n}x^{n}.
\end{align*}
Comparing this with $\mathbf{a}=u_{0}x^{0}+u_{1}x^{1}+\cdots+u_{n}x^{n}$, we
obtain $\mathbf{a}=\left(  u_{0},u_{1},u_{2},\ldots\right)  $. Hence, each
$k\in\mathbb{N}$ satisfies $\left[  x^{k}\right]  \mathbf{a}=u_{k}$ (by the
definition of $\left[  x^{k}\right]  \mathbf{a}$). Thus, in particular, each
$k\in\left\{  0,1,\ldots,n\right\}  $ satisfies
\begin{equation}
\left[  x^{k}\right]  \mathbf{a}=u_{k}. \label{sol.pol.basis.C2.pf.3}%
\end{equation}
The same argument (applied to $\left(  v_{0},v_{1},\ldots,v_{n}\right)  $
instead of $\left(  u_{0},u_{1},\ldots,u_{n}\right)  $) yields that each
$k\in\left\{  0,1,\ldots,n\right\}  $ satisfies
\begin{equation}
\left[  x^{k}\right]  \mathbf{a}=v_{k}. \label{sol.pol.basis.C2.pf.4}%
\end{equation}
Hence, each $k\in\left\{  0,1,\ldots,n\right\}  $ satisfies%
\begin{align*}
u_{k}  &  =\left[  x^{k}\right]  \mathbf{a}\ \ \ \ \ \ \ \ \ \ \left(
\text{by (\ref{sol.pol.basis.C2.pf.3})}\right) \\
&  =v_{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.pol.basis.C2.pf.4}%
)}\right)  .
\end{align*}
In other words, $\left(  u_{0},u_{1},\ldots,u_{n}\right)  =\left(  v_{0}%
,v_{1},\ldots,v_{n}\right)  $.

Now, forget that we fixed $\left(  u_{0},u_{1},\ldots,u_{n}\right)  $ and
$\left(  v_{0},v_{1},\ldots,v_{n}\right)  $. We thus have shown that if
$\left(  u_{0},u_{1},\ldots,u_{n}\right)  $ and $\left(  v_{0},v_{1}%
,\ldots,v_{n}\right)  $ are two $\left(  n+1\right)  $-tuples $\left(
\lambda_{1},\lambda_{2},\ldots,\lambda_{n+1}\right)  \in\mathbb{K}^{n+1}$ such
that $\mathbf{a}=\lambda_{1}x^{0}+\lambda_{2}x^{1}+\cdots+\lambda_{n+1}x^{n}$,
then $\left(  u_{0},u_{1},\ldots,u_{n}\right)  =\left(  v_{0},v_{1}%
,\ldots,v_{n}\right)  $. In other words, there exists \textbf{at most} one
$\left(  n+1\right)  $-tuple $\left(  \lambda_{1},\lambda_{2},\ldots
,\lambda_{n+1}\right)  \in\mathbb{K}^{n+1}$ such that $\mathbf{a}=\lambda
_{1}x^{0}+\lambda_{2}x^{1}+\cdots+\lambda_{n+1}x^{n}$. This proves Claim 2.]

Combining Claim 1 and Claim 2, we now conclude that there exists a
\textbf{unique} $\left(  n+1\right)  $-tuple $\left(  \lambda_{1},\lambda
_{2},\ldots,\lambda_{n+1}\right)  \in\mathbb{K}^{n+1}$ such that
$\mathbf{a}=\lambda_{1}x^{0}+\lambda_{2}x^{1}+\cdots+\lambda_{n+1}x^{n}$. In
other words, $\mathbf{a}$ can be uniquely written in the form
(\ref{sol.pol.basis.form}).

Now, forget that we fixed $\mathbf{a}$. We thus have shown that each
$\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$ can be uniquely written
in the form (\ref{sol.pol.basis.form}). In other words, each vector in
$\mathbb{K}\left[  x\right]  _{\leq n}$ can be \textbf{uniquely} written in
the form (\ref{sol.pol.basis.form}). Thus, the list $\left(  x^{0}%
,x^{1},\ldots,x^{n}\right)  $ is a basis of $\mathbb{K}\left[  x\right]
_{\leq n}$ (because we have seen that the list $\left(  x^{0},x^{1}%
,\ldots,x^{n}\right)  $ is a basis of $\mathbb{K}\left[  x\right]  _{\leq n}$
if and only if each vector in $\mathbb{K}\left[  x\right]  _{\leq n}$ can be
\textbf{uniquely} written in the form (\ref{sol.pol.basis.form})). This solves
Exercise \ref{exe.pol.basis}.
\end{proof}
\end{fineprint}

We can restate some of Theorem \ref{thm.pol.pol-basics} in terms of degrees:

\begin{theorem}
\label{thm.pol.deg-basics}\textbf{(a)} If $a\in\mathbb{K}$, then
$\underline{a}\in\mathbb{K}\left[  x\right]  $ and $\deg\underline{a}\leq0$.

\textbf{(b)} If $a\in\mathbb{K}$ is nonzero, then $\deg\underline{a}=0$.

\textbf{(c)} We have $x\in\mathbb{K}\left[  x\right]  $ and $\deg x\leq1$.

\textbf{(d)} If $\left\vert \mathbb{K}\right\vert >1$, then $\deg x=1$.

\textbf{(e)} If $\mathbf{a}$ and $\mathbf{b}$ are two polynomials, then
$\mathbf{a}+\mathbf{b}$ and $\mathbf{ab}$ are two polynomials satisfying
\[
\deg\left(  \mathbf{a}+\mathbf{b}\right)  \leq\max\left\{  \deg\mathbf{a}%
,\deg\mathbf{b}\right\}  \ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \deg\left(  \mathbf{ab}\right)  \leq\deg\mathbf{a}%
+\deg\mathbf{b}.
\]


\textbf{(f)} If $\mathbb{K}$ is a field, and if $\mathbf{a}$ and $\mathbf{b}$
are two polynomials, then $\deg\left(  \mathbf{ab}\right)  =\deg
\mathbf{a}+\deg\mathbf{b}$.
\end{theorem}

We shall prove this in Exercise \ref{exe.pol.deg-basics}. The condition
\textquotedblleft$\left\vert \mathbb{K}\right\vert >1$\textquotedblright\ in
Theorem \ref{thm.pol.deg-basics} \textbf{(d)} is a homage to the possibility
that $\mathbb{K}$ may be a trivial ring (i.e., a ring with only one element).
If $\mathbb{K}$ is a trivial ring, then all coefficients of the polynomial $x$
are $0$ (because all elements of $\mathbb{K}$ are $0$), and thus $\deg
x=-\infty$ rather than $\deg x=1$. The zero ring is generally responsible for
lots of exceptions in rules about degrees; thus it is better to speak of
\textquotedblleft polynomials of degree $\leq n$\textquotedblright\ than of
the exact degree of a polynomial.

Note also that Theorem \ref{thm.pol.deg-basics} \textbf{(f)} would not be true
without the \textquotedblleft$\mathbb{K}$ is a field\textquotedblright%
\ requirement. For example, if $\mathbb{K}=\mathbb{Z}/4$ and $\mathbf{a}=1+2x$
and $\mathbf{b}=1+2x$ (using the standard shorthand notations $1=\left[
1\right]  _{4}$ and $2=\left[  2\right]  _{4}$ etc.), then the polynomial%
\begin{equation}
\mathbf{ab}=\left(  1+2x\right)  \left(  1+2x\right)  =1+\underbrace{4x+4x^{2}%
}_{\substack{=0\\\text{(since }4=0\text{ in }\mathbb{K}\text{)}}}=1
\label{eq.pol.deg(ab)=0.cex}%
\end{equation}
has degree $<2$.

Our next lemma is a generalization of Theorem \ref{thm.pol.deg-basics}
\textbf{(f)}: Instead of requiring $\mathbb{K}$ to be a field, we will merely
require that the coefficient $\left[  x^{m}\right]  \mathbf{b}$ of
$\mathbf{b}$ be invertible (which is automatically satisfied when $\mathbb{K}$
is a field and $m=\deg\mathbf{b}$).

\begin{lemma}
\label{lem.pol.deg(ab)-ible}Let $m\in\mathbb{N}$. Let $\mathbf{a}$ and
$\mathbf{b}$ be two polynomials with $\mathbf{b}\in\mathbb{K}\left[  x\right]
_{\leq m}$. Assume that $\left[  x^{m}\right]  \mathbf{b}\in\mathbb{K}$ is
invertible. Then, $\deg\left(  \mathbf{ab}\right)  =\deg\mathbf{a}+m$.
\end{lemma}

\begin{exercise}
\label{exe.pol.deg-basics} Prove Theorem \ref{thm.pol.deg-basics} and Lemma
\ref{lem.pol.deg(ab)-ible}.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Proof of Lemma \ref{lem.pol.deg(ab)-ible}.]If $\mathbf{a}=\underline{0}$,
then the claim that we have to prove boils down to $-\infty=\left(
-\infty\right)  +m$ (since both polynomials $\underbrace{\mathbf{a}%
}_{=\underline{0}}\mathbf{b}=\underline{0}\mathbf{b}$ and $\mathbf{a}$ equal
$\underline{0}$ and thus have degree $-\infty$), which is a consequence of the
rules we stipulated for the symbol $-\infty$. Thus, WLOG assume that
$\mathbf{a}\neq\underline{0}$. Hence, $\deg\mathbf{a}\in\mathbb{N}$. Define
$n\in\mathbb{N}$ by $n=\deg\mathbf{a}$.

Now, $\deg\mathbf{a}=n\leq n$. Hence, $\mathbf{a}$ is a polynomial of degree
$\leq n$. According to Lemma \ref{lem.pol.deg} \textbf{(b)}, this entails that
$\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$. Hence, Lemma
\ref{lem.pol.deg(ab)} \textbf{(b)} yields that $\mathbf{ab}\in\mathbb{K}%
\left[  x\right]  _{\leq n+m}$. Furthermore, Lemma \ref{lem.pol.deg(ab)}
\textbf{(c)} yields $\left[  x^{n+m}\right]  \left(  \mathbf{ab}\right)
=\left(  \left[  x^{n}\right]  \mathbf{a}\right)  \cdot\left(  \left[
x^{m}\right]  \mathbf{b}\right)  $.

But Exercise \ref{exe.pol.deg-red} \textbf{(c)} yields that we have
$\deg\mathbf{a}=n$ if and only if $\left[  x^{n}\right]  \mathbf{a}\neq0$.
Hence, $\left[  x^{n}\right]  \mathbf{a}\neq0$ (since $\deg\mathbf{a}=n$).

Assume (for the sake of contradiction) that $\left[  x^{n+m}\right]  \left(
\mathbf{ab}\right)  =0$. Then, $0=\left[  x^{n+m}\right]  \left(
\mathbf{ab}\right)  =\left(  \left[  x^{n}\right]  \mathbf{a}\right)
\cdot\left(  \left[  x^{m}\right]  \mathbf{b}\right)  $. We can divide both
sides of this equality by $\left[  x^{m}\right]  \mathbf{b}$ (since $\left[
x^{m}\right]  \mathbf{b}$ is invertible), and thus obtain $0=\left[
x^{n}\right]  \mathbf{a}\neq0$. This is absurd. This contradiction shows that
our assumption was wrong. Hence, $\left[  x^{n+m}\right]  \left(
\mathbf{ab}\right)  \neq0$. Thus, Exercise \ref{exe.pol.deg-red} \textbf{(b)}
(applied to $\mathbf{ab}$ and $n+m$ instead of $\mathbf{a}$ and $n$) yields
$\deg\left(  \mathbf{ab}\right)  =n+m$ (since $\deg\left(  \mathbf{ab}\right)
\leq n+m$). In view of $n=\deg\mathbf{a}$, this rewrites as $\deg\left(
\mathbf{ab}\right)  =\deg\mathbf{a}+m$. This proves Lemma
\ref{lem.pol.deg(ab)-ible}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.pol.deg-basics}.]\textbf{(a)} Let $a\in\mathbb{K}$.
Theorem \ref{thm.pol.pol-basics} \textbf{(d)} yields $\underline{a}%
\in\mathbb{K}\left[  x\right]  _{\leq0}$. But Lemma \ref{lem.pol.deg}
\textbf{(b)} (applied to $\mathbf{a}=\underline{a}$ and $n=0$) shows that we
have the following equivalence:%
\[
\left(  \underline{a}\text{ is a polynomial of degree }\leq0\right)
\ \Longleftrightarrow\ \left(  \underline{a}\in\mathbb{K}\left[  x\right]
_{\leq0}\right)  .
\]
Hence, $\underline{a}$ is a polynomial of degree $\leq0$ (since $\underline{a}%
\in\mathbb{K}\left[  x\right]  _{\leq0}$). In other words, $\underline{a}%
\in\mathbb{K}\left[  x\right]  $ and $\deg\underline{a}\leq0$. This proves
Theorem \ref{thm.pol.deg-basics} \textbf{(a)}.

\textbf{(b)} Let $a\in\mathbb{K}$ be nonzero. Theorem \ref{thm.pol.pol-basics}
\textbf{(d)} yields $\underline{a}\in\mathbb{K}\left[  x\right]  _{\leq0}$.
Moreover, $\left[  x^{0}\right]  \left(  \underline{a}\right)  =a\neq0$ (since
$a$ is nonzero). Hence, Exercise \ref{exe.pol.deg-red} \textbf{(b)} (applied
to $n=0$ and $\mathbf{a}=\underline{a}$) yields $\deg\underline{a}=0$. This
proves Theorem \ref{thm.pol.deg-basics} \textbf{(b)}.

\textbf{(c)} Theorem \ref{thm.pol.pol-basics} \textbf{(e)} yields
$x\in\mathbb{K}\left[  x\right]  _{\leq1}$. But Lemma \ref{lem.pol.deg}
\textbf{(b)} (applied to $\mathbf{a}=x$ and $n=1$) shows that we have the
following equivalence:%
\[
\left(  x\text{ is a polynomial of degree }\leq1\right)  \ \Longleftrightarrow
\ \left(  x\in\mathbb{K}\left[  x\right]  _{\leq1}\right)  .
\]
Hence, $x$ is a polynomial of degree $\leq1$ (since $x\in\mathbb{K}\left[
x\right]  _{\leq1}$). In other words, $x\in\mathbb{K}\left[  x\right]  $ and
$\deg x\leq1$. This proves Theorem \ref{thm.pol.deg-basics} \textbf{(c)}.

\textbf{(d)} Assume that $\left\vert \mathbb{K}\right\vert >1$. Then, $1\neq0$
in $\mathbb{K}$ (that is, $1_{\mathbb{K}}\neq0_{\mathbb{K}}$%
)\ \ \ \ \footnote{\textit{Proof:} Let us recall how this is proven: If we had
$1=0$ in $\mathbb{K}$, then we would have $a=a\cdot\underbrace{1}_{=0}%
=a\cdot0=0$ for each $a\in\mathbb{K}$, and therefore we would have
$\mathbb{K}\subseteq\left\{  0\right\}  $ and thus $\left\vert \mathbb{K}%
\right\vert \leq\left\vert \left\{  0\right\}  \right\vert =1$, which would
contradict $\left\vert \mathbb{K}\right\vert >1$. Hence, we cannot have $1=0$
in $\mathbb{K}$. Thus, $1\neq0$ in $\mathbb{K}$.}. Now, Theorem
\ref{thm.pol.pol-basics} \textbf{(e)} yields $x\in\mathbb{K}\left[  x\right]
_{\leq1}$. Moreover, $\left[  x^{1}\right]  \left(  x\right)  =1\neq0$. Hence,
Exercise \ref{exe.pol.deg-red} \textbf{(b)} (applied to $n=1$ and
$\mathbf{a}=x$) yields $\deg x=1$. This proves Theorem
\ref{thm.pol.deg-basics} \textbf{(d)}.

\textbf{(e)} Let $\mathbf{a}$ and $\mathbf{b}$ be two polynomials. We must
prove that $\mathbf{a}+\mathbf{b}$ and $\mathbf{ab}$ are two polynomials
satisfying%
\[
\deg\left(  \mathbf{a}+\mathbf{b}\right)  \leq\max\left\{  \deg\mathbf{a}%
,\deg\mathbf{b}\right\}  \ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \deg\left(  \mathbf{ab}\right)  \leq\deg\mathbf{a}%
+\deg\mathbf{b}.
\]
If $\mathbf{a}=\underline{0}$, then this is all obvious (because in this case,
we have $\mathbf{a}+\mathbf{b}=\mathbf{b}$ and $\mathbf{ab}=\underline{0}$ and
$\deg\underline{0}=-\infty$). Thus, for the rest of this proof, we WLOG assume
that $\mathbf{a}\neq\underline{0}$. For a similar reason, we WLOG assume that
$\mathbf{b}\neq\underline{0}$. Now, $\deg\mathbf{a}$ is a well-defined
nonnegative integer (since $\mathbf{a}\neq\underline{0}$). Similarly,
$\deg\mathbf{b}$ is a well-defined nonnegative integer.

Define $n\in\mathbb{N}$ by $n=\deg\mathbf{a}$. Define $m\in\mathbb{N}$ by
$m=\deg\mathbf{b}$. Lemma \ref{lem.pol.deg} \textbf{(b)} shows that we have
the following equivalence:%
\[
\left(  \mathbf{a}\text{ is a polynomial of degree }\leq n\right)
\ \Longleftrightarrow\ \left(  \mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq
n}\right)  .
\]
Hence, $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$ (since
$\mathbf{a}$ is a polynomial of degree $\leq n$ (since $n=\deg\mathbf{a}$)).
Similarly, $\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq m}$.

Now, $\mathbf{a}$ is a polynomial of degree $\deg\mathbf{a}=n\leq\max\left\{
n,m\right\}  $. But Lemma \ref{lem.pol.deg} \textbf{(b)} (applied to
$\max\left\{  n,m\right\}  $ instead of $n$) shows that we have the following
equivalence:%
\[
\left(  \mathbf{a}\text{ is a polynomial of degree }\leq\max\left\{
n,m\right\}  \right)  \ \Longleftrightarrow\ \left(  \mathbf{a}\in
\mathbb{K}\left[  x\right]  _{\leq\max\left\{  n,m\right\}  }\right)  .
\]
Hence, $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq\max\left\{
n,m\right\}  }$ (since $\mathbf{a}$ is a polynomial of degree $\leq
\max\left\{  n,m\right\}  $). Similarly, $\mathbf{b}\in\mathbb{K}\left[
x\right]  _{\leq\max\left\{  n,m\right\}  }$. Thus, Lemma
\ref{lem.pol.addition} \textbf{(b)} (applied to $\max\left\{  n,m\right\}  $
instead of $n$) shows that $\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[
x\right]  _{\leq\max\left\{  n,m\right\}  }$. But Lemma \ref{lem.pol.deg}
\textbf{(b)} (applied to $\max\left\{  n,m\right\}  $ and $\mathbf{a}%
+\mathbf{b}$ instead of $n$ and $\mathbf{a}$) shows that we have the following
equivalence:%
\[
\left(  \mathbf{a}+\mathbf{b}\text{ is a polynomial of degree }\leq
\max\left\{  n,m\right\}  \right)  \ \Longleftrightarrow\ \left(
\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq\max\left\{
n,m\right\}  }\right)  .
\]
Hence, $\mathbf{a}+\mathbf{b}$ is a polynomial of degree $\leq\max\left\{
n,m\right\}  $ (since $\mathbf{a}+\mathbf{b}\in\mathbb{K}\left[  x\right]
_{\leq\max\left\{  n,m\right\}  }$). In other words, $\mathbf{a}+\mathbf{b}$
is a polynomial satisfying $\deg\left(  \mathbf{a}+\mathbf{b}\right)  \leq
\max\left\{  n,m\right\}  $.

Lemma \ref{lem.pol.deg(ab)} \textbf{(b)} yields $\mathbf{ab}\in\mathbb{K}%
\left[  x\right]  _{\leq n+m}$. But Lemma \ref{lem.pol.deg} \textbf{(b)}
(applied to $n+m$ and $\mathbf{ab}$ instead of $n$ and $\mathbf{a}$) shows
that we have the following equivalence:%
\[
\left(  \mathbf{ab}\text{ is a polynomial of degree }\leq n+m\right)
\ \Longleftrightarrow\ \left(  \mathbf{ab}\in\mathbb{K}\left[  x\right]
_{\leq n+m}\right)  .
\]
Hence, $\mathbf{ab}$ is a polynomial of degree $\leq n+m$ (since
$\mathbf{ab}\in\mathbb{K}\left[  x\right]  _{\leq n+m}$). In other words,
$\mathbf{ab}$ is a polynomial satisfying $\deg\left(  \mathbf{ab}\right)  \leq
n+m$.

So we have shown that $\mathbf{a}+\mathbf{b}$ and $\mathbf{ab}$ are two
polynomials, and we have%
\begin{align*}
\deg\left(  \mathbf{a}+\mathbf{b}\right)   &  \leq\max\left\{  \underbrace{n}%
_{=\deg\mathbf{a}},\underbrace{m}_{=\deg\mathbf{b}}\right\}  =\max\left\{
\deg\mathbf{a},\deg\mathbf{b}\right\}  \ \ \ \ \ \ \ \ \ \ \text{and}\\
\deg\left(  \mathbf{ab}\right)   &  \leq\underbrace{n}_{=\deg\mathbf{a}%
}+\underbrace{m}_{=\deg\mathbf{b}}=\deg\mathbf{a}+\deg\mathbf{b}.
\end{align*}
This completes the proof of Theorem \ref{thm.pol.deg-basics} \textbf{(e)}.

\textbf{(f)} Assume that $\mathbb{K}$ is a field. Let $\mathbf{a}$ and
$\mathbf{b}$ be two polynomials. We must prove that $\deg\left(
\mathbf{ab}\right)  =\deg\mathbf{a}+\deg\mathbf{b}$. If $\mathbf{a}%
=\underline{0}$, then this is obvious (because in this case, we have
$\mathbf{ab}=\underline{0}$ and $\deg\underline{0}=-\infty$). Thus, for the
rest of this proof, we WLOG assume that $\mathbf{a}\neq\underline{0}$. For a
similar reason, we WLOG assume that $\mathbf{b}\neq\underline{0}$.

Define $m\in\mathbb{N}$ by $m=\deg\mathbf{b}$. (We can do this, since
$\mathbf{b}\neq\underline{0}$.) Then, $\deg\mathbf{b}\leq m$. In other words,
$\mathbf{b}$ is a polynomial of degree $\leq m$. Exercise
\ref{exe.pol.deg-red} \textbf{(c)} (applied to $m$ and $\mathbf{b}$ instead of
$n$ and $\mathbf{a}$) yields that we have $\deg\mathbf{b}=m$ if and only if
$\left[  x^{m}\right]  \mathbf{b}\neq0$. Hence, $\left[  x^{m}\right]
\mathbf{b}\neq0$ (since $\deg\mathbf{b}=m$). Thus, the element $\left[
x^{m}\right]  \mathbf{b}\in\mathbb{K}$ is nonzero and therefore invertible
(since $\mathbb{K}$ is a field, and thus every nonzero element of $\mathbb{K}$
is invertible). Therefore, Lemma \ref{lem.pol.deg(ab)-ible} shows that
$\deg\left(  \mathbf{ab}\right)  =\deg\mathbf{a}+\underbrace{m}_{=\deg
\mathbf{b}}=\deg\mathbf{a}+\deg\mathbf{b}$. This proves Theorem
\ref{thm.pol.deg-basics} \textbf{(f)}.
\end{proof}
\end{fineprint}

\begin{proposition}
\label{prop.pol.deg-prod-k}Let $\mathbf{a}_{1},\mathbf{a}_{2},\ldots
,\mathbf{a}_{k}\in\mathbb{K}\left[  x\right]  $.

\textbf{(a)} Then,%
\[
\deg\left(  \mathbf{a}_{1}\mathbf{a}_{2}\cdots\mathbf{a}_{k}\right)  \leq
\deg\left(  \mathbf{a}_{1}\right)  +\deg\left(  \mathbf{a}_{2}\right)
+\cdots+\deg\left(  \mathbf{a}_{k}\right)  .
\]


\textbf{(b)} If $\mathbb{K}$ is a field, then this is an equality.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.pol.deg-prod-k}.]\textbf{(a)} Proceed by
induction on $k$. The base case ($k=0$) follows from Theorem
\ref{thm.pol.deg-basics} \textbf{(a)} (applied to $a=1$), since the empty
product of polynomials in $\mathbb{K}\left[  x\right]  $ is $1_{\mathbb{K}%
\left[  x\right]  }=\underline{1}$. The induction step relies on Theorem
\ref{thm.pol.deg-basics} \textbf{(e)} (specifically, the inequality
$\deg\left(  \mathbf{ab}\right)  \leq\deg\mathbf{a}+\deg\mathbf{b}$).

\textbf{(b)} Again, proceed by induction on $k$. The base case ($k=0$) follows
from Theorem \ref{thm.pol.deg-basics} \textbf{(b)} (applied to $a=1$), since
the empty product of polynomials in $\mathbb{K}\left[  x\right]  $ is
$1_{\mathbb{K}\left[  x\right]  }=\underline{1}$. The induction step relies on
Theorem \ref{thm.pol.deg-basics} \textbf{(f)}.
\end{proof}

The following exercise will be useful to us later on:

\begin{exercise}
\label{exe.pol.deg-ab-uniquot}Let $m\in\mathbb{N}$. Let $\mathbf{b}%
\in\mathbb{K}\left[  x\right]  _{\leq m}$ be such that $\left[  x^{m}\right]
\mathbf{b}\in\mathbb{K}$ is invertible. Let $\mathbf{q}\in\mathbb{K}\left[
x\right]  $ be such that $\mathbf{qb}\in\mathbb{K}\left[  x\right]  _{\leq
m-1}$. Prove that $\mathbf{q}=\underline{0}$.
\end{exercise}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.pol.deg-ab-uniquot}.]This can be easily solved
using classical logic: Assume the contrary. Thus, $\mathbf{q}\neq
\underline{0}$. Hence, $\deg\mathbf{q}$ is a well-defined nonnegative integer.
Thus, $\deg\mathbf{q}\geq0$. Now, Lemma \ref{lem.pol.deg(ab)-ible} (applied to
$\mathbf{a}=\mathbf{q}$) yields $\deg\left(  \mathbf{qb}\right)
=\underbrace{\deg\mathbf{q}}_{\geq0}+m\geq m$. But Lemma \ref{lem.pol.deg}
\textbf{(b)} (applied to $n=m-1$ and $\mathbf{a}=\mathbf{qb}$) shows that we
have the following equivalence:%
\[
\left(  \mathbf{qb}\text{ is a polynomial of degree }\leq m-1\right)
\ \Longleftrightarrow\ \left(  \mathbf{qb}\in\mathbb{K}\left[  x\right]
_{\leq m-1}\right)  .
\]
Hence, $\mathbf{qb}$ is a polynomial of degree $\leq m-1$ (since
$\mathbf{qb}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$). Hence, $\deg\left(
\mathbf{qb}\right)  \leq m-1<m$. This contradicts $\deg\left(  \mathbf{qb}%
\right)  \geq m$. This contradiction shows that our assumption was false.
Thus, the exercise is solved.

Here is a constructive solution: Theorem \ref{thm.pol.pol-basics} \textbf{(c)}
(applied to $\mathbf{a}=\mathbf{q}$) shows that there exists some
$n\in\mathbb{N}$ such that $\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq
n}$. Consider this $n$. We now claim that%
\begin{equation}
\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-d}%
\ \ \ \ \ \ \ \ \ \ \text{for each }d\in\left\{  0,1,\ldots,n+1\right\}  .
\label{sol.pol.deg-ab-uniquot.1}%
\end{equation}


[\textit{Proof of (\ref{sol.pol.deg-ab-uniquot.1}):} We shall prove
(\ref{sol.pol.deg-ab-uniquot.1}) by induction on $d$:

\textit{Induction base:} We have $\mathbf{q}\in\mathbb{K}\left[  x\right]
_{\leq n}=\mathbb{K}\left[  x\right]  _{\leq n-0}$ (since $n=n-0$). In other
words, (\ref{sol.pol.deg-ab-uniquot.1}) holds for $d=0$. This completes the
induction base.

\textit{Induction step:} Let $p\in\left\{  0,1,\ldots,n\right\}  $. Assume
that (\ref{sol.pol.deg-ab-uniquot.1}) holds for $d=p$. We must prove that
(\ref{sol.pol.deg-ab-uniquot.1}) holds for $d=p+1$.

Note that $p\in\left\{  0,1,\ldots,n\right\}  $, thus $p\leq n$, hence
$n-p\geq0$ and thus $n-p\in\mathbb{N}$. Hence, $\left(  n-p\right)
+m\in\mathbb{N}$ (since $m\in\mathbb{N}$). Furthermore, $\underbrace{\left(
n-p\right)  }_{\geq0}+m\geq m>m-1$.

We have assumed that (\ref{sol.pol.deg-ab-uniquot.1}) holds for $d=p$. In
other words, we have $\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-p}$.
Also, $n-p\in\mathbb{N}$ and $\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq
m}$. Hence, Lemma \ref{lem.pol.deg(ab)} \textbf{(c)} (applied to $n-p$ and
$\mathbf{q}$ instead of $n$ and $\mathbf{a}$) yields
\begin{equation}
\left[  x^{\left(  n-p\right)  +m}\right]  \left(  \mathbf{qb}\right)
=\left(  \left[  x^{n-p}\right]  \mathbf{q}\right)  \cdot\left(  \left[
x^{m}\right]  \mathbf{b}\right)  . \label{sol.pol.deg-ab-uniquot.1.pf.2}%
\end{equation}


Lemma \ref{lem.pol.deg} \textbf{(a)} (applied to $\mathbf{qb}$ and $m-1$
instead of $\mathbf{a}$ and $n$) shows that we have the following equivalence:%
\[
\left(  \mathbf{qb}\in\mathbb{K}\left[  x\right]  _{\leq m-1}\right)
\ \Longleftrightarrow\ \left(  \left[  x^{k}\right]  \left(  \mathbf{qb}%
\right)  =0\text{ for all }k>m-1\right)  .
\]
Hence, we have $\left[  x^{k}\right]  \left(  \mathbf{qb}\right)  =0$ for all
$k>m-1$ (since $\mathbf{qb}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$).
Applying this to $k=\left(  n-p\right)  +m$, we obtain $\left[  x^{\left(
n-p\right)  +m}\right]  \left(  \mathbf{qb}\right)  =0$ (since $\left(
n-p\right)  +m>m-1$). Comparing this with (\ref{sol.pol.deg-ab-uniquot.1.pf.2}%
), we obtain $\left(  \left[  x^{n-p}\right]  \mathbf{q}\right)  \cdot\left(
\left[  x^{m}\right]  \mathbf{b}\right)  =0$. We can divide both sides of this
equality by $\left[  x^{m}\right]  \mathbf{b}$ (since $\left[  x^{m}\right]
\mathbf{b}\in\mathbb{K}$ is invertible). As a result, we obtain $\left[
x^{n-p}\right]  \mathbf{q}=0$.

Now, we know that $\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-p}$ and
$\left[  x^{n-p}\right]  \mathbf{q}=0$. Hence, Exercise \ref{exe.pol.deg-red}
\textbf{(a)} (applied to $n-p$ and $\mathbf{q}$ instead of $n$ and
$\mathbf{a}$) yields $\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq
n-p-1}=\mathbb{K}\left[  x\right]  _{\leq n-\left(  p+1\right)  }$ (since
$n-p-1=n-\left(  p+1\right)  $). In other words,
(\ref{sol.pol.deg-ab-uniquot.1}) holds for $d=p+1$. This completes the
induction step. Thus, (\ref{sol.pol.deg-ab-uniquot.1}) is proven by induction.]

Now that we have proven (\ref{sol.pol.deg-ab-uniquot.1}), we can apply
(\ref{sol.pol.deg-ab-uniquot.1}) to $d=n+1$. As a result, we obtain
\begin{align*}
\mathbf{q}  &  \in\mathbb{K}\left[  x\right]  _{\leq n-\left(  n+1\right)
}=\mathbb{K}\left[  x\right]  _{\leq-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}n-\left(  n+1\right)  =-1\right) \\
&  =\left\{  \underline{0}\right\}
\end{align*}
(by Example \ref{exa.pol.deg.1} \textbf{(c)} (applied to $-1$ instead of $n$),
since $-1$ is negative). In other words, $\mathbf{q}=\underline{0}$. Thus,
Exercise \ref{exe.pol.deg-ab-uniquot} is solved again (constructively this time).
\end{proof}
\end{fineprint}

\subsection{\label{sect.pol.quorem}Division with remainder}

\subsubsection{\label{subsect.pol.quorem.gen}The general case}

Polynomials, in many senses, are like numbers. In particular, we can study
their divisibility, congruence and remainder classes just as we did with
integers and Gaussian integers. We will not go deeply into this, but we shall
see some of the very basic properties.

\begin{comment}
The first step towards a ``number theory'' of polynomials would
be to define divisibility among polynomials (in analogy to
Definition \ref{def.ent.div.div}).
Instead of doing this specificially for polynomials, let us do this once
and for all for any arbitrary commutative ring:
\begin{definition}
\label{def.pol.div}Let $\mathbb{L}$ be a commutative ring.
Let $a$ and $b$ be two elements of $\mathbb{L}$. We say that $a\mid b$
\textit{ in } $\mathbb{L}$
(or \textquotedblleft$a$ \textit{divides} $b$\textquotedblright\ or
\textquotedblleft$b$ is \textit{divisible by }$a$\textquotedblright\ or
\textquotedblleft$b$ is a \textit{multiple} of $a$\textquotedblright) if there
exists a $c \in \mathbb{L}$ such that $b=ac$.
We furthermore say that $a\nmid b$ if $a$ does not divide $b$.
\end{definition}
\end{comment}


The first basic fact is a version of division with remainder for polynomials
(compare with Theorem \ref{thm.ent.quorem.full} and Theorem
\ref{thm.Z[i].gauss.quorem}):

\begin{theorem}
\label{thm.pol.quorem}Let $m\in\mathbb{N}$. Let $\mathbf{b}\in\mathbb{K}%
\left[  x\right]  _{\leq m}$ be such that $\left[  x^{m}\right]  \mathbf{b}%
\in\mathbb{K}$ is invertible. Let $\mathbf{a}\in\mathbb{K}\left[  x\right]  $
be any polynomial.

\textbf{(a)} Then, there exists a \textbf{unique} pair $\left(  \mathbf{q}%
,\mathbf{r}\right)  $ of polynomials such that $\mathbf{a}=\mathbf{qb}%
+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$.

\textbf{(b)} Moreover, if $n\in\mathbb{N}$ satisfies $\mathbf{a}\in
\mathbb{K}\left[  x\right]  _{\leq n}$, then this pair satisfies
$\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-m}$.
\end{theorem}

We shall give an example for Theorem \ref{thm.pol.quorem} in a moment (and
then prove the theorem after a while); but first, let us comment on the
condition that $\left[  x^{m}\right]  \mathbf{b}$ be invertible. Indeed, if
$\mathbb{K}$ is a field, then this condition is equivalent to the requirement
that $\left[  x^{m}\right]  \mathbf{b}$ be nonzero; and this latter
requirement is equivalent to requiring that $\deg\mathbf{b}=m$ (by Exercise
\ref{exe.pol.deg-red} \textbf{(c)}). Hence, if $\mathbb{K}$ is a field, then
Theorem \ref{thm.pol.quorem} can be applied to any nonzero polynomial
$\mathbf{b}\in\mathbb{K}\left[  x\right]  $ (as long as $m$ is chosen to be
$\deg\mathbf{b}$). Thus, if $\mathbf{b}$ is a nonzero polynomial over a field
$\mathbb{K}$, then any polynomial $\mathbf{a}$ can be uniquely divided with
remainder by $\mathbf{b}$ (in such a way that the remainder will have degree
$<\deg\mathbf{b}$). But if $\mathbb{K}$ is not a field, then not every
polynomial can play the role of $\mathbf{b}$ in Theorem \ref{thm.pol.quorem}.
For example, the polynomial $1+2x$ over $\mathbb{K}=\mathbb{Z}$ cannot,
because its coefficient of $x^{1}$ is not invertible (it equals $2$). And
unsurprisingly, many polynomials over $\mathbb{Z}$ cannot be divided with
remainder by $1+2x$ (for example, $x^{2}$ cannot -- unless you allow
remainders of degree $>1$).

\begin{example}
\label{exa.pol.quorem.1} For this example, set $\mathbb{K}=\mathbb{Z}$ and
$m=2$ and $\mathbf{b}=x^{2}+x+1$. Then, $\mathbf{b}\in\mathbb{K}\left[
x\right]  _{\leq m}$.

Let $n=4$ and $\mathbf{a}=x^{4}-x^{2}$; thus, $\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}$. Then, Theorem \ref{thm.pol.quorem} \textbf{(a)} says
that there exists a \textbf{unique} pair $\left(  \mathbf{q},\mathbf{r}%
\right)  $ of polynomials such that
\begin{align*}
\mathbf{a}  &  =\mathbf{qb}+\mathbf{r}\ \ \ \ \ \ \ \ \ \ \left(  \text{that
is, }x^{4}-x^{2}=\mathbf{q}\cdot\left(  x^{2}+x+1\right)  +\mathbf{r}\right)
\ \ \ \ \ \ \ \ \ \ \text{and}\\
\mathbf{r}  &  \in\mathbb{K}\left[  x\right]  _{\leq m-1}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{that is, }\deg\mathbf{r}\leq\underbrace{m}%
_{=2}-1=1\right)  .
\end{align*}
Theorem \ref{thm.pol.quorem} \textbf{(b)} says that this pair satisfies
\[
\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-m}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{that is, }\deg\mathbf{q}\leq\underbrace{n}%
_{=4}-\underbrace{m}_{=2}=2\right)  .
\]
How can we find this pair?

Consider this, so far unknown, pair. Comparing the coefficients of $x^{4}$ in
the equality
\begin{equation}
x^{4}-x^{2}=\mathbf{q}\cdot\left(  x^{2}+x+1\right)  +\mathbf{r}=\left(
x^{2}+x+1\right)  \mathbf{q}+\mathbf{r}, \label{eq.exa.pol.quorem.1.1}%
\end{equation}
we obtain $1=1\cdot\left[  x^{2}\right]  \mathbf{q}$ (because $\deg
\mathbf{r}\leq1$ and $\deg\mathbf{q}\leq2$, so the only contribution to the
coefficient of $x^{4}$ on the right hand side of \eqref{eq.exa.pol.quorem.1.1}
comes from picking the \textquotedblleft$x^{2}$\textquotedblright\ from the
\textquotedblleft$x^{2}+x+1$\textquotedblright\ factor and the
\textquotedblleft$\left(  \left[  x^{2}\right]  \mathbf{q}\right)  x^{2}%
$\textquotedblright\ from the expansion of $\mathbf{q}$). Hence, $\left[
x^{2}\right]  \mathbf{q}=1$. Since $\deg\mathbf{q}\leq2$, we can thus write
$\mathbf{q}$ in the form
\[
\mathbf{q}=x^{2}+\mathbf{q}_{1}\qquad\text{ for some polynomial $\mathbf{q}%
_{1}$ with $\deg\mathbf{q}_{1}\leq1$}.
\]
Consider this $\mathbf{q}_{1}$. Now, \eqref{eq.exa.pol.quorem.1.1} can be
transformed as follows:
\begin{align}
&  \ \left(  x^{4}-x^{2}=\left(  x^{2}+x+1\right)  \underbrace{\mathbf{q}%
}_{=x^{2}+\mathbf{q}_{1}}+\mathbf{r}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  x^{4}-x^{2}=\underbrace{\left(  x^{2}%
+x+1\right)  \left(  x^{2}+\mathbf{q}_{1}\right)  }_{=\left(  x^{2}%
+x+1\right)  x^{2}+\left(  x^{2}+x+1\right)  \mathbf{q}_{1}}+\mathbf{r}\right)
\nonumber\\
&  \Longleftrightarrow\ \left(  x^{4}-x^{2}=\left(  x^{2}+x+1\right)
x^{2}+\left(  x^{2}+x+1\right)  \mathbf{q}_{1}+\mathbf{r}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \underbrace{x^{4}-x^{2}-\left(  x^{2}%
+x+1\right)  x^{2}}_{=-x^{3}-2x^{2}}=\left(  x^{2}+x+1\right)  \mathbf{q}%
_{1}+\mathbf{r}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  -x^{3}-2x^{2}=\left(  x^{2}+x+1\right)
\mathbf{q}_{1}+\mathbf{r}\right)  . \label{eq.exa.pol.quorem.1.2}%
\end{align}
Comparing the coefficients of $x^{3}$ in the last equality here, we obtain
$-1=1\cdot\left[  x^{1}\right]  \mathbf{q}_{1}$ (because $\deg\mathbf{r}\leq1$
and $\deg\mathbf{q}_{1}\leq1$). Hence, $\left[  x^{1}\right]  \mathbf{q}%
_{1}=-1$. Since $\deg\mathbf{q}_{1}\leq1$, we can thus write $\mathbf{q}_{1}$
in the form
\[
\mathbf{q}_{1}=-x+\mathbf{q}_{2}\qquad\text{ for some polynomial
$\mathbf{q}_{2}$ with $\deg\mathbf{q}_{2}\leq0$}.
\]
Consider this $\mathbf{q}_{2}$. Now, the last equality of
(\ref{eq.exa.pol.quorem.1.2}) can be transformed as follows:
\begin{align}
&  \ \left(  -x^{3}-2x^{2}=\left(  x^{2}+x+1\right)  \underbrace{\mathbf{q}%
_{1}}_{=-x+\mathbf{q}_{2}}+\mathbf{r}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  -x^{3}-2x^{2}=\underbrace{\left(
x^{2}+x+1\right)  \left(  -x+\mathbf{q}_{2}\right)  }_{=\left(  x^{2}%
+x+1\right)  \left(  -x\right)  +\left(  x^{2}+x+1\right)  \mathbf{q}_{2}%
}+\mathbf{r}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  -x^{3}-2x^{2}=\left(  x^{2}+x+1\right)
\left(  -x\right)  +\left(  x^{2}+x+1\right)  \mathbf{q}_{2}+\mathbf{r}\right)
\nonumber\\
&  \Longleftrightarrow\ \left(  \underbrace{-x^{3}-2x^{2}-\left(
x^{2}+x+1\right)  \left(  -x\right)  }_{=-x^{2}+x}=\left(  x^{2}+x+1\right)
\mathbf{q}_{2}+\mathbf{r}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  -x^{2}+x=\left(  x^{2}+x+1\right)
\mathbf{q}_{2}+\mathbf{r}\right)  . \label{eq.exa.pol.quorem.1.3}%
\end{align}
Comparing the coefficients of $x^{2}$ in the last equality here, we obtain
$-1=1\cdot\left[  x^{0}\right]  \mathbf{q}_{2}$ (because $\deg\mathbf{r}\leq1$
and $\deg\mathbf{q}_{2}\leq0$). Hence, $\left[  x^{0}\right]  \mathbf{q}%
_{2}=-1$. Since $\deg\mathbf{q}_{2}\leq0$, we can thus write $\mathbf{q}_{2}$
in the form%
\[
\mathbf{q}_{2}=-1+\mathbf{q}_{3}\qquad\text{ for some polynomial
$\mathbf{q}_{3}$ with $\deg\mathbf{q}_{3}\leq$}-1.
\]
Consider this $\mathbf{q}_{3}$. Of course, $\mathbf{q}_{3}$ must be the zero
polynomial (that is, $\underline{0}=0_{\mathbb{K}\left[  x\right]  }$), since
$\deg\mathbf{q}_{3}\leq-1$. Now that we have found $\mathbf{q}_{3}$, we can
recover $\mathbf{q}_{2},\mathbf{q}_{1},\mathbf{q}$ by back-substitution:%
\begin{align*}
\mathbf{q}_{2}  &  =-1+\underbrace{\mathbf{q}_{3}}_{=\underline{0}}=-1;\\
\mathbf{q}_{1}  &  =-x+\underbrace{\mathbf{q}_{2}}_{=-1}=-x-1;\\
\mathbf{q}  &  =x^{2}+\underbrace{\mathbf{q}_{1}}_{=-x-1}=x^{2}-x-1.
\end{align*}
Finally, we can find $\mathbf{r}$, for instance, by solving the last equality
(\ref{eq.exa.pol.quorem.1.3}):%
\[
\mathbf{r}=-x^{2}+x-\left(  x^{2}+x+1\right)  \underbrace{\mathbf{q}_{2}%
}_{=-1}=-x^{2}+x-\left(  x^{2}+x+1\right)  \left(  -1\right)  =2x+1.
\]
Hence, we have found the pair $\left(  \mathbf{q},\mathbf{r}\right)  $. And we
can check that this pair $\left(  \mathbf{q},\mathbf{r}\right)  $ does indeed
satisfy $\mathbf{a}=\mathbf{qb}+\mathbf{r}$: Indeed,
\[
\underbrace{\mathbf{q}}_{=x^{2}-x-1}\underbrace{\mathbf{b}}_{=x^{2}%
+x+1}+\underbrace{\mathbf{r}}_{=2x+1}=\left(  x^{2}-x-1\right)  \cdot\left(
x^{2}+x+1\right)  +\left(  2x+1\right)  =x^{4}-x^{2}=\mathbf{a}.
\]

\end{example}

Our next goal is to prove Theorem \ref{thm.pol.quorem}. You may have already
spotted a proof idea in Example \ref{exa.pol.quorem.1}; we will essentially
follow this idea when proving the \textquotedblleft
existence\textquotedblright\ part of Theorem \ref{thm.pol.quorem}
\textbf{(a)}, while the \textquotedblleft uniqueness\textquotedblright\ part
will be proven by a direct argument using Exercise
\ref{exe.pol.deg-ab-uniquot}.

Let us first combine the \textquotedblleft existence\textquotedblright\ part
of Theorem \ref{thm.pol.quorem} \textbf{(a)} with Theorem \ref{thm.pol.quorem}
\textbf{(b)} in order to prove both simultaneously:

\begin{lemma}
\label{lem.pol.quorem.exist}Let $m\in\mathbb{N}$. Let $\mathbf{b}\in
\mathbb{K}\left[  x\right]  _{\leq m}$ be such that $\left[  x^{m}\right]
\mathbf{b}\in\mathbb{K}$ is invertible. Let $n\in\left\{  -1,0,1,\ldots
\right\}  $. Let $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$. Then,
there exist $\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-m}$ and
$\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ such that
$\mathbf{a}=\mathbf{qb}+\mathbf{r}$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.pol.quorem.exist}.]We shall prove Lemma
\ref{lem.pol.quorem.exist} by strong induction on $n$ (while keeping $m$ and
$\mathbf{b}$ fixed).

So let $N\in\left\{  -1,0,1,\ldots\right\}  $. We assume (as the induction
hypothesis) that Lemma \ref{lem.pol.quorem.exist} holds whenever $n<N$. We
must now prove that Lemma \ref{lem.pol.quorem.exist} holds for $n=N$.

We have assumed that Lemma \ref{lem.pol.quorem.exist} holds whenever $n<N$. In
other words, the following claim holds:

\begin{statement}
\textit{Claim 1:} Let $n\in\left\{  -1,0,1,\ldots\right\}  $ be such that
$n<N$. Let $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq n}$. Then, there
exist $\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-m}$ and
$\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ such that
$\mathbf{a}=\mathbf{qb}+\mathbf{r}$.
\end{statement}

(We did not have to write \textquotedblleft Let $m\in\mathbb{N}$%
\textquotedblright\ and \textquotedblleft Let $\mathbf{b}$ be a
polynomial...\textquotedblright\ here, since $m$ and $\mathbf{b}$ are fixed.)

We must prove that Lemma \ref{lem.pol.quorem.exist} holds for $n=N$. In other
words, we must prove the following claim:

\begin{statement}
\textit{Claim 2:} Let $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq N}$.
Then, there exist $\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq N-m}$ and
$\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ such that
$\mathbf{a}=\mathbf{qb}+\mathbf{r}$.
\end{statement}

[\textit{Proof of Claim 2:} If $N<m$, then Claim 2 clearly holds (just take
$\mathbf{q}=\underline{0}$ and $\mathbf{r}=\mathbf{a}$%
)\ \ \ \ \footnote{\textit{Proof.} Assume that $N<m$. Then, $N\leq m-1$ (since
$N$ and $m$ are integers). Hence, Theorem \ref{thm.pol.pol-basics}
\textbf{(a)} (applied to $u=N$ and $v=m-1$) yields $\mathbb{K}\left[
x\right]  _{\leq N}\subseteq\mathbb{K}\left[  x\right]  _{\leq m-1}$. Hence,
$\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq N}\subseteq\mathbb{K}\left[
x\right]  _{\leq m-1}$. Furthermore, $\underline{0}\in\mathbb{K}\left[
x\right]  _{\leq N-m}$ (by Lemma \ref{lem.pol.addition} \textbf{(a)}, applied
to $n=N-m$). Finally, $\mathbf{a}=\underline{0}\cdot\mathbf{b}+\mathbf{a}$
(obviously). Thus, there exist $\mathbf{q}\in\mathbb{K}\left[  x\right]
_{\leq N-m}$ and $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ such
that $\mathbf{a}=\mathbf{qb}+\mathbf{r}$ (namely, $\mathbf{q}=\underline{0}$
and $\mathbf{r}=\mathbf{a}$). In other words, Claim 2 holds. So we have shown
that Claim 2 holds under the assumption that $N<m$.}. Hence, for the rest of
this proof of Claim 2, we WLOG assume that we don't have $N<m$. Hence, $N\geq
m$. Thus, $N-m\geq0$, so that $N-m\in\mathbb{N}$. Also, $N\geq m\geq0$ (since
$m\in\mathbb{N}$), so that $N\in\mathbb{N}$ and therefore $N-1\in\left\{
-1,0,1,\ldots\right\}  $.

Define two elements $a_{N}$ and $b_{m}$ of $\mathbb{K}$ by $a_{N}=\left[
x^{N}\right]  \mathbf{a}$ and $b_{m}=\left[  x^{m}\right]  \mathbf{b}$. (These
are well-defined, since $N\geq0$ and $m\geq0$.) Note that $b_{m}=\left[
x^{m}\right]  \mathbf{b}$ is invertible (by an assumption in Lemma
\ref{lem.pol.quorem.exist}).

Define an element $\lambda\in\mathbb{K}$ by $\lambda=\dfrac{a_{N}}{b_{m}}$.
(This is well-defined, since $b_{m}$ is invertible.)

Recall that $N-m\in\mathbb{N}$ and $N-m\leq N-m$. Hence, Lemma
\ref{lem.pol.addition} \textbf{(f)} (applied to $N-m$ and $N-m$ instead of $n$
and $i$) yields that $x^{N-m}\in\mathbb{K}\left[  x\right]  _{\leq N-m}$.
Thus, Lemma \ref{lem.pol.addition} \textbf{(c)} (applied to $N-m$ and
$x^{N-m}$ instead of $n$ and $\mathbf{a}$) yields that $\lambda x^{N-m}%
\in\mathbb{K}\left[  x\right]  _{\leq N-m}$. Recall also that $\mathbf{b}%
\in\mathbb{K}\left[  x\right]  _{\leq m}$. Hence, Lemma \ref{lem.pol.deg(ab)}
\textbf{(b)} (applied to $N-m$ and $\lambda x^{N-m}$ instead of $n$ and
$\mathbf{a}$) yields that $\lambda x^{N-m}\mathbf{b}\in\mathbb{K}\left[
x\right]  _{\leq\left(  N-m\right)  +m}=\mathbb{K}\left[  x\right]  _{\leq N}$
(since $\left(  N-m\right)  +m=N$). But we also know that $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  _{\leq N}$.

We have $N\in\mathbb{N}$ and $N-m\in\mathbb{N}$ and $N\geq N-m$ (since
$m\geq0$). Hence, Exercise \ref{exe.pol.coeff-shift} \textbf{(a)} (applied to
$u=N$ and $v=N-m$) yields
\begin{align*}
\left[  x^{N}\right]  \left(  x^{N-m}\mathbf{b}\right)   &  =\left[
x^{N-\left(  N-m\right)  }\right]  \mathbf{b}=\left[  x^{m}\right]
\mathbf{b}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }N-\left(  N-m\right)
=m\right) \\
&  =b_{m}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }b_{m}\right)
.
\end{align*}
Furthermore, (\ref{eq.pol.fps-scal.1}) (applied to $N$ and $x^{N-m}\mathbf{b}$
instead of $n$ and $\mathbf{a}$) yields%
\[
\left[  x^{N}\right]  \left(  \lambda x^{N-m}\mathbf{b}\right)
=\underbrace{\lambda}_{=\dfrac{a_{N}}{b_{m}}}\cdot\underbrace{\left[
x^{N}\right]  \left(  x^{N-m}\mathbf{b}\right)  }_{=b_{m}}=\dfrac{a_{N}}%
{b_{m}}\cdot b_{m}=a_{N}=\left[  x^{N}\right]  \mathbf{a}%
\]
(by the definition of $a_{N}$); in other words, $\left[  x^{N}\right]
\mathbf{a}=\left[  x^{N}\right]  \left(  \lambda x^{N-m}\mathbf{b}\right)  $.
Hence, Exercise \ref{exe.pol.leading-cancel} (applied to $N$ and $\lambda
x^{N-m}\mathbf{b}$ instead of $n$ and $\mathbf{b}$) yields that $\mathbf{a}%
-\lambda x^{N-m}\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq N-1}$. Hence,
Claim 1 (applied to $N-1$ and $\mathbf{a}-\lambda x^{N-m}\mathbf{b}$ instead
of $n$ and $\mathbf{a}$) yields that there exist $\mathbf{q}\in\mathbb{K}%
\left[  x\right]  _{\leq N-1-m}$ and $\mathbf{r}\in\mathbb{K}\left[  x\right]
_{\leq m-1}$ such that $\mathbf{a}-\lambda x^{N-m}\mathbf{b}=\mathbf{qb}%
+\mathbf{r}$ (since $N-1<N$). Consider these $\mathbf{q}$ and $\mathbf{r}$,
and denote them by $\mathbf{q}_{0}$ and $\mathbf{r}_{0}$. Thus, $\mathbf{q}%
_{0}\in\mathbb{K}\left[  x\right]  _{\leq N-1-m}$ and $\mathbf{r}_{0}%
\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ satisfy $\mathbf{a}-\lambda
x^{N-m}\mathbf{b}=\mathbf{q}_{0}\mathbf{b}+\mathbf{r}_{0}$.

From $\mathbf{a}-\lambda x^{N-m}\mathbf{b}=\mathbf{q}_{0}\mathbf{b}%
+\mathbf{r}_{0}$, we obtain%
\begin{equation}
\mathbf{a}=\lambda x^{N-m}\mathbf{b}+\mathbf{q}_{0}\mathbf{b}+\mathbf{r}%
_{0}=\left(  \lambda x^{N-m}+\mathbf{q}_{0}\right)  \mathbf{b}+\mathbf{r}_{0}.
\label{pf.lem.pol.quorem.exist.5}%
\end{equation}


We shall next show that $\lambda x^{N-m}+\mathbf{q}_{0}\in\mathbb{K}\left[
x\right]  _{\leq N-m}$. Indeed, $N-1-m\leq N-m$; hence, Theorem
\ref{thm.pol.pol-basics} \textbf{(a)} (applied to $u=N-1-m$ and $v=N-m$)
yields $\mathbb{K}\left[  x\right]  _{\leq N-1-m}\subseteq\mathbb{K}\left[
x\right]  _{\leq N-m}$. Thus, $\mathbf{q}_{0}\in\mathbb{K}\left[  x\right]
_{\leq N-1-m}\subseteq\mathbb{K}\left[  x\right]  _{\leq N-m}$. Furthermore,
$\lambda x^{N-m}\in\mathbb{K}\left[  x\right]  _{\leq N-m}$ (as we already
know). Thus, Lemma \ref{lem.pol.addition} \textbf{(c)} (applied to $N-m$,
$\lambda x^{N-m}$ and $\mathbf{q}_{0}$ instead of $n$, $\mathbf{a}$ and
$\mathbf{b}$) yields $\lambda x^{N-m}+\mathbf{q}_{0}\in\mathbb{K}\left[
x\right]  _{\leq N-m}$.

Altogether, we now know that $\lambda x^{N-m}+\mathbf{q}_{0}\in\mathbb{K}%
\left[  x\right]  _{\leq N-m}$ and $\mathbf{r}_{0}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$ and $\mathbf{a}=\left(  \lambda x^{N-m}+\mathbf{q}%
_{0}\right)  \mathbf{b}+\mathbf{r}_{0}$ (by (\ref{pf.lem.pol.quorem.exist.5}%
)). Hence, there exist $\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq N-m}$
and $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ such that
$\mathbf{a}=\mathbf{qb}+\mathbf{r}$ (namely, $\mathbf{q}=\lambda
x^{N-m}+\mathbf{q}_{0}$ and $\mathbf{r}=\mathbf{r}_{0}$). This proves Claim 2.]

Now, we have proven Claim 2; in other words, Lemma \ref{lem.pol.quorem.exist}
holds for $n=N$. This completes the induction step. Thus, Lemma
\ref{lem.pol.quorem.exist} is proven by induction.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.pol.quorem}.]\textbf{(a)} Theorem
\ref{thm.pol.pol-basics} \textbf{(c)} shows that there exists some
$n\in\mathbb{N}$ such that $\mathbf{a}\in\mathbb{K}\left[  x\right]  _{\leq
n}$. Consider this $n$.

Now, Lemma \ref{lem.pol.quorem.exist} yields that there exist $\mathbf{q}%
\in\mathbb{K}\left[  x\right]  _{\leq n-m}$ and $\mathbf{r}\in\mathbb{K}%
\left[  x\right]  _{\leq m-1}$ such that $\mathbf{a}=\mathbf{qb}+\mathbf{r}$.
Consider these $\mathbf{q}$ and $\mathbf{r}$, and denote them by
$\mathbf{q}_{0}$ and $\mathbf{r}_{0}$. Thus, $\mathbf{q}_{0}\in\mathbb{K}%
\left[  x\right]  _{\leq n-m}$ and $\mathbf{r}_{0}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$ satisfy $\mathbf{a}=\mathbf{q}_{0}\mathbf{b}%
+\mathbf{r}_{0}$.

Now, $\mathbf{q}_{0}\in\mathbb{K}\left[  x\right]  _{\leq n-m}\subseteq
\mathbb{K}\left[  x\right]  $ (since Theorem \ref{thm.pol.pol-basics}
\textbf{(b)} (applied to $n-m$ instead of $n$) shows that $\mathbb{K}\left[
x\right]  _{\leq n-m}$ is a $\mathbb{K}$-submodule of $\mathbb{K}\left[
x\right]  $). In other words, $\mathbf{q}_{0}$ is a polynomial. Similarly,
$\mathbf{r}_{0}$ is a polynomial. Hence, $\left(  \mathbf{q}_{0}%
,\mathbf{r}_{0}\right)  $ is a pair of polynomials. As we know, this pair
satisfies $\mathbf{a}=\mathbf{q}_{0}\mathbf{b}+\mathbf{r}_{0}$ and
$\mathbf{r}_{0}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$. Thus, there exists
a pair $\left(  \mathbf{q},\mathbf{r}\right)  $ of polynomials such that
$\mathbf{a}=\mathbf{qb}+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$ (namely, $\left(  \mathbf{q},\mathbf{r}\right)
=\left(  \mathbf{q}_{0},\mathbf{r}_{0}\right)  $).

It remains to prove that this pair is unique. In other words, it remains to
prove that any two such pairs $\left(  \mathbf{q},\mathbf{r}\right)  $ must be
equal. In other words, it remains to prove the following:

\begin{statement}
\textit{Claim 1:} If $\left(  \mathbf{q}_{1},\mathbf{r}_{1}\right)  $ and
$\left(  \mathbf{q}_{2},\mathbf{r}_{2}\right)  $ are two pairs $\left(
\mathbf{q},\mathbf{r}\right)  $ of polynomials such that $\mathbf{a}%
=\mathbf{qb}+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq
m-1}$, then $\left(  \mathbf{q}_{1},\mathbf{r}_{1}\right)  =\left(
\mathbf{q}_{2},\mathbf{r}_{2}\right)  $.
\end{statement}

[\textit{Proof of Claim 1:} Let $\left(  \mathbf{q}_{1},\mathbf{r}_{1}\right)
$ and $\left(  \mathbf{q}_{2},\mathbf{r}_{2}\right)  $ be two pairs $\left(
\mathbf{q},\mathbf{r}\right)  $ of polynomials such that $\mathbf{a}%
=\mathbf{qb}+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq
m-1}$. We must prove that $\left(  \mathbf{q}_{1},\mathbf{r}_{1}\right)
=\left(  \mathbf{q}_{2},\mathbf{r}_{2}\right)  $.

We have assumed that $\left(  \mathbf{q}_{1},\mathbf{r}_{1}\right)  $ is a
pair $\left(  \mathbf{q},\mathbf{r}\right)  $ of polynomials such that
$\mathbf{a}=\mathbf{qb}+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$. In other words, $\left(  \mathbf{q}_{1},\mathbf{r}%
_{1}\right)  $ is a pair of polynomials satisfying $\mathbf{a}=\mathbf{q}%
_{1}\mathbf{b}+\mathbf{r}_{1}$ and $\mathbf{r}_{1}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$. Similarly, $\left(  \mathbf{q}_{2},\mathbf{r}%
_{2}\right)  $ is a pair of polynomials satisfying $\mathbf{a}=\mathbf{q}%
_{2}\mathbf{b}+\mathbf{r}_{2}$ and $\mathbf{r}_{2}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$.

From $\mathbf{r}_{1}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ and
$\mathbf{r}_{2}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$, we easily obtain
$\mathbf{r}_{2}-\mathbf{r}_{1}\in\mathbb{K}\left[  x\right]  _{\leq m-1}%
$\ \ \ \ \footnote{\textit{Proof.} Lemma \ref{lem.pol.addition} \textbf{(c)}
(applied to $m-1$, $-1$ and $\mathbf{r}_{1}$ instead of $n$, $\lambda$ and
$\mathbf{a}$) yields $\left(  -1\right)  \mathbf{r}_{1}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$ (since $\mathbf{r}_{1}\in\mathbb{K}\left[  x\right]
_{\leq m-1}$). Hence, Lemma \ref{lem.pol.addition} \textbf{(b)} (applied to
$m-1$, $\mathbf{r}_{2}$ and $\left(  -1\right)  \mathbf{r}_{1}$ instead of
$n$, $\mathbf{a}$ and $\mathbf{b}$) yields $\mathbf{r}_{2}+\left(  -1\right)
\mathbf{r}_{1}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ (since
$\mathbf{r}_{2}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$). Thus,
$\mathbf{r}_{2}-\mathbf{r}_{1}=\mathbf{r}_{2}+\left(  -1\right)
\mathbf{r}_{1}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$.}.

Comparing the equalities $\mathbf{a}=\mathbf{q}_{1}\mathbf{b}+\mathbf{r}_{1}$
and $\mathbf{a}=\mathbf{q}_{2}\mathbf{b}+\mathbf{r}_{2}$, we obtain
$\mathbf{q}_{1}\mathbf{b}+\mathbf{r}_{1}=\mathbf{q}_{2}\mathbf{b}%
+\mathbf{r}_{2}$. In other words, $\mathbf{q}_{1}\mathbf{b}-\mathbf{q}%
_{2}\mathbf{b}=\mathbf{r}_{2}-\mathbf{r}_{1}$. Hence,%
\[
\left(  \mathbf{q}_{1}-\mathbf{q}_{2}\right)  \mathbf{b}=\mathbf{q}%
_{1}\mathbf{b}-\mathbf{q}_{2}\mathbf{b}=\mathbf{r}_{2}-\mathbf{r}_{1}%
\in\mathbb{K}\left[  x\right]  _{\leq m-1}.
\]
Hence, Exercise \ref{exe.pol.deg-ab-uniquot} (applied to $\mathbf{q}%
=\mathbf{q}_{1}-\mathbf{q}_{2}$) yields $\mathbf{q}_{1}-\mathbf{q}%
_{2}=\underline{0}=0_{\mathbb{K}\left[  \left[  x\right]  \right]  }$. In
other words, $\mathbf{q}_{1}=\mathbf{q}_{2}$. Now, comparing the equalities%
\[
\mathbf{a}=\underbrace{\mathbf{q}_{1}}_{=\mathbf{q}_{2}}\mathbf{b}%
+\mathbf{r}_{1}=\mathbf{q}_{2}\mathbf{b}+\mathbf{r}_{1}%
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \mathbf{a}=\mathbf{q}%
_{2}\mathbf{b}+\mathbf{r}_{2},
\]
we obtain $\mathbf{q}_{2}\mathbf{b}+\mathbf{r}_{1}=\mathbf{q}_{2}%
\mathbf{b}+\mathbf{r}_{2}$. Thus, $\mathbf{r}_{1}=\mathbf{r}_{2}$. Combining
$\mathbf{q}_{1}=\mathbf{q}_{2}$ with $\mathbf{r}_{1}=\mathbf{r}_{2}$, we
obtain $\left(  \mathbf{q}_{1},\mathbf{r}_{1}\right)  =\left(  \mathbf{q}%
_{2},\mathbf{r}_{2}\right)  $. This proves Claim 1.]

As we said, Claim 1 was the only thing that remained for us to prove in order
to obtain Theorem \ref{thm.pol.quorem} \textbf{(a)}. Thus, having just proven
Claim 1, we have finished the proof of Theorem \ref{thm.pol.quorem}
\textbf{(a)}.

\textbf{(b)} Let $n\in\mathbb{N}$ be such that $\mathbf{a}\in\mathbb{K}\left[
x\right]  _{\leq n}$. Let $\left(  \mathbf{u},\mathbf{v}\right)  $ be the pair
$\left(  \mathbf{q},\mathbf{r}\right)  $ whose existence is claimed by Theorem
\ref{thm.pol.quorem} \textbf{(a)}. (We don't want to call it $\left(
\mathbf{q},\mathbf{r}\right)  $ just yet, since we want to keep the letters
$\mathbf{q}$ and $\mathbf{r}$ free for other uses.) We shall show that
$\mathbf{u}\in\mathbb{K}\left[  x\right]  _{\leq n-m}$.

Indeed, Lemma \ref{lem.pol.quorem.exist} yields that there exist
$\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-m}$ and $\mathbf{r}%
\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ such that $\mathbf{a}%
=\mathbf{qb}+\mathbf{r}$. Consider these $\mathbf{q}$ and $\mathbf{r}$, and
denote them by $\mathbf{q}_{0}$ and $\mathbf{r}_{0}$. Thus, $\mathbf{q}_{0}%
\in\mathbb{K}\left[  x\right]  _{\leq n-m}$ and $\mathbf{r}_{0}\in
\mathbb{K}\left[  x\right]  _{\leq m-1}$ satisfy $\mathbf{a}=\mathbf{q}%
_{0}\mathbf{b}+\mathbf{r}_{0}$.

Now, $\left(  \mathbf{q}_{0},\mathbf{r}_{0}\right)  $ is a pair of
polynomials\footnote{This can be shown just as in the proof of Theorem
\ref{thm.pol.quorem} \textbf{(a)} above.}. As we know, this pair satisfies
$\mathbf{a}=\mathbf{q}_{0}\mathbf{b}+\mathbf{r}_{0}$ and $\mathbf{r}_{0}%
\in\mathbb{K}\left[  x\right]  _{\leq m-1}$. Thus, $\left(  \mathbf{q}%
_{0},\mathbf{r}_{0}\right)  $ is a pair $\left(  \mathbf{q},\mathbf{r}\right)
$ of polynomials such that $\mathbf{a}=\mathbf{qb}+\mathbf{r}$ and
$\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$. But $\left(
\mathbf{u},\mathbf{v}\right)  $ also is a pair $\left(  \mathbf{q}%
,\mathbf{r}\right)  $ of polynomials such that $\mathbf{a}=\mathbf{qb}%
+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$
(because this is how $\left(  \mathbf{u},\mathbf{v}\right)  $ was defined).
Now, recall the Claim 1 that we stated (and proved) during our proof of
Theorem \ref{thm.pol.quorem} \textbf{(a)}. We can apply this Claim to $\left(
\mathbf{q}_{1},\mathbf{r}_{1}\right)  =\left(  \mathbf{u},\mathbf{v}\right)  $
and $\left(  \mathbf{q}_{2},\mathbf{r}_{2}\right)  =\left(  \mathbf{q}%
_{0},\mathbf{r}_{0}\right)  $ (since $\left(  \mathbf{u},\mathbf{v}\right)  $
and $\left(  \mathbf{q}_{0},\mathbf{r}_{0}\right)  $ are two pairs $\left(
\mathbf{q},\mathbf{r}\right)  $ of polynomials such that $\mathbf{a}%
=\mathbf{qb}+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq
m-1}$). As a result, we obtain $\left(  \mathbf{u},\mathbf{v}\right)  =\left(
\mathbf{q}_{0},\mathbf{r}_{0}\right)  $. In other words, $\mathbf{u}%
=\mathbf{q}_{0}$ and $\mathbf{v}=\mathbf{r}_{0}$. Thus, $\mathbf{u}%
=\mathbf{q}_{0}\in\mathbb{K}\left[  x\right]  _{\leq n-m}$.

Now, forget that we introduced $\left(  \mathbf{u},\mathbf{v}\right)  $. We
thus have shown that if $\left(  \mathbf{u},\mathbf{v}\right)  $ is the pair
$\left(  \mathbf{q},\mathbf{r}\right)  $ whose existence is claimed by Theorem
\ref{thm.pol.quorem} \textbf{(a)}, then $\mathbf{u}\in\mathbb{K}\left[
x\right]  _{\leq n-m}$. Renaming $\left(  \mathbf{u},\mathbf{v}\right)  $ as
$\left(  \mathbf{q},\mathbf{r}\right)  $ in this statement, we obtain the
following: The pair $\left(  \mathbf{q},\mathbf{r}\right)  $ whose existence
is claimed by Theorem \ref{thm.pol.quorem} \textbf{(a)} satisfies
$\mathbf{q}\in\mathbb{K}\left[  x\right]  _{\leq n-m}$. This proves Theorem
\ref{thm.pol.quorem} \textbf{(b)}.
\end{proof}

\subsubsection{\label{subsect.pol.quorem.field}The case of a field}

When $\mathbb{K}$ is a field, every nonzero polynomial $\mathbf{b}%
\in\mathbb{K}\left[  x\right]  $ has an invertible leading coefficient (i.e.,
if $m=\deg\mathbf{b}$, then $\left[  x^{m}\right]  \mathbf{b}\in\mathbb{K}$ is
invertible). Thus, Theorem \ref{thm.pol.quorem} \textbf{(a)} shows that we can
divide (with remainder) any polynomial $\mathbf{a}$ by any nonzero polynomial
$\mathbf{b}$ when $\mathbb{K}$ is a field. More precisely, the following holds:

\begin{theorem}
\label{thm.pol.quorem-over-field}Let $\mathbb{K}$ be a field. Let $\mathbf{a}$
and $\mathbf{b}\neq\underline{0}$ be polynomials in $\mathbb{K}\left[
x\right]  $. Then, there exist polynomials $\mathbf{q}$ and $\mathbf{r}$ in
$\mathbb{K}\left[  x\right]  $ such that $\mathbf{a}=\mathbf{qb}+\mathbf{r}$
and $\deg\mathbf{r}<\deg\mathbf{b}$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.pol.quorem-over-field}.]Let $m=\deg\mathbf{b}$.
Then, $m\in\mathbb{N}$ (since $\mathbf{b}\neq\underline{0}$) and
$\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq m}$ (since $\deg\mathbf{b}%
=m$). The coefficient $\left[  x^{m}\right]  \mathbf{b}\in\mathbb{K}$ is
nonzero (since $\deg\mathbf{b}=m$), and thus invertible (since any nonzero
element of $\mathbb{K}$ is invertible\footnote{because $\mathbb{K}$ is a
field}). Thus, Theorem \ref{thm.pol.quorem} \textbf{(a)} shows that there
exists a \textbf{unique} pair $\left(  \mathbf{q},\mathbf{r}\right)  $ of
polynomials such that $\mathbf{a}=\mathbf{qb}+\mathbf{r}$ and $\mathbf{r}%
\in\mathbb{K}\left[  x\right]  _{\leq m-1}$. In other words, there exists a
\textbf{unique} pair $\left(  \mathbf{q},\mathbf{r}\right)  $ of polynomials
such that $\mathbf{a}=\mathbf{qb}+\mathbf{r}$ and $\deg\mathbf{r}%
<\deg\mathbf{b}$ (because for a polynomial $\mathbf{r}\in\mathbb{K}\left[
x\right]  $, the condition \textquotedblleft$\mathbf{r}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$\textquotedblright\ is equivalent to the condition
\textquotedblleft$\deg\mathbf{r}<\deg\mathbf{b}$\textquotedblright%
\ \ \ \ \footnote{Indeed, if $\mathbf{r}\in\mathbb{K}\left[  x\right]  $ is
any polynomial, then we have the following chain of equivalences:%
\begin{align*}
\left(  \mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}\right)  \  &
\Longleftrightarrow\ \left(  \deg\mathbf{r}\leq m-1\right)
\ \Longleftrightarrow\ \left(  \deg\mathbf{r}<m\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }m\in\mathbb{Z}\text{ and }%
\deg\mathbf{r}\in\mathbb{Z}\cup\left\{  -\infty\right\}  \right) \\
&  \Longleftrightarrow\ \left(  \deg\mathbf{r}<\deg\mathbf{b}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }m=\deg\mathbf{b}\right)  .
\end{align*}
}). Hence, in particular, there exist polynomials $\mathbf{q}$ and
$\mathbf{r}$ in $\mathbb{K}\left[  x\right]  $ such that $\mathbf{a}%
=\mathbf{qb}+\mathbf{r}$ and $\deg\mathbf{r}<\deg\mathbf{b}$. This proves
Theorem \ref{thm.pol.quorem-over-field}.
\end{proof}

I have deliberately stated Theorem \ref{thm.pol.quorem-over-field} in the
above form (omitting the uniqueness of the pair $\left(  \mathbf{q}%
,\mathbf{r}\right)  $, which I could have stated but did not) in order to
evoke a deja-vu; indeed, in this form, Theorem \ref{thm.pol.quorem-over-field}
is obviously an analogue of Theorem \ref{thm.Z[i].gauss.quorem}. This analogy
can be taken much further. When $\mathbb{K}$ is a field, the ring
$\mathbb{K}\left[  x\right]  $ shares many properties with $\mathbb{Z}$ and
$\mathbb{Z}\left[  i\right]  $. In particular, there is a good theory of
divisibility, congruence, common divisors and gcds in this ring, which
parallels the corresponding theory for Gaussian integers. The degree of a
polynomial plays the same role in $\mathbb{K}\left[  x\right]  $ that the norm
of a Gaussian integer plays in $\mathbb{Z}\left[  i\right]  $; in particular,
it can be used for purposes of induction.

In defining the gcd of two polynomials over a field $\mathbb{K}$, we are faced
with the same difficulty as in the case of $\mathbb{Z}\left[  i\right]  $: The
gcd is not unique on the nose, but only unique up to unit-equivalence.
However, for polynomials there is a natural choice: Out of all possible gcds
of two polynomials, we pick the gcd whose leading coefficient is $1$. (The
\textquotedblleft leading coefficient\textquotedblright\ of a polynomial means
the coefficient of $x^{n}$, where $n$ is the degree of the polynomial.)

There is a Euclidean algorithm for finding gcd's: For example, if
$\mathbb{K}=\mathbb{Q}$, then%
\begin{align*}
&  \gcd\left(  x^{2}-1,x^{3}-1\right) \\
&  =\gcd\left(  x^{2}-1,\underbrace{\left(  x^{3}-1\right)  \%\left(
x^{2}-1\right)  }_{=x-1}\right) \\
&  =\gcd\left(  x^{2}-1,x-1\right)  =\gcd\left(  x-1,x^{2}-1\right) \\
&  =\gcd\left(  x-1,\underbrace{\left(  x^{2}-1\right)  \%\left(  x-1\right)
}_{=0}\right)  =\gcd\left(  x-1,0\right) \\
&  =\gcd\left(  x-1\right)  =x-1.
\end{align*}
Here, of course, the notation $\mathbf{a}\%\mathbf{b}$ for a remainder is
defined for polynomials in the same way as for integers (after all, the
$\mathbf{q}$ and $\mathbf{r}$ in Theorem \ref{thm.pol.quorem-over-field} are
unique, even if we didn't say so!).

\subsection{\label{sect.pol.eval}Evaluating polynomials}

So far, polynomials have just been sequences of scalars. But recall that the
most useful thing about polynomials should be the ability of evaluating them
(at numbers, matrices, other polynomials). So how do we evaluate our polynomials?

\begin{definition}
\label{def.pol.eval}Let $U$ be a $\mathbb{K}$-algebra. Let $u\in U$.

Let $\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)  \in\mathbb{K}\left[
x\right]  $ be a polynomial over $\mathbb{K}$. (Thus, $\mathbf{a}%
=\sum\limits_{k\in\mathbb{N}}a_{k}x^{k}$.) Then, we define%
\[
\mathbf{a}\left[  u\right]  :=\sum_{k\in\mathbb{N}}a_{k}u^{k}\in U.
\]
This sum is well-defined, since all but finitely many of its addends are zero
(indeed, $\left(  a_{0},a_{1},a_{2},\ldots\right)  $ is a polynomial, and thus
all but finitely many $k\in\mathbb{N}$ satisfy $a_{k}=0$).

We shall call $\mathbf{a}\left[  u\right]  $ the \textit{value} of
$\mathbf{a}$ at $u$. This is commonly denoted by $\mathbf{a}\left(  u\right)
$, but that notation is problematic, since expressions like \textquotedblleft%
$\mathbf{a}\left(  x+1\right)  $\textquotedblright\ could mean different
things depending on whether they are interpreted as values or as products.
(That said, be careful with the notation \textquotedblleft$\mathbf{a}\left[
u\right]  $\textquotedblright\ as well: The expression \textquotedblleft%
$\mathbf{a}\left[  x^{2}\right]  \mathbf{b}$\textquotedblright\ can mean
either $\mathbf{a}$ times the coefficient $\left[  x^{2}\right]  \mathbf{b}$
or the value $\mathbf{a}\left[  x^{2}\right]  $ times $\mathbf{b}$.
Disambiguate such expressions using parentheses or dots.)
\end{definition}

\begin{comment}
As we have seen in (\ref{eq.pol.deg(ab)=0.cex}), even over nontrivial rings
$\mathbb{K}$, degrees of polynomials can behave weirdly. A class of
polynomials for which this does not happen are the \textit{monic polynomials}:
\begin{definition}
\label{def.pol.monic}Let $n\in\mathbb{N}$. Let $\mathbf{a}\in\mathbb{K}\left[
x\right]  $. We say that the polynomial $\mathbf{a}$ is \textit{monic of
degree }$n$ if and only if it satisfies
\[
\deg\mathbf{a}\leq n\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left[
x^{n}\right]  \mathbf{a}=1.
\]
In other words, $\mathbf{a}$ is monic of degree $n$ if and only if it
satisfies%
\[
\left(  \left[  x^{k}\right]  \mathbf{a}=0\text{ for all }k>n\right)
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \left[  x^{n}\right]
\mathbf{a}=1.
\]
(These two statements are equivalent because of Lemma \ref{lem.pol.deg-rest}.)
\end{definition}
Again, if the ring $\mathbb{K}$ is trivial, then weird things happen: The
polynomial $0$ is monic of every possible degree in that case (despite its
degree, as we originally defined it, being $-\infty$). Other than this, the
notation does not mislead us: If $\left\vert \mathbb{K}\right\vert >1$, and if
a polynomial $\mathbf{a}\in\mathbb{K}\left[  x\right]  $ is monic of degree
$n$, then the degree of $\mathbf{a}$ is actually $n$ (since $\left[
x^{n}\right]  \mathbf{a}=1\neq0$).
\end{comment}


\begin{teachingnote}
\textbf{2019-04-26 lecture}
\end{teachingnote}

\begin{example}
\label{exa.pol.eval.0}Let $\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)
\in\mathbb{K}\left[  x\right]  $ be a polynomial.

\textbf{(a)} Taking $U=\mathbb{K}$ and $u=0$ in Definition \ref{def.pol.eval},
we obtain%
\[
\mathbf{a}\left[  0\right]  =\sum_{k\in\mathbb{N}}a_{k}0^{k}=a_{0}%
\underbrace{0^{0}}_{=1}+\sum_{k>0}a_{k}\underbrace{0^{k}}%
_{\substack{=0\\\text{(since }k>0\text{)}}}=a_{0}=\left[  x^{0}\right]
\mathbf{a}.
\]


\textbf{(b)} Taking $U=\mathbb{K}$ and $u=1$ in Definition \ref{def.pol.eval},
we obtain%
\[
\mathbf{a}\left[  1\right]  =\sum_{k\in\mathbb{N}}a_{k}\underbrace{1^{k}}%
_{=1}=\sum_{k\in\mathbb{N}}a_{k}=a_{0}+a_{1}+a_{2}+\cdots.
\]
This is the sum of all coefficients of $\mathbf{a}$.

\textbf{(c)} Taking $U=\mathbb{K}\left[  x\right]  $ and $u=x$ in Definition
\ref{def.pol.eval}, we obtain%
\[
\mathbf{a}\left[  x\right]  =\sum_{k\in\mathbb{N}}a_{k}x^{k}=\left(
a_{0},a_{1},a_{2},\ldots\right)  =\mathbf{a}.
\]
So $\mathbf{a}\left[  x\right]  $ is another way of saying \textquotedblleft%
$\mathbf{a}$\textquotedblright.

\textbf{(d)} Furthermore,%
\[
\mathbf{a}\left[  -x\right]  =\sum_{k\in\mathbb{N}}a_{k}\underbrace{\left(
-x\right)  ^{k}}_{=\left(  -1\right)  ^{k}x^{k}}=\sum_{k\in\mathbb{N}}\left(
-1\right)  ^{k}a_{k}x^{k}=\left(  a_{0},-a_{1},a_{2},-a_{3},a_{4}%
,\ldots\right)  .
\]


\textbf{(e)} Furthermore,%
\[
\mathbf{a}\left[  x^{2}\right]  =\sum_{k\in\mathbb{N}}a_{k}\left(
x^{2}\right)  ^{k}=\sum_{k\in\mathbb{N}}a_{k}x^{2k}=\left(  a_{0}%
,0,a_{1},0,a_{2},0,a_{3},0,\ldots\right)  .
\]

\end{example}

In Definition \ref{def.pol.eval}, we have rigorously defined the value
$\mathbf{a}\left[  u\right]  $ of a polynomial $\mathbf{a}$ at an element $u$
of a $\mathbb{K}$-algebra. In practice, this value is best understood through
the following slogan:

\begin{statement}
\textit{Substitution slogan: }Let $U$ be a $\mathbb{K}$-algebra, and let $u\in
U$. Let $\mathbf{a}\in\mathbb{K}\left[  x\right]  $ be a polynomial. Then,
$\mathbf{a}\left[  u\right]  $ is, roughly speaking, the result of
\textquotedblleft substituting $u$ for $x$\textquotedblright\ into
$\mathbf{a}$.
\end{statement}

For example,%
\begin{align}
\left(  1+3x+8x^{2}\right)  \left[  u\right]   &  =1+3u+8u^{2}%
\ \ \ \ \ \ \ \ \ \ \text{and}\label{eq.exa.pol.eval.1.1}\\
\left(  x^{9}-2x\right)  \left[  u\right]   &  =u^{9}%
-2u\ \ \ \ \ \ \ \ \ \ \text{and}\label{eq.exa.pol.eval.1.2}\\
\left(  x^{4}-\left(  x-1\right)  ^{2}\left(  x+1\right)  ^{2}\right)  \left[
u\right]   &  =u^{4}-\left(  u-1\right)  ^{2}\left(  u+1\right)  ^{2}.
\label{eq.exa.pol.eval.1.3}%
\end{align}
However, strictly speaking, this is not all obvious at this point yet. While
(\ref{eq.exa.pol.eval.1.1}) and (\ref{eq.exa.pol.eval.1.2}) can easily be
checked using Definition \ref{def.pol.eval}\footnote{Namely: Write the
polynomial $1+3x+8x^{2}$ in the form $\left(  a_{0},a_{1},a_{2},\ldots\right)
$ for some $a_{0},a_{1},a_{2},\ldots\in\mathbb{K}$. Then, $a_{0}=1$ and
$a_{1}=3$ and $a_{2}=8$ and $a_{k}=0$ for all $k>2$. But Definition
\ref{def.pol.eval} (applied to $\mathbf{a}=1+3x+8x^{2}$) yields%
\begin{align*}
\left(  1+3x+8x^{2}\right)  \left[  u\right]   &  =\sum_{k\in\mathbb{N}}%
a_{k}u^{k}=\underbrace{a_{0}}_{=1}\underbrace{u^{0}}_{=1}+\underbrace{a_{1}%
}_{=3}\underbrace{u^{1}}_{=u}+\underbrace{a_{2}}_{=8}u^{2}+\sum_{k>2}%
\underbrace{a_{k}}_{=0}u^{k}\\
&  =1+3u+8u^{2}+\underbrace{\sum_{k>2}0u^{k}}_{=0}=1+3u+8u^{2}.
\end{align*}
This proves (\ref{eq.exa.pol.eval.1.1}). A similar argument can be used to
prove (\ref{eq.exa.pol.eval.1.2}).}, it is not so clear how to obtain
(\ref{eq.exa.pol.eval.1.3}) from Definition \ref{def.pol.eval} without
multiplying out both sides\footnote{Of course, if you multiply them out, then
(\ref{eq.exa.pol.eval.1.3}) becomes obvious: We have $x^{4}-\left(
x-1\right)  ^{2}\left(  x+1\right)  ^{2}=2x^{2}-1$, so that%
\[
\left(  x^{4}-\left(  x-1\right)  ^{2}\left(  x+1\right)  ^{2}\right)  \left[
u\right]  =\left(  2x^{2}-1\right)  \left[  u\right]  =2u^{2}-1
\]
(this follows from Definition \ref{def.pol.eval} in the same way as
(\ref{eq.exa.pol.eval.1.1}) did). Comparing this with%
\[
u^{4}-\left(  u-1\right)  ^{2}\left(  u+1\right)  ^{2}=2u^{2}-1,
\]
we obtain $\left(  x^{4}-\left(  x-1\right)  ^{2}\left(  x+1\right)
^{2}\right)  \left[  u\right]  =u^{4}-\left(  u-1\right)  ^{2}\left(
u+1\right)  ^{2}$, and thus (\ref{eq.exa.pol.eval.1.3}) is proven.
\par
But multiplying out is not always viable. Let's say we want to prove that%
\[
\left(  x^{2n}-\left(  x-1\right)  ^{n}\left(  x+1\right)  ^{n}\right)
\left[  u\right]  =u^{2n}-\left(  u-1\right)  ^{n}\left(  u+1\right)  ^{n}%
\]
for all $n\in\mathbb{N}$. This can no longer be proven as easily, since the
coefficients of the polynomial $x^{2n}-\left(  x-1\right)  ^{n}\left(
x+1\right)  ^{n}$ will grow more complicated as $n$ grows larger.}. Definition
\ref{def.pol.eval} only justifies the Substitution slogan when the
substitution happens in the \textbf{expanded form} of $\mathbf{a}$ (that is,
in the form $\mathbf{a}=a_{0}x^{0}+a_{1}x^{1}+a_{2}x^{2}+\cdots$), but not
when it happens in some other form like $\left(  1+x\right)  \left(
1-x\right)  $ or $x^{2}-\left(  x-1\right)  ^{2}$. We shall soon convince
ourselves that the Substitution slogan is true for the latter forms as well.
First, we need to prove some basic properties of values of polynomials:

\begin{theorem}
\label{thm.pol.eval.a+b}Let $U$ be a $\mathbb{K}$-algebra. Let $u\in U$.

\textbf{(a)} Any $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  $
satisfy%
\[
\left(  \mathbf{a}+\mathbf{b}\right)  \left[  u\right]  =\mathbf{a}\left[
u\right]  +\mathbf{b}\left[  u\right]  \ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \left(  \mathbf{ab}\right)  \left[  u\right]
=\mathbf{a}\left[  u\right]  \cdot\mathbf{b}\left[  u\right]  .
\]


\textbf{(b)} Any $\lambda\in\mathbb{K}$ and $\mathbf{a}\in\mathbb{K}\left[
x\right]  $ satisfy%
\[
\left(  \lambda\mathbf{a}\right)  \left[  u\right]  =\lambda\cdot
\mathbf{a}\left[  u\right]  .
\]


\textbf{(c)} Any $a\in\mathbb{K}$ satisfies $\underline{a}\left[  u\right]
=a\cdot1_{U}$. (This is often written as \textquotedblleft$\underline{a}%
\left[  u\right]  =a$\textquotedblright, but keep in mind that the
\textquotedblleft$a$\textquotedblright\ on the right hand side of this
equality is understood to be \textquotedblleft coerced into $U$%
\textquotedblright, so it actually means \textquotedblleft the element of $U$
corresponding to $a$\textquotedblright, which is $a\cdot1_{U}$.)

\textbf{(d)} We have $x\left[  u\right]  =u$.

\textbf{(e)} We have $x^{i}\left[  u\right]  =u^{i}$ for each $i\in\mathbb{N}$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.pol.eval.a+b}.]For each $\mathbf{a}\in
\mathbb{K}\left[  x\right]  $, we have $\mathbf{a}=\left(  \left[
x^{0}\right]  \mathbf{a},\left[  x^{1}\right]  \mathbf{a},\left[
x^{2}\right]  \mathbf{a},\ldots\right)  $ (by (\ref{eq.pol.fps-a=()})) and
therefore%
\begin{equation}
\mathbf{a}\left[  u\right]  =\sum_{k\in\mathbb{N}}\left(  \left[
x^{k}\right]  \mathbf{a}\right)  u^{k}. \label{pf.thm.pol.eval.a+b.au=}%
\end{equation}


\textbf{(e)} Let $i\in\mathbb{N}$. Then, (\ref{pf.thm.pol.eval.a+b.au=})
(applied to $\mathbf{a}=x^{i}$) yields%
\begin{align*}
x^{i}\left[  u\right]   &  =\sum_{k\in\mathbb{N}}\underbrace{\left(  \left[
x^{k}\right]  \left(  x^{i}\right)  \right)  }_{\substack{=%
\begin{cases}
1, & \text{if }k=i;\\
0, & \text{if }k\neq i
\end{cases}
\\\text{(by (\ref{eq.prop.pol.xk.rest}), applied}\\\text{to }k\text{ and
}i\text{ instead of }n\text{ and }k\text{)}}}u^{k}=\sum_{k\in\mathbb{N}}%
\begin{cases}
1, & \text{if }k=i;\\
0, & \text{if }k\neq i
\end{cases}
u^{k}\\
&  =\underbrace{%
\begin{cases}
1, & \text{if }i=i;\\
0, & \text{if }i\neq i
\end{cases}
}_{\substack{=1\\\text{(since }i=i\text{)}}}u^{i}+\sum_{\substack{k\in
\mathbb{N};\\k\neq i}}\underbrace{%
\begin{cases}
1, & \text{if }k=i;\\
0, & \text{if }k\neq i
\end{cases}
}_{\substack{=0\\\text{(since }k\neq i\text{)}}}u^{k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=i\text{ from the sum}\right) \\
&  =u^{i}+\underbrace{\sum_{\substack{k\in\mathbb{N};\\k\neq i}}0u^{k}}%
_{=0}=u^{i}.
\end{align*}
This proves Theorem \ref{thm.pol.eval.a+b} \textbf{(e)}.

\textbf{(d)} Theorem \ref{thm.pol.eval.a+b} \textbf{(e)} (applied to $i=1$)
yields $x^{1}\left[  u\right]  =u^{1}=u$. In view of $x^{1}=x$, this rewrites
as $x\left[  u\right]  =u$. This proves Theorem \ref{thm.pol.eval.a+b}
\textbf{(d)}.

\textbf{(c)} Let $a\in\mathbb{K}$. Then, (\ref{pf.thm.pol.eval.a+b.au=})
(applied to $\mathbf{a}=\underline{a}$) yields%
\begin{align*}
\underline{a}\left[  u\right]   &  =\sum_{k\in\mathbb{N}}\underbrace{\left(
\left[  x^{k}\right]  \left(  \underline{a}\right)  \right)  }_{\substack{=%
\begin{cases}
a, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
\\\text{(by (\ref{eq.pol.fps-cst.1}), applied to }n=k\text{)}}}u^{k}%
=\sum_{k\in\mathbb{N}}%
\begin{cases}
a, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
u^{k}\\
&  =\underbrace{%
\begin{cases}
a, & \text{if }0=0;\\
0, & \text{if }0\neq0
\end{cases}
}_{\substack{=a\\\text{(since }0=0\text{)}}}\underbrace{u^{0}}_{=1_{U}}%
+\sum_{\substack{k\in\mathbb{N};\\k\neq0}}\underbrace{%
\begin{cases}
a, & \text{if }k=0;\\
0, & \text{if }k\neq0
\end{cases}
}_{\substack{=0\\\text{(since }k\neq0\text{)}}}u^{k}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=0\text{ from the sum}\right) \\
&  =a\cdot1_{U}+\underbrace{\sum_{\substack{k\in\mathbb{N};\\k\neq0}}0u^{k}%
}_{=0}=a\cdot1_{U}.
\end{align*}
This proves Theorem \ref{thm.pol.eval.a+b} \textbf{(c)}.

\textbf{(c)} This is easy and left to the reader.

\textbf{(a)} Let $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  $. It is
easy to see that $\left(  \mathbf{a}+\mathbf{b}\right)  \left[  u\right]
=\mathbf{a}\left[  u\right]  +\mathbf{b}\left[  u\right]  $.

It remains to prove that $\left(  \mathbf{ab}\right)  \left[  u\right]
=\mathbf{a}\left[  u\right]  \cdot\mathbf{b}\left[  u\right]  $.

Write $\mathbf{a}$ and $\mathbf{b}$ as $\mathbf{a}=\left(  a_{0},a_{1}%
,a_{2},\ldots\right)  $ and $\mathbf{b}=\left(  b_{0},b_{1},b_{2}%
,\ldots\right)  $. Then, the definition of multiplication on $\mathbb{K}%
\left[  \left[  x\right]  \right]  $ yields%
\[
\mathbf{ab}=\left(  c_{0},c_{1},c_{2},\ldots\right)
,\ \ \ \ \ \ \ \ \ \ \text{where }c_{n}=\sum\limits_{\substack{i,j\in
\mathbb{N};\\i+j=n}}a_{i}b_{j}.
\]
Hence,%
\begin{align*}
\left(  \mathbf{ab}\right)  \left[  u\right]   &  =\sum_{k\in\mathbb{N}}%
c_{k}u^{k}=\sum_{n\in\mathbb{N}}\underbrace{c_{n}}_{=\sum
\limits_{\substack{i,j\in\mathbb{N};\\i+j=n}}a_{i}b_{j}}u^{n}=\sum
_{n\in\mathbb{N}}\sum\limits_{\substack{i,j\in\mathbb{N};\\i+j=n}}a_{i}%
b_{j}\underbrace{u^{n}}_{\substack{=u^{i+j}\\\text{(since }n=i+j\text{)}}}\\
&  =\underbrace{\sum_{n\in\mathbb{N}}\sum\limits_{\substack{i,j\in
\mathbb{N};\\i+j=n}}}_{\substack{=\sum\limits_{i,j\in\mathbb{N}}%
\\=\sum\limits_{i\in\mathbb{N}}\sum\limits_{j\in\mathbb{N}}}}a_{i}%
b_{j}\underbrace{u^{i+j}}_{=u^{i}u^{j}}=\sum\limits_{i\in\mathbb{N}}%
\sum\limits_{j\in\mathbb{N}}a_{i}b_{j}u^{i}u^{j}=\sum\limits_{i\in\mathbb{N}%
}a_{i}u^{i}\sum\limits_{j\in\mathbb{N}}b_{j}u^{j}\\
&  =\underbrace{\left(  \sum\limits_{i\in\mathbb{N}}a_{i}u^{i}\right)
}_{\substack{=\sum\limits_{k\in\mathbb{N}}a_{k}u^{k}\\=\mathbf{a}\left[
u\right]  }}\ \ \underbrace{\left(  \sum\limits_{j\in\mathbb{N}}b_{j}%
u^{j}\right)  }_{\substack{=\sum\limits_{k\in\mathbb{N}}b_{k}u^{k}%
\\=\mathbf{b}\left[  u\right]  }}=\mathbf{a}\left[  u\right]  \cdot
\mathbf{b}\left[  u\right]  .
\end{align*}
(These manipulations with infinite sums are all kosher, because only finitely
many pairs $\left(  i,j\right)  \in\mathbb{N}\times\mathbb{N}$ satisfy
$a_{i}b_{j}\neq0$.) This completes our proof of Theorem \ref{thm.pol.eval.a+b}
\textbf{(a)}.
\end{proof}

\begin{corollary}
\label{cor.pol.eval.evu}Let $U$ be a $\mathbb{K}$-algebra. Let $u\in U$. Then,
the map%
\begin{align*}
\operatorname*{ev}\nolimits_{u}:\mathbb{K}\left[  x\right]   &  \rightarrow
U,\\
\mathbf{a}  &  \mapsto\mathbf{a}\left[  u\right]
\end{align*}
is a $\mathbb{K}$-algebra homomorphism.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.pol.eval.evu}.]We must prove that
$\operatorname*{ev}\nolimits_{u}$ is a $\mathbb{K}$-algebra homomorphism. In
other words, we must prove that $\operatorname*{ev}\nolimits_{u}$ is a ring
homomorphism and a $\mathbb{K}$-module homomorphism (by the definition of a
$\mathbb{K}$-algebra homomorphism).

In order to prove that $\operatorname*{ev}\nolimits_{u}$ is a ring
homomorphism, we must prove the following four claims:

\begin{statement}
\textit{Claim 1:} We have $\operatorname*{ev}\nolimits_{u}\left(
\mathbf{a}+\mathbf{b}\right)  =\operatorname*{ev}\nolimits_{u}\left(
\mathbf{a}\right)  +\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}\right)
$ for all $\mathbf{a},\mathbf{b}\in\mathbb{\mathbb{K}}\left[  x\right]  $.
\end{statement}

\begin{statement}
\textit{Claim 2:} We have $\operatorname*{ev}\nolimits_{u}\left(  0\right)
=0$.
\end{statement}

\begin{statement}
\textit{Claim 3:} We have $\operatorname*{ev}\nolimits_{u}\left(
\mathbf{ab}\right)  =\operatorname*{ev}\nolimits_{u}\left(  \mathbf{a}\right)
\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}\right)  $ for all
$\mathbf{a},\mathbf{b}\in\mathbb{\mathbb{K}}\left[  x\right]  $.
\end{statement}

\begin{statement}
\textit{Claim 4:} We have $\operatorname*{ev}\nolimits_{u}\left(  1\right)
=1$.
\end{statement}

\noindent Indeed, these four claims are the axioms in the definition of a ring homomorphism.

In order to prove that $\operatorname*{ev}\nolimits_{u}$ is a $\mathbb{K}%
$-module homomorphism, we must prove the following four claims:

\begin{statement}
\textit{Claim 5:} We have $\operatorname*{ev}\nolimits_{u}\left(
\mathbf{a}+\mathbf{b}\right)  =\operatorname*{ev}\nolimits_{u}\left(
\mathbf{a}\right)  +\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}\right)
$ for all $\mathbf{a},\mathbf{b}\in\mathbb{\mathbb{K}}\left[  x\right]  $.
\end{statement}

\begin{statement}
\textit{Claim 6:} We have $\operatorname*{ev}\nolimits_{u}\left(  0\right)
=0$.
\end{statement}

\begin{statement}
\textit{Claim 7:} We have $\operatorname*{ev}\nolimits_{u}\left(
\lambda\mathbf{a}\right)  =\lambda\operatorname*{ev}\nolimits_{u}\left(
\mathbf{a}\right)  $ for all $\lambda\in\mathbb{K}$ and $\mathbf{a}%
\in\mathbb{\mathbb{K}}\left[  x\right]  $.
\end{statement}

\noindent Indeed, these three claims are the axioms in the definition of a
$\mathbb{K}$-module homomorphism.

Let us first prove Claim 3:

[\textit{Proof of Claim 3:} Let $\mathbf{a},\mathbf{b}\in\mathbb{\mathbb{K}%
}\left[  x\right]  $. We must prove that $\operatorname*{ev}\nolimits_{u}%
\left(  \mathbf{ab}\right)  =\operatorname*{ev}\nolimits_{u}\left(
\mathbf{a}\right)  \cdot\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}%
\right)  $. But the definition of $\operatorname*{ev}\nolimits_{u}$ yields
$\operatorname*{ev}\nolimits_{u}\left(  \mathbf{ab}\right)  =\left(
\mathbf{ab}\right)  \left[  u\right]  $ and $\operatorname*{ev}\nolimits_{u}%
\left(  \mathbf{a}\right)  =\mathbf{a}\left[  u\right]  $ and
$\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}\right)  =\mathbf{b}\left[
u\right]  $. Hence, proving that $\operatorname*{ev}\nolimits_{u}\left(
\mathbf{ab}\right)  =\operatorname*{ev}\nolimits_{u}\left(  \mathbf{a}\right)
\cdot\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}\right)  $ is tantamount
to proving that $\left(  \mathbf{ab}\right)  \left[  u\right]  =\mathbf{a}%
\left[  u\right]  \cdot\mathbf{b}\left[  u\right]  $. But the latter equality
follows from Theorem \ref{thm.pol.eval.a+b} \textbf{(a)}. Hence,
$\operatorname*{ev}\nolimits_{u}\left(  \mathbf{ab}\right)
=\operatorname*{ev}\nolimits_{u}\left(  \mathbf{a}\right)  \cdot
\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}\right)  $ is proven. This
proves Claim 3.]

Claim 1 is proven in the same way as Claim 3. Claims 2 and 4 follow easily
from Theorem \ref{thm.pol.eval.a+b} \textbf{(c)}. Claims 5 and 6 are just
Claims 1 and 2, repeated. Claim 7 follows easily from Theorem
\ref{thm.pol.eval.a+b} \textbf{(b)}. Thus, we have proven all seven Claims 1,
2, ..., 7. As we explained, this shows that $\operatorname*{ev}\nolimits_{u}$
is a $\mathbb{K}$-algebra homomorphism. Thus, Corollary \ref{cor.pol.eval.evu} holds.
\end{proof}

The map $\operatorname*{ev}\nolimits_{u}$ in Corollary \ref{cor.pol.eval.evu}
is called an \textit{evaluation homomorphism} (specifically, the
\textit{evaluation homomorphism at }$u$), since it \textquotedblleft
evaluates\textquotedblright\ each polynomial at $u$.

\begin{corollary}
\label{cor.pol.eval.concs}Let $U$ be a $\mathbb{K}$-algebra. Let $u\in U$. Then:

\textbf{(a)} We have $\left(  -\mathbf{a}\right)  \left[  u\right]
=-\mathbf{a}\left[  u\right]  $ for each $\mathbf{a}\in\mathbb{K}\left[
x\right]  $.

\textbf{(b)} We have $\left(  \mathbf{a}-\mathbf{b}\right)  \left[  u\right]
=\mathbf{a}\left[  u\right]  -\mathbf{b}\left[  u\right]  $ for each
$\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  $.

\textbf{(c)} We have $\left(  \sum_{s\in S}\mathbf{a}_{s}\right)  \left[
u\right]  =\sum_{s\in S}\left(  \mathbf{a}_{s}\left[  u\right]  \right)  $
whenever $S$ is a finite set and $\mathbf{a}_{s}\in\mathbb{K}\left[  x\right]
$ for all $s\in S$.

\textbf{(d)} We have $\left(  \mathbf{a}_{1}\mathbf{a}_{2}\cdots\mathbf{a}%
_{k}\right)  \left[  u\right]  =\mathbf{a}_{1}\left[  u\right]  \cdot
\mathbf{a}_{2}\left[  u\right]  \cdot\cdots\cdot\mathbf{a}_{k}\left[
u\right]  $ whenever $\mathbf{a}_{1},\mathbf{a}_{2},\ldots,\mathbf{a}_{k}%
\in\mathbb{K}\left[  x\right]  $.

\textbf{(e)} If the ring $U$ is commutative, then $\left(  \prod_{s\in
S}\mathbf{a}_{s}\right)  \left[  u\right]  =\prod_{s\in S}\left(
\mathbf{a}_{s}\left[  u\right]  \right)  $ whenever $S$ is a finite set and
$\mathbf{a}_{s}\in\mathbb{K}\left[  x\right]  $ for all $s\in S$.

\textbf{(f)} We have $\mathbf{a}^{n}\left[  u\right]  =\left(  \mathbf{a}%
\left[  u\right]  \right)  ^{n}$ for each $\mathbf{a}\in\mathbb{K}\left[
x\right]  $ and each $n\in\mathbb{N}$.

\textbf{(g)} We have $\left(  n\mathbf{a}\right)  \left[  u\right]
=n\cdot\mathbf{a}\left[  u\right]  $ for each $\mathbf{a}\in\mathbb{K}\left[
x\right]  $ and each $n\in\mathbb{Z}$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.pol.eval.concs}.]Consider the map
$\operatorname*{ev}\nolimits_{u}$ in Corollary \ref{cor.pol.eval.evu}. This
map is a $\mathbb{K}$-algebra homomorphism (by Corollary
\ref{cor.pol.eval.evu}), and thus is a ring homomorphism. Hence, each part of
Corollary \ref{cor.pol.eval.concs} follows from a corresponding part of
Proposition \ref{prop.riho.subtract} (applied to $\mathbb{K}\left[  x\right]
$, $U$ and $\operatorname*{ev}\nolimits_{u}$ instead of $\mathbb{K}$,
$\mathbb{L}$ and $f$). For example, let us show how Corollary
\ref{cor.pol.eval.concs} \textbf{(d)} follows from Proposition
\ref{prop.riho.subtract} \textbf{(f)}:

\textbf{(d)} Let $\mathbf{a}_{1},\mathbf{a}_{2},\ldots,\mathbf{a}_{k}%
\in\mathbb{K}\left[  x\right]  $. Then, Proposition \ref{prop.riho.subtract}
\textbf{(f)} (applied to $\mathbb{K}\left[  x\right]  $, $U$,
$\operatorname*{ev}\nolimits_{u}$ and $\mathbf{a}_{i}$ instead of $\mathbb{K}%
$, $\mathbb{L}$, $f$ and $a_{i}$) yields%
\[
\operatorname*{ev}\nolimits_{u}\left(  \mathbf{a}_{1}\mathbf{a}_{2}%
\cdots\mathbf{a}_{k}\right)  =\operatorname*{ev}\nolimits_{u}\left(
\mathbf{a}_{1}\right)  \operatorname*{ev}\nolimits_{u}\left(  \mathbf{a}%
_{2}\right)  \cdots\operatorname*{ev}\nolimits_{u}\left(  \mathbf{a}%
_{k}\right)  .
\]
Since each $\mathbf{b}\in\mathbb{K}\left[  x\right]  $ satisfies
$\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}\right)  =\mathbf{b}\left[
u\right]  $ (by the definition of $\operatorname*{ev}\nolimits_{u}$), this
equality rewrites as
\[
\left(  \mathbf{a}_{1}\mathbf{a}_{2}\cdots\mathbf{a}_{k}\right)  \left[
u\right]  =\mathbf{a}_{1}\left[  u\right]  \cdot\mathbf{a}_{2}\left[
u\right]  \cdot\cdots\cdot\mathbf{a}_{k}\left[  u\right]  .
\]
This proves Corollary \ref{cor.pol.eval.concs} \textbf{(d)}. As we said, all
the other parts of Corollary \ref{cor.pol.eval.concs} follow similarly from
other parts of Proposition \ref{prop.riho.subtract}.
\end{proof}

Theorem \ref{thm.pol.eval.a+b} and Corollary \ref{cor.pol.eval.concs} (or,
more abstractly, Corollary \ref{cor.pol.eval.evu}) justify the Substitution
slogan in general. For example, we can now prove (\ref{eq.exa.pol.eval.1.3})
directly, without multiplying out anything, as follows:%
\begin{align*}
&  \left(  x^{4}-\left(  x-1\right)  ^{2}\left(  x+1\right)  ^{2}\right)
\left[  u\right] \\
&  =\underbrace{x^{4}\left[  u\right]  }_{\substack{=\left(  x\left[
u\right]  \right)  ^{4}\\\text{(by Corollary \ref{cor.pol.eval.concs}
\textbf{(f)})}}}-\underbrace{\left(  \left(  x-1\right)  ^{2}\left(
x+1\right)  ^{2}\right)  \left[  u\right]  }_{\substack{=\left(  x-1\right)
^{2}\left[  u\right]  \cdot\left(  x+1\right)  ^{2}\left[  u\right]
\\\text{(by the second equality of}\\\text{Theorem \ref{thm.pol.eval.a+b}
\textbf{(a)})}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Corollary
\ref{cor.pol.eval.concs} \textbf{(b)}}\right) \\
&  =\left(  \underbrace{x\left[  u\right]  }_{\substack{=u\\\text{(by Theorem
\ref{thm.pol.eval.a+b} \textbf{(d)})}}}\right)  ^{4}-\underbrace{\left(
x-1\right)  ^{2}\left[  u\right]  }_{\substack{=\left(  \left(  x-1\right)
\left[  u\right]  \right)  ^{2}\\\text{(by Corollary \ref{cor.pol.eval.concs}
\textbf{(f)})}}}\cdot\underbrace{\left(  x+1\right)  ^{2}\left[  u\right]
}_{\substack{=\left(  \left(  x+1\right)  \left[  u\right]  \right)
^{2}\\\text{(by Corollary \ref{cor.pol.eval.concs} \textbf{(f)})}}}\\
&  =u^{4}-\left(  \underbrace{\left(  x-1\right)  \left[  u\right]
}_{\substack{=x\left[  u\right]  -1\left[  u\right]  \\\text{(by Corollary
\ref{cor.pol.eval.concs} \textbf{(b)})}}}\right)  ^{2}\cdot\left(
\underbrace{\left(  x+1\right)  \left[  u\right]  }_{\substack{=x\left[
u\right]  +1\left[  u\right]  \\\text{(by the first equality of}%
\\\text{Theorem \ref{thm.pol.eval.a+b} \textbf{(a)})}}}\right)  ^{2}\\
&  =u^{4}-\left(  x\left[  u\right]  -1\left[  u\right]  \right)  ^{2}%
\cdot\left(  x\left[  u\right]  +1\left[  u\right]  \right)  ^{2}\\
&  =u^{4}-\left(  \underbrace{x\left[  u\right]  }_{\substack{=u\\\text{(by
Theorem \ref{thm.pol.eval.a+b} \textbf{(d)})}}}-\underbrace{\underline{1}%
\left[  u\right]  }_{\substack{=1\\\text{(by Theorem \ref{thm.pol.eval.a+b}
\textbf{(c)})}}}\right)  ^{2}\cdot\left(  \underbrace{x\left[  u\right]
}_{\substack{=u\\\text{(by Theorem \ref{thm.pol.eval.a+b} \textbf{(d)})}%
}}+\underbrace{\underline{1}\left[  u\right]  }_{\substack{=1\\\text{(by
Theorem \ref{thm.pol.eval.a+b} \textbf{(c)})}}}\right)  ^{2}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since our \textquotedblleft%
}1\text{\textquotedblright\ here really means \textquotedblleft}%
\underline{1}\text{\textquotedblright}\right) \\
&  =u^{4}-\left(  u-1\right)  ^{2}\left(  u+1\right)  ^{2}.
\end{align*}
This argument was completely straightforward (despite its length); all we did
was \textquotedblleft opening the parentheses\textquotedblright\footnote{more
formally: rewriting an expression of the form \textquotedblleft$\left(
\text{something complicated}\right)  \left[  u\right]  $\textquotedblright\ in
terms of one or several expressions of the form \textquotedblleft$\left(
\text{something simpler}\right)  \left[  u\right]  $\textquotedblright} using
whatever part of Theorem \ref{thm.pol.eval.a+b} or Corollary
\ref{cor.pol.eval.concs} would let us do that.

Thanks to Corollary \ref{cor.pol.eval.evu} (or the Substitution slogan), the
polynomial ring $\mathbb{K}\left[  x\right]  $ is a sort of \textquotedblleft
forge\textquotedblright\ for identities that concern an arbitrary element $u$
of an arbitrary $\mathbb{K}$-algebra $U$. For example, if you want to prove
the identity%
\[
u^{3}-u=u\left(  u-1\right)  \left(  u+1\right)  \ \ \ \ \ \ \ \ \ \ \text{for
any }\mathbb{K}\text{-algebra }U\text{ and any }u\in U,
\]
then it suffices to prove the identity%
\[
x^{3}-x=x\left(  x-1\right)  \left(  x+1\right)  \ \ \ \ \ \ \ \ \ \ \text{in
}\mathbb{K}\left[  x\right]
\]
and then apply $\operatorname*{ev}\nolimits_{u}$ to both sides of it (or, less
formally, take the values of both sides at $u$, and simplify them using the
Substitution slogan). Indeed, the map $\operatorname*{ev}\nolimits_{u}$ sends
$x$ to $u$ and is a $\mathbb{K}$-algebra homomorphism, whence it also sends
$x^{3}-x$ to $u^{3}-u$ and sends $x\left(  x-1\right)  \left(  x+1\right)  $
to $u\left(  u-1\right)  \left(  u+1\right)  $. The Substitution slogan is
saying this at a more concrete level: Indeed, applying the map
$\operatorname*{ev}\nolimits_{u}$ is tantamount to \textquotedblleft
substituting $u$ for $x$\textquotedblright\ in a polynomial.

\begin{remark}
\label{rmk.pol.eval.FPS}Let $U$ be a $\mathbb{K}$-algebra. Let $u\in U$. We
have defined $\mathbf{a}\left[  u\right]  $ for $\mathbf{a}\in\mathbb{K}%
\left[  x\right]  $. We can try to define it for arbitrary $\mathbf{a}=\left(
a_{0},a_{1},a_{2},\ldots\right)  \in\mathbb{K}\left[  \left[  x\right]
\right]  $ as well. But in general, this will not work, since the sum
$\sum_{k\in\mathbb{N}}a_{k}u^{k}$ may not be well-defined. However, if $u$
itself is a FPS (that is, $u\in\mathbb{K}\left[  \left[  x\right]  \right]  $)
and satisfies $\left[  x^{0}\right]  u=0$, then the family $\left(  a_{k}%
u^{k}\right)  _{k\in\mathbb{N}}$ is summable (because in this case, we have%
\[
\left[  x^{0}\right]  \left(  u^{k}\right)  =\left[  x^{1}\right]  \left(
u^{k}\right)  =\cdots=\left[  x^{k-1}\right]  \left(  u^{k}\right)  =0
\]
for all $k\in\mathbb{N}$), and therefore $\mathbf{a}\left[  u\right]  $ is
well-defined. For example, $\mathbf{a}\left[  x^{2}\right]  $ is well-defined,
and more generally, $\mathbf{a}\left[  x^{k}\right]  $ is well-defined for
every positive integer $k$; but $\mathbf{a}\left[  1\right]  $ is not well-defined.
\end{remark}

We now define the concept of a root of a polynomial:

\begin{definition}
\label{def.pol.eval.root}Let $U$ be a $\mathbb{K}$-algebra. Let $u\in U$. Let
$\mathbf{a}\in\mathbb{K}\left[  x\right]  $.

We say that $u$ is a \textit{root} of $\mathbf{a}$ if $\mathbf{a}\left[
u\right]  =0$.
\end{definition}

This is a very general notion of \textquotedblleft root\textquotedblright%
\ that we have just defined. You may be used to the idea that a polynomial
$\mathbf{a}\in\mathbb{K}\left[  x\right]  $ can have roots in the ring
$\mathbb{K}$ itself, but we are allowing roots in any arbitrary $\mathbb{K}%
$-algebra (e.g., in a matrix algebra $\mathbb{K}^{n\times n}$ or even in the
polynomial ring $\mathbb{K}\left[  x\right]  $ itself). For example, the roots
of the polynomial $x\left(  x-1\right)  $ in a $\mathbb{K}$-algebra $U$ are
the idempotent elements of $U$, because for any element $u\in U$, we have the
following equivalence:%
\begin{align*}
&  \ \left(  u\text{ is a root of }x\left(  x-1\right)  \right) \\
&  \Longleftrightarrow\ \left(  \underbrace{\left(  x\left(  x-1\right)
\right)  \left[  u\right]  }_{=x\left[  u\right]  \cdot\left(  x-1\right)
\left[  u\right]  }=0\right)  \ \Longleftrightarrow\ \left(
\underbrace{x\left[  u\right]  }_{=u}\cdot\underbrace{\left(  x-1\right)
\left[  u\right]  }_{=u-1}=0\right) \\
&  \Longleftrightarrow\ \left(  \underbrace{u\cdot\left(  u-1\right)
}_{=u^{2}-u}=0\right)  \ \Longleftrightarrow\ \left(  u^{2}-u=0\right)
\ \Longleftrightarrow\ \left(  u^{2}=u\right) \\
&  \Longleftrightarrow\ \left(  u\text{ is idempotent}\right)  .
\end{align*}
If $U$ is a field, then the only idempotent elements of $U$ are $0$ and $1$
(because $u\cdot\left(  u-1\right)  =0$ implies that $u$ or $u-1$ is $0$).
Otherwise, there can be more idempotent elements; for example, $\mathbb{Z}/6$
has the four idempotent elements $\left[  0\right]  _{6},\left[  1\right]
_{6},\left[  3\right]  _{6},\left[  4\right]  _{6}$.

We now define divisibility of polynomials in the same way as we defined
divisibility of integers (Definition \ref{def.ent.div.div}) and divisibility
of Gaussian integers (Definition \ref{def.Z[i].gauss.div}):

\begin{definition}
\label{def.pol.div}Let $\mathbf{a}$ and $\mathbf{b}$ be two polynomials in
$\mathbb{K}\left[  x\right]  $. We say that $\mathbf{a}\mid\mathbf{b}$ (or,
more precisely, \textquotedblleft$\mathbf{a}\mid\mathbf{b}$ in $\mathbb{K}%
\left[  x\right]  $\textquotedblright) if there exists a $\mathbf{c}%
\in\mathbb{K}\left[  x\right]  $ such that $\mathbf{b}=\mathbf{ac}$.
\end{definition}

Be aware that this is a somewhat slippery notion, as its meaning depends on
$\mathbb{K}$, which is not reflected in the notation \textquotedblleft%
$\mathbf{a}\mid\mathbf{b}$\textquotedblright. For example, the two polynomials
$1+x$ and $2+2x$ satisfy $2+2x\mid1+x$ when $\mathbb{K}=\mathbb{Q}$ (since
$1+x=\left(  2+2x\right)  \cdot\dfrac{1}{2}$), but not when $\mathbb{K}%
=\mathbb{Z}$. Thus, when ambiguity is possible, $\mathbb{K}$ should be
specified (i.e., you should write \textquotedblleft$\mathbf{a}\mid\mathbf{b}$
in $\mathbb{K}\left[  x\right]  $\textquotedblright\ rather than just
\textquotedblleft$\mathbf{a}\mid\mathbf{b}$\textquotedblright).

The roots of a polynomial $\mathbf{a}\in\mathbb{K}\left[  x\right]  $ are
closely connected to divisors of $\mathbf{a}$ -- specifically, ones of the
form $x-u$:

\begin{proposition}
\label{prop.pol.root=div}Let $\mathbf{a}$ be a polynomial in $\mathbb{K}%
\left[  x\right]  $. Let $u\in\mathbb{K}$. Then,%
\[
\left(  u\text{ is a root of }\mathbf{a}\right)  \Longleftrightarrow\left(
x-u\mid\mathbf{a}\right)  .
\]
(Of course, $x-u$ means $x-\underline{u}$.)
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.pol.root=div}.]$\Longrightarrow:$ Assume that
$u$ is a root of $\mathbf{a}$. We must prove that $x-u\mid\mathbf{a}$.

We have $x-u\in\mathbb{K}\left[  x\right]  _{\leq1}$, and the coefficient
$\left[  x^{1}\right]  \left(  x-u\right)  \in\mathbb{K}$ is invertible (since
this coefficient is $1$). Thus, Theorem \ref{thm.pol.quorem} \textbf{(a)}
(applied to $m=1$ and $\mathbf{b}=x-u$) shows that there exists a
\textbf{unique} pair $\left(  \mathbf{q},\mathbf{r}\right)  $ of polynomials
such that $\mathbf{a}=\mathbf{q}\cdot\left(  x-u\right)  +\mathbf{r}$ and
$\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq1-1}$. Consider this pair.

Now,
\begin{align*}
\mathbf{r}  &  \in\mathbb{K}\left[  x\right]  _{\leq1-1}=\mathbb{K}\left[
x\right]  _{\leq0}=\left\{  \underline{a}\ \mid\ a\in\mathbb{K}\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Example \ref{exa.pol.deg.1} \textbf{(a)}%
}\right) \\
&  =\left\{  \underline{b}\ \mid\ b\in\mathbb{K}\right\}  .
\end{align*}
In other words, $\mathbf{r}=\underline{b}$ for some $b\in\mathbb{K}$. Consider
this $b$. Thus, $\mathbf{a}=\mathbf{q}\cdot\left(  x-u\right)
+\underbrace{\mathbf{r}}_{=\underline{b}}=\mathbf{q}\cdot\left(  x-u\right)
+\underline{b}$.

We can substitute $u$ for $x$ in this equation (i.e., apply the $\mathbb{K}%
$-algebra homomorphism $\operatorname*{ev}\nolimits_{u}$ to both sides of it),
and obtain%
\[
\mathbf{a}\left[  u\right]  =\left(  \mathbf{q}\cdot\left(  x-u\right)
+\underline{b}\right)  \left[  u\right]  =\mathbf{q}\left[  u\right]
\cdot\underbrace{\left(  x-u\right)  \left[  u\right]  }_{=u-u=0}%
+\underbrace{\underline{b}\left[  u\right]  }_{=b}=\underbrace{\mathbf{q}%
\left[  u\right]  \cdot0}_{=0}+b=b.
\]
Thus, $b=\mathbf{a}\left[  u\right]  =0$ (since $u$ is a root of $\mathbf{a}%
$). Hence, $\underline{b}=\underline{0}$, so that%
\[
\mathbf{a}=\mathbf{q}\cdot\left(  x-u\right)  +\underbrace{\underline{b}%
}_{=\underline{0}}=\mathbf{q}\cdot\left(  x-u\right)
,\ \ \ \ \ \ \ \ \ \ \text{and thus }x-u\mid\mathbf{a}.
\]
Thus, the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction of
Proposition \ref{prop.pol.root=div} is proven.

$\Longleftarrow:$ Assume that $x-u\mid\mathbf{a}$. We must prove that $u$ is a
root of $\mathbf{a}$.

We have $x-u\mid\mathbf{a}$. In other words, $\mathbf{a}=\left(  x-u\right)
\cdot\mathbf{c}$ for some polynomial $\mathbf{c}$. Substituting $u$ for $x$ in
this equation, we obtain%
\[
\mathbf{a}\left[  u\right]  =\underbrace{\left(  u-u\right)  }_{=0}%
\cdot\mathbf{c}\left[  u\right]  =0,
\]
so that $u$ is a root of $\mathbf{a}$. Thus, the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Proposition
\ref{prop.pol.root=div} is proven.
\end{proof}

\begin{example}
\label{exa.pol.root=div.Z/6}Let $\mathbb{K}=\mathbb{Z}/6$ and $\mathbf{a}%
=x^{2}-x$. Then, the roots of $\mathbf{a}$ in $\mathbb{K}$ are precisely the
idempotent elements of $\mathbb{K}$; these are $0,1,3,4$. So the previous
proposition yields that $x-0$, $x-1$, $x-3$ and $x-4$ all divide $\mathbf{a}$.
However, this does not mean that the product $\left(  x-0\right)  \left(
x-1\right)  \left(  x-3\right)  \left(  x-4\right)  $ divides $\mathbf{a}$.
Instead, we have%
\[
\mathbf{a}=\left(  x-0\right)  \left(  x-1\right)  =\left(  x-3\right)
\left(  x-4\right)  \ \ \ \ \ \ \ \ \ \ \text{in }\mathbb{K}\left[  x\right]
.
\]

\end{example}

If this example appears weird, keep in mind that $\mathbb{Z}/6$ is not a
field. When $\mathbb{K}$ is a field, the polynomial ring $\mathbb{K}\left[
x\right]  $ behaves very much like $\mathbb{Z}$ or $\mathbb{Z}\left[
i\right]  $: We have division with remainder by any nonzero polynomial; we
have gcds; we have a notion of \textquotedblleft primes\textquotedblright%
\ (which are called irreducible polynomials); and every nonzero polynomial has
a unique factorization into primes (up to units, which are the nonzero
constant polynomials). But when $\mathbb{K}$ is merely a commutative ring,
this can all break down; in particular, Example \ref{exa.pol.root=div.Z/6}
shows that the factorization into primes (when it exists) is not unique.

The following theorem is often called the \textquotedblleft\textit{easy half
of the Fundamental Theorem of Algebra}\textquotedblright:

\begin{theorem}
\label{thm.pol.FTA-easy}Let $\mathbb{K}$ be a field. Let $n\in\mathbb{N}$.
Then, any nonzero polynomial $\mathbf{a}\in\mathbb{K}\left[  x\right]  $ of
degree $\leq n$ has at most $n$ roots in $\mathbb{K}$. (We are not counting
the roots with multiplicity here.)
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.pol.FTA-easy}.]Induction on $n$.

The base case ($n=0$) is obvious, since a nonzero constant polynomial has no roots.

\textit{Induction step:} Let $n$ be a positive integer. Assume (as induction
hypothesis) that any nonzero polynomial of degree $\leq n-1$ has at most $n-1$
roots in $\mathbb{K}$. We must prove the analogous fact for $n$.

Let $\mathbf{a}\in\mathbb{K}\left[  x\right]  $ be a nonzero polynomial of
degree $\leq n$. We must prove that $\mathbf{a}$ has at most $n$ roots in
$\mathbb{K}$. If $\mathbf{a}$ has no roots at all, then we are done. So WLOG
assume that $\mathbf{a}$ has a root $u\in\mathbb{K}$. Then, $x-u\mid
\mathbf{a}$ (by Proposition \ref{prop.pol.root=div}). Hence,%
\[
\mathbf{a}=\left(  x-u\right)  \cdot\mathbf{c}\ \ \ \ \ \ \ \ \ \ \text{for
some }\mathbf{c}\in\mathbb{K}\left[  x\right]  .
\]
Consider this $\mathbf{c}$. From $\mathbf{a}=\left(  x-u\right)
\cdot\mathbf{c}$, we obtain%
\begin{align*}
\deg\mathbf{a}  &  =\deg\left(  \left(  x-u\right)  \cdot\mathbf{c}\right)
=\underbrace{\deg\left(  x-u\right)  }_{=1}+\deg\mathbf{c}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\mathbb{K}\text{ is a field}\right)
\\
&  =1+\deg\mathbf{c},
\end{align*}
so that $\deg\mathbf{c}=\underbrace{\deg\mathbf{a}}_{\leq n}-1\leq n-1$. Thus,
$\mathbf{c}$ is a polynomial of degree $\leq n-1$, and thus has at most $n-1$
roots in $\mathbb{K}$ (by the induction hypothesis).

Next, we claim that every root of $\mathbf{a}$ other than $u$ must be a root
of $\mathbf{c}$.

[\textit{Proof:} Let $v$ be a root of $\mathbf{a}$ other than $u$. We must
prove that $v$ is a root of $\mathbf{c}$.

By definition of $v$, we have $v\neq u$ and $\mathbf{a}\left[  v\right]  =0$.
From $v\neq u$, we obtain $v-u\neq0$, and thus $v-u\in\mathbb{K}$ is
invertible (since $\mathbb{K}$ is a field). But substituting $v$ for $x$ in
$\mathbf{a}=\left(  x-u\right)  \cdot\mathbf{c}$, we obtain%
\[
\mathbf{a}\left[  v\right]  =\left(  v-u\right)  \cdot\mathbf{c}\left[
v\right]  .
\]
Thus, $\left(  v-u\right)  \cdot\mathbf{c}\left[  v\right]  =\mathbf{a}\left[
v\right]  =0$. We can divide this equation by $v-u$ (since $v-u$ is
invertible), and thus obtain $\mathbf{c}\left[  v\right]  =0$. In other words,
$v$ is a root of $\mathbf{c}$. As we claimed.]

The claim that we just proved shows that $\mathbf{a}$ has at most one more
root than $\mathbf{c}$. Thus, $\mathbf{a}$ has at most $n$ roots (since
$\mathbf{c}$ has at most $n-1$ roots). This completes the induction step.
Hence, Theorem \ref{thm.pol.FTA-easy} is proven.
\end{proof}

When $\mathbb{K}$ is just an arbitrary field, the number of roots of a
degree-$n$ nonzero polynomial over $\mathbb{K}$ can be much smaller than $n$.
For example, the polynomial $x^{2}+1\in\mathbb{R}\left[  x\right]  $ has $0$
roots in $\mathbb{R}$ (but it has $2$ roots in $\mathbb{C}$). The
\textquotedblleft hard half\textquotedblright\ of the Fundamental Theorem of
Algebra says that a nonzero polynomial $\mathbf{a}\in\mathbb{C}\left[
x\right]  $ of degree $n$ has exactly $n$ roots in $\mathbb{C}$, counted with
multiplicity. As I said before, this is not a theorem of algebra, since it
relies on the fact that $\mathbb{C}$ has a topology and is closed in this topology.

Next comes a little potpourri of properties of polynomials:

\begin{proposition}
\label{prop.pol.deg-compose}Let $\mathbf{a}$ and $\mathbf{b}$ be two nonzero
polynomials in $\mathbb{K}\left[  x\right]  $.

\textbf{(a)} We have $\deg\left(  \mathbf{a}\left[  \mathbf{b}\right]
\right)  \leq\deg\mathbf{a}\cdot\deg\mathbf{b}$.

\textbf{(b)} If $\mathbb{K}$ is a field, then this inequality is an equality.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.pol.deg-compose}.]Easy.
\end{proof}

\begin{proposition}
\label{prop.pol.eval-funct}Let $U$ and $V$ be two $\mathbb{K}$-algebras. Let
$f:U\rightarrow V$ be a $\mathbb{K}$-algebra homomorphism. Let $u\in U$ and
$\mathbf{a}\in\mathbb{K}\left[  x\right]  $. Then,%
\[
f\left(  \mathbf{a}\left[  u\right]  \right)  =\mathbf{a}\left[  f\left(
u\right)  \right]  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.pol.eval-funct}.]For example, if
$\mathbf{a}=x^{3}+2x+5$, then this is saying%
\[
f\left(  u^{3}+2u+5\right)  =\left(  f\left(  u\right)  \right)
^{3}+2f\left(  u\right)  +5
\]
(because $\mathbf{a}\left[  u\right]  =u^{3}+2u+5$ and $\mathbf{a}\left[
f\left(  u\right)  \right]  =\left(  f\left(  u\right)  \right)
^{3}+2f\left(  u\right)  +5$ in this case). But this equality is true, since
$f$ preserves addition, multiplication, scaling, zero and unity (because $f$
is a $\mathbb{K}$-algebra homomorphism).

The proof of Proposition \ref{prop.pol.eval-funct} in the general case follows
this example. Here are the details:

\begin{fineprint}
First we notice that $f$ is a ring homomorphism (since $f$ is a $\mathbb{K}%
$-algebra homomorphism). Thus,
\begin{equation}
f\left(  u^{k}\right)  =\left(  f\left(  u\right)  \right)  ^{k}%
\ \ \ \ \ \ \ \ \ \ \text{for all }k\in\mathbb{N}
\label{pf.prop.pol.eval-funct.uk}%
\end{equation}
(by Proposition \ref{prop.riho.subtract} \textbf{(h)}, applied to $U$, $V$,
$u$ and $k$ instead of $\mathbb{K}$, $\mathbb{L}$, $a$ and $n$). Now, write
the polynomial $\mathbf{a}\in\mathbb{K}\left[  x\right]  $ in the form
$\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)  $. Then, the definition
of $\mathbf{a}\left[  u\right]  $ yields%
\begin{equation}
\mathbf{a}\left[  u\right]  =\sum_{k\in\mathbb{N}}a_{k}u^{k},
\label{pf.prop.pol.eval-funct.au=}%
\end{equation}
whereas the definition of $\mathbf{a}\left[  f\left(  u\right)  \right]  $
yields%
\begin{equation}
\mathbf{a}\left[  f\left(  u\right)  \right]  =\sum_{k\in\mathbb{N}}%
a_{k}\left(  f\left(  u\right)  \right)  ^{k}.
\label{pf.prop.pol.eval-funct.afu=}%
\end{equation}


Now, applying the map $f$ to both sides of the equality
(\ref{pf.prop.pol.eval-funct.au=}), we find%
\begin{equation}
f\left(  \mathbf{a}\left[  u\right]  \right)  =f\left(  \sum_{k\in\mathbb{N}%
}a_{k}u^{k}\right)  =\sum_{k\in\mathbb{N}}f\left(  a_{k}u^{k}\right)  .
\label{pf.prop.pol.eval-funct.4}%
\end{equation}
Here, the last equality sign needs a bit of a justification. It is tempting to
say that this equality sign follows from Proposition \ref{prop.riho.subtract}
\textbf{(e)}, but this is not quite precise: The set $S$ in Proposition
\ref{prop.riho.subtract} \textbf{(e)} is required to be finite, while the set
$\mathbb{N}$, which the sums in (\ref{pf.prop.pol.eval-funct.4}) are ranging
over, is infinite. However, $\mathbf{a}$ is a polynomial; in other words, all
but finitely many $i\in\mathbb{N}$ satisfy $a_{i}=0$ (by the definition of a
polynomial). In other words, there exists a finite subset $S$ of $\mathbb{Z}$
such that%
\begin{equation}
\text{all }i\in\mathbb{N}\setminus S\text{ satisfy }a_{i}=0.
\label{pf.prop.pol.eval-funct.4.pf.fin}%
\end{equation}
Consider this $S$. Now, each $k\in\mathbb{N}$ satisfies either $k\in S$ or
$k\notin S$ (but not both at once); hence,%
\begin{align*}
\sum_{k\in\mathbb{N}}a_{k}u^{k}  &  =\underbrace{\sum_{\substack{k\in
\mathbb{N};\\k\in S}}}_{\substack{=\sum_{k\in S}\\\text{(since }%
S\subseteq\mathbb{N}\text{)}}}a_{k}u^{k}+\underbrace{\sum_{\substack{k\in
\mathbb{N};\\k\notin S}}}_{=\sum_{k\in\mathbb{N}\setminus S}}a_{k}u^{k}%
=\sum_{k\in S}a_{k}u^{k}+\sum_{k\in\mathbb{N}\setminus S}\underbrace{a_{k}%
}_{\substack{=0\\\text{(by (\ref{pf.prop.pol.eval-funct.4.pf.fin}%
),}\\\text{applied to }i=k\text{)}}}u^{k}\\
&  =\sum_{k\in S}a_{k}u^{k}+\underbrace{\sum_{k\in\mathbb{N}\setminus S}%
0u^{k}}_{=0}=\sum_{k\in S}a_{k}u^{k}.
\end{align*}
Applying the map $f$ to both sides of this equality, we find%
\begin{equation}
f\left(  \sum_{k\in\mathbb{N}}a_{k}u^{k}\right)  =f\left(  \sum_{k\in S}%
a_{k}u^{k}\right)  =\sum_{k\in S}f\left(  a_{k}u^{k}\right)
\label{pf.prop.pol.eval-funct.4.pf.6}%
\end{equation}
(by Proposition \ref{prop.riho.subtract} \textbf{(e)}, since the set $S$ is
finite). But if $k\in\mathbb{N}\setminus S$, then $a_{k}=0$ (by
(\ref{pf.prop.pol.eval-funct.4.pf.fin}), applied to $i=k$) and thus
$\underbrace{a_{k}}_{=0}u^{k}=0$ and thus%
\begin{equation}
f\left(  \underbrace{a_{k}u^{k}}_{=0}\right)  =f\left(  0\right)  =0
\label{pf.prop.pol.eval-funct.4.pf.finf}%
\end{equation}
(since $f$ is a $\mathbb{K}$-linear map\footnote{because $f$ is a $\mathbb{K}%
$-algebra homomorphism}). Now, again, recall that each $k\in\mathbb{N}$
satisfies either $k\in S$ or $k\notin S$ (but not both at once); hence,
\begin{align*}
\sum_{k\in\mathbb{N}}f\left(  a_{k}u^{k}\right)   &  =\underbrace{\sum
_{\substack{k\in\mathbb{N};\\k\in S}}}_{\substack{=\sum_{k\in S}\\\text{(since
}S\subseteq\mathbb{N}\text{)}}}f\left(  a_{k}u^{k}\right)  +\underbrace{\sum
_{\substack{k\in\mathbb{N};\\k\notin S}}}_{=\sum_{k\in\mathbb{N}\setminus S}%
}f\left(  a_{k}u^{k}\right)  =\sum_{k\in S}f\left(  a_{k}u^{k}\right)
+\sum_{k\in\mathbb{N}\setminus S}\underbrace{f\left(  a_{k}u^{k}\right)
}_{\substack{=0\\\text{(by (\ref{pf.prop.pol.eval-funct.4.pf.finf}))}}}\\
&  =\sum_{k\in S}f\left(  a_{k}u_{k}\right)  .
\end{align*}
Comparing this with (\ref{pf.prop.pol.eval-funct.4.pf.6}), we obtain $f\left(
\sum_{k\in\mathbb{N}}a_{k}u^{k}\right)  =\sum_{k\in\mathbb{N}}f\left(
a_{k}u^{k}\right)  $. Thus, the last equality sign in
(\ref{pf.prop.pol.eval-funct.4}) has been justified. (This sort of
straightforward argument is commonly left unsaid when working with
polynomials, because it is almost completely automatic; the main idea is
\textquotedblleft reduce the infinite sum to a finite sum by throwing out
vanishing addends\textquotedblright.)

Now that (\ref{pf.prop.pol.eval-funct.4}) is proven, we can move on. The map
$f$ is $\mathbb{K}$-linear (since it is a $\mathbb{K}$-algebra homomorphism).
Hence, for each $k\in\mathbb{N}$, we have%
\[
f\left(  a_{k}u^{k}\right)  =a_{k}\underbrace{f\left(  u^{k}\right)
}_{\substack{=\left(  f\left(  u\right)  \right)  ^{k}\\\text{(by
(\ref{pf.prop.pol.eval-funct.uk}))}}}=a_{k}\left(  f\left(  u\right)  \right)
^{k}.
\]
Hence, (\ref{pf.prop.pol.eval-funct.4}) rewrites as%
\[
f\left(  \mathbf{a}\left[  u\right]  \right)  =\sum_{k\in\mathbb{N}}%
a_{k}\left(  f\left(  u\right)  \right)  ^{k}.
\]
Comparing this with (\ref{pf.prop.pol.eval-funct.afu=}), we obtain $f\left(
\mathbf{a}\left[  u\right]  \right)  =\mathbf{a}\left[  f\left(  u\right)
\right]  $. Thus, Proposition \ref{prop.pol.eval-funct} is proven.
\end{fineprint}
\end{proof}

\begin{proposition}
\label{prop.pol.eval-assoc}Let $U$ be a $\mathbb{K}$-algebra. Let $u\in U$.
Let $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  x\right]  $. Then,%
\[
\mathbf{a}\left[  \mathbf{b}\left[  u\right]  \right]  =\left(  \mathbf{a}%
\left[  \mathbf{b}\right]  \right)  \left[  u\right]  .
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.pol.eval-assoc}.]The map $\operatorname*{ev}%
\nolimits_{u}:\mathbb{K}\left[  x\right]  \rightarrow U$ is a $\mathbb{K}%
$-algebra homomorphism (by Corollary \ref{cor.pol.eval.evu}). Hence,
Proposition \ref{prop.pol.eval-funct} (applied to $\mathbb{K}\left[  x\right]
$, $U$, $\operatorname*{ev}\nolimits_{u}$ and $\mathbf{b}$ instead of $U$,
$V$, $f$ and $u$) yields $\operatorname*{ev}\nolimits_{u}\left(
\mathbf{a}\left[  \mathbf{b}\right]  \right)  =\mathbf{a}\left[
\operatorname*{ev}\nolimits_{u}\left(  \mathbf{b}\right)  \right]  $. But the
definition of $\operatorname*{ev}\nolimits_{u}$ yields $\operatorname*{ev}%
\nolimits_{u}\left(  \mathbf{b}\right)  =\mathbf{b}\left[  u\right]  $ and
$\operatorname*{ev}\nolimits_{u}\left(  \mathbf{a}\left[  \mathbf{b}\right]
\right)  =\left(  \mathbf{a}\left[  \mathbf{b}\right]  \right)  \left[
u\right]  $. Hence, $\left(  \mathbf{a}\left[  \mathbf{b}\right]  \right)
\left[  u\right]  =\operatorname*{ev}\nolimits_{u}\left(  \mathbf{a}\left[
\mathbf{b}\right]  \right)  =\mathbf{a}\left[  \underbrace{\operatorname*{ev}%
\nolimits_{u}\left(  \mathbf{b}\right)  }_{=\mathbf{b}\left[  u\right]
}\right]  =\mathbf{a}\left[  \mathbf{b}\left[  u\right]  \right]  $. This
proves Proposition \ref{prop.pol.eval-assoc}.
\end{proof}

One more notation is needed for the next section.

\begin{definition}
Let $\mathbb{L}$ be a ring that contains $\mathbb{Q}$ as a subring. (For
example, $\mathbb{L}$ can be $\mathbb{R}$ or $\mathbb{C}$ or $\mathbb{Q}%
\left[  x\right]  $.)

Recall that in Definition \ref{def.binom.binom}, we have defined the binomial
coefficient $\dbinom{n}{k}$ for all $n\in\mathbb{Q}$ and $k\in\mathbb{Q}$. We
extend the very same definition to all $n\in\mathbb{L}$.
\end{definition}

Thus, in particular, we have a polynomial $\dbinom{x}{k}\in\mathbb{Q}\left[
x\right]  $ for each $k\in\mathbb{Q}$. This polynomial $\dbinom{x}{k}$ is
explicitly given by%
\begin{equation}
\dbinom{x}{k}=\dfrac{x\left(  x-1\right)  \left(  x-2\right)  \cdots\left(
x-k+1\right)  }{k!}\ \ \ \ \ \ \ \ \ \ \text{when }k\in\mathbb{N}
\label{eq.pol.bin-coeff.xk.1}%
\end{equation}
(and equals $0$ when $k\notin\mathbb{N}$). More generally, for each polynomial
$\mathbf{a}\in\mathbb{Q}\left[  x\right]  $ and each $k\in\mathbb{N}$, we have
a polynomial%
\begin{equation}
\dbinom{\mathbf{a}}{k}=\dfrac{\mathbf{a}\left(  \mathbf{a}-1\right)  \left(
\mathbf{a}-2\right)  \cdots\left(  \mathbf{a}-k+1\right)  }{k!}.
\label{eq.pol.bin-coeff.xk.ak}%
\end{equation}
The following is easy:

\begin{corollary}
\label{cor.pol.xchoosen}Let $k\in\mathbb{N}$.

\textbf{(a)} Then, $\dbinom{x}{k}$ is a polynomial of degree $k$.

\textbf{(b)} For each $u\in\mathbb{Q}$, we have $\dbinom{x}{k}\left[
u\right]  =\dbinom{u}{k}$.

\textbf{(c)} For each $\mathbf{a}\in\mathbb{Q}\left[  x\right]  $ and
$u\in\mathbb{Q}$, we have $\dbinom{\mathbf{a}}{k}\left[  u\right]
=\dbinom{\mathbf{a}\left[  u\right]  }{k}$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.pol.xchoosen}.]\textbf{(a)} This follows from
(\ref{eq.pol.bin-coeff.xk.1}) and Proposition \ref{prop.pol.deg-prod-k}
\textbf{(b)} (applied to $\mathbf{a}_{i}=x-i+1$).

\textbf{(b)} Let $u\in\mathbb{Q}$. Evaluating both sides of the equality
(\ref{eq.pol.bin-coeff.xk.1}) at $u$ (that is, applying the evaluation
homomorphism $\operatorname*{ev}\nolimits_{u}:\mathbb{Q}\left[  x\right]
\rightarrow\mathbb{Q}$ to this equality), we obtain%
\begin{align*}
\dbinom{x}{k}\left[  u\right]   &  =\dfrac{x\left(  x-1\right)  \left(
x-2\right)  \cdots\left(  x-k+1\right)  }{k!}\left[  u\right] \\
&  =\dfrac{\left(  x\left[  u\right]  \right)  \left(  x\left[  u\right]
-1\left[  u\right]  \right)  \left(  x\left[  u\right]  -2\left[  u\right]
\right)  \cdots\left(  x\left[  u\right]  -\left(  k-1\right)  \left[
u\right]  \right)  }{k!}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\operatorname*{ev}\nolimits_{u}%
\text{ is a }\mathbb{Q}\text{-algebra homomorphism}\right) \\
&  =\dfrac{u\left(  u-1\right)  \left(  u-2\right)  \cdots\left(
u-k+1\right)  }{k!}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }x\left[  u\right]  =u\text{ and
}i\left[  u\right]  =i\text{ for all integers }i\right) \\
&  =\dbinom{u}{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
}\dbinom{u}{k}\right)  .
\end{align*}
This proves Corollary \ref{cor.pol.xchoosen} \textbf{(b)}.

\textbf{(c)} Let $\mathbf{a}\in\mathbb{Q}\left[  x\right]  $ and
$u\in\mathbb{Q}$. Evaluating both sides of the equality
(\ref{eq.pol.bin-coeff.xk.ak}) at $u$ (that is, applying the evaluation
homomorphism $\operatorname*{ev}\nolimits_{u}:\mathbb{Q}\left[  x\right]
\rightarrow\mathbb{Q}$ to this equality), we obtain%
\begin{align*}
\dbinom{\mathbf{a}}{k}\left[  u\right]   &  =\dfrac{\mathbf{a}\left(
\mathbf{a}-1\right)  \left(  \mathbf{a}-2\right)  \cdots\left(  \mathbf{a}%
-k+1\right)  }{k!}\left[  u\right] \\
&  =\dfrac{\left(  \mathbf{a}\left[  u\right]  \right)  \left(  \mathbf{a}%
\left[  u\right]  -1\left[  u\right]  \right)  \left(  \mathbf{a}\left[
u\right]  -2\left[  u\right]  \right)  \cdots\left(  \mathbf{a}\left[
u\right]  -\left(  k-1\right)  \left[  u\right]  \right)  }{k!}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\operatorname*{ev}\nolimits_{u}%
\text{ is a }\mathbb{Q}\text{-algebra homomorphism}\right) \\
&  =\dfrac{\left(  \mathbf{a}\left[  u\right]  \right)  \left(  \mathbf{a}%
\left[  u\right]  -1\right)  \left(  \mathbf{a}\left[  u\right]  -2\right)
\cdots\left(  \mathbf{a}\left[  u\right]  -k+1\right)  }{k!}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }i\left[  u\right]  =i\text{ for
all integers }i\right) \\
&  =\dbinom{\mathbf{a}\left[  u\right]  }{k}\ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of }\dbinom{\mathbf{a}\left[  u\right]  }{k}\right)  .
\end{align*}
This proves Corollary \ref{cor.pol.xchoosen} \textbf{(c)}.
\end{proof}

\subsection{\label{sect.pol.id}The polynomial identity trick}

\begin{convention}
For this whole section, let $\mathbb{K}$ be a field.
\end{convention}

\subsubsection{Enough equal values make polynomials equal}

\begin{corollary}
\label{cor.pol.id.n+1}Let $\mathbf{a}$ and $\mathbf{b}$ be two polynomials of
degree $\leq n$ over the field $\mathbb{K}$. Assume that at least $n+1$ many
elements $u\in\mathbb{K}$ satisfy $\mathbf{a}\left[  u\right]  =\mathbf{b}%
\left[  u\right]  $. Then, $\mathbf{a}=\mathbf{b}$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.pol.id.n+1}.]Clearly, $\mathbf{a}-\mathbf{b}$ is
a polynomial of degree $\leq n$.

Moreover, at least $n+1$ many elements $u\in\mathbb{K}$ satisfy $\left(
\mathbf{a}-\mathbf{b}\right)  \left[  u\right]  =0$ (since this is what
$\mathbf{a}\left[  u\right]  =\mathbf{b}\left[  u\right]  $ means). In other
words, the polynomial $\mathbf{a}-\mathbf{b}$ must have at least $n+1$ roots
in $\mathbb{K}$.

But Theorem \ref{thm.pol.FTA-easy} (applied to $\mathbf{a}-\mathbf{b}$ instead
of $\mathbf{a}$) yields that if $\mathbf{a}-\mathbf{b}$ is nonzero, then
$\mathbf{a}-\mathbf{b}$ has at most $n$ roots in $\mathbb{K}$. This would
contradict the preceding sentence. So $\mathbf{a}-\mathbf{b}$ cannot be
nonzero. In other words, $\mathbf{a}-\mathbf{b}=\underline{0}$. In other
words, $\mathbf{a}=\mathbf{b}$. This proves Corollary \ref{cor.pol.id.n+1}.
\end{proof}

I like to refer to the following corollary as \textquotedblleft the
\textit{polynomial identity trick}\textquotedblright:

\begin{corollary}
\label{cor.pol.id.trick}Let $\mathbf{a}$ and $\mathbf{b}$ be two polynomials
over the field $\mathbb{K}$. Assume that infinitely many elements
$u\in\mathbb{K}$ satisfy $\mathbf{a}\left[  u\right]  =\mathbf{b}\left[
u\right]  $. Then, $\mathbf{a}=\mathbf{b}$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.pol.id.trick}.]Choose an $n\in\mathbb{N}$ such
that $\mathbf{a}$ and $\mathbf{b}$ have degree $\leq n$. Then, apply Corollary
\ref{cor.pol.id.n+1}.
\end{proof}

\begin{example}
Corollary \ref{cor.pol.id.trick} can be false when $\mathbb{K}$ is not a
field. For an example, pick any infinite set $S$, and let $\mathbb{K}$ be the
commutative ring $\left(  \mathcal{P}\left(  S\right)  ,\bigtriangleup
,\cap,\varnothing,S\right)  $ constructed in Section \ref{sect.ring.exa}. Let
$n=2$, $\mathbf{a}=x^{2}-x$ and $\mathbf{b}=\underline{0}$. Then,
\textbf{each} $u\in\mathbb{K}$ satisfies $\mathbf{a}\left[  u\right]
=\mathbf{b}\left[  u\right]  $ (because $\mathbf{a}\left[  u\right]
=u^{2}-u=\underbrace{u\cap u}_{=u}-u=u-u=\varnothing=0_{\mathbb{K}%
}=\underline{0}\left[  u\right]  =\mathbf{b}\left[  u\right]  $); thus, in
particular, infinitely many elements $u\in\mathbb{K}$ satisfy $\mathbf{a}%
\left[  u\right]  =\mathbf{b}\left[  u\right]  $. But it is not true that
$\mathbf{a}=\mathbf{b}$.
\end{example}

\begin{teachingnote}
\textbf{2019-04-29 lecture}
\end{teachingnote}

We can now prove Proposition \ref{prop.poly.informal.f=g}:

\begin{proof}
[Proof of Proposition \ref{prop.poly.informal.f=g}.]The polynomials $P$ and
$Q$ are polynomials over the field $\mathbb{Q}$. We have assumed that
infinitely many $u\in\mathbb{Q}$ satisfy $P\left(  u\right)  =Q\left(
u\right)  $. In other words, infinitely many $u\in\mathbb{Q}$ satisfy
$P\left[  u\right]  =Q\left[  u\right]  $ (since we are now using the notation
$\mathbf{a}\left[  u\right]  $ for what we previously denoted by
$\mathbf{a}\left(  u\right)  $). Hence, Corollary \ref{cor.pol.id.trick}
(applied to $\mathbb{K}=\mathbb{Q}$, $\mathbf{a}=P$ and $\mathbf{b}=Q$) yields
$P=Q$. This proves Proposition \ref{prop.poly.informal.f=g}.
\end{proof}

We can now finish our proof of Theorem \ref{thm.binom.vandermonde} by putting
on solid ground everything we used about polynomials in that proof:

\begin{proof}
[Finishing touches to our proof of Theorem \ref{thm.binom.vandermonde}.]In the
proof of Lemma \ref{lem.binom.vandermonde.QN}, we defined two polynomials $P$
and $Q$ by (\ref{pf.lem.binom.vandermonde.NN.P=}) and
(\ref{pf.lem.binom.vandermonde.NN.Q=}). Both of these $P$ and $Q$ are
well-defined polynomials in $\mathbb{Q}\left[  x\right]  $, due to Corollary
\ref{cor.pol.xchoosen}. Moreover, substituting $u$ for $x$ into these
polynomials works exactly as we claimed in our proof of Lemma
\ref{lem.binom.vandermonde.QN} (i.e., for example, we have $P\left(  u\right)
=\dbinom{u+b}{n}$), due to parts \textbf{(b)} and \textbf{(c)} of Corollary
\ref{cor.pol.xchoosen}. The same holds for the polynomials $P$ and $Q$ defined
in the proof of Lemma \ref{lem.binom.vandermonde.QQ}. But these two lemmas
were the only places in which polynomials were used in our above proof of
Theorem \ref{thm.binom.vandermonde}. Hence, our proof of Theorem
\ref{thm.binom.vandermonde} is now on solid ground.
\end{proof}

\subsubsection{\label{subsect.pol.id.lagrange}Lagrange interpolation}

Corollary \ref{cor.pol.id.n+1} shows that for any $n\in\mathbb{N}$, a
polynomial of degree $\leq n$ over a field $\mathbb{K}$ is uniquely determined
by its values on any $n+1$ (given) distinct elements of $\mathbb{K}$. There is
a matching existence claim to this uniqueness claim: To any choice of values
at any $n+1$ given distinct elements of $\mathbb{K}$, you can find excatly one
polynomial of degree $\leq n$ over $\mathbb{K}$ that takes these values at
these elements. This polynomial can even be determined explicitly, as the
following theorem shows:

\begin{theorem}
\label{thm.pol.id.lag}Let $n\in\mathbb{N}$. Let $a_{1},a_{2},\ldots,a_{n+1}$
be $n+1$ distinct elements of a field $\mathbb{K}$. Let $b_{1},b_{2}%
,\ldots,b_{n+1}$ be $n+1$ arbitrary elements of $\mathbb{K}$.

\textbf{(a)} There is a unique polynomial $\mathbf{f}\in\mathbb{K}\left[
x\right]  _{\leq n}$ satisfying
\begin{equation}
\left(  \mathbf{f}\left[  a_{i}\right]  =b_{i}\ \ \ \ \ \ \ \ \ \ \text{for
all }i\in\left\{  1,2,\ldots,n+1\right\}  \right)  .
\label{eq.thm.pol.id.lag.a.1}%
\end{equation}


\textbf{(b)} This polynomial $\mathbf{f}$ is given by%
\[
\mathbf{f}=\sum_{j=1}^{n+1}b_{j}\dfrac{\prod_{k\neq j}\left(  x-a_{k}\right)
}{\prod_{k\neq j}\left(  a_{j}-a_{k}\right)  }%
\]
(where the \textquotedblleft$\prod_{k\neq j}$\textquotedblright\ signs mean
\textquotedblleft$\prod_{\substack{k\in\left\{  1,2,\ldots,n+1\right\}
;\\k\neq j}}$\textquotedblright).
\end{theorem}

Theorem \ref{thm.pol.id.lag} is known as the \textit{Lagrange interpolation
theorem}. Before we prove it, let us remark that it generalizes (and
concretizes) Proposition \ref{prop.intro.shamir.quadpol} (which is its
particular case for $n=2$ and $\mathbb{K}=\mathbb{Q}$ or $\mathbb{K}%
=\mathbb{R}$). After proving it, we will discuss how it helps make Shamir's
Secret Sharing Scheme work. We also notice that Theorem \ref{thm.pol.id.lag}
requires $\mathbb{K}$ to be a field; when $\mathbb{K}$ is merely a commutative
ring, both the \textquotedblleft existence\textquotedblright\ and
\textquotedblleft uniqueness\textquotedblright\ parts of Theorem
\ref{thm.pol.id.lag} \textbf{(a)} may fail, and the fractions appearing in
Theorem \ref{thm.pol.id.lag} \textbf{(b)} may fail to be well-defined (since
their denominators $a_{j}-a_{k}$ may fail to be invertible). We have already
witnessed the failure of the \textquotedblleft existence\textquotedblright%
\ part of Theorem \ref{thm.pol.id.lag} \textbf{(a)} in the case when
$\mathbb{K}=\mathbb{Z}$: Indeed, if we set
\begin{align*}
n=2,\ \ \ \ \ \ \ \ \ \  &  a_{1}=0,\ \ \ \ \ \ \ \ \ \ a_{2}%
=1,\ \ \ \ \ \ \ \ \ \ a_{3}=2,\\
\ \ \ \ \ \ \ \ \ \  &  b_{1}=0,\ \ \ \ \ \ \ \ \ \ b_{2}%
=0,\ \ \ \ \ \ \ \ \ \ b_{3}=1,
\end{align*}
then there exists no polynomial $\mathbf{f}\in\mathbb{Z}\left[  x\right]
_{\leq2}$ satisfying $\mathbf{f}\left[  a_{i}\right]  =b_{i}$ for all
$i\in\left\{  1,2,3\right\}  $. (The polynomial $\dbinom{x}{2}$ would satisfy
this, but it is not a polynomial in $\mathbb{Z}\left[  x\right]  _{\leq2}$,
since its coefficients are not integers. We have already observed this in
Example \ref{exa.ivp.ivps1} \textbf{(a)}.)

\begin{proof}
[Proof of Theorem \ref{thm.pol.id.lag}.]Define a polynomial $\mathbf{g}%
\in\mathbb{K}\left[  x\right]  $ by%
\begin{equation}
\mathbf{g}=\sum_{j=1}^{n+1}b_{j}\dfrac{\prod_{k\neq j}\left(  x-a_{k}\right)
}{\prod_{k\neq j}\left(  a_{j}-a_{k}\right)  } \label{pf.thm.pol.id.lag.g=}%
\end{equation}
(where the \textquotedblleft$\prod_{k\neq j}$\textquotedblright\ signs mean
\textquotedblleft$\prod_{\substack{k\in\left\{  1,2,\ldots,n+1\right\}
;\\k\neq j}}$\textquotedblright). Note that $\mathbf{g}$ is well-defined;
indeed, all the differences $a_{j}-a_{k}$ appearing in the denominators are
nonzero (because $a_{1},a_{2},\ldots,a_{n+1}$ are distinct) and thus
invertible (since $\mathbb{K}$ is a field).

Each of the $n+1$ addends $b_{j}\dfrac{\prod_{k\neq j}\left(  x-a_{k}\right)
}{\prod_{k\neq j}\left(  a_{j}-a_{k}\right)  }$ on the right hand side of
(\ref{pf.thm.pol.id.lag.g=}) belongs to $\mathbb{K}\left[  x\right]  _{\leq
n}$\ \ \ \ \footnote{\textit{Proof.} Let $j\in\left\{  1,2,\ldots,n+1\right\}
$. We must prove that $b_{j}\dfrac{\prod_{k\neq j}\left(  x-a_{k}\right)
}{\prod_{k\neq j}\left(  a_{j}-a_{k}\right)  }\in\mathbb{K}\left[  x\right]
_{\leq n}$.
\par
Indeed, the product $\prod_{k\neq j}\left(  x-a_{k}\right)  $ has exactly $n$
factors, each of which is a polynomial of degree $1$. Thus, this product has
degree $\leq n$ (by Proposition \ref{prop.pol.deg-prod-k} \textbf{(a)}), i.e.,
belongs to $\mathbb{K}\left[  x\right]  _{\leq n}$. The polynomial
$b_{j}\dfrac{\prod_{k\neq j}\left(  x-a_{k}\right)  }{\prod_{k\neq j}\left(
a_{j}-a_{k}\right)  }$ is obtained by scaling this product by $\dfrac{b_{j}%
}{\prod_{k\neq j}\left(  a_{j}-a_{k}\right)  }\in\mathbb{K}$; thus, it also
belongs to $\mathbb{K}\left[  x\right]  _{\leq n}$ (since $\mathbb{K}\left[
x\right]  _{\leq n}$ is a $\mathbb{K}$-module). Qed.}. Hence, their sum must
belong to $\mathbb{K}\left[  x\right]  _{\leq n}$ as well (since
$\mathbb{K}\left[  x\right]  _{\leq n}$ is a $\mathbb{K}$-module). In other
words, $\mathbf{g}$ belongs to $\mathbb{K}\left[  x\right]  _{\leq n}$ (since
(\ref{pf.thm.pol.id.lag.g=}) shows that the sum of these $n+1$ addends is
$\mathbf{g}$). In other words, $\mathbf{g}\in\mathbb{K}\left[  x\right]
_{\leq n}$.

If $i\in\left\{  1,2,\ldots,n+1\right\}  $ and $j\in\left\{  1,2,\ldots
,n+1\right\}  $ satisfy $j\neq i$, then we have%
\begin{equation}
\prod_{k\neq j}\left(  a_{i}-a_{k}\right)  =0 \label{pf.thm.pol.id.lag.2}%
\end{equation}
(because in this case, the product $\prod_{k\neq j}\left(  a_{i}-a_{k}\right)
$ contains the factor $a_{i}-a_{i}$ (since $i\neq j$), but this factor is $0$,
and therefore the whole product is $0$).

For each $i\in\left\{  1,2,\ldots,n+1\right\}  $, we have%
\begin{align*}
\mathbf{g}\left[  a_{i}\right]   &  =\left(  \sum_{j=1}^{n+1}b_{j}\dfrac
{\prod_{k\neq j}\left(  x-a_{k}\right)  }{\prod_{k\neq j}\left(  a_{j}%
-a_{k}\right)  }\right)  \left[  a_{i}\right]  \ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of }\mathbf{g}\right) \\
&  =\sum_{j=1}^{n+1}b_{j}\dfrac{\prod_{k\neq j}\left(  a_{i}-a_{k}\right)
}{\prod_{k\neq j}\left(  a_{j}-a_{k}\right)  }\\
&  =b_{i}\underbrace{\dfrac{\prod_{k\neq i}\left(  a_{i}-a_{k}\right)  }%
{\prod_{k\neq i}\left(  a_{i}-a_{k}\right)  }}_{=1}+\sum_{\substack{j\in
\left\{  1,2,\ldots,n+1\right\}  ;\\j\neq i}}b_{j}\underbrace{\dfrac
{\prod_{k\neq j}\left(  a_{i}-a_{k}\right)  }{\prod_{k\neq j}\left(
a_{j}-a_{k}\right)  }}_{\substack{=0\\\text{(by (\ref{pf.thm.pol.id.lag.2}))}%
}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}j=i\text{ from the sum}\right) \\
&  =b_{i}+\underbrace{\sum_{\substack{j\in\left\{  1,2,\ldots,n+1\right\}
;\\j\neq i}}b_{j}0}_{=0}=b_{i}.
\end{align*}
Hence, $\mathbf{g}$ is a polynomial $\mathbf{f}\in\mathbb{K}\left[  x\right]
_{\leq n}$ satisfying (\ref{eq.thm.pol.id.lag.a.1}) (since we already know
that $\mathbf{g}\in\mathbb{K}\left[  x\right]  _{\leq n}$).

\textbf{(a)} We need to prove that there is a unique polynomial $\mathbf{f}%
\in\mathbb{K}\left[  x\right]  _{\leq n}$ satisfying
(\ref{eq.thm.pol.id.lag.a.1}). We already know that such an $\mathbf{f}$
exists (because we have just shown that $\mathbf{g}$ is such an $\mathbf{f}$);
thus, it remains to prove its uniqueness. In other words, we need to prove the
following claim:

\begin{statement}
\textit{Claim 1:} Let $\mathbf{f}_{1}$ and $\mathbf{f}_{2}$ be two polynomials
$\mathbf{f}\in\mathbb{K}\left[  x\right]  _{\leq n}$ satisfying
(\ref{eq.thm.pol.id.lag.a.1}). Then, $\mathbf{f}_{1}=\mathbf{f}_{2}$.
\end{statement}

[\textit{Proof of Claim 1:} We have assumed that $\mathbf{f}_{1}$ is a
polynomial $\mathbf{f}\in\mathbb{K}\left[  x\right]  _{\leq n}$ satisfying
(\ref{eq.thm.pol.id.lag.a.1}). In other words, $\mathbf{f}_{1}\in
\mathbb{K}\left[  x\right]  _{\leq n}$ is a polynomial and satisfies%
\begin{equation}
\mathbf{f}_{1}\left[  a_{i}\right]  =b_{i}\ \ \ \ \ \ \ \ \ \ \text{for all
}i\in\left\{  1,2,\ldots,n+1\right\}  . \label{pf.thm.pol.id.lag.c1.pf.1}%
\end{equation}
Similarly, $\mathbf{f}_{2}\in\mathbb{K}\left[  x\right]  _{\leq n}$ is a
polynomial and satisfies%
\begin{equation}
\mathbf{f}_{2}\left[  a_{i}\right]  =b_{i}\ \ \ \ \ \ \ \ \ \ \text{for all
}i\in\left\{  1,2,\ldots,n+1\right\}  . \label{pf.thm.pol.id.lag.c1.pf.2}%
\end{equation}


The polynomials $\mathbf{f}_{1}$ and $\mathbf{f}_{2}$ belong to $\mathbb{K}%
\left[  x\right]  _{\leq n}$; in other words, they have degree $\leq n$.
Moreover, each $i\in\left\{  1,2,\ldots,n+1\right\}  $ satisfies
$\mathbf{f}_{1}\left[  a_{i}\right]  =\mathbf{f}_{2}\left[  a_{i}\right]  $
(as we can see by comparing (\ref{pf.thm.pol.id.lag.c1.pf.1}) with
(\ref{pf.thm.pol.id.lag.c1.pf.2})). Thus, at least $n+1$ many elements
$u\in\mathbb{K}$ satisfy $\mathbf{f}_{1}\left[  u\right]  =\mathbf{f}%
_{2}\left[  u\right]  $ (namely, the $n+1$ elements $a_{1},a_{2}%
,\ldots,a_{n+1}$ satisfy this\footnote{Recall that $a_{1},a_{2},\ldots
,a_{n+1}$ are distinct (by assumption), so they actually do constitute $n+1$
many elements $u\in\mathbb{K}$.}). Hence, Corollary \ref{cor.pol.id.n+1}
(applied to $\mathbf{a}=\mathbf{f}_{1}$ and $\mathbf{b}=\mathbf{f}_{2}$) shows
that $\mathbf{f}_{1}=\mathbf{f}_{2}$. This proves Claim 1.]

Now, our proof of Theorem \ref{thm.pol.id.lag} \textbf{(a)} is complete.

\textbf{(b)} In our above proof of Theorem \ref{thm.pol.id.lag} \textbf{(a)},
we have shown not just that there is a unique polynomial $\mathbf{f}%
\in\mathbb{K}\left[  x\right]  _{\leq n}$ satisfying
(\ref{eq.thm.pol.id.lag.a.1}); we have also shown that $\mathbf{g}$ is such a
polynomial. But since this $\mathbf{f}$ is unique, this means that
$\mathbf{g}$ is the \textbf{only} such polynomial. This proves Theorem
\ref{thm.pol.id.lag} \textbf{(b)}.
\end{proof}

\subsubsection{Application: Curve fitting}

Theorem \ref{thm.pol.id.lag} has multiple applications.

The most obvious one is to treat Theorem \ref{thm.pol.id.lag} as an
interpolation theorem: Roughly speaking, it says that $n+1$ values (at
distinct points) in a field can always be fit by a unique polynomial of degree
$\leq n$. See the Wikipedia pages for
\href{https://en.wikipedia.org/wiki/Lagrange_polynomial}{Lagrange polynomials}
and \href{https://en.wikipedia.org/wiki/Polynomial_interpolation}{polynomial
interpolation}, but beware that this is not the kind of interpolation that is
a good choice for curve-fitting practical datasets (which rarely follow a
polynomial rule). It is best suited for interpolating functions when you can
freely choose the points at which you sample (i.e., the $a_{i}$ in Theorem
\ref{thm.pol.id.lag}); certain choices of $a_{i}$ fare much better than
others. Thus, Lagrange interpolation can also be used in designing numerical
quadrature rules. See \cite{Trefet11} for details.

\subsubsection{Application: Shamir's Secret Sharing Scheme}

Here is another application of Theorem \ref{thm.pol.id.lag}. Shamir's Secret
Sharing Scheme (as presented in Subsection \ref{subsect.intro.shamir.k=3} and
fixed in Remark \ref{rmk.finfield.shamir1}) can now finally be implemented
concretely. Indeed, consider the setting of Section \ref{sect.intro.shamir}
with general $n$ and $k$, and assume that the secret $\mathbf{a}$ that we want
to distribute is a bitstring of length $N$. As in Remark
\ref{rmk.finfield.shamir1}, we pick a prime $p$ such that both $p\geq2^{N}$
and $p>n$, and we encode $\mathbf{a}$ as a residue class $\alpha\in
\mathbb{Z}/p$. Pick $k-1$ uniformly random elements $\beta_{1},\beta
_{2},\ldots,\beta_{k-1}$ of $\mathbb{Z}/p$, and define the polynomial%
\[
\mathbf{f}=\beta_{k-1}x^{k-1}+\beta_{k-2}x^{k-2}+\cdots+\beta_{1}x^{1}%
+\alpha\in\left(  \mathbb{Z}/p\right)  \left[  x\right]  _{\leq k-1}.
\]
Reveal to each person $i\in\left\{  1,2,\ldots,n\right\}  $ the value
$\mathbf{f}\left[  \left[  i\right]  _{p}\right]  $. Then, Theorem
\ref{thm.pol.id.lag} (applied to $k-1$ instead of $n$) shows that any $k$ of
the $n$ people can uniquely reconstruct $\mathbf{f}$ (since they know the
values of $\mathbf{f}$ at $k$ distinct elements of $\mathbb{Z}/p$%
\ \ \ \ \footnote{Here we are using the fact that the elements $\left[
1\right]  _{p},\left[  2\right]  _{p},\ldots,\left[  n\right]  _{p}$ of
$\mathbb{Z}/p$ are distinct (since $p>n$).}), whereas $k-1$ of the $n$ people
cannot gain any knowledge about the secret $\mathbf{a}$ (since they only know
the values of $\mathbf{f}$ at $k-1$ nonzero elements of $\mathbb{Z}%
/p$\ \ \ \ \footnote{Here we are using the fact that the elements $\left[
1\right]  _{p},\left[  2\right]  _{p},\ldots,\left[  n\right]  _{p}$ of
$\mathbb{Z}/p$ are nonzero (since $p>n$).}, and these values could be combined
with any possible value at $\left[  0\right]  _{p}$ to form a valid polynomial
in $\left(  \mathbb{Z}/p\right)  \left[  x\right]  _{\leq k-1}$). Thus, both
Requirements 1 and 2 from Section \ref{sect.intro.shamir} are satisfied. This
is Shamir's Secret Sharing Scheme in its final form.

Instead of $\mathbb{Z}/p$ we could have used any finite field $\mathbb{F}$
whose size is $\geq2^{N}$ and $>n$, but we would need to be careful, since the
elements $\left[  1\right]  _{p},\left[  2\right]  _{p},\ldots,\left[
n\right]  _{p}$ would no longer necessarily be distinct and nonzero. Thus, we
would have to use $n$ distinct nonzero elements of $\mathbb{F}$ instead.

\subsubsection{\label{subsect.pol.id.app-RS}Application: Reed--Solomon codes}

Finally, here is a far more important application of Theorem
\ref{thm.pol.id.lag}.

Assume that you want to send digital data over a noisy channel (e.g., radio).
\textquotedblleft Noisy\textquotedblright\ means that the transmission will
introduce errors, and you expect (e.g.) that every bit you send has a small
probability $p$ of getting corrupted on its way\footnote{\textquotedblleft
Corrupted\textquotedblright\ means that the recepient will receive a $0$
instead of $1$, or a $1$ instead of a $0$. For simplicity, we assume that bits
will not be lost, and the order in which they are received is the order in
which they are sent (so, e.g., messenger pigeons are not the kind of channel
we are considering).}. You want to ensure that the recepient gets the correct
bits that you sent him.\footnote{Another, mostly equivalent, version of this
problem is long-term storage of data on a medium (e.g., a hard drive, a DVD,
paper or a scroll) that gradually decays. Here, the sender is you when you are
storing the data; the recepient is you (or whoever wants to read it) in the
future. That's a noisy channel!} How can you do this?

Of course, you cannot guarantee this with complete surety. But there are
several schemes that you can use to make it rather likely. They are called
\textit{\href{https://en.wikipedia.org/wiki/Error_correction_code}{\textit{error-correcting
codes}}}.

\begin{itemize}
\item For instance, let us assume you have agreed with your recepient that you
will be sending each bit \textbf{twice} in a row. Then, if the recepient gets
two different bits when they expect the same bit sent twice, he can
immediately tell that a bit got corrupted on its way. He cannot tell which bit
you meant to send him -- but at least he knows that he cannot trust the ones
he got.\footnote{If he can talk back to you, this means he can ask you to
resend the correct one.} Of course, there is a probability that he got the
wrong bit twice, in which case he is clueless about it being wrong; but this
probability is $p^{2}$, which is a lot smaller than $p$. This is called
\textit{error detection}.

\item An even better scheme is to send each bit \textbf{thrice} in a row. This
way, your recipient can not only tell if some bit was corrupted (with an even
smaller probability of falsely believing that everything went right -- namely,
$p^{3}$); he can also try to guess which bit is the right one, by the
\textquotedblleft majority rule\textquotedblright\ (i.e., among the $3$ bits
he obtained, he chooses the one that appears more often). This is called
\textit{error correction}.

\item But sending each bit multiple times is not the only thing you can do;
you can also mix several bits together. For example, you can follow every four
bits $a,b,c,d$ that you are sending with the three bits
\[
a+b+d,\ \ \ \ \ \ \ \ \ \ a+c+d,\ \ \ \ \ \ \ \ \ \ b+c+d,
\]
where you are regarding bits as elements of $\mathbb{Z}/2$ (so that, for
example, $1+1+1=1$). Thus, you are sending $7$ bits instead of $4$ bits, but
the transmission has become a lot safer, because:

\begin{itemize}
\item If at most $2$ of the $7$ bits get corrupted along the way, the
recepient will be able to tell that something went wrong. (In the language of
coding theory, this is saying that your code \textit{detects up to }$2$
\textit{errors}.)

\item If at most $1$ of the $7$ bits gets corrupted along the way, the
recepient will be able to guess the bits you intended to send\footnote{without
having to ask you to re-send them}. (In the language of coding theory, this is
saying that your code \textit{corrects up to }$1$ \textit{error}.)
\end{itemize}

This scheme is called the
\href{https://en.wikipedia.org/wiki/Hamming(7,4)}{Hamming$\left(  7,4\right)
$ code}, and was invented by Richard W. Hamming in 1950 as a tool to make
error-prone punch card readers less likely to fail.

\item Here is yet another error-correcting code, which makes use of finite
fields. Fix two integers $d,e\in\mathbb{N}$ such that $d<e$, as well as a
finite field $\mathbb{K}$ and $e$ distinct elements $a_{1},a_{2},\ldots,a_{e}$
of $\mathbb{K}$. (You have to agree on these in advance with your recepient.
Of course, the field must satisfy $\left\vert \mathbb{K}\right\vert \geq e$.)
Now, instead of transmitting bits, you transmit elements of $\mathbb{K}$.
(This does not require a different kind of channel; you can always, under the
hood, re-encode your elements of $\mathbb{K}$ into bitstrings and send those
as bits via the channel that you have.\footnote{Of course, an element of
$\mathbb{K}$ is more likely to get corrupted along the way than a single bit
(if $\left\vert \mathbb{K}\right\vert >2$), because it will be encoded as
several bits (and each of them can get corrupted). But this is par for the
course: After all, an element of $\mathbb{K}$ carries more information than a
bit, too.}) Now, when you want to send $d+1$ elements $u_{0},u_{1}%
,\ldots,u_{d}$ of $\mathbb{K}$ over the channel, you instead form the
polynomial%
\[
\mathbf{f}=u_{0}+u_{1}x+\cdots+u_{d}x^{d}\in\mathbb{K}\left[  x\right]  _{\leq
d},
\]
and transmit the $e$ values $\mathbf{f}\left[  a_{1}\right]  ,\mathbf{f}%
\left[  a_{2}\right]  ,\ldots,\mathbf{f}\left[  a_{e}\right]  $ of this
polynomial. The recepient will then receive $e$ values of the polynomial
$\mathbf{f}$. If all of these values have been transmitted correctly, then he
will be able to pick any $d+1$ of these values\footnote{He can do this, since
$e\geq d+1$.} and use them to reconstruct $\mathbf{f}$ (and therefore, your
messages $u_{0},u_{1},\ldots,u_{d}$) via Theorem \ref{thm.pol.id.lag}. If at
most $e-d-1$ of these $e$ values get corrupted along the way, he will be able
to recognize that something is wrong\footnote{e.g., by attempting to recover
$\mathbf{f}$ using some $d+1$ of the values, and then checking whether the
resulting polynomial also fits the remaining $e-d-1$ values}. Thus, this code
detects up to $e-d-1$ errors. It furthermore corrects up to $\left\lfloor
\dfrac{e-d-1}{2}\right\rfloor $ errors (i.e., there is a way in which the
recepient can guess your original messages, and if no more than $\left\lfloor
\dfrac{e-d-1}{2}\right\rfloor $ of your $e$ values have gotten corrupted, then
his guess will be right).

This is called a
\textit{\href{https://en.wikipedia.org/wiki/Reed-Solomon_error_correction}{\textit{Reed--Solomon
code}}}; such codes were used by the Voyager spacecraft and later in the
storage of data on CDs and DVDs (as said above, storing data on a decaying
medium is transmitting it through a noisy channel).

See \cite[Chapter 29]{Childs00} for more about these codes, and see textbooks
on coding theory (e.g., \cite{Garret07}) for much more.\footnote{Be aware that
there are several different ways of defining Reed--Solomon codes; the one in
\cite{Garret07} is not the same as ours.}
\end{itemize}

\subsection{Generating functions}

\subsubsection{A binomial identity}

Let me show a further application of the \textquotedblleft polynomial identity
trick\textquotedblright, which is interesting in that it uses polynomials in
two different ways.

Among many properties of Pascal's triangle, one rather famous one is that the
sum of all entries in the $n$-th row is $2^{n}$. That is,%
\[
\sum_{k=0}^{n}\dbinom{n}{k}=2^{n}\ \ \ \ \ \ \ \ \ \ \text{for each }%
n\in\mathbb{N}.
\]
This is, in fact, the direct result of applying Theorem \ref{thm.binom.binf}
to $x=1$ and $y=1$. Likewise, we can apply Theorem \ref{thm.binom.binf} to
$x=-1$ and $y=1$, and conclude that%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}=0^{n}=%
\begin{cases}
1, & \text{if }n=0;\\
0, & \text{if }n\neq0
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }n\in\mathbb{N}.
\]
In other words, the alternating sum of all entries in the $n$-th row of
Pascal's triangle is $0$, unless $n=0$ (in which case it is $1$).

One may wonder what happens if we start summing higher powers of the entries
of a row of Pascal's triangle. For example, the sum of their squares has a
nice formula:

\begin{proposition}
\label{prop.binom.sum-squares}Let $n\in\mathbb{N}$. Then,%
\[
\sum_{k=0}^{n}\dbinom{n}{k}^{2}=\dbinom{2n}{n}.
\]

\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.binom.sum-squares}.]We have%
\[
\sum_{k=0}^{n}\underbrace{\dbinom{n}{k}^{2}}_{=\dbinom{n}{k}\dbinom{n}{k}%
}=\sum_{k=0}^{n}\dbinom{n}{k}\underbrace{\dbinom{n}{k}}_{\substack{=\dbinom
{n}{n-k}\\\text{(by Theorem \ref{thm.binom.symmetry})}}}=\sum_{k=0}^{n}%
\dbinom{n}{k}\dbinom{n}{n-k}.
\]
Comparing this with%
\[
\dbinom{2n}{n}=\dbinom{n+n}{n}=\sum_{k=0}^{n}\dbinom{n}{k}\dbinom{n}%
{n-k}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.binom.vandermonde},}\\
\text{applied to }x=n\text{ and }y=n
\end{array}
\right)  ,
\]
we obtain $\sum_{k=0}^{n}\dbinom{n}{k}^{2}=\dbinom{2n}{n}$. This proves
Proposition \ref{prop.binom.sum-squares}.
\end{proof}

Now, what about the alternating sum of the squares of the elements of the
$n$-th row of Pascal's triangle? Here, the formula turns out to be just as
neat, apart from having two cases to distinguish:

\begin{proposition}
\label{prop.binom.altsum-squares}Let $n\in\mathbb{N}$. Then,%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}^{2}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{n}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
.
\]

\end{proposition}

Just as we derived Proposition \ref{prop.binom.sum-squares} from Theorem
\ref{thm.binom.vandermonde}, we are going to derive Proposition
\ref{prop.binom.altsum-squares} from the following fact:

\begin{theorem}
\label{thm.binom.altsum-squares-u}Let $u\in\mathbb{Q}$ and $n\in\mathbb{N}$.
Then,%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{u}{k}\dbinom{u}{n-k}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{u}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
.
\]

\end{theorem}

Theorem \ref{thm.binom.altsum-squares-u} can be proven in an elementary,
computational way (see \cite[Second solution to Exercise 3.22]{detnotes} for
this proof). Let us, however, prove it by applying polynomials strategically
(this argument is \cite[First solution to Exercise 3.22]{detnotes}, and is
folklore). First, we prove the particular case of Theorem
\ref{thm.binom.altsum-squares-u} for $u\in\mathbb{N}$:

\begin{lemma}
\label{lem.binom.altsum-squares-N}Let $u\in\mathbb{N}$ and $n\in\mathbb{N}$.
Then,%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{u}{k}\dbinom{u}{n-k}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{u}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.binom.altsum-squares-N}.]Let $\mathbb{K}$ be the
polynomial ring $\mathbb{Q}\left[  x\right]  $. We have%
\begin{align*}
\left(  1-x\right)  ^{u}\left(  1+x\right)  ^{u}  &  =\left(
\underbrace{\left(  1-x\right)  \left(  1+x\right)  }_{=1-x^{2}=1+\left(
-x^{2}\right)  }\right)  ^{u}=\left(  1+\left(  -x^{2}\right)  \right)
^{u}=\sum_{k\in\mathbb{N}}\dbinom{u}{k}\underbrace{\left(  -x^{2}\right)
^{k}}_{=\left(  -1\right)  ^{k}x^{2k}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma \ref{lem.binom.psgu}, applied to
}a=-x^{2}\right) \\
&  =\sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom{u}{k}x^{2k}.
\end{align*}
Hence,%
\begin{align}
\left[  x^{n}\right]  \left(  \left(  1-x\right)  ^{u}\left(  1+x\right)
^{u}\right)   &  =\left[  x^{n}\right]  \left(  \sum_{k\in\mathbb{N}}\left(
-1\right)  ^{k}\dbinom{u}{k}x^{2k}\right) \nonumber\\
&  =%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{u}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
. \label{pf.lem.binom.altsum-squares-N.1}%
\end{align}


Let us now compute the left hand side in a different way, using
(\ref{eq.pol.fps-mul.1}). Namely,
\begin{align*}
\left(  \underbrace{1-x}_{=1+\left(  -x\right)  }\right)  ^{u}  &  =\left(
1+\left(  -x\right)  \right)  ^{u}=\sum_{k\in\mathbb{N}}\dbinom{u}%
{k}\underbrace{\left(  -x\right)  ^{k}}_{=\left(  -1\right)  ^{k}x^{k}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma \ref{lem.binom.psgu}, applied to
}a=-x\right) \\
&  =\sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom{u}{k}x^{k}.
\end{align*}
Hence, each $i\in\mathbb{N}$ satisfies%
\begin{equation}
\left[  x^{i}\right]  \left(  \left(  1-x\right)  ^{u}\right)  =\left[
x^{i}\right]  \left(  \sum_{k\in\mathbb{N}}\left(  -1\right)  ^{k}\dbinom
{u}{k}x^{k}\right)  =\left(  -1\right)  ^{i}\dbinom{u}{i}.
\label{pf.lem.binom.altsum-squares-N.2}%
\end{equation}
A similar argument (without the \textquotedblleft$-1$\textquotedblright) shows
that each $i\in\mathbb{N}$ satisfies%
\begin{equation}
\left[  x^{i}\right]  \left(  \left(  1+x\right)  ^{u}\right)  =\dbinom{u}{i}.
\label{pf.lem.binom.altsum-squares-N.3}%
\end{equation}


Now, (\ref{eq.pol.fps-mul.1}) (applied to $\mathbf{a}=\left(  1-x\right)
^{u}$ and $\mathbf{b}=\left(  1+x\right)  ^{u}$) yields%
\begin{align*}
\left[  x^{n}\right]  \left(  \left(  1-x\right)  ^{u}\left(  1+x\right)
^{u}\right)   &  =\sum_{i=0}^{n}\underbrace{\left(  \left[  x^{i}\right]
\left(  \left(  1-x\right)  ^{u}\right)  \right)  }_{\substack{=\left(
-1\right)  ^{i}\dbinom{u}{i}\\\text{(by (\ref{pf.lem.binom.altsum-squares-N.2}%
))}}}\cdot\underbrace{\left(  \left[  x^{n-i}\right]  \left(  \left(
1+x\right)  ^{u}\right)  \right)  }_{\substack{=\dbinom{u}{n-i}\\\text{(by
(\ref{pf.lem.binom.altsum-squares-N.3}), applied to }n-i\\\text{instead of
}i\text{)}}}\\
&  =\sum_{i=0}^{n}\left(  -1\right)  ^{i}\dbinom{u}{i}\dbinom{u}{n-i}%
=\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{u}{k}\dbinom{u}{n-k}%
\end{align*}
(here, we have renamed the summation index $i$ as $k$). Comparing this with
(\ref{pf.lem.binom.altsum-squares-N.1}), we obtain%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{u}{k}\dbinom{u}{n-k}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{u}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
.
\]
This proves Lemma \ref{lem.binom.altsum-squares-N}.
\end{proof}

Our proof of Lemma \ref{lem.binom.altsum-squares-N} is an example of the use
of \textquotedblleft generating functions\textquotedblright: We have proven
that two sequences $\left(  a_{0},a_{1},a_{2},\ldots\right)  $ and $\left(
b_{0},b_{1},b_{2},\ldots\right)  $ of numbers were equal\footnote{In our case,
the two sequences are given by $a_{n}=\sum_{k=0}^{n}\left(  -1\right)
^{k}\dbinom{u}{k}\dbinom{u}{n-k}$ and $b_{n}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{u}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
$ for all $n\in\mathbb{N}$.} by showing that the two FPSs $\sum_{k\in
\mathbb{N}}a_{k}x^{k}$ and $\sum_{k\in\mathbb{N}}b_{k}x^{k}$ are equal. (In
our case, these two FPSs were actually the polynomials $\left(  1-x^{2}%
\right)  ^{u}$ and $\left(  1-x\right)  ^{u}\left(  1+x\right)  ^{u}$. But
they don't have to be polynomials in order for the technique of generating
functions to be applicable.) This technique is central to enumerative
combinatorics, and also has many uses in pure algebra. See \cite[Chapters 7
and 8]{Loehr-BC} and \cite{Wilf94} for (a lot) more about this technique.

We still need to prove Theorem \ref{thm.binom.altsum-squares-u}, which
generalizes Lemma \ref{lem.binom.altsum-squares-N} from $u\in\mathbb{N}$ to
$u\in\mathbb{Q}$. Here, polynomials come useful once again (in the same way as
they came useful when we were generalizing Lemma
\ref{lem.binom.vandermonde.NN} to Lemma \ref{lem.binom.vandermonde.QN}):

\begin{proof}
[Proof of Theorem \ref{thm.binom.altsum-squares-u}.]Forget that we fixed $u$.
Define the two polynomials%
\begin{align*}
\mathbf{a}  &  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{x}{k}\dbinom
{x}{n-k}\ \ \ \ \ \ \ \ \ \ \text{and}\\
\mathbf{b}  &  =%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{x}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
\end{align*}
in $1$ variable over the field $\mathbb{Q}$. For each $u\in\mathbb{Q}$, we
have%
\begin{align}
\mathbf{a}\left[  u\right]   &  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}%
\dbinom{u}{k}\dbinom{u}{n-k}\ \ \ \ \ \ \ \ \ \ \text{and}%
\label{pf.thm.binom.altsum-squares-u.1}\\
\mathbf{b}\left[  u\right]   &  =%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{u}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
\label{pf.thm.binom.altsum-squares-u.2}%
\end{align}
(since the evaluation map $\operatorname*{ev}\nolimits_{u}$ is a $\mathbb{Q}%
$-algebra homomorphism and satisfies Corollary \ref{cor.pol.xchoosen}
\textbf{(b)}). Thus, for each $u\in\mathbb{N}$, we have%
\begin{align*}
\mathbf{a}\left[  u\right]   &  =\sum_{k=0}^{n}\left(  -1\right)  ^{k}%
\dbinom{u}{k}\dbinom{u}{n-k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.binom.altsum-squares-u.1})}\right) \\
&  =%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{u}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma \ref{lem.binom.altsum-squares-N}%
}\right) \\
&  =\mathbf{b}\left[  u\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.binom.altsum-squares-u.2})}\right)  .
\end{align*}
Hence, infinitely many elements $u\in\mathbb{Q}$ satisfy $\mathbf{a}\left[
u\right]  =\mathbf{b}\left[  u\right]  $ (since infinitely many elements
$u\in\mathbb{Q}$ satisfy $u\in\mathbb{N}$). Thus, Corollary
\ref{cor.pol.id.trick} (applied to $\mathbb{K}=\mathbb{Q}$) yields
$\mathbf{a}=\mathbf{b}$. Thus, each $u\in\mathbb{Q}$ satisfies%
\begin{align*}
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{u}{k}\dbinom{u}{n-k}  &
=\underbrace{\mathbf{a}}_{=\mathbf{b}}\left[  u\right]
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.binom.altsum-squares-u.1}%
)}\right) \\
&  =\mathbf{b}\left[  u\right]  =%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{u}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.binom.altsum-squares-u.2}%
)}\right)  .
\end{align*}
This proves Theorem \ref{thm.binom.altsum-squares-u}.
\end{proof}

\begin{proof}
[Proof of Proposition \ref{prop.binom.altsum-squares}.]We have%
\begin{align*}
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\underbrace{\dbinom{n}{k}^{2}}%
_{=\dbinom{n}{k}\dbinom{n}{k}}  &  =\sum_{k=0}^{n}\left(  -1\right)
^{k}\dbinom{n}{k}\underbrace{\dbinom{n}{k}}_{\substack{=\dbinom{n}%
{n-k}\\\text{(by Theorem \ref{thm.binom.symmetry})}}}=\sum_{k=0}^{n}\left(
-1\right)  ^{k}\dbinom{n}{k}\dbinom{n}{n-k}\\
&  =%
\begin{cases}
\left(  -1\right)  ^{n/2}\dbinom{n}{n/2}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
\end{align*}
(by Theorem \ref{thm.binom.altsum-squares-u}, or just Lemma
\ref{lem.binom.altsum-squares-N}, applied to $u=n$). This proves Proposition
\ref{prop.binom.altsum-squares}.
\end{proof}

\begin{fineprint}
\begin{remark}
We now know

\begin{itemize}
\item the sum of all entries of the $n$-th row of Pascal's triangle (it is
$2^{n}$);

\item the alternating sum of all entries of the $n$-th row of Pascal's
triangle (it is $0$ if $n\neq0$, and $1$ otherwise);

\item the sum of the squares of all entries of the $n$-th row of Pascal's
triangle (it is $\dbinom{2n}{n}$);

\item the alternating sum of the squares of all entries of the $n$-th row of
Pascal's triangle (see Proposition \ref{prop.binom.altsum-squares}).
\end{itemize}

How does this pattern continue? We may ask for the sum $\sum_{k=0}^{n}%
\dbinom{n}{k}^{3}$ of all cubes of all entries of the $n$-th row of Pascal's
triangle, as well as their alternating sum.

The numbers $\sum_{k=0}^{n}\dbinom{n}{k}^{3}$ are known as the \textit{Franel
numbers} (\href{https://oeis.org/A000172}{OEIS sequence A000172}); no explicit
(sum-less) formula for them is known (unlike for the sums of squares).

As for the alternating sum, however, there is a nice formula:%
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}^{3}=%
\begin{cases}
\left(  -1\right)  ^{n/2}\dfrac{\left(  3n/2\right)  !}{\left(  n/2\right)
!^{3}}, & \text{if }n\text{ is even};\\
0, & \text{if }n\text{ is odd}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}\text{.}%
\]
In the case when $n$ is odd, this formula is easy to check (indeed, in the sum
$\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}^{3}$, the addend for $k=u$
cancels the addend for $k=n-u$). In the case when $n$ is even, it is a
particular case of what is known as
\textit{\href{https://en.wikipedia.org/wiki/Dixon's_identity}{\textit{Dixon's
identity}}} (see, e.g., \cite{Ward91}). The sequence of these alternating sums
is \href{https://oeis.org/A245086}{OEIS sequence A245086}.

Higher powers are even more complicated. For example, as far as fourth powers
are concerned, neither $\sum_{k=0}^{n}\dbinom{n}{k}^{4}$ nor $\sum_{k=0}%
^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}^{4}$ has a known explicit form (see
OEIS sequences \href{https://oeis.org/A005260}{A005260} and
\href{https://oeis.org/A228304}{A228304}).
\end{remark}
\end{fineprint}

\subsubsection{Proving Lucas's congruence}

Recall Lucas's congruence (Theorem \ref{thm.binom.lucas}), which we have left
unproven back when we were studying binomial coefficients. Let us now outline
how it can be proven using polynomials and FPSs. We first shall prove a
particular case:

\begin{lemma}
\label{lem.binom.lucas.21N}Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$. Then, we
have the four congruences%
\begin{align*}
\dbinom{2a}{2b}  &  \equiv\dbinom{a}{b}\operatorname{mod}%
2;\ \ \ \ \ \ \ \ \ \ \dbinom{2a}{2b+1}\equiv0\operatorname{mod}2;\\
\dbinom{2a+1}{2b}  &  \equiv\dbinom{a}{b}\operatorname{mod}%
2;\ \ \ \ \ \ \ \ \ \ \dbinom{2a+1}{2b+1}\equiv\dbinom{a}{b}\operatorname{mod}%
2.
\end{align*}

\end{lemma}

Lemma \ref{lem.binom.lucas.21N} is a very particular case of Theorem
\ref{thm.binom.lucas} -- namely, the one when $p=2$ and $a\in\mathbb{N}$ and
$b\in\mathbb{N}$. (The four congruences correspond to the four different
options for the pair $\left(  c,d\right)  \in\left\{  0,1,\ldots,p-1\right\}
^{2}$.) Nevertheless, it is already the reason for a curious pattern: If you
plot the first $2^{n}$ rows of Pascal's triangle (for some $n\in\mathbb{N}$),
and color all odd entries black and all even entries white, then
\href{https://en.wikipedia.org/wiki/Pascal's_triangle#Overall_patterns_and_properties}{you
obtain an (approximation to) Sierpinski's triangle (the fractal)}. Lemma
\ref{lem.binom.lucas.21N} can be used to prove this (by induction on $n$).

\begin{proof}
[Proof of Lemma \ref{lem.binom.lucas.21N} (sketched).]Work in the polynomial
ring $\left(  \mathbb{Z}/2\right)  \left[  x\right]  $ over $\mathbb{Z}/2$. In
this ring, we have%
\[
\left(  1+x\right)  ^{2}=1+\underbrace{2x}_{\substack{=0\\\text{(since
}2=0\text{ in }\mathbb{Z}/2\text{)}}}+x^{2}=1+x^{2}.
\]
\ Lemma \ref{lem.binom.psgu} (applied to $\left(  \mathbb{Z}/2\right)  \left[
x\right]  $, $a$ and $x^{2}$ instead of $\mathbb{K}$, $u$ and $a$) yields%
\begin{align}
\left(  1+x^{2}\right)  ^{a}  &  =\sum_{k\in\mathbb{N}}\dbinom{a}%
{k}\underbrace{\left(  x^{2}\right)  ^{k}}_{=x^{2k}}%
\label{pf.lem.binom.lucas.21N.bin1}\\
&  =\sum_{k\in\mathbb{N}}\dbinom{a}{k}x^{2k}=\dbinom{a}{0}x^{0}+\dbinom{a}%
{1}x^{2}+\dbinom{a}{2}x^{4}+\dbinom{a}{3}x^{6}+\cdots.\nonumber
\end{align}


Now,%
\begin{align}
\left(  1+x\right)  ^{2a+1}  &  =\underbrace{\left(  1+x\right)  ^{2a}%
}_{=\left(  \left(  1+x\right)  ^{2}\right)  ^{a}}\left(  1+x\right)  =\left(
\underbrace{\left(  1+x\right)  ^{2}}_{=1+x^{2}}\right)  ^{a}\left(
1+x\right) \nonumber\\
&  =\underbrace{\left(  1+x^{2}\right)  ^{a}}_{=\dbinom{a}{0}x^{0}+\dbinom
{a}{1}x^{2}+\dbinom{a}{2}x^{4}+\dbinom{a}{3}x^{6}+\cdots\cdots}\left(
1+x\right) \nonumber\\
&  =\left(  \dbinom{a}{0}x^{0}+\dbinom{a}{1}x^{2}+\dbinom{a}{2}x^{4}%
+\dbinom{a}{3}x^{6}+\cdots\right)  \left(  1+x\right) \nonumber\\
&  =\left(  \dbinom{a}{0}x^{0}+\dbinom{a}{1}x^{2}+\dbinom{a}{2}x^{4}%
+\dbinom{a}{3}x^{6}+\cdots\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ +\left(  \dbinom{a}{0}x^{0}+\dbinom{a}{1}x^{2}%
+\dbinom{a}{2}x^{4}+\dbinom{a}{3}x^{6}+\cdots\right)  x\nonumber\\
&  =\dbinom{a}{0}x^{0}+\dbinom{a}{0}x^{1}+\dbinom{a}{1}x^{2}+\dbinom{a}%
{1}x^{3}+\dbinom{a}{2}x^{4}+\dbinom{a}{2}x^{5}+\cdots\nonumber\\
&  =\sum_{k\in\mathbb{N}}\dbinom{a}{k//2}x^{k}
\label{pf.lem.binom.lucas.21N.0}%
\end{align}
(where we are using Definition \ref{def.ent.quorem}).

Comparing this to%
\begin{align}
\left(  1+x\right)  ^{2a+1}  &  =\sum_{k\in\mathbb{N}}\dbinom{2a+1}{k}%
x^{k}\label{pf.lem.binom.lucas.21N.bin2}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Lemma \ref{lem.binom.psgu}, applied to }\left(  \mathbb{Z}/2\right)
\left[  x\right]  \text{, }2a+1\text{ and }x\\
\text{instead of }\mathbb{K}\text{, }u\text{ and }a
\end{array}
\right)  ,\nonumber
\end{align}
we obtain%
\begin{equation}
\sum_{k\in\mathbb{N}}\dbinom{2a+1}{k}x^{k}=\sum_{k\in\mathbb{N}}\dbinom
{a}{k//2}x^{k}. \label{pf.lem.binom.lucas.21N.1}%
\end{equation}
This is an equality of FPSs (actually, polynomials). But recall that FPSs are
just sequences of elements of $\mathbb{K}$ (where in our case, $\mathbb{K}%
=\mathbb{Z}/2$). Hence, if two FPSs are equal, then the coefficients in
$x^{n}$ in these two FPSs are equal (whenever $n\in\mathbb{N}$). Hence, from
(\ref{pf.lem.binom.lucas.21N.1}), we conclude that
\[
\left[  x^{n}\right]  \left(  \sum_{k\in\mathbb{N}}\dbinom{2a+1}{k}%
x^{k}\right)  =\left[  x^{n}\right]  \left(  \sum_{k\in\mathbb{N}}\dbinom
{a}{k//2}x^{k}\right)
\]
for each $n\in\mathbb{N}$. In view of
\begin{equation}
\left[  x^{n}\right]  \left(  \sum_{k\in\mathbb{N}}\dbinom{2a+1}{k}%
x^{k}\right)  =\dbinom{2a+1}{n} \label{pf.lem.binom.lucas.21N.co1}%
\end{equation}
(by the definition of $\left[  x^{n}\right]  \mathbf{a}$ for an FPS
$\mathbf{a}$) and
\begin{equation}
\left[  x^{n}\right]  \left(  \sum_{k\in\mathbb{N}}\dbinom{a}{k//2}%
x^{k}\right)  =\dbinom{a}{n//2}, \label{pf.lem.binom.lucas.21N.co2}%
\end{equation}
this rewrites as%
\begin{equation}
\dbinom{2a+1}{n}=\dbinom{a}{n//2}. \label{pf.lem.binom.lucas.21N.2}%
\end{equation}


Thus, we have proven (\ref{pf.lem.binom.lucas.21N.2}) for each $n\in
\mathbb{N}$. Applying (\ref{pf.lem.binom.lucas.21N.2}) to $n=2b$, we obtain%
\[
\dbinom{2a+1}{2b}=\dbinom{a}{\left(  2b\right)  //2}=\dbinom{a}{b}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  2b\right)  //2=b\right)  .
\]
This proves the third of the four congruences that are claimed in Lemma
\ref{lem.binom.lucas.21N}... except that something is amiss: Why did we get an
equality rather than a congruence? As an equality between two integers,
$\dbinom{2a+1}{2b}=\dbinom{a}{b}$ is clearly wrong (e.g., if $a=1$ and $b=1$,
then it claims that $3=1$). What did we do wrong?

The culprit is our abuse of notation which lets us use the same symbol for an
integer $w$ and the corresponding element $w\cdot1_{\mathbb{Z}/2}=\left[
w\right]  _{2}$ of $\mathbb{Z}/2$. For example, the coefficients of the FPS
$\sum_{k\in\mathbb{N}}\dbinom{2a+1}{k}x^{k}$ on the left hand side of
(\ref{pf.lem.binom.lucas.21N.co2}) are not the \textbf{integers}
$\dbinom{2a+1}{k}$, but rather the corresponding elements $\dbinom{2a+1}%
{k}\cdot1_{\mathbb{Z}/2}$ of $\mathbb{Z}/2$ (since $\lambda x^{k}=\left(
\lambda\cdot1_{\mathbb{Z}/2}\right)  \cdot x^{k}$ for each $\lambda
\in\mathbb{Z}$). Thus, the \textquotedblleft$\dbinom{2a+1}{n}$%
\textquotedblright\ on the right hand side of
(\ref{pf.lem.binom.lucas.21N.co2}) should be understood not as the
\textbf{integer} $\dbinom{2a+1}{n}$, but rather as the corresponding element
$\dbinom{2a+1}{n}\cdot1_{\mathbb{Z}/2}$ of $\mathbb{Z}/2$. Hence, the equality
(\ref{pf.lem.binom.lucas.21N.2}) that we obtained is not actually an equality
between integers (despite looking like one), but rather an equality between
the corresponding elements of $\mathbb{Z}/2$, namely%
\begin{equation}
\dbinom{2a+1}{n}\cdot1_{\mathbb{Z}/2}=\dbinom{a}{n//2}\cdot1_{\mathbb{Z}/2}.
\label{pf.lem.binom.lucas.21N.2-corr}%
\end{equation}
Such an equality can be translated into a congruence modulo $2$ between the
integers: Indeed, if $u$ and $v$ are two integers satisfying $u\cdot
1_{\mathbb{Z}/2}=v\cdot1_{\mathbb{Z}/2}$, then $\left[  u\right]  _{2}%
=u\cdot1_{\mathbb{Z}/2}=v\cdot1_{\mathbb{Z}/2}=\left[  v\right]  _{2}$ and
thus $u\equiv v\operatorname{mod}2$. Hence,
(\ref{pf.lem.binom.lucas.21N.2-corr}) yields%
\[
\dbinom{2a+1}{n}\equiv\dbinom{a}{n//2}\operatorname{mod}2.
\]
By applying this to $n=2b$, we obtain the third of the four congruences that
are claimed in Lemma \ref{lem.binom.lucas.21N}. Likewise, we can apply it to
$n=2b+1$, and thus obtain the fourth of these four congruences.

In order to prove the first two of these four congruences, we have to consider
$\left(  1+x\right)  ^{2a}$ instead of $\left(  1+x\right)  ^{2a+1}$. Thus,
the computation (\ref{pf.lem.binom.lucas.21N.0}) is replaced by%
\begin{align*}
\left(  1+x\right)  ^{2a}  &  =\left(  \underbrace{\left(  1+x\right)  ^{2}%
}_{=1+x^{2}}\right)  ^{a}=\left(  1+x^{2}\right)  ^{a}\\
&  =\dbinom{a}{0}x^{0}+\dbinom{a}{1}x^{2}+\dbinom{a}{2}x^{4}+\dbinom{a}%
{3}x^{6}+\cdots\\
&  =\dbinom{a}{0}x^{0}+0x^{1}+\dbinom{a}{1}x^{2}+0x^{3}+\dbinom{a}{2}%
x^{4}+0x^{5}+\cdots\\
&  =\sum_{k\in\mathbb{N}}%
\begin{cases}
\dbinom{a}{k//2}, & \text{if }k\text{ is even;}\\
0, & \text{if }k\text{ is odd}%
\end{cases}
x^{k}.
\end{align*}
The rest of the argument is similar to the argument we used above to prove the
third and fourth congruences; we leave this to the reader. Thus, Lemma
\ref{lem.binom.lucas.21N} is proven.
\end{proof}

Now, how can we extend this proof to a full proof of Theorem
\ref{thm.binom.lucas}? As we know, Lemma \ref{lem.binom.lucas.21N} is the
particular case of Theorem \ref{thm.binom.lucas} for $p=2$ and $a\in
\mathbb{N}$ and $b\in\mathbb{N}$. Thus, we need to lift the three restrictions
$p=2$, $a\in\mathbb{N}$ and $b\in\mathbb{N}$. Here is a rough plan:

\begin{itemize}
\item To lift the restriction $b\in\mathbb{N}$, we simply observe that Theorem
\ref{thm.binom.lucas} is trivial in the case when $b\in\mathbb{Z}$ is
negative. Indeed, if $b\in\mathbb{Z}$ is negative, then both $pb+d$ and $b$
are negative (since $d\in\left\{  0,1,\ldots,p-1\right\}  $ yields $d<p$, but
$b<0$ yields $pb\leq-p$), and therefore Theorem \ref{thm.binom.lucas} boils
down to the obvious congruence $0\equiv0\dbinom{c}{d}\operatorname{mod}p$.

\item To lift the restriction $a\in\mathbb{N}$, we have to tweak our above
proof so that it works for negative $a$ as well. Of course, the first step is
to use FPSs instead of polynomials. There are only two places in our proof
where we have used the nonnegativity of $a$ -- namely, the two places where we
applied Lemma \ref{lem.binom.psgu}. The first place was
(\ref{pf.lem.binom.lucas.21N.bin1}); the second was
(\ref{pf.lem.binom.lucas.21N.bin2}). So we have to prove
(\ref{pf.lem.binom.lucas.21N.bin1}) and (\ref{pf.lem.binom.lucas.21N.bin2})
without using the requirement that $a\in\mathbb{N}$. But this is easy using
Newton's binomial theorem. In fact, (\ref{pf.lem.binom.lucas.21N.bin2})
follows directly from Theorem \ref{thm.pol.binom-newton} \textbf{(b)} (applied
to $u=2a+1$), whereas (\ref{pf.lem.binom.lucas.21N.bin1}) follows by first
applying Theorem \ref{thm.pol.binom-newton} \textbf{(b)} to $u=a$ and then
substituting $x^{2}$ for $x$. (As we explained in Remark
\ref{rmk.pol.eval.FPS}, not every element of a $\mathbb{K}$-algebra can be
substituted into an FPS; but $x^{2}$ can always be substituted into an FPS,
and the usual properties of substitution -- such as it being a $\mathbb{K}%
$-algebra homomorphism -- are satisfied.)

\item Finally, how can we lift the restriction that $p$ be a prime? Recall
that we used the identity $\left(  1+x\right)  ^{2}=1+x^{2}$ (in $\left(
\mathbb{Z}/2\right)  \left[  x\right]  $) in our above proof. This has to be
replaced by the identity%
\[
\left(  1+x\right)  ^{p}=1+x^{p}\ \ \ \ \ \ \ \ \ \ \text{in }\left(
\mathbb{Z}/p\right)  \left[  x\right]  .
\]
This identity is a consequence of Theorem \ref{thm.ring.freshdream} (applied
to $\mathbb{K}=\left(  \mathbb{Z}/p\right)  \left[  x\right]  $, $a=1$ and
$b=x$), since $p\cdot1_{\left(  \mathbb{Z}/p\right)  \left[  x\right]  }=0$.
\end{itemize}

\begin{noncompile}
An alternative way of lifting the restriction $a\in\mathbb{N}$ is to reduce
the \textquotedblleft negative $a$\textquotedblright\ case to the
\textquotedblleft nonnegative $a$\textquotedblright\ case using Theorem
\ref{thm.binom.upneg-n}; but this is laborious and painful (some cases need to
be distinguished).
\end{noncompile}

Thus, we obtain the following proof of Theorem \ref{thm.binom.lucas} in full generality:

\begin{proof}
[Proof of Theorem \ref{thm.binom.lucas} (sketched).]If $b<0$, then both $pb+d$
and $b$ are negative\footnote{The proof of this is left to the reader.
(\textbf{Hint:} From $b<0$, we obtain $b\leq-1$ and thus $pb\leq-p$; but from
$d\in\left\{  0,1,\ldots,p-1\right\}  $, we obtain $d\leq p-1<p$.)}, and
therefore both $\dbinom{pa+c}{pb+d}$ and $\dbinom{a}{b}$ equal $0$. Thus, if
$b<0$, then the claim of Theorem \ref{thm.binom.lucas} rewrites as
$0\equiv0\dbinom{c}{d}\operatorname{mod}p$, which is obvious. Hence, for the
rest of this proof, we WLOG assume that we don't have $b<0$. Thus, $b\geq0$,
so that $b\in\mathbb{N}$ and therefore $pb+d\in\mathbb{N}$.

Let us work in the ring $\left(  \mathbb{Z}/p\right)  \left[  \left[
x\right]  \right]  $. In this ring, we have%
\[
p\cdot\underbrace{1_{\left(  \mathbb{Z}/p\right)  \left[  \left[  x\right]
\right]  }}_{=1_{\mathbb{Z}/p}\cdot1_{\left(  \mathbb{Z}/p\right)  \left[
\left[  x\right]  \right]  }}=\underbrace{p\cdot1_{\mathbb{Z}/p}}_{=\left[
p\right]  _{p}=\left[  0\right]  _{p}=0}\cdot1_{\left(  \mathbb{Z}/p\right)
\left[  \left[  x\right]  \right]  }=0\cdot1_{\left(  \mathbb{Z}/p\right)
\left[  \left[  x\right]  \right]  }=0.
\]
Thus, Theorem \ref{thm.ring.freshdream} (applied to $\mathbb{K}=\left(
\mathbb{Z}/p\right)  \left[  \left[  x\right]  \right]  $, $a=1$ and $b=x$)
yields%
\begin{equation}
\left(  1+x\right)  ^{p}=\underbrace{1^{p}}_{=1}+x^{p}=1+x^{p}%
\ \ \ \ \ \ \ \ \ \ \text{in }\left(  \mathbb{Z}/p\right)  \left[  \left[
x\right]  \right]  . \label{pf.thm.binom.lucas.freshman}%
\end{equation}


Theorem \ref{thm.pol.binom-newton} \textbf{(b)} (applied to $\mathbb{K}%
=\mathbb{Z}/p$ and $u=a$) yields%
\[
\left(  1+x\right)  ^{a}=\sum_{k\in\mathbb{N}}\dbinom{a}{k}x^{k}.
\]
We can substitute $x^{p}$ for $x$ in this equality\footnote{Rigorously
speaking, this means that we apply the map
\begin{align*}
\mathbb{K}\left[  \left[  x\right]  \right]   &  \rightarrow\mathbb{K}\left[
\left[  x\right]  \right]  ,\\
\mathbf{a}  &  \mapsto\mathbf{a}\left[  x^{p}\right]
\end{align*}
to both sides of this equality. This map is well-defined because of Remark
\ref{rmk.pol.eval.FPS} (since $p$ is a positive integer), and it is not hard
to see that this map is a $\mathbb{K}$-algebra homomorphism (this is proven
just as Corollary \ref{cor.pol.eval.evu} was proven, except that we are now
working with FPSs instead of polynomials) that furthermore respects not just
finite sums but also infinite sums (of summable families). Thus, applying this
map to $\left(  1+x\right)  ^{a}$ yields $\left(  1+x^{p}\right)  ^{a}$
(because it is a ring homomorphism), and applying it to $\sum_{k\in\mathbb{N}%
}\dbinom{a}{k}x^{k}$ yields $\sum_{k\in\mathbb{N}}\dbinom{a}{k}\left(
x^{p}\right)  ^{k}$ (because it respects infinite sums of summable
families).}, and thus obtain%
\begin{align}
\left(  1+x^{p}\right)  ^{a}  &  =\sum_{k\in\mathbb{N}}\dbinom{a}%
{k}\underbrace{\left(  x^{p}\right)  ^{k}}_{=x^{pk}=x^{kp}}=\sum
_{k\in\mathbb{N}}\dbinom{a}{k}x^{kp}\nonumber\\
&  =\sum_{q\in\mathbb{N}}\dbinom{a}{q}x^{qp} \label{pf.thm.binom.lucas.q-part}%
\end{align}
(here, we have renamed the summation index $k$ as $q$).

On the other hand, $c\in\left\{  0,1,\ldots,p-1\right\}  $ and thus $c\leq
p-1<p$. Hence, for each $k\in\left\{  p,p+1,p+2,\ldots\right\}  $, we have
$k\geq p>c$ and thus%
\begin{equation}
\dbinom{c}{k}=0 \label{pf.thm.binom.lucas.0}%
\end{equation}
(by Theorem \ref{thm.binom.k>n0}, applied to $n=c$). Now, Theorem
\ref{thm.pol.binom-newton} \textbf{(b)} (applied to $\mathbb{K}=\mathbb{Z}/p$
and $u=c$) yields
\begin{align}
\left(  1+x\right)  ^{c}  &  =\sum_{k\in\mathbb{N}}\dbinom{c}{k}x^{k}%
=\sum_{k=0}^{p-1}\dbinom{c}{k}x^{k}+\sum_{k=p}^{\infty}\underbrace{\dbinom
{c}{k}}_{\substack{=0\\\text{(by (\ref{pf.thm.binom.lucas.0}))}}}x^{k}%
=\sum_{k=0}^{p-1}\dbinom{c}{k}x^{k}+\underbrace{\sum_{k=p}^{\infty}0x^{k}%
}_{=0}\nonumber\\
&  =\sum_{k=0}^{p-1}\dbinom{c}{k}x^{k}=\sum_{r=0}^{p-1}\dbinom{c}{r}x^{r}
\label{pf.thm.binom.lucas.r-part}%
\end{align}
(here, we have renamed the summation index $k$ as $r$).

Now,%
\begin{align*}
\left(  1+x\right)  ^{pa+c}  &  =\underbrace{\left(  1+x\right)  ^{pa}%
}_{=\left(  \left(  1+x\right)  ^{p}\right)  ^{a}}\left(  1+x\right)
^{c}=\left(  \underbrace{\left(  1+x\right)  ^{p}}_{\substack{=1+x^{p}%
\\\text{(by (\ref{pf.thm.binom.lucas.freshman}))}}}\right)  ^{a}\left(
1+x\right)  ^{c}=\underbrace{\left(  1+x^{p}\right)  ^{a}}_{\substack{=\sum
_{q\in\mathbb{N}}\dbinom{a}{q}x^{qp}\\\text{(by
(\ref{pf.thm.binom.lucas.q-part}))}}}\ \ \underbrace{\left(  1+x\right)  ^{c}%
}_{\substack{=\sum_{r=0}^{p-1}\dbinom{c}{r}x^{r}\\\text{(by
(\ref{pf.thm.binom.lucas.r-part}))}}}\\
&  =\left(  \sum_{q\in\mathbb{N}}\dbinom{a}{q}x^{qp}\right)  \left(
\sum_{r=0}^{p-1}\dbinom{c}{r}x^{r}\right)  =\sum_{q\in\mathbb{N}}\sum
_{r=0}^{p-1}\dbinom{a}{q}\dbinom{c}{r}x^{qp}x^{r}.
\end{align*}
Comparing this with%
\begin{align*}
&  \sum_{k\in\mathbb{N}}\dbinom{a}{k//p}\dbinom{c}{k\%p}x^{k}\\
&  =\underbrace{\sum_{\left(  q,r\right)  \in\mathbb{N}\times\left\{
0,1,\ldots,p-1\right\}  }}_{=\sum_{q\in\mathbb{N}}\sum_{r\in\left\{
0,1,\ldots,p-1\right\}  }}\dbinom{a}{\left(  qp+r\right)  //p}\dbinom
{c}{\left(  qp+r\right)  \%p}\underbrace{x^{qp+r}}_{=x^{qp}x^{r}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }qp+r\text{ for }k\text{ in the sum, since}\\
\text{the map }\mathbb{N}\times\left\{  0,1,\ldots,p-1\right\}  \rightarrow
\mathbb{N},\ \left(  q,r\right)  \mapsto qp+r\text{ is a}\\
\text{bijection (by Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(b)}, applied
to }n=p\text{)}%
\end{array}
\right) \\
&  =\sum_{q\in\mathbb{N}}\underbrace{\sum_{r\in\left\{  0,1,\ldots
,p-1\right\}  }}_{=\sum_{r=0}^{p-1}}\underbrace{\dbinom{a}{\left(
qp+r\right)  //p}}_{\substack{=\dbinom{a}{q}\\\text{(since Exercise
\ref{exe.ent.quo-rem.bijs} \textbf{(c)}}\\\text{(applied to }n=p\text{)}%
\\\text{yields }\left(  qp+r\right)  //p=q\text{)}}}\ \ \underbrace{\dbinom
{c}{\left(  qp+r\right)  \%p}}_{\substack{=\dbinom{c}{r}\\\text{(since
Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(d)}}\\\text{(applied to
}n=p\text{)}\\\text{yields }\left(  qp+r\right)  \%p=r\text{)}}}x^{qp}x^{r}\\
&  =\sum_{q\in\mathbb{N}}\sum_{r=0}^{p-1}\dbinom{a}{q}\dbinom{c}{r}x^{qp}%
x^{r},
\end{align*}
we obtain%
\begin{equation}
\left(  1+x\right)  ^{pa+c}=\sum_{k\in\mathbb{N}}\dbinom{a}{k//p}\dbinom
{c}{k\%p}x^{k}. \label{pf.thm.binom.lucas.pa+c}%
\end{equation}
But Theorem \ref{thm.pol.binom-newton} \textbf{(b)} (applied to $\mathbb{K}%
=\mathbb{Z}/p$ and $u=pa+c$) yields%
\[
\left(  1+x\right)  ^{pa+c}=\sum_{k\in\mathbb{N}}\dbinom{pa+c}{k}x^{k}.
\]
Comparing this with (\ref{pf.thm.binom.lucas.pa+c}), we find%
\[
\sum_{k\in\mathbb{N}}\dbinom{pa+c}{k}x^{k}=\sum_{k\in\mathbb{N}}\dbinom
{a}{k//p}\dbinom{c}{k\%p}x^{k}.
\]
Thus, for each $n\in\mathbb{N}$, we have%
\begin{align}
\left[  x^{n}\right]  \left(  \sum_{k\in\mathbb{N}}\dbinom{pa+c}{k}%
x^{k}\right)   &  =\left[  x^{n}\right]  \left(  \sum_{k\in\mathbb{N}}%
\dbinom{a}{k//p}\dbinom{c}{k\%p}x^{k}\right) \nonumber\\
&  =\dbinom{a}{n//p}\dbinom{c}{n\%p}\cdot1_{\mathbb{Z}/p}
\label{pf.thm.binom.lucas.uL}%
\end{align}
(by the definition of $\left[  x^{n}\right]  \mathbf{a}$ for an FPS
$\mathbf{a}$). Here, the \textquotedblleft$1_{\mathbb{Z}/p}$\textquotedblright%
\ factor on the right hand side stems from the fact that our FPSs are over
$\mathbb{Z}/p$, so their coefficients are not the integers they seem to be but
rather the corresponding elements of $\mathbb{Z}/p$. On the other hand, for
each $n\in\mathbb{N}$, we have%
\begin{equation}
\left[  x^{n}\right]  \left(  \sum_{k\in\mathbb{N}}\dbinom{pa+c}{k}%
x^{k}\right)  =\dbinom{pa+c}{n}\cdot1_{\mathbb{Z}/p}
\label{pf.thm.binom.lucas.uR}%
\end{equation}
(by the definition of $\left[  x^{n}\right]  \mathbf{a}$ for an FPS
$\mathbf{a}$). Comparing this with (\ref{pf.thm.binom.lucas.uL}), we conclude
that%
\[
\dbinom{a}{n//p}\dbinom{c}{n\%p}\cdot1_{\mathbb{Z}/p}=\dbinom{pa+c}{n}%
\cdot1_{\mathbb{Z}/p}%
\]
for each $n\in\mathbb{N}$. In other words,%
\begin{equation}
\dbinom{a}{n//p}\dbinom{c}{n\%p}\equiv\dbinom{pa+c}{n}\operatorname{mod}p
\label{pf.thm.binom.lucas.cong}%
\end{equation}
for each $n\in\mathbb{N}$ (because if $u$ and $v$ are two integers satisfying
$u\cdot1_{\mathbb{Z}/p}=v\cdot1_{\mathbb{Z}/p}$, then $\left[  u\right]
_{p}=u\cdot1_{\mathbb{Z}/p}=v\cdot1_{\mathbb{Z}/p}=\left[  v\right]  _{p}$ and
thus $u\equiv v\operatorname{mod}p$).

We can apply this to $n=pb+d$. Thus, we obtain%
\[
\dbinom{a}{\left(  pb+d\right)  //p}\dbinom{c}{\left(  pb+d\right)  \%p}%
\equiv\dbinom{pa+c}{pb+d}\operatorname{mod}p.
\]
Hence,%
\begin{align*}
\dbinom{pa+c}{pb+d}  &  \equiv\underbrace{\dbinom{a}{\left(  pb+d\right)
//p}}_{\substack{=\dbinom{a}{\left(  bp+d\right)  //p}=\dbinom{a}%
{b}\\\text{(since Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(c)}%
}\\\text{(applied to }n=p\text{, }q=b\text{ and }r=d\text{)}\\\text{yields
}\left(  bp+d\right)  //p=b\text{)}}}\ \ \underbrace{\dbinom{c}{\left(
pb+d\right)  \%p}}_{\substack{=\dbinom{c}{\left(  bp+d\right)  \%p}=\dbinom
{c}{d}\\\text{(since Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(d)}%
}\\\text{(applied to }n=p\text{, }q=b\text{ and }r=d\text{)}\\\text{yields
}\left(  bp+d\right)  \%p=d\text{)}}}\\
&  =\dbinom{a}{b}\dbinom{c}{d}\operatorname{mod}p.
\end{align*}
This proves Theorem \ref{thm.binom.lucas}.
\end{proof}

\subsection{Invertible and nilpotent polynomials}

In Subsection \ref{subsect.FPS.inv.crit}, we have seen when an FPS
$\mathbf{a}\in\mathbb{K}\left[  \left[  x\right]  \right]  $ is invertible in
the ring $\mathbb{K}\left[  \left[  x\right]  \right]  $. When is a polynomial
$\mathbf{a}\in\mathbb{K}\left[  x\right]  $ invertible in the ring
$\mathbb{K}\left[  x\right]  $ ?

The first hint that the answer is different comes from the example of $1+x$.
As we know, the FPS $1+x$ is invertible in $\mathbb{K}\left[  \left[
x\right]  \right]  $. Since this FPS is actually a polynomial, we might wonder
whether it is invertible in $\mathbb{K}\left[  x\right]  $ as well. The answer
is \textquotedblleft no\textquotedblright, unless the ring $\mathbb{K}$ is
trivial.\footnote{Indeed, if it was invertible in $\mathbb{K}\left[  x\right]
$, then its multiplicative inverse in $\mathbb{K}\left[  x\right]  $ would
also be its multiplicative inverse in $\mathbb{K}\left[  \left[  x\right]
\right]  $; but we already know that the latter is $1-x+x^{2}-x^{3}\pm\cdots$
and therefore does not belong to $\mathbb{K}\left[  x\right]  $ unless
$\mathbb{K}$ is trivial.} More generally, we can easily characterize the
invertible elements of $\mathbb{K}\left[  x\right]  $ when $\mathbb{K}$ is a field:

\begin{proposition}
\label{prop.pol.invertible.field}Let $\mathbb{K}$ be a field. Let
$\mathbf{a}\in\mathbb{K}\left[  x\right]  $ be a polynomial. Then,
$\mathbf{a}$ is invertible in $\mathbb{K}\left[  x\right]  $ if and only if
$\deg\mathbf{a}=0$ (that is, $\mathbf{a}$ is a nonzero constant polynomial).
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.pol.invertible.field} (sketched).]%
$\Longleftarrow:$ Assume that $\deg\mathbf{a}=0$. Then, $\mathbf{a}%
=\underline{a}$ for some $a\in\mathbb{K}$. This $a$ is nonzero (since
otherwise, we would have $\mathbf{a}=\underline{0}$ and thus $\deg
\mathbf{a}=-\infty$, which contradicts $\deg\mathbf{a}=0$), and thus
invertible (since $\mathbb{K}$ is a field). Now, it is easy to see that
$\underline{a^{-1}}$ is a multiplicative inverse of $\mathbf{a}$ in
$\mathbb{K}\left[  x\right]  $. Hence, $\mathbf{a}$ is invertible in
$\mathbb{K}\left[  x\right]  $. This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Proposition
\ref{prop.pol.invertible.field}.

$\Longrightarrow:$ Assume that $\mathbf{a}$ is invertible in $\mathbb{K}%
\left[  x\right]  $. Then, $\mathbf{a}$ has a multiplicative inverse
$\mathbf{a}^{-1}\in\mathbb{K}\left[  x\right]  $. Clearly, $\mathbf{aa}%
^{-1}=1_{\mathbb{K}\left[  x\right]  }=\underline{1}$, so that $\deg\left(
\mathbf{aa}^{-1}\right)  =0$. Also, from $\mathbf{aa}^{-1}=\underline{1}\neq
0$, we conclude that $\mathbf{a}$ and $\mathbf{a}^{-1}$ are nonzero. Thus,
$\deg\mathbf{a}$ and $\deg\left(  \mathbf{a}^{-1}\right)  $ are nonnegative
integers. Theorem \ref{thm.pol.deg-basics} \textbf{(f)} (applied to
$\mathbf{b}=\mathbf{a}^{-1}$) yields $\deg\left(  \mathbf{aa}^{-1}\right)
=\deg\mathbf{a}+\underbrace{\deg\left(  \mathbf{a}^{-1}\right)  }_{\geq0}%
\geq\deg\mathbf{a}$, thus $\deg\mathbf{a}\leq\deg\left(  \mathbf{aa}%
^{-1}\right)  =0$. Hence, $\deg\mathbf{a}=0$ (since $\deg\mathbf{a}$ is a
nonnegative integer). This proves the \textquotedblleft$\Longrightarrow
$\textquotedblright\ direction of Proposition \ref{prop.pol.invertible.field}.
\end{proof}

If the ring $\mathbb{K}$ is not a field, the situation becomes more
interesting: As we have already seen, the polynomial $1+2x$ is invertible when
$\mathbb{K}=\mathbb{Z}/4$, despite its degree not being $0$, so Proposition
\ref{prop.pol.invertible.field} would no longer hold here. Instead, we can
give a necessary and sufficient criterion based on the notion of
\textit{nilpotent elements}. Let us define this notion:

\begin{definition}
Let $\mathbb{L}$ be a ring. Let $a\in\mathbb{L}$. We say that $a$ is
\textit{nilpotent} if there exists an $r\in\mathbb{N}$ satisfying $a^{r}=0$.
\end{definition}

In other words, an element $a$ of a ring $\mathbb{L}$ is nilpotent if one of
its powers is $0$.

For example:

\begin{itemize}
\item The element $0$ of any ring $\mathbb{L}$ is nilpotent, since $0^{r}=0$
holds for $r=1$.

\item If $m\in\mathbb{Z}$ and $k\in\mathbb{N}$, then the element $\left[
m\right]  _{m^{k}}$ of $\mathbb{Z}/m^{k}$ is nilpotent, since its $k$-th power
is $\left[  m^{k}\right]  _{m^{k}}=0$.

\item The nilpotent elements of a matrix ring $\mathbb{K}^{n\times n}$ are
exactly the \href{https://en.wikipedia.org/wiki/Nilpotent_matrix}{nilpotent
$n\times n$-matrices}. It is well-known that any nilpotent $n\times n$-matrix
$A$ over a field $\mathbb{K}$ satisfies $A^{n}=0$; but this is not always true
when $\mathbb{K}$ is not a field.
\end{itemize}

If $\mathbb{K}$ is a field, then the only nilpotent element of $\mathbb{K}$ is
$0$ (this can be easily proven using Exercise \ref{exe.field.xy=0}).

Let us state two basic and simple properties of nilpotent elements:

\begin{proposition}
\label{prop.ring.nilp.a+b}Let $\mathbb{L}$ be a ring. Let $a$ and $b$ be two
nilpotent elements of $\mathbb{L}$ such that $ab=ba$. Then, $a+b$ is also nilpotent.
\end{proposition}

The requirement $ab=ba$ in Proposition \ref{prop.ring.nilp.a+b} cannot be
removed: e.g., the two matrices $\left(
\begin{array}
[c]{cc}%
0 & 1\\
0 & 0
\end{array}
\right)  $ and $\left(
\begin{array}
[c]{cc}%
0 & 0\\
1 & 0
\end{array}
\right)  $ in $\mathbb{Q}^{2\times2}$ are nilpotent, but their sum $\left(
\begin{array}
[c]{cc}%
0 & 1\\
0 & 0
\end{array}
\right)  +\left(
\begin{array}
[c]{cc}%
0 & 0\\
1 & 0
\end{array}
\right)  =\left(
\begin{array}
[c]{cc}%
0 & 1\\
1 & 0
\end{array}
\right)  $ is not.

\begin{proof}
[Proof of Proposition \ref{prop.ring.nilp.a+b}.]We know that $a$ is nilpotent.
In other words, there exists a $p\in\mathbb{N}$ satisfying $a^{p}=0$ (by the
definition of \textquotedblleft nilpotent\textquotedblright). Similarly, there
exists a $q\in\mathbb{N}$ such that $b^{q}=0$ (since $b$ is nilpotent).
Consider these $p$ and $q$.

Now, every $k\in\left\{  0,1,\ldots,p\right\}  $ satisfies%
\begin{equation}
b^{p+q-k}=0. \label{pf.prop.ring.nilp.a+b.1}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.ring.nilp.a+b.1}):} Let $k\in\left\{
0,1,\ldots,p\right\}  $. Then, $k\leq p$, so that $p-k\in\mathbb{N}$. Now,
$p+q-k=q+\left(  p-k\right)  $, so that%
\begin{align*}
b^{p+q-k}  &  =b^{q+\left(  p-k\right)  }=\underbrace{b^{q}}_{=0}%
b^{p-k}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }p-k\in\mathbb{N}\right) \\
&  =0b^{p-k}=0.
\end{align*}
This proves (\ref{pf.prop.ring.nilp.a+b.1}).]

Furthermore, every $k\in\left\{  p+1,p+2,\ldots,p+q\right\}  $ satisfies%
\begin{equation}
a^{k}=0. \label{pf.prop.ring.nilp.a+b.2}%
\end{equation}


[\textit{Proof of (\ref{pf.prop.ring.nilp.a+b.2}):} Let $k\in\left\{
p+1,p+2,\ldots,p+q\right\}  $. Then, $k\geq p+1\geq p$, so that $k-p\in
\mathbb{N}$. Now, $k=p+\left(  k-p\right)  $, so that%
\begin{align*}
a^{k}  &  =a^{p+\left(  k-p\right)  }=\underbrace{a^{p}}_{=0}a^{k-p}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }k-p\in\mathbb{N}\right) \\
&  =0a^{k-p}=0.
\end{align*}
This proves (\ref{pf.prop.ring.nilp.a+b.2}).]

Now, $ab=ba$. Thus, (\ref{eq.prop.rings.pow.rules.c.binom}) (applied to
$\mathbb{K}=\mathbb{L}$ and $n=p+q$) yields%
\begin{align*}
\left(  a+b\right)  ^{p+q}  &  =\sum_{k=0}^{p+q}\dbinom{n}{k}a^{k}%
b^{p+q-k}=\sum_{k=0}^{p}\dbinom{n}{k}a^{k}\underbrace{b^{p+q-k}}%
_{\substack{=0\\\text{(by (\ref{pf.prop.ring.nilp.a+b.1}))}}}+\sum
_{k=p+1}^{p+q}\dbinom{n}{k}\underbrace{a^{k}}_{\substack{=0\\\text{(by
(\ref{pf.prop.ring.nilp.a+b.2}))}}}b^{p+q-k}\\
&  =\underbrace{\sum_{k=0}^{p}\dbinom{n}{k}a^{k}0}_{=0}+\underbrace{\sum
_{k=p+1}^{p+q}\dbinom{n}{k}0b^{p+q-k}}_{=0}=0.
\end{align*}
Thus, there exists an $r\in\mathbb{N}$ satisfying $\left(  a+b\right)  ^{r}=0$
(namely, $r=p+q$). In other words, $a+b$ is nilpotent (by the definition of
\textquotedblleft nilpotent\textquotedblright). This proves Proposition
\ref{prop.ring.nilp.a+b}.
\end{proof}

\begin{proposition}
\label{prop.ring.nilp.u-a}Let $\mathbb{L}$ be a ring. Let $u$ be an invertible
element of $\mathbb{L}$. Let $a$ be a nilpotent element of $\mathbb{L}$ such
that $ua=au$. Then, the element $u-a$ of $\mathbb{L}$ is invertible.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.ring.nilp.u-a} (sketched).]The element $u$ is
invertible. Thus, it has a multiplicative inverse $u^{-1}\in\mathbb{L}$. We
have $uu^{-1}=1_{\mathbb{L}}=u^{-1}u$.

We know that $a$ is nilpotent. In other words, there exists an $r\in
\mathbb{N}$ satisfying $a^{r}=0$ (by the definition of \textquotedblleft
nilpotent\textquotedblright). Consider this $r$.

Applying (\ref{eq.prop.rings.pow.rules.c.3}) to $\mathbb{K}=\mathbb{L}$,
$a=u$, $b=u^{-1}$ and $n=r$, we obtain $\left(  uu^{-1}\right)  ^{r}%
=u^{r}\left(  u^{-1}\right)  ^{r}$ (since $uu^{-1}=u^{-1}u$). Thus,
$u^{r}\left(  u^{-1}\right)  ^{r}=\left(  \underbrace{uu^{-1}}_{=1_{\mathbb{L}%
}}\right)  ^{r}=\left(  1_{\mathbb{L}}\right)  ^{r}=1_{\mathbb{L}}$.

Furthermore, $ua=au$. Hence, Proposition \ref{prop.rings.pow.rules}
\textbf{(d)} (applied to $\mathbb{L}$, $u$, $a$ and $r$ instead of
$\mathbb{K}$, $a$, $b$ and $n$) yields%
\[
u^{r}-a^{r}=\left(  u-a\right)  \left(  u^{r-1}+u^{r-2}a+\cdots+ua^{r-2}%
+a^{r-1}\right)  .
\]
Comparing this with $u^{r}-\underbrace{a^{r}}_{=0}=u^{r}$, we obtain%
\[
\left(  u-a\right)  \left(  u^{r-1}+u^{r-2}a+\cdots+ua^{r-2}+a^{r-1}\right)
=u^{r}.
\]
Multiplying both sides of this equality with $\left(  u^{-1}\right)  ^{r}$, we
obtain%
\[
\left(  u-a\right)  \left(  u^{r-1}+u^{r-2}a+\cdots+ua^{r-2}+a^{r-1}\right)
\left(  u^{-1}\right)  ^{r}=u^{r}\left(  u^{-1}\right)  ^{r}=1_{\mathbb{L}}.
\]
A similar argument (but using products in the opposite order\footnote{and,
accordingly, relying on a variant of Proposition \ref{prop.rings.pow.rules}
\textbf{(d)} that says%
\[
a^{n}-b^{n}=\left(  a^{n-1}+a^{n-2}b+\cdots+ab^{n-2}+b^{n-1}\right)  \left(
a-b\right)
\]
instead of
\[
a^{n}-b^{n}=\left(  a-b\right)  \left(  a^{n-1}+a^{n-2}b+\cdots+ab^{n-2}%
+b^{n-1}\right)
\]
}) shows that%
\[
\left(  u^{-1}\right)  ^{r}\left(  u^{r-1}+u^{r-2}a+\cdots+ua^{r-2}%
+a^{r-1}\right)  \left(  u-a\right)  =1_{\mathbb{L}}.
\]
Hence, Exercise \ref{exe.ring.invertible.indirect} (applied to $\mathbb{L}$,
$\left(  u^{-1}\right)  ^{r}\left(  u^{r-1}+u^{r-2}a+\cdots+ua^{r-2}%
+a^{r-1}\right)  $, $u-a$ and $\left(  u^{r-1}+u^{r-2}a+\cdots+ua^{r-2}%
+a^{r-1}\right)  \left(  u^{-1}\right)  ^{r}$ instead of $\mathbb{K}$, $a$,
$b$ and $c$) shows that the element $u-a$ is invertible and its multiplicative
inverse satisfies%
\begin{align*}
\left(  u-a\right)  ^{-1}  &  =\left(  u^{-1}\right)  ^{r}\left(
u^{r-1}+u^{r-2}a+\cdots+ua^{r-2}+a^{r-1}\right) \\
&  =\left(  u^{r-1}+u^{r-2}a+\cdots+ua^{r-2}+a^{r-1}\right)  \left(
u^{-1}\right)  ^{r}.
\end{align*}
This proves Proposition \ref{prop.ring.nilp.u-a}.
\end{proof}

Now, when is a polynomial $\mathbf{a}\in\mathbb{K}\left[  x\right]  $
invertible in $\mathbb{K}\left[  x\right]  $ ? The answer is given by the
following result:

\begin{theorem}
\label{thm.pol.invertible-as-pol}Let $\mathbf{a}\in\mathbb{K}\left[  x\right]
$ (where $\mathbb{K}$, still, is a commutative ring). Then, $\mathbf{a}$ is
invertible in $\mathbb{K}\left[  x\right]  $ if and only if

\begin{itemize}
\item its coefficient $\left[  x^{0}\right]  \mathbf{a}$ is invertible in
$\mathbb{K}$, \textbf{and}

\item its coefficients $\left[  x^{n}\right]  \mathbf{a}$ are nilpotent for
all positive integers $n$.
\end{itemize}
\end{theorem}

For example, the polynomial $\mathbf{a}=1+2x$ over $\mathbb{K}=\mathbb{Z}/4$
satisfies this condition, since its coefficient $\left[  x^{0}\right]
\mathbf{a}=\left[  1\right]  _{4}$ is invertible in $\mathbb{Z}/4$ whereas its
other coefficients (which are $\left[  2\right]  _{4},\left[  0\right]
_{4},\left[  0\right]  _{4},\left[  0\right]  _{4},\ldots$) are nilpotent.

We will not prove Theorem \ref{thm.pol.invertible-as-pol} here. We only notice
that its \textquotedblleft$\Longleftarrow$\textquotedblright\ direction is
fairly easy (using Proposition \ref{prop.ring.nilp.a+b} and Proposition
\ref{prop.ring.nilp.u-a}), while its \textquotedblleft$\Longrightarrow
$\textquotedblright\ direction is proven in
\url{https://math.stackexchange.com/a/392604/} .

Note the stark contrast between Theorem \ref{thm.pol.invertible-as-pol} and
Theorem \ref{thm.pol.FPS-inv}.

Now that we have introduced nilpotent elements, we might also wonder when a
polynomial is nilpotent. This can also be answered:

\begin{theorem}
\label{thm.pol.nilp}Let $\mathbf{a}\in\mathbb{K}\left[  x\right]  $ (where
$\mathbb{K}$, still, is a commutative ring). Then, $\mathbf{a}$ is nilpotent
if and only if its coefficients $\left[  x^{n}\right]  \mathbf{a}$ are
nilpotent for all $n\in\mathbb{N}$.
\end{theorem}

Again, we omit the proof of this theorem.

Note that Theorem \ref{thm.pol.nilp} has no analogue for FPSs: An FPS can fail
to be nilpotent even if all its coefficients are nilpotent.

Let us briefly note that the non-invertibility of most polynomials over a
field can be amended: We can introduce formal fractions of polynomials over a
field in the same way as formal fractions of integers (also known as
\textquotedblleft rational numbers\textquotedblright) were defined. These
fractions are called \textit{rational functions}\footnote{This is a confusing
name, because polynomials are not functions. It is an artifact of the history
of the subject.}.

\subsection{Functoriality of power series and polynomial rings}

The polynomial ring $\mathbb{K}\left[  x\right]  $, and the ring
$\mathbb{K}\left[  \left[  x\right]  \right]  $ of FPSs, are defined for every
ring $\mathbb{K}$. How do they depend on $\mathbb{K}$ ? For example, does
$\mathbb{Z}\left[  x\right]  $ lie in $\mathbb{Q}\left[  x\right]  $ in the
same way $\mathbb{Z}$ lies in $\mathbb{Q}$ ? The answer is a \textquotedblleft
yes\textquotedblright, for fairly simple reasons:

\begin{proposition}
\label{prop.pol.subring}Let $\mathbb{K}$ be a subring of a commutative ring
$\mathbb{L}$. Then:

\textbf{(a)} The polynomial ring $\mathbb{K}\left[  x\right]  $ is a subring
of $\mathbb{L}\left[  x\right]  $.

\textbf{(b)} The ring $\mathbb{K}\left[  \left[  x\right]  \right]  $ is a
subring of $\mathbb{L}\left[  \left[  x\right]  \right]  $.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.pol.subring} (sketched).]\textbf{(b)} This is
easy: The elements of $\mathbb{K}\left[  \left[  x\right]  \right]  $ are
sequences of elements of $\mathbb{K}$. But any sequence of elements of
$\mathbb{K}$ is a sequence of elements of $\mathbb{L}$ (since $\mathbb{K}%
\subseteq\mathbb{L}$), and thus belongs to $\mathbb{L}\left[  \left[
x\right]  \right]  $. Hence, $\mathbb{K}\left[  \left[  x\right]  \right]
\subseteq\mathbb{L}\left[  \left[  x\right]  \right]  $. The rest of the proof
is straightforward.

\textbf{(a)} LTTR.
\end{proof}

So being a subring is \textquotedblleft inherited\textquotedblright\ to
polynomial rings and rings of FPSs.

Does a homomorphism between two commutative rings also yield a homomorphism
between their polynomial rings or a homomorphism between their FPS rings? The
next theorem shows that the answer is \textquotedblleft yes\textquotedblright%
\ to both questions:

\begin{theorem}
\label{thm.pol.functorial}Let $\mathbb{K}$ and $\mathbb{L}$ be two commutative
rings. Let $f:\mathbb{K}\rightarrow\mathbb{L}$ be a ring homomorphism.

\textbf{(a)} Then, the map%
\begin{align*}
\mathbb{K}\left[  \left[  x\right]  \right]   &  \rightarrow\mathbb{L}\left[
\left[  x\right]  \right]  ,\\
\left(  a_{0},a_{1},a_{2},\ldots\right)   &  \mapsto\left(  f\left(
a_{0}\right)  ,f\left(  a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots\right)
\end{align*}
is a ring homomorphism.

\textbf{(b)} Its restriction to $\mathbb{K}\left[  x\right]  $ is a ring
homomorphism from $\mathbb{K}\left[  x\right]  $ to $\mathbb{L}\left[
x\right]  $.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.pol.functorial}.]\textbf{(a)} Let us denote this
map by $F$. We must then prove that $F$ is a ring homomorphism.

Let us only prove that $F\left(  \mathbf{ab}\right)  =F\left(  \mathbf{a}%
\right)  F\left(  \mathbf{b}\right)  $ for all $\mathbf{a},\mathbf{b}%
\in\mathbb{K}\left[  \left[  x\right]  \right]  $. (This is axiom \textbf{(c)}
in Definition \ref{def.riho.riho}; the other three axioms are proven similarly.)

Let $\mathbf{a},\mathbf{b}\in\mathbb{K}\left[  \left[  x\right]  \right]  $.
Write the FPSs $\mathbf{a}$ and $\mathbf{b}$ as $\mathbf{a}=\left(
a_{0},a_{1},a_{2},\ldots\right)  $ and $\mathbf{b}=\left(  b_{0},b_{1}%
,b_{2},\ldots\right)  $. Then, their images $F\left(  \mathbf{a}\right)  $ and
$F\left(  \mathbf{b}\right)  $ under $F$ are%
\[
F\left(  \mathbf{a}\right)  =\left(  f\left(  a_{0}\right)  ,f\left(
a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots\right)
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ F\left(  \mathbf{b}\right)
=\left(  f\left(  b_{0}\right)  ,f\left(  b_{1}\right)  ,f\left(
b_{2}\right)  ,\ldots\right)
\]
(by the definition of $F$). Hence, the definition of the multiplication on
$\mathbb{L}\left[  \left[  x\right]  \right]  $ yields%
\begin{equation}
F\left(  \mathbf{a}\right)  F\left(  \mathbf{b}\right)  =\left(  d_{0}%
,d_{1},d_{2},\ldots\right)  , \label{pf.thm.pol.functorial.FaFb=}%
\end{equation}
where%
\begin{equation}
d_{n}=\sum_{i=0}^{n}f\left(  a_{i}\right)  f\left(  b_{n-i}\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }n\in\mathbb{N}.
\label{pf.thm.pol.functorial.dn=}%
\end{equation}
Consider these $d_{n}$.

On the other hand, $\mathbf{a}=\left(  a_{0},a_{1},a_{2},\ldots\right)  $ and
$\mathbf{b}=\left(  b_{0},b_{1},b_{2},\ldots\right)  $. Hence, the definition
of the multiplication on $\mathbb{K}\left[  \left[  x\right]  \right]  $
yields%
\begin{equation}
\mathbf{ab}=\left(  c_{0},c_{1},c_{2},\ldots\right)  ,
\label{pf.thm.pol.functorial.ab=}%
\end{equation}
where%
\begin{equation}
c_{n}=\sum_{i=0}^{n}a_{i}b_{n-i}\ \ \ \ \ \ \ \ \ \ \text{for all }%
n\in\mathbb{N}. \label{pf.thm.pol.functorial.cn=}%
\end{equation}
Consider these $c_{n}$. From (\ref{pf.thm.pol.functorial.ab=}), we obtain%
\begin{equation}
F\left(  \mathbf{ab}\right)  =\left(  f\left(  c_{0}\right)  ,f\left(
c_{1}\right)  ,f\left(  c_{2}\right)  ,\ldots\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }F\right)  .
\label{pf.thm.pol.functorial.Fab=}%
\end{equation}


But for each $n\in\mathbb{N}$, we have%
\begin{align*}
f\left(  c_{n}\right)   &  =f\left(  \sum_{i=0}^{n}a_{i}b_{n-i}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.pol.functorial.cn=})}\right)
\\
&  =\sum_{i=0}^{n}\underbrace{f\left(  a_{i}b_{n-i}\right)  }%
_{\substack{=f\left(  a_{i}\right)  f\left(  b_{n-i}\right)  \\\text{(since
}f\text{ is a ring}\\\text{homomorphism)}}}\ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.riho.subtract} \textbf{(e)}}\right) \\
&  =\sum_{i=0}^{n}f\left(  a_{i}\right)  f\left(  b_{n-i}\right)
=d_{n}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.thm.pol.functorial.dn=}%
)}\right)  .
\end{align*}
Hence, $\left(  f\left(  c_{0}\right)  ,f\left(  c_{1}\right)  ,f\left(
c_{2}\right)  ,\ldots\right)  =\left(  d_{0},d_{1},d_{2},\ldots\right)  $.
Thus, the right hand sides of the equalities (\ref{pf.thm.pol.functorial.Fab=}%
) and (\ref{pf.thm.pol.functorial.FaFb=}) are equal. Hence, their left hand
sides are equal as well. In other words, we have $F\left(  \mathbf{ab}\right)
=F\left(  \mathbf{a}\right)  F\left(  \mathbf{b}\right)  $. Thus, the map $F$
satisfies axiom \textbf{(c)} in Definition \ref{def.riho.riho}. As we have
said, the other three axioms are proven similarly; thus, $F$ is a ring
homomorphism. This proves Theorem \ref{thm.pol.functorial} \textbf{(a)}.

\textbf{(b)} LTTR.
\end{proof}

\section{Quotient constructions}

\begin{teachingnote}
\textbf{2019-05-01 lecture}
\end{teachingnote}

\subsection{Residue classes in commutative rings}

\subsubsection{The general case}

We have previously defined

\begin{itemize}
\item what it means for an \textbf{integer} to divide an integer (Definition
\ref{def.ent.div.div});

\item what it means for a \textbf{Gaussian integer} to divide a Gaussian
integer (Definition \ref{def.Z[i].gauss.div});

\item what it means for a \textbf{polynomial} to divide a polynomial
(Definition \ref{def.pol.div}).
\end{itemize}

\noindent These definitions differed only in what kind of \textquotedblleft
numbers\textquotedblright\ we were using. So let us generalize them all together:

\begin{definition}
\label{def.quot.ring-div}Let $\mathbb{L}$ be a commutative ring. Let $a$ and
$b$ be two elements of $\mathbb{L}$. We say that $a\mid b$ \textit{in
}$\mathbb{L}$ (or \textquotedblleft$a$ \textit{divides} $b$ \textit{in}
$\mathbb{L}$\textquotedblright\ or \textquotedblleft$b$ is \textit{divisible
by }$a$ \textit{in} $\mathbb{L}$\textquotedblright\ or \textquotedblleft$b$ is
a \textit{multiple} of $a$ \textit{in} $\mathbb{L}$\textquotedblright) if
there exists a $c\in\mathbb{L}$ such that $b=ac$.

We furthermore say that $a\nmid b$ \textit{in} $\mathbb{L}$ if $a$ does not
divide $b$ \textit{in} $\mathbb{L}$.
\end{definition}

We shall omit the words \textquotedblleft in $\mathbb{L}$\textquotedblright%
\ whenever $\mathbb{L}$ is clear. But keep in mind that $\mathbb{L}$ matters.
For example, $2\nmid1$ in $\mathbb{Z}$, but $2\mid1$ in $\mathbb{Q}$ (since
$1=2\cdot\dfrac{1}{2}$). Of course, when we speak of divisibility between
integers, we mean \textquotedblleft in $\mathbb{Z}$\textquotedblright, since
divisibility in $\mathbb{Q}$ is boring\footnote{More generally: If
$\mathbb{F}$ is any field, then divisibility in $\mathbb{F}$ is boring
(because $a\mid b$ holds for any $a,b\in\mathbb{F}$ unless we have $a=0$ and
$b\neq0$).}.

Most of the standard properties of divisibility still work for any commutative
ring $\mathbb{L}$. For example:

\begin{itemize}
\item we have $a\mid a$ for all $a\in\mathbb{L}$;

\item if $a,b,c\in\mathbb{L}$ satisfy $a\mid b$ and $b\mid c$, then $a\mid c$,
\end{itemize}

\noindent and so on. (But, for example, the obvious generalization of Exercise
\ref{exe.ent.div.acbc} does not work: In general, we cannot conclude $a\mid b$
from $ac\mid bc$ even if $c\neq0$.)

We can furthermore generalize the concept of congruence (Definition
\ref{def.ent.cong} and Definition \ref{def.Z[i].cong}) to arbitrary
commutative rings:

\begin{definition}
\label{def.quot.ring-cong}Let $\mathbb{L}$ be a commutative ring. Let
$w,a,b\in\mathbb{L}$. We say that $a$ \textit{is congruent to }$b$
\textit{modulo }$w$ (\textit{in }$\mathbb{L}$\textit{)} if and only if $w\mid
a-b$. We shall use the notation \textquotedblleft$a\equiv b\operatorname{mod}%
w$\textquotedblright\ for \textquotedblleft$a$ is congruent to $b$ modulo
$w$\textquotedblright.

We furthermore shall use the notation \textquotedblleft$a\not \equiv
b\operatorname{mod}w$\textquotedblright\ for \textquotedblleft$a$ is not
congruent to $b$ modulo $w$\textquotedblright.
\end{definition}

Again, the standard properties of congruence all hold. For example, the
following analogue of Proposition \ref{prop.ent.mod.basics} holds (and is
proven in the same way as Proposition \ref{prop.ent.mod.basics}):

\begin{proposition}
\label{prop.quot.ring-cong.nice}Let $\mathbb{L}$ be a commutative ring. Let
$w\in\mathbb{L}$.

\textbf{(a)} We have $a\equiv a\operatorname{mod}w$ for every $a\in\mathbb{L}$.

\textbf{(b)} If $a,b,c\in\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}w$
and $b\equiv c\operatorname{mod}w$, then $a\equiv c\operatorname{mod}w$.

\textbf{(c)} If $a,b\in\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}w$,
then $b\equiv a\operatorname{mod}w$.

\textbf{(d)} If $a_{1},a_{2},b_{1},b_{2}\in\mathbb{L}$ satisfy $a_{1}\equiv
b_{1}\operatorname{mod}w$ and $a_{2}\equiv b_{2}\operatorname{mod}w$, then%
\begin{align}
a_{1}+a_{2}  &  \equiv b_{1}+b_{2}\operatorname{mod}w;\\
a_{1}-a_{2}  &  \equiv b_{1}-b_{2}\operatorname{mod}w;\\
a_{1}a_{2}  &  \equiv b_{1}b_{2}\operatorname{mod}w.
\end{align}


\textbf{(e)} Let $m\in\mathbb{L}$ be such that $m\mid w$. If $a,b\in
\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}w$, then $a\equiv
b\operatorname{mod}m$.
\end{proposition}

Now, we can define the straightforward generalization of residue classes
(Definition \ref{def.eqrel.Z/n.res-class} and Definition
\ref{def.eqrel.Z/n.Z/n}) and of the standard operations (addition,
multiplication and scaling) on them (Definition \ref{def.eqrel.Z/n.op} and
Definition \ref{def.eqrel.Z/n.scaling}):

\begin{definition}
\label{def.quot.ring/w.defs}Fix a commutative ring $\mathbb{L}$ and an element
$w\in\mathbb{L}$.

\textbf{(a)} Define a relation $\underset{w}{\equiv}$ on the set $\mathbb{L}$
by
\[
\left(  a\underset{w}{\equiv}b\right)  \Longleftrightarrow\left(  a\equiv
b\operatorname{mod}w\right)  .
\]


This $\underset{w}{\equiv}$ is an equivalence relation. (The proof of this is
analogous to the proof of Example \ref{exa.eqrel.eqrel.eqrelmodn}.)

\textbf{(b)} A \textit{residue class modulo}\textbf{ }$w$ means an equivalence
class of the relation $\underset{w}{\equiv}$.

\textbf{(c)} If $a\in\mathbb{L}$, then we denote the residue class $\left[
a\right]  _{\underset{w}{\equiv}}$ by $\left[  a\right]  _{w}$.

\textbf{(d)} The set $\mathbb{L}/\underset{w}{\equiv}$ of all residue classes
modulo $w$ is called $\mathbb{L}/w$.

\textbf{(e)} We define a binary operation $+$ on $\mathbb{L}/w$ (called
\textit{addition}) by setting%
\[
\left[  a\right]  _{w}+\left[  b\right]  _{w}=\left[  a+b\right]
_{w}\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{L}.
\]
This is well-defined, because of Theorem \ref{thm.quot.ring/w.wd} \textbf{(a)} below.

\textbf{(f)} We define a binary operation $\cdot$ on $\mathbb{L}/w$ (called
\textit{multiplication}) by setting%
\[
\left[  a\right]  _{w}\cdot\left[  b\right]  _{w}=\left[  a\cdot b\right]
_{w}\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{L}.
\]
This is well-defined, because of Theorem \ref{thm.quot.ring/w.wd} \textbf{(a)} below.

\textbf{(g)} Fix $r\in\mathbb{L}$. For any $\alpha\in\mathbb{L}/w$, we define
a residue class $r\alpha\in\mathbb{L}/w$ by setting%
\[
\left(  r\left[  a\right]  _{w}=\left[  ra\right]  _{w}%
\ \ \ \ \ \ \ \ \ \ \text{for any }a\in\mathbb{L}\right)  .
\]
(In other words, for any $\alpha\in\mathbb{L}/w$, we let $r\alpha=\left[
ra\right]  _{w}$, where $a$ is an element of $\mathbb{L}$ satisfying
$\alpha=\left[  a\right]  _{w}$.) This is well-defined, because of Theorem
\ref{thm.quot.ring/w.wd} \textbf{(a)} below.

We shall also write $r\cdot\alpha$ instead of $r\alpha$. The map
$\mathbb{L}\times\left(  \mathbb{L}/w\right)  \rightarrow\mathbb{L}%
/w,\ \left(  r,\alpha\right)  \mapsto r\alpha$ will be called \textit{scaling}.
\end{definition}

If we set $\mathbb{L}=\mathbb{Z}$ in Definition \ref{def.quot.ring/w.defs},
and let $w$ be an integer $n$, then we recover our old definitions of residue
classes modulo $n$ and of their set $\mathbb{Z}/n$. Note that we are not
defining a subtraction on $\mathbb{L}/w$ this time, because we will get it for
free once we recognize $\mathbb{L}/w$ as a ring.

\begin{theorem}
\label{thm.quot.ring/w.wd}Fix a commutative ring $\mathbb{L}$ and an element
$w\in\mathbb{L}$.

\textbf{(a)} The operations $+$ and $\cdot$ and the \textquotedblleft scaling
map\textquotedblright\ $\cdot$ in Definition \ref{def.quot.ring/w.defs} are well-defined.

\textbf{(b)} The set $\mathbb{L}/w$, equipped with the addition $+$ (defined
in Definition \ref{def.quot.ring/w.defs} \textbf{(e)}), the multiplication
$\cdot$ (defined in Definition \ref{def.quot.ring/w.defs} \textbf{(f)}) and
the zero $\left[  0\right]  _{w}$ and the unity $\left[  1\right]  _{w}$, is a
commutative ring.

\textbf{(c)} The set $\mathbb{L}/w$, equipped with the addition $+$ (defined
in Definition \ref{def.quot.ring/w.defs} \textbf{(e)}), the scaling $\cdot$
(defined in Definition \ref{def.quot.ring/w.defs} \textbf{(g)}) and the zero
vector $\left[  0\right]  _{w}$, is an $\mathbb{L}$-module.

\textbf{(d)} The set $\mathbb{L}/w$, equipped with all of these items, is a
commutative $\mathbb{L}$-algebra.

\textbf{(e)} The map%
\begin{align*}
\pi_{w}:\mathbb{L}  &  \rightarrow\mathbb{L}/w,\\
a  &  \mapsto\left[  a\right]  _{w}%
\end{align*}
is an $\mathbb{L}$-algebra homomorphism.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.quot.ring/w.wd}.]All of this is analogous to the
proofs we did for integers (but $\mathbb{Z}$ and $n$ have to become
$\mathbb{L}$ and $w$). To be more specific:

\begin{itemize}
\item The proof of Theorem \ref{thm.quot.ring/w.wd} \textbf{(a)} is analogous
to the proof of Proposition \ref{thm.eqrel.Z/n.op.wd} and Proposition
\ref{prop.eqrel.Z/n.scaling.wd} \textbf{(a)}.

\item The proof of Theorem \ref{thm.quot.ring/w.wd} \textbf{(b)} boils down to
checking the ring axioms and the \textquotedblleft commutativity of
multiplication\textquotedblright\ axiom. This is analogous to our proof of
Theorem \ref{thm.eqrel.Z/n.rules}, except that the representatives of our
residue classes are now elements of $\mathbb{L}$ rather than integers.

\item The proof of Theorem \ref{thm.quot.ring/w.wd} \textbf{(c)} boils down to
checking the module axioms. This is analogous to our proof of Theorem
\ref{thm.eqrel.Z/n.rules}.

\item The proof of Theorem \ref{thm.quot.ring/w.wd} \textbf{(d)} boils down to
checking the \textquotedblleft Scale-invariance of
multiplication\textquotedblright\ axiom (since all remaining axioms have
already been checked when we proved parts \textbf{(b)} and \textbf{(c)} of
this theorem). This is analogous to our proof of Theorem
\ref{thm.eqrel.Z/n.rules} \textbf{(m)}.

\item The proof of Theorem \ref{thm.quot.ring/w.wd} \textbf{(e)} follows
straightforwardly from the definition of the operations $+$ and $\cdot$ and
the scaling map on $\mathbb{L}/w$.
\end{itemize}
\end{proof}

\begin{definition}
\label{def.quot.ring/w.L/w}Consider the setting of Theorem
\ref{thm.quot.ring/w.wd}.

The commutative $\mathbb{L}$-algebra $\mathbb{L}/w$ constructed in Theorem
\ref{thm.quot.ring/w.wd} \textbf{(d)} is called \textquotedblleft$\mathbb{L}%
$\textit{ modulo }$w$\textquotedblright\ or \textquotedblleft$\mathbb{L}%
$\textit{ divided by }$w$\textquotedblright\ or \textquotedblleft$\mathbb{L}%
$\textit{ quotiented by }$w$\textquotedblright. Whenever we speak of
\textquotedblleft the $\mathbb{L}$-algebra $\mathbb{L}/w$\textquotedblright,
we shall mean this precise $\mathbb{L}$-algebra.
\end{definition}

The reader can easily check the following:

\begin{itemize}
\item If we have $w=0$ in Theorem \ref{thm.quot.ring/w.wd}, then the map
$\pi_{w}$ is an $\mathbb{L}$-algebra isomorphism, so that $\mathbb{L}%
/0\cong\mathbb{L}$ as rings and as $\mathbb{L}$-modules.

\item If we have $w=1$ in Theorem \ref{thm.quot.ring/w.wd}, then the ring
$\mathbb{L}/w=\mathbb{L}/1$ is trivial. More generally, if $w\in\mathbb{L}$ is
invertible, then the ring $\mathbb{L}/w$ is trivial.
\end{itemize}

\subsubsection{The case of a polynomial ring}

The commutative $\mathbb{L}$-algebra $\mathbb{L}/w$ constructed in Theorem
\ref{thm.quot.ring/w.wd} \textbf{(d)} generalizes not just the $\mathbb{Z}%
$-algebras $\mathbb{Z}/n$, but also the $\mathbb{Z}\left[  i\right]
$-algebras $\mathbb{Z}\left[  i\right]  /\alpha$ (where $\alpha$ is a Gaussian
integer). But we can apply this construction to other rings $\mathbb{L}$ as
well. It will prove particularly useful to apply it to $\mathbb{L}%
=\mathbb{K}\left[  x\right]  $, where $\mathbb{K}$ is a commutative ring. In
particular, this will help us adjoin a root of a polynomial to a commutative
ring $\mathbb{K}$. First, let us introduce some standard conventions:

\begin{convention}
\label{conv.pol.Kx-mod-as-K-mod}Let $\mathbb{K}$ be a commutative ring.

\textbf{(a)} Any $\mathbb{K}\left[  x\right]  $-module automatically becomes a
$\mathbb{K}$-module: In fact, let $M$ be a $\mathbb{K}\left[  x\right]
$-module. Then, $\mathbf{a}m$ is defined for each $\mathbf{a}\in
\mathbb{K}\left[  x\right]  $ and each $m\in M$. But we have identified each
element $a\in\mathbb{K}$ with the corresponding constant polynomial
$\underline{a}\in\mathbb{K}\left[  x\right]  $. Thus, $am$ is also defined for
each $a\in\mathbb{K}$ and each $m\in M$ (because we can treat $a$ as a
constant polynomial); explicitly speaking, it is defined by the equality%
\[
am=\underline{a}m\ \ \ \ \ \ \ \ \ \ \text{for all }a\in\mathbb{K}\text{ and
}m\in M.
\]
Thus, a \textquotedblleft scaling\textquotedblright\ map $\cdot:\mathbb{K}%
\times M\rightarrow M$ is defined. This \textquotedblleft
scaling\textquotedblright\ map (along with the addition and the zero vector
that $M$ is already equipped with) makes $M$ a $\mathbb{K}$-module. Thus,
every $\mathbb{K}\left[  x\right]  $-module $M$ automatically becomes a
$\mathbb{K}$-module.

\textbf{(b)} In this way, any $\mathbb{K}\left[  x\right]  $-algebra becomes a
$\mathbb{K}$-algebra (because we just explained how it becomes a $\mathbb{K}%
$-module, and it is easy to see that this $\mathbb{K}$-module structure
harmonizes with the ring structure in a way that yields a $\mathbb{K}$-algebra\footnotemark).

\textbf{(c)} Any $\mathbb{K}\left[  x\right]  $-module homomorphism is
automatically a $\mathbb{K}$-module homomorphism. (This is easy to check.)

\textbf{(d)} Any $\mathbb{K}\left[  x\right]  $-algebra homomorphism is
automatically a $\mathbb{K}$-algebra homomorphism. (This is easy to check.)
\end{convention}

\footnotetext{i.e., the \textquotedblleft Scale-invariance of
multiplication\textquotedblright\ axiom is satisfied} Thus, in particular, if
$\mathbf{b}\in\mathbb{K}\left[  x\right]  $ is any polynomial, then the
$\mathbb{K}\left[  x\right]  $-algebra $\mathbb{K}\left[  x\right]
/\mathbf{b}$ automatically becomes a $\mathbb{K}$-algebra as well.

\begin{proposition}
\label{prop.quot.ring/w.root-in-L/w}Let $\mathbb{K}$ be a commutative ring.
Let $\mathbf{b}\in\mathbb{K}\left[  x\right]  $ be a polynomial.

\textbf{(a)} The projection map%
\begin{align*}
\pi_{\mathbf{b}}:\mathbb{K}\left[  x\right]   &  \rightarrow\mathbb{K}\left[
x\right]  /\mathbf{b},\\
\mathbf{a}  &  \mapsto\left[  \mathbf{a}\right]  _{\mathbf{b}}%
\end{align*}
is a $\mathbb{K}\left[  x\right]  $-algebra homomorphism and thus a
$\mathbb{K}$-algebra homomorphism.

\textbf{(b)} The map%
\begin{align*}
\mathbb{K}  &  \rightarrow\mathbb{K}\left[  x\right]  /\mathbf{b},\\
a  &  \mapsto\left[  \underline{a}\right]  _{\mathbf{b}}%
\end{align*}
is a $\mathbb{K}$-algebra homomorphism.

\textbf{(c)} We have $\mathbf{a}\left[  \left[  x\right]  _{\mathbf{b}%
}\right]  =\left[  \mathbf{a}\right]  _{\mathbf{b}}$ for any $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  $.

\textbf{(d)} The element $\left[  x\right]  _{\mathbf{b}}\in\mathbb{K}\left[
x\right]  /\mathbf{b}$ is a root of $\mathbf{b}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.quot.ring/w.root-in-L/w}.]\textbf{(a)} This is
a particular case of Theorem \ref{thm.quot.ring/w.wd} \textbf{(e)} (applied to
$\mathbb{L}=\mathbb{K}\left[  x\right]  $ and $w=\mathbf{b}$).

\textbf{(b)} This map is a composition of the projection map $\pi_{\mathbf{b}%
}$ from Proposition \ref{prop.quot.ring/w.root-in-L/w} \textbf{(a)} with the
map $\mathbb{K}\rightarrow\mathbb{K}\left[  x\right]  ,\ a\mapsto
\underline{a}$. Since both of the maps we are composing are $\mathbb{K}%
$-algebra homomorphisms, their composition is therefore a $\mathbb{K}$-algebra
homomorphism as well.

\textbf{(c)} The projection map%
\begin{align*}
\pi_{\mathbf{b}}:\mathbb{K}\left[  x\right]   &  \rightarrow\mathbb{K}\left[
x\right]  /\mathbf{b},\\
\mathbf{a}  &  \mapsto\left[  \mathbf{a}\right]  _{\mathbf{b}}%
\end{align*}
is a $\mathbb{K}$-algebra homomorphism (by Proposition
\ref{prop.quot.ring/w.root-in-L/w} \textbf{(a)}). Now, let $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  $. The definition of $\pi_{\mathbf{b}}$ yields
$\pi_{\mathbf{b}}\left(  x\right)  =\left[  x\right]  _{\mathbf{b}}$ and
$\pi_{\mathbf{b}}\left(  \mathbf{a}\right)  =\left[  \mathbf{a}\right]
_{\mathbf{b}}$. But Proposition \ref{prop.pol.eval-funct} (applied to
$\mathbb{K}\left[  x\right]  $, $\mathbb{K}\left[  x\right]  /\mathbf{b}$,
$\pi_{\mathbf{b}}$ and $x$ instead of $U$, $V$, $f$ and $u$) yields%
\begin{align*}
\pi_{\mathbf{b}}\left(  \mathbf{a}\left[  x\right]  \right)   &
=\mathbf{a}\left[  \underbrace{\pi_{\mathbf{b}}\left(  x\right)  }_{=\left[
x\right]  _{\mathbf{b}}}\right]  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }%
\pi_{\mathbf{b}}\text{ is a }\mathbb{K}\text{-algebra homomorphism}\right) \\
&  =\mathbf{a}\left[  \left[  x\right]  _{\mathbf{b}}\right]  .
\end{align*}
Hence,%
\[
\mathbf{a}\left[  \left[  x\right]  _{\mathbf{b}}\right]  =\pi_{\mathbf{b}%
}\left(  \underbrace{\mathbf{a}\left[  x\right]  }_{=\mathbf{a}}\right)
=\pi_{\mathbf{b}}\left(  \mathbf{a}\right)  =\left[  \mathbf{a}\right]
_{\mathbf{b}}.
\]
This proves Proposition \ref{prop.quot.ring/w.root-in-L/w} \textbf{(c)}.

\textbf{(d)} We must prove that $\mathbf{b}\left[  \left[  x\right]
_{\mathbf{b}}\right]  =0_{\mathbb{K}\left[  x\right]  /\mathbf{b}}$.

Applying Proposition \ref{prop.quot.ring/w.root-in-L/w} \textbf{(c)} to
$\mathbf{a}=\mathbf{b}$, we obtain
\begin{align*}
\mathbf{b}\left[  \left[  x\right]  _{\mathbf{b}}\right]   &  =\left[
\mathbf{b}\right]  _{\mathbf{b}}=\left[  0\right]  _{\mathbf{b}}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\mathbf{b}\equiv0\operatorname{mod}%
\mathbf{b}\right) \\
&  =0_{\mathbb{K}\left[  x\right]  /\mathbf{b}},
\end{align*}
and this shows that $\left[  x\right]  _{\mathbf{b}}$ is a root of
$\mathbf{b}$. This proves Proposition \ref{prop.quot.ring/w.root-in-L/w}
\textbf{(d)}.
\end{proof}

\begin{theorem}
\label{thm.quot.ring/w.basis-of-quot}Let $\mathbb{K}$ be a commutative ring.

Let $m\in\mathbb{N}$. Let $\mathbf{b}\in\mathbb{K}\left[  x\right]  _{\leq m}$
be such that $\left[  x^{m}\right]  \mathbf{b}\in\mathbb{K}$ is invertible. Then:

\textbf{(a)} Each element of $\mathbb{K}\left[  x\right]  /\mathbf{b}$ can be
uniquely written in the form%
\[
\lambda_{0}\left[  x^{0}\right]  _{\mathbf{b}}+\lambda_{1}\left[
x^{1}\right]  _{\mathbf{b}}+\cdots+\lambda_{m-1}\left[  x^{m-1}\right]
_{\mathbf{b}}\ \ \ \ \ \ \ \ \ \ \text{with }\lambda_{0},\lambda_{1}%
,\ldots,\lambda_{m-1}\in\mathbb{K}.
\]


\textbf{(b)} The $m$ vectors $\left[  x^{0}\right]  _{\mathbf{b}},\left[
x^{1}\right]  _{\mathbf{b}},\ldots,\left[  x^{m-1}\right]  _{\mathbf{b}}$ form
a basis of the $\mathbb{K}$-module $\mathbb{K}\left[  x\right]  /\mathbf{b}$.
(See Definition \ref{def.module.lincomb} \textbf{(d)} for what
\textquotedblleft basis\textquotedblright\ means.)

\textbf{(c)} Assume that $m>0$. Then, the $\mathbb{K}$-algebra homomorphism%
\begin{align*}
\mathbb{K}  &  \rightarrow\mathbb{K}\left[  x\right]  /\mathbf{b},\\
a  &  \mapsto\left[  \underline{a}\right]  _{\mathbf{b}}%
\end{align*}
is injective. Thus, $\mathbb{K}$ can be viewed as a $\mathbb{K}$-subalgebra of
$\mathbb{K}\left[  x\right]  /\mathbf{b}$ if we identify each $a\in\mathbb{K}$
with the $\left[  \underline{a}\right]  _{\mathbf{b}}\in\mathbb{K}\left[
x\right]  /\mathbf{b}$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.quot.ring/w.basis-of-quot}.]\textbf{(a)} Let
$\alpha\in\mathbb{K}\left[  x\right]  /\mathbf{b}$. Then, $\alpha=\left[
\mathbf{a}\right]  _{\mathbf{b}}$ for \textbf{some} polynomial $\mathbf{a}%
\in\mathbb{K}\left[  x\right]  $. Consider this $\mathbf{a}$. Theorem
\ref{thm.pol.quorem} \textbf{(a)} yields that there is a unique pair $\left(
\mathbf{q},\mathbf{r}\right)  $ of polynomials with $\mathbf{a}=\mathbf{qb}%
+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$.
Consider this pair $\left(  \mathbf{q},\mathbf{r}\right)  $. Then,
$\mathbf{a}=\underbrace{\mathbf{qb}}_{\equiv0\operatorname{mod}\mathbf{b}%
}+\mathbf{r}\equiv\mathbf{r}\operatorname{mod}\mathbf{b}$, so that $\left[
\mathbf{a}\right]  _{\mathbf{b}}=\left[  \mathbf{r}\right]  _{\mathbf{b}}$.

Write $\mathbf{r}$ in the form $\mathbf{r}=r_{0}x^{0}+r_{1}x^{1}%
+\cdots+r_{m-1}x^{m-1}$ with $r_{0},r_{1},\ldots,r_{m-1}\in\mathbb{K}$ (this
can be done, since $\mathbf{r}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$).
Then,%
\begin{align*}
\alpha &  =\left[  \mathbf{a}\right]  _{\mathbf{b}}=\left[  \mathbf{r}\right]
_{\mathbf{b}}=\left[  r_{0}x^{0}+r_{1}x^{1}+\cdots+r_{m-1}x^{m-1}\right]
_{\mathbf{b}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\mathbf{r}=r_{0}x^{0}+r_{1}%
x^{1}+\cdots+r_{m-1}x^{m-1}\right) \\
&  =r_{0}\left[  x^{0}\right]  _{\mathbf{b}}+r_{1}\left[  x^{1}\right]
_{\mathbf{b}}+\cdots+r_{m-1}\left[  x^{m-1}\right]  _{\mathbf{b}}.
\end{align*}
So we have found a way to write $\alpha$ in the form
\[
\lambda_{0}\left[  x^{0}\right]  _{\mathbf{b}}+\lambda_{1}\left[
x^{1}\right]  _{\mathbf{b}}+\cdots+\lambda_{m-1}\left[  x^{m-1}\right]
_{\mathbf{b}}\ \ \ \ \ \ \ \ \ \ \text{with }\lambda_{0},\lambda_{1}%
,\ldots,\lambda_{m-1}\in\mathbb{K}%
\]
(namely, with $\left(  \lambda_{0},\lambda_{1},\ldots,\lambda_{m-1}\right)
=\left(  r_{0},r_{1},\ldots,r_{m-1}\right)  $).

It remains to prove that this way is unique. This can easily be done using the
uniqueness part of Theorem \ref{thm.pol.quorem} \textbf{(a)}.\footnote{Here is
the argument in detail:
\par
Let $\left(  \mu_{0},\mu_{1},\ldots,\mu_{m-1}\right)  $ and $\left(  \rho
_{0},\rho_{1},\ldots,\rho_{m-1}\right)  $ be two $m$-tuples $\left(
\lambda_{0},\lambda_{1},\ldots,\lambda_{m-1}\right)  \in\mathbb{K}^{m}$
satisfying $\alpha=\lambda_{0}\left[  x^{0}\right]  _{\mathbf{b}}+\lambda
_{1}\left[  x^{1}\right]  _{\mathbf{b}}+\cdots+\lambda_{m-1}\left[
x^{m-1}\right]  _{\mathbf{b}}$. We shall show that $\left(  \mu_{0},\mu
_{1},\ldots,\mu_{m-1}\right)  =\left(  \rho_{0},\rho_{1},\ldots,\rho
_{m-1}\right)  $.
\par
Define a polynomial $\mathbf{m}\in\mathbb{K}\left[  x\right]  $ by
$\mathbf{m}=\mu_{0}x^{0}+\mu_{1}x^{1}+\cdots+\mu_{m-1}x^{m-1}$. Then,
$\mathbf{m}\in\mathbb{K}\left[  x\right]  _{\leq m-1}$ and%
\begin{equation}
\left[  x^{i}\right]  \mathbf{m}=\mu_{i}\ \ \ \ \ \ \ \ \ \ \text{for each
}i\in\left\{  0,1,\ldots,m-1\right\}  .
\label{pf.thm.quot.ring/w.basis-of-quot.fn1.coeffm}%
\end{equation}
\par
We know that $\left(  \mu_{0},\mu_{1},\ldots,\mu_{m-1}\right)  $ is an
$m$-tuple $\left(  \lambda_{0},\lambda_{1},\ldots,\lambda_{m-1}\right)
\in\mathbb{K}^{m}$ satisfying $\alpha=\lambda_{0}\left[  x^{0}\right]
_{\mathbf{b}}+\lambda_{1}\left[  x^{1}\right]  _{\mathbf{b}}+\cdots
+\lambda_{m-1}\left[  x^{m-1}\right]  _{\mathbf{b}}$. In other words, $\left(
\mu_{0},\mu_{1},\ldots,\mu_{m-1}\right)  $ is an $m$-tuple in $\mathbb{K}^{m}$
and satisfies $\alpha=\mu_{0}\left[  x^{0}\right]  _{\mathbf{b}}+\mu
_{1}\left[  x^{1}\right]  _{\mathbf{b}}+\cdots+\mu_{m-1}\left[  x^{m-1}%
\right]  _{\mathbf{b}}$. Thus, from $\alpha=\left[  \mathbf{a}\right]
_{\mathbf{b}}$, we obtain%
\[
\left[  \mathbf{a}\right]  _{\mathbf{b}}=\alpha=\mu_{0}\left[  x^{0}\right]
_{\mathbf{b}}+\mu_{1}\left[  x^{1}\right]  _{\mathbf{b}}+\cdots+\mu
_{m-1}\left[  x^{m-1}\right]  _{\mathbf{b}}=\left[  \mu_{0}x^{0}+\mu_{1}%
x^{1}+\cdots+\mu_{m-1}x^{m-1}\right]  _{\mathbf{b}}=\left[  \mathbf{m}\right]
_{\mathbf{b}}%
\]
(since $\mu_{0}x^{0}+\mu_{1}x^{1}+\cdots+\mu_{m-1}x^{m-1}=\mathbf{m}$). In
other words, $\mathbf{a}\equiv\mathbf{m}\operatorname{mod}\mathbf{b}$. In
other words, $\mathbf{b}\mid\mathbf{a}-\mathbf{m}.$In other words, there
exists a polynomial $\mathbf{c}\in\mathbb{K}\left[  x\right]  $ such that
$\mathbf{a}-\mathbf{m}=\mathbf{bc}$. Consider this $\mathbf{c}$. From
$\mathbf{a}-\mathbf{m}=\mathbf{bc}$, we obtain $\mathbf{a}=\mathbf{m}%
+\mathbf{bc}=\mathbf{cb}+\mathbf{m}$.
\par
Now, recall that $\left(  \mathbf{q},\mathbf{r}\right)  $ was defined as the
\textbf{unique} pair $\left(  \mathbf{q},\mathbf{r}\right)  $ of polynomials
with $\mathbf{a}=\mathbf{qb}+\mathbf{r}$ and $\mathbf{r}\in\mathbb{K}\left[
x\right]  _{\leq m-1}$. Thus, in particular, it is the only such pair. In
other words, if $\left(  \widetilde{\mathbf{q}},\widetilde{\mathbf{r}}\right)
$ is a pair of polynomials with $\mathbf{a}=\widetilde{\mathbf{q}}%
\mathbf{b}+\widetilde{\mathbf{r}}$ and $\widetilde{\mathbf{r}}\in
\mathbb{K}\left[  x\right]  _{\leq m-1}$, then $\left(  \widetilde{\mathbf{q}%
},\widetilde{\mathbf{r}}\right)  =\left(  \mathbf{q},\mathbf{r}\right)  $. We
can apply this fact to $\left(  \widetilde{\mathbf{q}},\widetilde{\mathbf{r}%
}\right)  =\left(  \mathbf{c},\mathbf{m}\right)  $ (since $\mathbf{a}%
=\mathbf{cb}+\mathbf{m}$ and $\mathbf{m}\in\mathbb{K}\left[  x\right]  _{\leq
m-1}$), and thus obtain $\left(  \mathbf{c},\mathbf{m}\right)  =\left(
\mathbf{q},\mathbf{r}\right)  $. In other words, $\mathbf{c}=\mathbf{q}$ and
$\mathbf{m}=\mathbf{r}$. Now, for each $i\in\left\{  0,1,\ldots,m-1\right\}
$, we have%
\begin{align}
\mu_{i}  &  =\left[  x^{i}\right]  \underbrace{\mathbf{m}}_{=\mathbf{r}%
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.thm.quot.ring/w.basis-of-quot.fn1.coeffm})}\right) \nonumber\\
&  =\left[  x^{i}\right]  \mathbf{r}.
\label{pf.thm.quot.ring/w.basis-of-quot.fn1.mui=}%
\end{align}
The same argument (applied to $\left(  \rho_{0},\rho_{1},\ldots,\rho
_{m-1}\right)  $ instead of $\left(  \mu_{0},\mu_{1},\ldots,\mu_{m-1}\right)
$) shows that for each $i\in\left\{  0,1,\ldots,m-1\right\}  $, we have%
\[
\rho_{i}=\left[  x^{i}\right]  \mathbf{r}.
\]
Comparing this with (\ref{pf.thm.quot.ring/w.basis-of-quot.fn1.mui=}), we
conclude that for each $i\in\left\{  0,1,\ldots,m-1\right\}  $, we have
$\mu_{i}=\rho_{i}$. In other words, $\left(  \mu_{0},\mu_{1},\ldots,\mu
_{m-1}\right)  =\left(  \rho_{0},\rho_{1},\ldots,\rho_{m-1}\right)  $.
\par
Now, forget that we fixed $\left(  \mu_{0},\mu_{1},\ldots,\mu_{m-1}\right)  $
and $\left(  \rho_{0},\rho_{1},\ldots,\rho_{m-1}\right)  $. We thus have shown
that if $\left(  \mu_{0},\mu_{1},\ldots,\mu_{m-1}\right)  $ and $\left(
\rho_{0},\rho_{1},\ldots,\rho_{m-1}\right)  $ are two $m$-tuples $\left(
\lambda_{0},\lambda_{1},\ldots,\lambda_{m-1}\right)  \in\mathbb{K}^{m}$
satisfying $\alpha=\lambda_{0}\left[  x^{0}\right]  _{\mathbf{b}}+\lambda
_{1}\left[  x^{1}\right]  _{\mathbf{b}}+\cdots+\lambda_{m-1}\left[
x^{m-1}\right]  _{\mathbf{b}}$, then $\left(  \mu_{0},\mu_{1},\ldots,\mu
_{m-1}\right)  =\left(  \rho_{0},\rho_{1},\ldots,\rho_{m-1}\right)  $. In
other words, any two $m$-tuples $\left(  \lambda_{0},\lambda_{1}%
,\ldots,\lambda_{m-1}\right)  \in\mathbb{K}^{m}$ satisfying $\alpha
=\lambda_{0}\left[  x^{0}\right]  _{\mathbf{b}}+\lambda_{1}\left[
x^{1}\right]  _{\mathbf{b}}+\cdots+\lambda_{m-1}\left[  x^{m-1}\right]
_{\mathbf{b}}$ must be identical. In other words, there exists at most one
such $m$-tuple. In other words, there is at most one way to write $\alpha$ in
the form
\[
\lambda_{0}\left[  x^{0}\right]  _{\mathbf{b}}+\lambda_{1}\left[
x^{1}\right]  _{\mathbf{b}}+\cdots+\lambda_{m-1}\left[  x^{m-1}\right]
_{\mathbf{b}}\ \ \ \ \ \ \ \ \ \ \text{with }\lambda_{0},\lambda_{1}%
,\ldots,\lambda_{m-1}\in\mathbb{K}.
\]
Since we already know that such a way exists, we thus conclude that such a way
is unique.} Thus, Theorem \ref{thm.quot.ring/w.basis-of-quot} \textbf{(a)} is proven.

\textbf{(b)} Proposition \ref{prop.module.basis-unique} shows that Theorem
\ref{thm.quot.ring/w.basis-of-quot} \textbf{(b)} is a restatement of Theorem
\ref{thm.quot.ring/w.basis-of-quot} \textbf{(a)}. Thus, Theorem
\ref{thm.quot.ring/w.basis-of-quot} \textbf{(b)} holds.

\textbf{(c)} We already know (from Proposition
\ref{prop.quot.ring/w.root-in-L/w} \textbf{(b)}) that the map%
\begin{align*}
\mathbb{K}  &  \rightarrow\mathbb{K}\left[  x\right]  /\mathbf{b},\\
a  &  \mapsto\left[  \underline{a}\right]  _{\mathbf{b}}%
\end{align*}
is a $\mathbb{K}$-algebra homomorphism. We just need to show that it is
injective. In other words, we need to show that if $a,b\in\mathbb{K}$ satisfy
$\left[  \underline{a}\right]  _{\mathbf{b}}=\left[  \underline{b}\right]
_{\mathbf{b}}$, then $a=b$.

So let $a,b\in\mathbb{K}$ satisfy $\left[  \underline{a}\right]  _{\mathbf{b}%
}=\left[  \underline{b}\right]  _{\mathbf{b}}$. Note that%
\begin{align*}
\left[  \underline{a}\right]  _{\mathbf{b}}  &  =\left[  ax^{0}\right]
_{\mathbf{b}}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\underline{a}%
=a\cdot\underbrace{\underline{1}}_{=x^{0}}=ax^{0}\right) \\
&  =a\left[  x^{0}\right]  _{\mathbf{b}},
\end{align*}
and similarly $\left[  \underline{b}\right]  _{\mathbf{b}}=b\left[
x^{0}\right]  _{\mathbf{b}}$. Hence, the equality $\left[  \underline{a}%
\right]  _{\mathbf{b}}=\left[  \underline{b}\right]  _{\mathbf{b}}$ rewrites
as%
\[
a\left[  x^{0}\right]  _{\mathbf{b}}=b\left[  x^{0}\right]  _{\mathbf{b}}.
\]
Thus, define an element $\alpha\in\mathbb{K}\left[  x\right]  /\mathbf{b}$ by
$\alpha=a\left[  x^{0}\right]  _{\mathbf{b}}=b\left[  x^{0}\right]
_{\mathbf{b}}$. Then, we have found two ways of representing the element
$\alpha\in\mathbb{K}\left[  x\right]  /\mathbf{b}$ in the form%
\[
\lambda_{0}\left[  x^{0}\right]  _{\mathbf{b}}+\lambda_{1}\left[
x^{1}\right]  _{\mathbf{b}}+\cdots+\lambda_{m-1}\left[  x^{m-1}\right]
_{\mathbf{b}}\ \ \ \ \ \ \ \ \ \ \text{with }\lambda_{0},\lambda_{1}%
,\ldots,\lambda_{m-1}\in\mathbb{K}\text{:}%
\]
one way uses $\lambda_{0}=a$ and $\lambda_{i}=0$ for all $i>0$; the other way
uses $\lambda_{0}=b$ and $\lambda_{i}=0$ for all $i>0$. But the
\textquotedblleft uniqueness\textquotedblright\ statement in Theorem
\ref{thm.quot.ring/w.basis-of-quot} \textbf{(a)} yields that there is only one
way to represent an element in this form. Hence, these two ways must be equal.
Therefore, $a=b$.
\end{proof}

Note that Theorem \ref{thm.quot.ring/w.basis-of-quot} \textbf{(c)} really
requires $m$ to be $>0$ (otherwise, $\mathbb{K}\left[  x\right]  /\mathbf{b}$
is a trivial ring) and $\left[  x^{m}\right]  \mathbf{b}$ to be invertible (we
will see an example below where $\left[  x^{m}\right]  \mathbf{b}$ is not
invertible, and $\mathbb{K}$ does not inject into $\mathbb{K}\left[  x\right]
/\mathbf{b}$).

We now understand the quotient rings $\mathbb{K}\left[  x\right]  /\mathbf{b}$
well enough at least in the case when the leading coefficient of $\mathbf{b}$
is invertible. Let us use this to see some examples:

\begin{example}
\label{exa.quot.ring.C=Rx/}We have $\mathbb{C}\cong\mathbb{R}\left[  x\right]
/\left(  x^{2}+1\right)  $ (as rings).

Indeed, the map%
\begin{align*}
\mathbb{C}  &  \rightarrow\mathbb{R}\left[  x\right]  /\left(  x^{2}+1\right)
,\\
\left(  a,b\right)  =a+bi  &  \mapsto\left[  a+bx\right]  _{x^{2}+1}%
\end{align*}
is a ring homomorphism, and is invertible, with inverse%
\begin{align*}
\mathbb{R}\left[  x\right]  /\left(  x^{2}+1\right)   &  \rightarrow
\mathbb{C},\\
\left[  \mathbf{a}\right]  _{x^{2}+1}  &  \mapsto\mathbf{a}\left[  i\right]  .
\end{align*}
To see that the latter inverse is well-defined, you have to check that if
$\mathbf{a}$ and $\mathbf{b}$ are two polynomials in $\mathbb{R}\left[
x\right]  $ satisfying $\mathbf{a}\equiv\mathbf{b}\operatorname{mod}x^{2}+1$,
then $\mathbf{a}\left[  i\right]  =\mathbf{b}\left[  i\right]  $. (LTTR.)
\end{example}

\begin{example}
We have $\mathbb{Z}\left[  i\right]  \cong\mathbb{Z}\left[  x\right]  /\left(
x^{2}+1\right)  $ (as rings).
\end{example}

\begin{example}
Recall the dual numbers $\mathbb{D}$ from
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw4s.pdf}{homework set \#4}
exercise 3. Each dual number has the form $\left(  a,b\right)  =a+b\varepsilon
$ for a unique pair $\left(  a,b\right)  $ of real numbers, and the
multiplication of $\mathbb{D}$ satisfies $\varepsilon^{2}=0$.

We have $\mathbb{D}\cong\mathbb{R}\left[  x\right]  /x^{2}$ (as rings). More
precisely, the map%
\begin{align*}
\mathbb{D}  &  \rightarrow\mathbb{R}\left[  x\right]  /x^{2},\\
\left(  a,b\right)  =a+b\varepsilon &  \mapsto\left[  a+bx\right]  _{x^{2}}%
\end{align*}
is a ring isomorphism.

Moreover, we also have $\mathbb{D}\cong\mathbb{R}\left[  \left[  x\right]
\right]  /x^{2}$ as rings.

Note, however, that this is unusual: Normally, if $\mathbf{a}\in
\mathbb{K}\left[  x\right]  $ is a polynomial, then $\mathbb{K}\left[  \left[
x\right]  \right]  /\mathbf{a}$ is not isomorphic to $\mathbb{K}\left[
x\right]  /\mathbf{a}$. For example, the ring $\mathbb{R}\left[  x\right]
/\left(  x^{2}+1\right)  $ is isomorphic to $\mathbb{C}$ (as we have seen
above), whereas the ring $\mathbb{R}\left[  \left[  x\right]  \right]
/\left(  x^{2}+1\right)  $ is trivial (since the FPS $x^{2}+1$ is invertible,
and thus any two FPSs are congruent to each other modulo $x^{2}+1$).
\end{example}

\begin{example}
In Section \ref{sect.ring.hunting1}, we constructed a field with $4$ elements
by adjoining a $j$ satisfying $j^{2}=j+1$ to $\mathbb{Z}/2$. This field is
isomorphic to
\[
\left(  \mathbb{Z}/2\right)  \left[  x\right]  /\left(  x^{2}-x-1\right)  .
\]

\end{example}

\begin{example}
Let $m\in\mathbb{Z}$ be nonzero. On
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/mt2s.pdf}{midterm \#2}
exercise 1, we defined $R_{m}$ to be the set of all $m$-integers (= rational
numbers that can be turned into integers by multiplying with $m$ often
enough). We proved that $R_{m}$ is a ring. Each element of $R_{m}$ can be
written in the form $\dfrac{a}{m^{k}}$ for some $a\in\mathbb{Z}$ and some
$k\in\mathbb{N}$ (but these $a$ and $k$ are not unique, since $\dfrac{a}%
{m^{k}}=\dfrac{am}{m^{k+1}}=\dfrac{am^{2}}{m^{k+2}}=\cdots$).

This ring $R_{m}$ is isomorphic to the ring $\mathbb{Z}\left[  x\right]
/\left(  mx-1\right)  $. Indeed, we have a ring homomorphism%
\begin{align*}
\mathbb{Z}\left[  x\right]  /\left(  mx-1\right)   &  \rightarrow R_{m},\\
\left[  \mathbf{a}\right]  _{mx-1}  &  \mapsto\mathbf{a}\left[  \dfrac{1}%
{m}\right]  ,
\end{align*}
and this is invertible, with inverse%
\begin{align*}
R_{m}  &  \rightarrow\mathbb{Z}\left[  x\right]  /\left(  mx-1\right)  ,\\
\dfrac{a}{m^{k}}  &  \mapsto\left[  ax^{k}\right]  _{mx-1}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{for }a\in\mathbb{Z}\text{ and }%
k\in\mathbb{N}\right)
\end{align*}
(you have to check that this is well-defined).

Note that Theorem \ref{thm.quot.ring/w.basis-of-quot} does not apply here
(unless $m\in\left\{  1,-1\right\}  $), and the $\mathbb{Z}$-module $R_{m}$
has no basis (again, unless $m\in\left\{  1,-1\right\}  $).

Note that $R_{m}$ (the ring of $m$-integers) is commonly called $\mathbb{Z}%
\left[  \dfrac{1}{m}\right]  $, in analogy to $\mathbb{Z}\left[  i\right]  $.
\end{example}

\begin{example}
We have a ring isomorphism%
\[
\left(  \mathbb{Z}/6\right)  \left[  x\right]  /\left(  2x+1\right)
\cong\mathbb{Z}/3.
\]
Thus, if we adjoin a root of $2x+1$ to the ring $\mathbb{Z}/6$, then we get a
smaller ring (namely, $\mathbb{Z}/3$). In particular, there is no injective
map from $\mathbb{Z}/6$ to the result of this adjunction!

This is no surprise, since $\left[  x^{1}\right]  \left(  2x+1\right)
=\left[  2\right]  _{6}$ is not invertible in $\mathbb{Z}/6$, and thus Theorem
\ref{thm.quot.ring/w.basis-of-quot} does not apply here.

This is similar to how dividing by $0$ makes all numbers equal:%
\[
\mathbb{Z}\left[  x\right]  /\left(  0x-1\right)  \cong\left\{  0\right\}  .
\]

\end{example}

Let us summarize: We can always adjoin a root of a polynomial $\mathbf{b}$ to
a commutative ring $\mathbb{K}$ by forming the ring $\mathbb{K}\left[
x\right]  /\mathbf{b}$. This latter ring will always be a commutative ring;
moreover, if $\mathbf{b}$ is \textquotedblleft nice\textquotedblright\ (that
is, there is a positive integer $m$ such that $\mathbf{b}\in\mathbb{K}\left[
x\right]  _{\leq m}$ and such that $\left[  x^{m}\right]  \mathbf{b}$ is
invertible), then Theorem \ref{thm.quot.ring/w.basis-of-quot} \textbf{(c)}
shows that this latter ring will contain $\mathbb{K}$ as a subring (at least
if we make a natural identification). If $\mathbf{b}$ is not as
\textquotedblleft nice\textquotedblright, then the ring $\mathbb{K}\left[
x\right]  /\mathbf{b}$ may fail to contain $\mathbb{K}$ as a subring (though
it is always a $\mathbb{K}$-algebra), and may be smaller than $\mathbb{K}$ and
even trivial.

If $\mathbb{K}$ itself is a field, then $\mathbf{b}$ will always be
\textquotedblleft nice\textquotedblright\ (unless $\mathbf{b}=0$), but the
ring $\mathbb{K}\left[  x\right]  /\mathbf{b}$ may and may not be a field.
What must a polynomial $\mathbf{b}$ satisfy in order for $\mathbb{K}\left[
x\right]  /\mathbf{b}$ to be a field?

\begin{definition}
\label{def.pol.irreducible}Let $\mathbb{F}$ be a field.

A polynomial $\mathbf{a}\in\mathbb{F}\left[  x\right]  $ is said to be
\textit{irreducible} if $\deg\mathbf{a}>0$ and there exist no two polynomials
$\mathbf{b},\mathbf{c}\in\mathbb{F}\left[  x\right]  $ with $\mathbf{a}%
=\mathbf{bc}$ and $\deg\mathbf{b}>0$ and $\deg\mathbf{c}>0$.

In other words, a polynomial $\mathbf{a}\in\mathbb{F}\left[  x\right]  $ is
said to be \textit{irreducible} if it is non-constant but cannot be written as
a product of two non-constant polynomials. (Indeed, the non-constant
polynomials are precisely the polynomials having degree $>0$.)
\end{definition}

Irreducible polynomials over a field $\mathbb{F}$ are an analogue of prime
numbers (or, to be more precise, of integers of the form $\pm p$ where $p$ is
a prime).

\begin{theorem}
\label{thm.quot.field/w.irred}Let $\mathbb{F}$ be a field. Let $\mathbf{a}%
\in\mathbb{F}\left[  x\right]  $ be a polynomial.

Then, the ring $\mathbb{F}\left[  x\right]  /\mathbf{a}$ is a field if and
only if $\mathbf{a}$ is irreducible.
\end{theorem}

So, for example, the irreducible polynomial $x^{2}+1$ over $\mathbb{R}$ yields
the field $\mathbb{R}\left[  x\right]  /\left(  x^{2}+1\right)  $ (which is
$\cong\mathbb{C}$), but the non-irreducible polynomial $x^{2}$ over
$\mathbb{R}$ yields the non-field $\mathbb{R}\left[  x\right]  /x^{2}$ (which
is $\cong\mathbb{D}$).

\begin{proof}
[Proof of Theorem \ref{thm.quot.field/w.irred} (sketched).]In Subsection
\ref{subsect.pol.quorem.field}, we have already explained that there is an
analogy between polynomials in $\mathbb{F}\left[  x\right]  $ and Gaussian
integers in $\mathbb{Z}\left[  i\right]  $ (although we denoted the field by
$\mathbb{K}$ rather than $\mathbb{F}$ in that Subsection). In particular, the
degree of a polynomial is analogous to the norm of a Gaussian integer. The
nonzero constant polynomials in $\mathbb{F}\left[  x\right]  $ (that is, the
polynomials of degree $0$) are precisely the units of the ring $\mathbb{F}%
\left[  x\right]  $ (that is, the invertible elements of $\mathbb{F}\left[
x\right]  $)\ \ \ \ \footnote{This follows from Proposition
\ref{prop.pol.invertible.field}.}, and thus play the same role in
$\mathbb{F}\left[  x\right]  $ that the units $1,-1,i,-i$ play in
$\mathbb{Z}\left[  i\right]  $. Theorem \ref{thm.pol.quorem-over-field} serves
as an analogue of Theorem \ref{thm.Z[i].gauss.quorem}, and can be used to
prove an analogue of Bezout's theorem for polynomials in $\mathbb{F}\left[
x\right]  $. This lets us define an analogue of gcds. Irreducible polynomials
in $\mathbb{F}\left[  x\right]  $ are an analogue of Gaussian primes. This
analogy between $\mathbb{Z}\left[  i\right]  $ and $\mathbb{F}\left[
x\right]  $ is not perfect\footnote{For example: If $n\in\mathbb{N}$, then
there are only finitely many Gaussian integers $\alpha\in\mathbb{Z}\left[
i\right]  $ having norm $n$, but there are often infinitely many polynomials
$\mathbf{a}\in\mathbb{F}\left[  x\right]  $ having degree $n$.}; but it
suffices to prove $\mathbb{F}\left[  x\right]  $-analogues of all the
fundamental results such as Theorem \ref{thm.ent.gcd.bezout}, Theorem
\ref{thm.ent.gcd.uniprop}, Theorem \ref{thm.ent.coprime.cancel}, Theorem
\ref{thm.ent.coprime.combine}, Theorem \ref{thm.ent.coprime.modinv},
Proposition \ref{prop.ent.prime.each-i-coprime}, Proposition
\ref{prop.ent.prime.div-or-coprime} and Theorem \ref{thm.ent.prime.pab}%
.\footnote{The analogue of Proposition \ref{prop.ent.prime.each-i-coprime}
states that if $\mathbf{p}\in\mathbb{F}\left[  x\right]  $ is an irreducible
polynomial, then every polynomial $\mathbf{i}\in\mathbb{F}\left[  x\right]  $
with degree $\deg\mathbf{i}\in\left\{  1,2,\ldots,\deg\mathbf{p}-1\right\}  $
is coprime to $\mathbf{p}$.} As a consequence, we can prove an $\mathbb{F}%
\left[  x\right]  $-analogue of Theorem \ref{thm.field.Z/n}. This latter
analogue shows that if $\mathbf{n}\in\mathbb{F}\left[  x\right]  $ is a
polynomial of degree $\deg\mathbf{n}>0$, then the ring $\mathbb{F}\left[
x\right]  /\mathbf{n}$ is a field if and only if $\mathbf{n}$ is irreducible.
Applying this to $\mathbf{n}=\mathbf{a}$, we obtain Theorem
\ref{thm.quot.field/w.irred} (after first dealing with the easy case when
$\deg\mathbf{a}\leq0$).
\end{proof}

\subsection{Quotients modulo ideals}

\subsubsection{Congruence and quotients modulo ideals}

The notion of \textquotedblleft congruence modulo $w$\textquotedblright%
\ introduced in Definition \ref{def.quot.ring-cong} was a generalization of
\textquotedblleft congruence modulo $n$\textquotedblright\ from number theory;
but it can be generalized further. Namely, we can replace $w$ by an ideal $I$
of $\mathbb{L}$. (See Definition \ref{def.ring.ideal} for the definition of an
ideal.) Here is how this general notion is defined:

\begin{definition}
\label{def.quot.mod-ideal}Let $\mathbb{L}$ be a ring. Let $I$ be an ideal of
$\mathbb{L}$. Let $a,b\in\mathbb{L}$. We say that $a$ \textit{is congruent to
}$b$ \textit{modulo }$I$ (\textit{in }$\mathbb{L}$\textit{)} if and only if
$a-b\in I$. We shall use the notation \textquotedblleft$a\equiv
b\operatorname{mod}I$\textquotedblright\ for \textquotedblleft$a$ is congruent
to $b$ modulo $I$\textquotedblright.

We furthermore shall use the notation \textquotedblleft$a\not \equiv
b\operatorname{mod}I$\textquotedblright\ for \textquotedblleft$a$ is not
congruent to $b$ modulo $I$\textquotedblright.
\end{definition}

Why is this a generalization of \textquotedblleft congruence modulo
$w$\textquotedblright? Because congruence modulo $w$ is recovered if we take
$I$ to be the principal ideal\footnote{See Example \ref{exa.ring.ideal.princ}
for the definition of principal ideals.} $w\mathbb{L}$. More precisely, the
following holds:

\begin{proposition}
\label{prop.quot.ring/ideal.principal}Let $\mathbb{L}$ be a commutative ring.
Let $w\in\mathbb{L}$. Let $a,b\in\mathbb{L}$. Consider the principal ideal
$w\mathbb{L}$ of $\mathbb{L}$, defined as in Example
\ref{exa.ring.ideal.princ} (that is, by $w\mathbb{L}=\left\{  wz\ \mid
\ z\in\mathbb{L}\right\}  $). Then, $a\equiv b\operatorname{mod}w$ holds if
and only if $a\equiv b\operatorname{mod}w\mathbb{L}$.
\end{proposition}

\begin{proof}
[Proof of Proposition \ref{prop.quot.ring/ideal.principal}.]The definition of
$w\mathbb{L}$ yields $w\mathbb{L}=\left\{  wz\ \mid\ z\in\mathbb{L}\right\}
$. Now, We have the following chain of equivalences:%
\begin{align*}
\left(  a\equiv b\operatorname{mod}w\right)  \  &  \Longleftrightarrow
\ \left(  w\mid a-b\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition
\ref{def.quot.ring-cong}}\right) \\
&  \Longleftrightarrow\ \left(  a-b=wz\text{ for some }z\in\mathbb{L}\right)
\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition \ref{def.quot.ring-div}%
}\right) \\
&  \Longleftrightarrow\ \left(  a-b\in\underbrace{\left\{  wz\ \mid
\ z\in\mathbb{L}\right\}  }_{=w\mathbb{L}}\right)  \ \Longleftrightarrow
\ \left(  a-b\in w\mathbb{L}\right) \\
&  \Longleftrightarrow\ \left(  a\equiv b\operatorname{mod}w\mathbb{L}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition \ref{def.quot.mod-ideal}%
}\right)  .
\end{align*}
Thus, Proposition \ref{prop.quot.ring/ideal.principal} is proven.
\end{proof}

Knowing that \textquotedblleft congruence modulo $I$\textquotedblright\ is a
generalization of \textquotedblleft congruence modulo $w$\textquotedblright%
\ and of \textquotedblleft congruence modulo $n$\textquotedblright, we can
play the usual game in which we recall properties of the latter and check
whether they still hold for the former. For example, the following
generalization of Proposition \ref{prop.quot.ring-cong.nice} holds:

\begin{proposition}
\label{prop.quot.ring/ideal.nice}Let $\mathbb{L}$ be a ring. Let $I$ be an
ideal of $\mathbb{L}$.

\textbf{(a)} We have $a\equiv a\operatorname{mod}I$ for every $a\in\mathbb{L}$.

\textbf{(b)} If $a,b,c\in\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}I$
and $b\equiv c\operatorname{mod}I$, then $a\equiv c\operatorname{mod}I$.

\textbf{(c)} If $a,b\in\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}I$,
then $b\equiv a\operatorname{mod}I$.

\textbf{(d)} If $a_{1},a_{2},b_{1},b_{2}\in\mathbb{L}$ satisfy $a_{1}\equiv
b_{1}\operatorname{mod}I$ and $a_{2}\equiv b_{2}\operatorname{mod}I$, then%
\begin{align}
a_{1}+a_{2}  &  \equiv b_{1}+b_{2}\operatorname{mod}I;\\
a_{1}-a_{2}  &  \equiv b_{1}-b_{2}\operatorname{mod}I;\\
a_{1}a_{2}  &  \equiv b_{1}b_{2}\operatorname{mod}I.
\end{align}


\textbf{(e)} Let $J$ be an ideal of $\mathbb{L}$ such that $I\subseteq J$. If
$a,b\in\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}I$, then $a\equiv
b\operatorname{mod}J$.
\end{proposition}

Note how the \textquotedblleft$I\subseteq J$\textquotedblright\ assumption in
Proposition \ref{prop.quot.ring/ideal.nice} \textbf{(e)} is the correct
generalization of the \textquotedblleft$m\mid w$\textquotedblright\ assumption
in Proposition \ref{prop.quot.ring-cong.nice}, because of the following fact:

\begin{proposition}
\label{prop.ring.principal-ideals-contain}Let $\mathbb{L}$ be a commutative
ring. Let $m,w\in\mathbb{L}$. Then, $w\mathbb{L}\subseteq m\mathbb{L}$ holds
if and only if $m\mid w$. (Here, the principal ideals $w\mathbb{L}$ and
$m\mathbb{L}$ are defined as in Example \ref{exa.ring.ideal.princ}).
\end{proposition}

This proposition is so easy it barely needs proof, but it illustrates a useful
point of view: Divisibility of elements of $\mathbb{L}$ can be rewritten as
containment of ideals of $\mathbb{L}$.

\begin{proof}
[Proof of Proposition \ref{prop.ring.principal-ideals-contain}.]%
$\Longrightarrow:$ Assume that $w\mathbb{L}\subseteq m\mathbb{L}$. We must
prove that $m\mid w$.

The definition of $w\mathbb{L}$ yields $w\mathbb{L}=\left\{  wz\ \mid
\ z\in\mathbb{L}\right\}  $. Now, $w=w\cdot1$; hence, the element $w$ has the
form $wz$ for some $z\in\mathbb{L}$ (namely, for $z=1$). Thus,%
\[
w\in\left\{  wz\ \mid\ z\in\mathbb{L}\right\}  =w\mathbb{L}\subseteq
m\mathbb{L}=\left\{  mz\ \mid\ z\in\mathbb{L}\right\}
\]
(by the definition of $m\mathbb{L}$). In other words, $w=mz$ for some
$z\in\mathbb{L}$. In other words, $m\mid w$ (by Definition
\ref{def.quot.ring-div}). Thus, the \textquotedblleft$\Longrightarrow
$\textquotedblright\ part of Proposition
\ref{prop.ring.principal-ideals-contain} is proven.

$\Longleftarrow:$ Assume that $m\mid w$. We must prove that $w\mathbb{L}%
\subseteq m\mathbb{L}$.

We have assumed that $m\mid w$. In other words, $w=mc$ for some $c\in
\mathbb{L}$. Consider this $c$.

The definition of $m\mathbb{L}$ yields $m\mathbb{L}=\left\{  mz\ \mid
\ z\in\mathbb{L}\right\}  =\left\{  ma\ \mid\ a\in\mathbb{L}\right\}  $ (here,
we have renamed the index $z$ as $a$).

Now, let $g\in w\mathbb{L}$. Hence, $g\in w\mathbb{L}=\left\{  wz\ \mid
\ z\in\mathbb{L}\right\}  $ (by the definition of $w\mathbb{L}$). In other
words, $g=wz$ for some $z\in\mathbb{L}$. Consider this $z$. Then,
$g=\underbrace{w}_{=mc}z=mcz$. Hence, $g=ma$ for some $a\in\mathbb{L}$
(namely, for $a=cz$). In other words, $g\in\left\{  ma\ \mid\ a\in
\mathbb{L}\right\}  =m\mathbb{L}$.

Forget that we fixed $g$. We thus have shown that $g\in m\mathbb{L}$ for some
$g\in w\mathbb{L}$. In other words, $w\mathbb{L}\subseteq m\mathbb{L}$. Thus,
the \textquotedblleft$\Longleftarrow$\textquotedblright\ part of Proposition
\ref{prop.ring.principal-ideals-contain} is proven.
\end{proof}

\begin{proof}
[Proof of Proposition \ref{prop.quot.ring/ideal.nice}.]We know that $I$ is an
ideal of $\mathbb{L}$. Thus, $I$ satisfies the four conditions in Definition
\ref{def.ring.ideal} (applied to $\mathbb{L}$ instead of $\mathbb{K}$). In
other words, the following holds:

\begin{itemize}
\item The subset $I$ is closed under addition (i.e., we have $a+b\in I$ for
all $a\in I$ and $b\in I$).

\item The subset $I$ contains $0_{\mathbb{L}}$.

\item We have
\begin{equation}
\lambda a\in I\ \ \ \ \ \ \ \ \ \ \text{for all }\lambda\in\mathbb{L}\text{
and }a\in I. \label{pf.prop.quot.ring/ideal.nice.la}%
\end{equation}


\item We have
\begin{equation}
a\lambda\in I\ \ \ \ \ \ \ \ \ \ \text{for all }\lambda\in\mathbb{L}\text{ and
}a\in I. \label{pf.prop.quot.ring/ideal.nice.al}%
\end{equation}

\end{itemize}

\textbf{(a)} Let $a\in\mathbb{L}$. We know that $I$ contains $0_{\mathbb{L}}$.
Thus, $0_{\mathbb{L}}\in I$. Now, $a-a=0_{\mathbb{L}}\in I$. This rewrites as
$a\equiv a\operatorname{mod}I$ (by Definition \ref{def.quot.mod-ideal}). This
proves Proposition \ref{prop.quot.ring/ideal.nice} \textbf{(a)}.

\textbf{(b)} Let $a,b,c\in\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}I$
and $b\equiv c\operatorname{mod}I$. Then, $a\equiv b\operatorname{mod}I$, so
that $a-b\in I$ (by Definition \ref{def.quot.mod-ideal}). Similarly, $b-c\in
I$. But we know that $I$ is closed under addition. Hence, from $a-b\in I$ and
$b-c\in I$, we obtain $\underbrace{\left(  a-b\right)  }_{\in I}%
+\underbrace{\left(  b-c\right)  }_{\in I}\in I$. Hence, $a-c=\left(
a-b\right)  +\left(  b-c\right)  \in I$. In other words, $a\equiv
c\operatorname{mod}I$ (by Definition \ref{def.quot.mod-ideal}). This proves
Proposition \ref{prop.quot.ring/ideal.nice} \textbf{(b)}.

\textbf{(c)} Let $a,b\in\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}I$.
Thus, $a-b\in I$ (by Definition \ref{def.quot.mod-ideal}). Hence,
(\ref{pf.prop.quot.ring/ideal.nice.la}) (applied to $-1$ and $a-b$ instead of
$\lambda$ and $a$) yields $\left(  -1\right)  \left(  a-b\right)  \in I$.
Hence, $b-a=\left(  -1\right)  \left(  a-b\right)  \in I$. In other words,
$b\equiv a\operatorname{mod}I$ (by Definition \ref{def.quot.mod-ideal}). This
proves Proposition \ref{prop.quot.ring/ideal.nice} \textbf{(c)}.

\textbf{(d)} Let $a_{1},a_{2},b_{1},b_{2}\in\mathbb{L}$ satisfy $a_{1}\equiv
b_{1}\operatorname{mod}I$ and $a_{2}\equiv b_{2}\operatorname{mod}I$. We have
$a_{1}\equiv b_{1}\operatorname{mod}I$ and thus $a_{1}-b_{1}\in I$ (by
Definition \ref{def.quot.mod-ideal}). But we know that $I$ is closed under
addition. Hence, from $a_{1}-b_{1}\in I$ and $a_{2}-b_{2}\in I$, we obtain
$\underbrace{\left(  a_{1}-b_{1}\right)  }_{\in I}+\underbrace{\left(
a_{2}-b_{2}\right)  }_{\in I}\in I$. Hence,
\[
\left(  a_{1}+a_{2}\right)  -\left(  b_{1}+b_{2}\right)  =\left(  a_{1}%
-b_{1}\right)  +\left(  a_{2}-b_{2}\right)  \in I.
\]
In other words, $a_{1}+a_{2}\equiv b_{1}+b_{2}\operatorname{mod}I$ (by
Definition \ref{def.quot.mod-ideal}).

Recall that $a_{2}-b_{2}\in I$. Hence, (\ref{pf.prop.quot.ring/ideal.nice.la})
(applied to $-1$ and $a_{2}-b_{2}$ instead of $\lambda$ and $a$) yields
$\left(  -1\right)  \left(  a_{2}-b_{2}\right)  \in I$. Hence, $b_{2}%
-a_{2}=\left(  -1\right)  \left(  a_{2}-b_{2}\right)  \in I$. Recall again
that $I$ is closed under addition. Hence, from $a_{1}-b_{1}\in I$ and
$b_{2}-a_{2}\in I$, we obtain $\underbrace{\left(  a_{1}-b_{1}\right)  }_{\in
I}+\underbrace{\left(  b_{2}-a_{2}\right)  }_{\in I}\in I$. Hence,
\[
\left(  a_{1}-a_{2}\right)  -\left(  b_{1}-b_{2}\right)  =\left(  a_{1}%
-b_{1}\right)  +\left(  b_{2}-a_{2}\right)  \in I.
\]
In other words, $a_{1}-a_{2}\equiv b_{1}-b_{2}\operatorname{mod}I$ (by
Definition \ref{def.quot.mod-ideal}).

It remains to prove that $a_{1}a_{2}\equiv b_{1}b_{2}\operatorname{mod}I$.

Let us first show that $a_{1}a_{2}\equiv a_{1}b_{2}\operatorname{mod}I$.
Indeed, $a_{1}a_{2}-a_{1}b_{2}=a_{1}\left(  a_{2}-b_{2}\right)  \in I$ (by
(\ref{pf.prop.quot.ring/ideal.nice.la}), applied to $a_{1}$ and $a_{2}-b_{2}$
instead of $\lambda$ and $a$), because $a_{2}-b_{2}\in I$. In other words,
$a_{1}a_{2}\equiv a_{1}b_{2}\operatorname{mod}I$.

Next, we shall show that $a_{1}b_{2}\equiv b_{1}b_{2}\operatorname{mod}I$.
Indeed, $a_{1}b_{2}-b_{1}b_{2}=\left(  a_{1}-b_{1}\right)  b_{2}\in I$ (by
(\ref{pf.prop.quot.ring/ideal.nice.al}), applied to $b_{2}$ and $a_{1}-b_{1}$
instead of $\lambda$ and $a$), because $a_{1}-b_{1}\in I$. In other words,
$a_{1}b_{2}\equiv b_{1}b_{2}\operatorname{mod}I$.

Now, we have $a_{1}a_{2}\equiv a_{1}b_{2}\operatorname{mod}I$ and $a_{1}%
b_{2}\equiv b_{1}b_{2}\operatorname{mod}I$. Hence, Proposition
\ref{prop.quot.ring/ideal.nice} \textbf{(b)} (applied to $a=a_{1}a_{2}$,
$b=a_{1}b_{2}$ and $c=b_{1}b_{2}$) yields $a_{1}a_{2}\equiv b_{1}%
b_{2}\operatorname{mod}I$. This completes the proof of Proposition
\ref{prop.quot.ring/ideal.nice} \textbf{(d)}.

\textbf{(e)} Let $a,b\in\mathbb{L}$ satisfy $a\equiv b\operatorname{mod}I$.
Thus, $a-b\in I$ (by Definition \ref{def.quot.mod-ideal}). Hence, $a-b\in
I\subseteq J$. In other words, $a\equiv b\operatorname{mod}J$ (by Definition
\ref{def.quot.mod-ideal}). This proves Proposition
\ref{prop.quot.ring/ideal.nice} \textbf{(e)}.
\end{proof}

The following definition generalizes Definition \ref{def.quot.ring/w.defs}
(and thus also generalizes our construction of $\mathbb{Z}/n$ for
$n\in\mathbb{Z}$):

\begin{definition}
\label{def.quot.ring/ideal.defs}Fix a ring $\mathbb{L}$ and an ideal $I$ of
$\mathbb{L}$.

\textbf{(a)} Define a relation $\underset{I}{\equiv}$ on the set $\mathbb{L}$
by
\[
\left(  a\underset{I}{\equiv}b\right)  \Longleftrightarrow\left(  a\equiv
b\operatorname{mod}I\right)  .
\]


This $\underset{I}{\equiv}$ is an equivalence relation. (The proof of this is
analogous to the proof of Example \ref{exa.eqrel.eqrel.eqrelmodn}.)

\textbf{(b)} A \textit{residue class modulo}\textbf{ }$I$ means an equivalence
class of the relation $\underset{I}{\equiv}$.

\textbf{(c)} If $a\in\mathbb{L}$, then we denote the residue class $\left[
a\right]  _{\underset{I}{\equiv}}$ by $\left[  a\right]  _{I}$.

\textbf{(d)} The set $\mathbb{L}/\underset{I}{\equiv}$ of all residue classes
modulo $I$ is called $\mathbb{L}/I$.

\textbf{(e)} We define a binary operation $+$ on $\mathbb{L}/I$ (called
\textit{addition}) by setting%
\[
\left[  a\right]  _{I}+\left[  b\right]  _{I}=\left[  a+b\right]
_{I}\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{L}.
\]
This is well-defined, because of Theorem \ref{thm.quot.ring/ideal.wd}
\textbf{(a)} below.

\textbf{(f)} We define a binary operation $\cdot$ on $\mathbb{L}/I$ (called
\textit{multiplication}) by setting%
\[
\left[  a\right]  _{I}\cdot\left[  b\right]  _{I}=\left[  a\cdot b\right]
_{I}\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{L}.
\]
This is well-defined, because of Theorem \ref{thm.quot.ring/ideal.wd}
\textbf{(a)} below.

\textbf{(g)} Fix $r\in\mathbb{L}$. For any $\alpha\in\mathbb{L}/I$, we define
a residue class $r\alpha\in\mathbb{L}/I$ by setting%
\[
\left(  r\left[  a\right]  _{I}=\left[  ra\right]  _{I}%
\ \ \ \ \ \ \ \ \ \ \text{for any }a\in\mathbb{L}\right)  .
\]
(In other words, for any $\alpha\in\mathbb{L}/I$, we let $r\alpha=\left[
ra\right]  _{I}$, where $a$ is an element of $\mathbb{L}$ satisfying
$\alpha=\left[  a\right]  _{I}$.) This is well-defined, because of Theorem
\ref{thm.quot.ring/ideal.wd} \textbf{(a)} below.

We shall also write $r\cdot\alpha$ instead of $r\alpha$. The map
$\mathbb{L}\times\left(  \mathbb{L}/I\right)  \rightarrow\mathbb{L}%
/I,\ \left(  r,\alpha\right)  \mapsto r\alpha$ will be called \textit{scaling}.
\end{definition}

\begin{theorem}
\label{thm.quot.ring/ideal.wd}Fix a ring $\mathbb{L}$ and an ideal $I$ of
$\mathbb{L}$.

\textbf{(a)} The operations $+$ and $\cdot$ and the \textquotedblleft scaling
map\textquotedblright\ $\cdot$ in Definition \ref{def.quot.ring/ideal.defs}
are well-defined.

\textbf{(b)} The set $\mathbb{L}/I$, equipped with the addition $+$ (defined
in Definition \ref{def.quot.ring/ideal.defs} \textbf{(e)}), the multiplication
$\cdot$ (defined in Definition \ref{def.quot.ring/ideal.defs} \textbf{(f)})
and the zero $\left[  0\right]  _{I}$ and the unity $\left[  1\right]  _{I}$,
is a commutative ring.

\textbf{(c)} The set $\mathbb{L}/I$, equipped with the addition $+$ (defined
in Definition \ref{def.quot.ring/ideal.defs} \textbf{(e)}), the scaling
$\cdot$ (defined in Definition \ref{def.quot.ring/ideal.defs} \textbf{(g)})
and the zero vector $\left[  0\right]  _{I}$, is an $\mathbb{L}$-module when
$\mathbb{L}$ is commutative.

\textbf{(d)} The set $\mathbb{L}/I$, equipped with all of these items, is an
$\mathbb{L}$-algebra when $\mathbb{L}$ is commutative.

\textbf{(e)} The map%
\begin{align*}
\pi_{I}:\mathbb{L}  &  \rightarrow\mathbb{L}/I,\\
a  &  \mapsto\left[  a\right]  _{I}%
\end{align*}
is an $\mathbb{L}$-algebra homomorphism.

\textbf{(f)} If the ring $\mathbb{L}$ is commutative, then the ring
$\mathbb{L}/I$ is a commutative $\mathbb{L}$-algebra.

\textbf{(g)} The kernel of the $\mathbb{L}$-algebra homomorphism $\pi_{I}$ is
$\operatorname*{Ker}\left(  \pi_{I}\right)  =I$. (See Proposition
\ref{prop.rihom.ker} \textbf{(a)} for the definition of a kernel.)
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.quot.ring/ideal.wd}.]Parts \textbf{(a)},
\textbf{(b)}, \textbf{(c)}, \textbf{(d)} and \textbf{(e)} of this theorem are
proven in the same way as the corresponding parts of Theorem
\ref{thm.quot.ring/w.wd}. Part \textbf{(f)} is easy.

\textbf{(g)} The map $\pi_{I}$ is an $\mathbb{L}$-algebra homomorphism (by
Theorem \ref{thm.quot.ring/ideal.wd} \textbf{(e)}), thus a ring homomorphism.

For each $a\in\mathbb{L}$, we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  \pi_{I}\left(  a\right)  =0_{\mathbb{L}/I}\right) \\
&  \Longleftrightarrow\ \left(  \left[  a\right]  _{I}=\left[  0\right]
_{I}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\pi_{I}\left(  a\right)  =\left[
a\right]  _{I}\text{ (by the definition of }\pi_{I}\text{) and }%
0_{\mathbb{L}/I}=\left[  0\right]  _{I}\right) \\
&  \Longleftrightarrow\ \left(  \left[  a\right]  _{\underset{I}{\equiv}%
}=\left[  0\right]  _{\underset{I}{\equiv}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since Definition
\ref{def.quot.ring/ideal.defs} \textbf{(c)} yields }\left[  a\right]
_{I}=\left[  a\right]  _{\underset{I}{\equiv}}\text{ and }\left[  0\right]
_{I}=\left[  0\right]  _{\underset{I}{\equiv}}\right) \\
&  \Longleftrightarrow\ \left(  a\underset{I}{\equiv}0\right)
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since Proposition \ref{thm.eqrel.eqcl.disj} \textbf{(e)} yields that}\\
\text{we have }a\underset{I}{\equiv}0\text{ if and only if }\left[  a\right]
_{\underset{I}{\equiv}}=\left[  0\right]  _{\underset{I}{\equiv}}%
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  a\equiv0\operatorname{mod}I\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition \ref{def.quot.ring/ideal.defs}
\textbf{(a)}}\right) \\
&  \Longleftrightarrow\ \left(  a-0\in I\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Definition \ref{def.quot.mod-ideal}}\right) \\
&  \Longleftrightarrow\ \left(  a\in I\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }a-0=a\right)  .
\end{align*}
Hence,%
\[
\left\{  a\in\mathbb{L}\ \mid\ \pi_{I}\left(  a\right)  =0_{\mathbb{L}%
/I}\right\}  =\left\{  a\in\mathbb{L}\ \mid\ a\in I\right\}  =I
\]
(since $I\subseteq\mathbb{L}$). Now, the definition of $\operatorname*{Ker}%
\left(  \pi_{I}\right)  $ yields%
\begin{align*}
\operatorname*{Ker}\left(  \pi_{I}\right)   &  =\left\{  v\in\mathbb{L}%
\ \mid\ \pi_{I}\left(  v\right)  =0_{\mathbb{L}/I}\right\}  =\left\{
a\in\mathbb{L}\ \mid\ \pi_{I}\left(  a\right)  =0_{\mathbb{L}/I}\right\} \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have renamed the index }v\text{
as }a\right) \\
&  =I.
\end{align*}
This proves Theorem \ref{thm.quot.ring/ideal.wd} \textbf{(g)}.
\end{proof}

Proposition \ref{prop.quot.ring/ideal.principal} shows that Definition
\ref{def.quot.ring/ideal.defs} generalizes Definition
\ref{def.quot.ring/w.defs}: Namely, if $\mathbb{L}$ is a commutative ring, and
if the ideal $I$ in Definition \ref{def.quot.ring/ideal.defs} is a principal
ideal $w\mathbb{L}$ (for some $w\in\mathbb{L}$), then the relation
$\underset{I}{\equiv}$ and the ring $\mathbb{L}/I$ are precisely the relation
$\underset{w}{\equiv}$ and the ring $\mathbb{L}/w$ defined in Definition
\ref{def.quot.ring/w.defs}. Thus, if $w$ is any element of a commutative ring
$\mathbb{L}$, then%
\[
\mathbb{L}/w=\mathbb{L}/w\mathbb{L}.
\]
Thus, in particular, $\mathbb{Z}/n=\mathbb{Z}/n\mathbb{Z}$ for any
$n\in\mathbb{Z}$. Most authors prefer the notation $\mathbb{Z}/n\mathbb{Z}$ to
our notation $\mathbb{Z}/n$ (since it is an instance of the more general
construction $\mathbb{L}/I$).

\begin{noncompile}
The universal property of the quotient

Let us briefly mention an analogue of Theorem \ref{thm.eqrel.quot.uniprop.1}
for quotients of rings, which helps construct ring homomorphisms out of them:

\begin{theorem}
\label{thm.quot.ring/ideal.uniprop.1}Let $\mathbb{L}$ and $\mathbb{M}$ be two
rings, and let $I$ be an ideal of $\mathbb{L}$. Let $F:\mathbb{L}%
\rightarrow\mathbb{M}$ be a ring homomorphism. Assume that $F\left(  i\right)
=0$ for each $i\in I$.

Then, there exists a unique ring homomorphism $f:\mathbb{L}/I\rightarrow
\mathbb{M}$ such that every $s\in\mathbb{L}$ satisfies $f\left(  \left[
s\right]  _{I}\right)  =F\left(  s\right)  $.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.quot.ring/ideal.uniprop.1}.]Omitted for now (LTTR).
\end{proof}

\begin{corollary}
\label{cor.quot.ring/ideal.polring-uniprop}....
\end{corollary}

\begin{example}
Let us use Theorem \ref{thm.quot.ring/ideal.uniprop.1} to give a somewhat
different proof of Example \ref{exa.quot.ring.C=Rx/}.

Indeed,
\end{example}

[To be continued!]

TODO:

Quotients modulo rings:

\begin{itemize}
\item Applying this to one of the isomorphism examples.
\end{itemize}

Quotients modulo submodules:

\begin{itemize}
\item Congruence $\underset{M}{\equiv}$ modulo a submodule $M$ of $N$.

\item Quotient module $N/M$.

\item Over a field, $\dim\left(  N/M\right)  =\dim N-\dim M$.

\item Universal property of quotient module.

\item If $f:U\rightarrow V$ a $\mathbb{K}$-module homomorphism, then iso
$U/\operatorname*{Ker}f\rightarrow f\left(  U\right)  ,\ \left[  u\right]
_{\operatorname*{Ker}f}\mapsto f\left(  u\right)  $.

\item Conclude the rank-nullity theorem.
\end{itemize}

%\section{Groups and $G$-sets}


...
\end{noncompile}

\section{\label{chp.epilogue-19f}Epilogue (UMN Fall 2019 Math 4281)}

Here ends our one-semester course on abstract algebra (Fall 2019 at UMN). I
will now tie up some loose ends and point into a few directions for further study.

\subsection{\label{sect.epilogue-19f.more}Roads not taken}

During the course of the past semester, we have learned new things about old
concepts (such as the integers) as well as new concepts -- both concrete (such
as the Gaussian integers) and abstract (such as arbitrary rings and fields).

A one-semester course on abstract algebra always has to decide between many
things of roughly equal importance; not everything can get its
day\footnote{The alternative is to skimp on proofs; I consider this the worst
option.}. The main topics we missed are:

\begin{itemize}
\item \textbf{Groups} (and monoids, and group homomorphisms, and subgroups,
etc.). Many algebra classes \textbf{start} with this topic, since much of it
can be done with almost no prerequisites. I have kept delaying this topic and,
in the end, did not get to it at all. My main excuse is that it would have
taken me afield -- we haven't needed groups in what we did above (though they
would have simplified a few of our proofs). Nevertheless, groups are worth
learning about. Readable introductions into groups include \cite{Siksek},
\cite[\S 4.1--\S 4.2]{Gallier-RSA}, \cite[Chapters 1--5]{Goodman} and
\cite[Chapter 1--16]{Pinter}; other sources are \cite[Abstract Algebra
I]{Armstrong} (with a historical perspective), \cite[Chapter 2]{Artin},
\cite[Chapter 1]{Bosch}, \cite[Chapter 2]{Carrel17}, \cite[Chapters
III--IV]{Elman18}, \cite[Chapter IV]{Knapp1}, \cite[Chapter 9]{Loehr-BC},
\cite{Milne17}.

Only a few dozen pages of basic properties of groups will get you ready for
the proof of Theorem \ref{thm.eqrel.primroot.gauss}, which we left unproved.
See \cite[\S 4.1--\S 4.2]{Gallier-RSA} or \cite[\textquotedblleft Cyclicity of
$\left(  \mathbf{Z}/\left(  p\right)  \right)  ^{\times}$\textquotedblright%
]{Conrad*} (for the case $n=p$).

\item \textbf{Permutations}. The basics of this subject are extremely
important throughout mathematics; in particular, the notion of the
\textbf{sign} of a permutation is needed for the study of determinants of
matrices and of signed volumes in geometry. Concerning this notion, see
\cite[Appendix B]{Strickland} for a quick \textquotedblleft
from-scratch\textquotedblright\ introduction, and \cite[\textquotedblleft The
sign of a permutation\textquotedblright]{Conrad*} for an approach using group theory.

You can learn more about permutations from a textbook on enumerative
combinatorics (such as \cite{Loehr-BC}) or on permutation puzzles (such as
\cite{Bump02}, \cite{Joyner08} or \cite{Mulhol16}). The latter texts focus on
permutation-related puzzles such as Rubik's cube and the 15-game; but in doing
so, they motivate and introduce the properties of permutations and even the
basics of group theory.

\item \textbf{Determinants}. Determinants belong equally to combinatorics,
abstract algebra and linear algebra. As a consequence, none of these courses
covers them well; usually, only the most basic properties are stated, and
their proofs outlined as best. Strickland, in \cite[\S 12 and Appendix
B]{Strickland}, gives a short but rigorous and honest treatment of the
fundamentals. Other good introductions are found in Day's \cite[Chapter
6]{Day}, Mate's \cite{Mate14}, Walker's \cite[\S 5.4]{Walker87}, and Pinkham's
\cite[Chapter 11]{Pinkha15} (but they all limit themselves to the basics). In
\cite[Chapter 6]{detnotes}, I prove a variety of results (including some
nonstandard ones) in much detail (probably too much). The \textquotedblleft
bible\textquotedblright\ on determinants is \cite{MuiMet60} (and, for the
particularly bold, \cite{Muir} is a goldmine of forgotten results).

\href{https://mathoverflow.net/questions/35988/why-were-matrix-determinants-once-such-a-big-deal/}{The
determinant used to be one of the central notions in mathematics}, and even
predated the notion of matrices!
(\href{https://www-history.mcs.st-and.ac.uk/HistTopics/Matrices_and_determinants.html}{Determinants
first appear in a 1693 letter of Leibniz}. The word \textquotedblleft
matrix\textquotedblright\ was coined in 1850 by J. J. Sylvester, as a
\textquotedblleft womb\textquotedblright\ (this is what \textquotedblleft
matrix\textquotedblright\ means in Latin) from which determinants spring out.)
Determinants have become less central since, thanks to abstract algebra
incorporating many ideas that were first stated in their language.
Nevertheless, they are still one of the strongest tools on the algebraic side
of mathematics.

\item \textbf{Multivariate polynomials} (i.e., polynomials in several
variables). This is a highly useful topic, but it is rarely done justice in
one-semester courses on algebra, since it takes some amount of notational
work. For example, $3+2x+3x^{2}y+6y^{2}$ is a polynomial in the two variables
$x,y$ over the ring $\mathbb{Q}$. To define such polynomials rigorously, we
recall that we defined FPSs in one variable as infinite sequences of elements
of our ring $\mathbb{K}$. Likewise, we can define FPSs in two variables as
infinite \textquotedblleft$2$-dimensional sequences\textquotedblright\ of
elements of $\mathbb{K}$, where a \textquotedblleft$2$-dimensional
sequence\textquotedblright\ is a family $\left(  a_{i,j}\right)  _{\left(
i,j\right)  \in\mathbb{N}^{2}}$ of elements of $\mathbb{K}$ indexed by pairs
of nonnegative integers.\footnote{You can think of such a \textquotedblleft%
$2$-dimensional sequence\textquotedblright\ as an infinite table%
\[%
\begin{array}
[c]{cccc}%
a_{0,0} & a_{0,1} & a_{0,2} & \cdots\\
a_{1,0} & a_{1,1} & a_{1,2} & \cdots\\
a_{2,0} & a_{2,1} & a_{2,2} & \cdots\\
\vdots & \vdots & \vdots & \ddots
\end{array}
\ \ .
\]
} Such an FPS is called a polynomial if the family has only finitely many
nonzero entries. Then, $x$ is defined to be the family $\left(  a_{i,j}%
\right)  _{\left(  i,j\right)  \in\mathbb{N}^{2}}$ whose only nonzero entry is
$a_{1,0}=1$, and $y$ is defined to be the family $\left(  a_{i,j}\right)
_{\left(  i,j\right)  \in\mathbb{N}^{2}}$ whose only nonzero entry is
$a_{0,1}=1$. The theory of polynomials (and FPSs) in two variables can thus be
built up in analogy to our 1-variable theory; details can be found in
\cite[Chapter III, \S 5]{Hungerford-03}, \cite[\S 7.16]{Loehr-BC},
\cite[\S 30.2]{GalQua18} and \cite[\S I.8]{AmaEsc05}.

Eventually, the theory of multivariate polynomials becomes more complicated
than the 1-variable theory. The first point where it significantly differs is
division with remainder: There is no analogue of Theorem \ref{thm.pol.quorem};
instead there is a rich and highly useful theory of \textit{Gr\"{o}bner bases}
(\cite{CoLiOs15}). Also, a polynomial $f$ in two variables $x$ and $y$ can be
evaluated at two elements $u$ and $v$ of a $\mathbb{K}$-algebra $U$ only if
$u$ and $v$ commute (that is, $uv=vu$).

\item \textbf{Galois theory} (i.e., the theory of field extensions and roots
of polynomials). This is the study of \textit{field extensions}. In the
simplest case, this is about how a field $\mathbb{K}$ grows when a root of
some polynomial is adjoined to it. We saw a small bit of it when we
constructed $\mathbb{C}$, or finite fields of size $p^{2}$, by adjoining roots
of quadratic polynomials; but the game can be played in greater generality.
When a field $\mathbb{K}$ is a subring of a field $\mathbb{L}$, the pair
$\left(  \mathbb{K},\mathbb{L}\right)  $ is called a \textit{field extension}
(and is often written as $\mathbb{L}/\mathbb{K}$, a notation that has nothing
to do with quotients despite its look). The Galois theory proper studies the
$\mathbb{K}$-algebra isomorphisms from $\mathbb{L}$ to $\mathbb{L}$. (For
example, there are two $\mathbb{R}$-algebra homomorphisms from $\mathbb{C}$ to
$\mathbb{C}$; one of them is simply the identity map, while the other is the
conjugation map $z\mapsto\overline{z}$. The dimension of the $\mathbb{R}%
$-vector space $\mathbb{C}$ also happens to be $2$. Coincidence?)

A one-semester class on Galois theory usually covers only the very basics, but
undergraduate-level introductions to the theory exist. Two of them are
\cite{Stewar15} and \cite{Tignol}. Some algebra texts centered on Galois
theory are \cite{Armstrong}, \cite{Goodman} and \cite{Bosch}.

\item \textbf{Finite fields} (also known as Galois fields). We have started
exploring them by defining the ones of size $p$ and $p^{2}$ (for $p$ prime).
But as I already mentioned, there exists a finite field of any prime-power
size, and it is unique up to isomorphism. Most algebra textbooks that go
deeper than a one-semester course will prove this and perhaps say more --
Galois theory texts in particular. But there are also books specifically
devoted to finite fields, such as \cite{Wan11} and \cite{LidNie97}.
\end{itemize}

Then, there are deeper topics such as representation theory, algebraic number
theory and algebraic geometry, which we have grazed at best (see, e.g.,
\cite{Dummit-Foote}, \cite{Knapp1} and \cite{Knapp2}).

\subsection{\label{sect.epilogue-19f.eqns}A quick history of algebraic
equations}

Algebraic equations (i.e., equations of the form $P\left(  x\right)  =0$,
where $P$ is a given polynomial) were the historical origin of much of
abstract algebra. Thus, I am going to say a few words about them, even though
they eventually lead into topics (like Galois theory and algebraic geometry)
which have not been the subject of this course.

The Babylonians knew
\href{https://en.wikipedia.org/wiki/Quadratic_formula#Historical_development}{the
quadratic formula}: The solutions to a quadratic equation $ax^{2}+bx+c=0$
(say, over $\mathbb{C}$) are $x=\dfrac{-b\pm\sqrt{b^{2}-4ac}}{2a}$. (Of
course, the Babylonians did not know $\mathbb{C}$; even the negative numbers
\href{https://en.wikipedia.org/wiki/Negative_number}{only appeared during the
Chinese Han Dynasty} and took a long time to propagate into the West. But the
idea was there.)

The question of solving cubic equations ($ax^{3}+bx^{2}+cx+d=0$) and equations
of higher degree has puzzled people for centuries, until the case of the cubic
was solved by Scipione del Ferro and Niccol\`{o} Tartaglia (and written up by
Girolamo Cardano) in the early 16th Century. The history of their solution has
been amply discussed and dramatized in the literature (even over-dramatized,
as if the truth wasn't interesting enough!); see the lecture slides%
\[
\text{{\small \url{https://cs.uwaterloo.ca/~cbruni/CO480Resources/lectures/CO480MayAug2017/lecture11.pdf}}%
}%
\]
for a highly readable chronology, and see \cite{Rothma15} for some pop-science
claims debunked (including some from the slides).

The formula they found is surprising in its practical uselessness. Consider
the case of a \textquotedblleft depressed\textquotedblright\ cubic polynomial;
this is a polynomial of the form $x^{3}+px+q$ (so the coefficient of $x^{2}$
is $0$). In this particular case, the Cardano formula\footnote{The attentive
reader will have noticed that this is another instance of an object named for
its first expositor, not for its original discoverer. There is a moral here.}
says that the roots of this polynomial are%
\[
\sqrt[3]{-\dfrac{q}{2}+\sqrt{\dfrac{q^{2}}{4}+\dfrac{p^{3}}{27}}}%
+\sqrt[3]{-\dfrac{q}{2}-\sqrt{\dfrac{q^{2}}{4}+\dfrac{p^{3}}{27}}}.
\]
The cubic roots here are understood to be \textit{complex} cubic
roots\footnote{If $z\in\mathbb{C}$ is a complex number, then the
\textit{complex cubic roots} of $z$ are the complex numbers $w$ satisfying
$w^{3}=z$. There are three of them (unless $z=0$), and (in terms of the Argand
diagram) they form the vertices of an equilateral triangle with center at
$0$.}, which is why you get not $1$ but $3$ roots\footnote{Actually, you get
$9$ roots if you are not careful (because there are two $\sqrt[3]{}$ signs in
the formula). When picking complex cubic roots of $-\dfrac{q}{2}+\sqrt
{\dfrac{q^{2}}{4}+\dfrac{p^{3}}{27}}$ and $-\dfrac{q}{2}-\sqrt{\dfrac{q^{2}%
}{4}+\dfrac{p^{3}}{27}}$, you should choose not all $3\cdot3=9$ combinations,
but only the ones whose product is $-\dfrac{1}{3}p$.}. Note that $\sqrt
{\dfrac{q^{2}}{4}+\dfrac{p^{3}}{27}}$ may be non-real, even if the polynomial
has a real root! Ironically, this happens precisely in the case when the cubic
polynomial has $3$ real roots (which is the maximum possible number); thus, it
qualifies as an explicit formula only if we tolerate the presence of cubic
roots of complex numbers inside it.

Worse yet: Even if the Cardano formula does not involve any non-real numbers,
it is still far from the expression you might be looking for. For instance,
let us try to find the roots of the polynomial $x^{3}+3x-4$ using this
formula. By plugging in $p=3$ and $q=-4$, we get the expression%
\[
\sqrt[3]{2+\sqrt{4+1}}+\sqrt[3]{2-\sqrt{4+1}}=\sqrt[3]{2+\sqrt{5}}%
+\sqrt[3]{2-\sqrt{5}}%
\]
for its roots. To find the real root, we take the usual (i.e., non-complex)
cubic roots. Thus we conclude that $\sqrt[3]{2+\sqrt{5}}+\sqrt[3]{2-\sqrt{5}}$
is a root of the polynomial $x^{3}+3x-4$. But a bit of numerical computation
suggests that this root is actually the number $1$. And this is indeed the
case, as you can easily verify by evaluating the polynomial $x^{3}+3x-4$ at
$1$; but how could you have guessed this from the cube-root formula? So the
Cardano formula gave us a complicated expression for the number $1$, and no
way to simplify it!\footnote{Actually, you can prove that $\sqrt[3]{2+\sqrt
{5}}+\sqrt[3]{2-\sqrt{5}}=1$ by showing that $\sqrt[3]{2+\sqrt{5}}=\dfrac
{1}{2}\left(  1+\sqrt{5}\right)  $ and $\sqrt[3]{2-\sqrt{5}}=\dfrac{1}%
{2}\left(  1-\sqrt{5}\right)  $. But how would you have found these two
identities?}

Nevertheless, the discovery of the Cardano formula has proven highly useful,
as it forced the introduction of complex numbers! While complex numbers
already appear as solutions of \textbf{quadratic} equations, this has not
convinced anyone to define them, because everyone would content themselves
with the answer \textquotedblleft no solutions\textquotedblright. But cubic
equations like $x^{3}-x+1=0$ tease you with their $3$ real roots which,
nevertheless, cannot be expressed through $\sqrt[3]{}$ and $\sqrt{}$ signs
until complex numbers are defined. Thus, it was the cubic equation that made
complex numbers accepted.\footnote{There may be a moral here as well.}

Cardano went on and
\href{https://en.wikipedia.org/wiki/Quartic_function#Solving_a_quartic_equation}{solved
the general quartic equation} $ax^{4}+bx^{3}+cx^{2}+dx+e=0$ with an even
longer formula. The proofs of these formulas have remained tricky and
computational (see, e.g., \cite[Week 1]{Armstrong} for the case of the cubic),
even as some of the tricks have since been explained using abstract algebra.

For three more centuries, the quintic equation $ax^{5}+bx^{4}+cx^{3}%
+dx^{2}+ex+f=0$ stumped mathematicians. Finally, in 1824, Niels Henrik Abel
(based on work by Paolo Ruffini) showed that a general formula for the roots
of a degree-$5$ polynomial (using $+$, $-$, $\cdot$, $/$ and $\sqrt{}$ signs
only) does not exist (not even an impractical one like Cardano's). A real
understanding of the reasons behind this emerged when \'{E}variste Galois
introduced the notion of groups, and what later became known as
\href{https://en.wikipedia.org/wiki/Galois_theory}{Galois groups}, in 1832.
This formed the beginning of Galois theory (for which see the references in
Section \ref{sect.epilogue-19f.more}).

From a modern viewpoint, the question of finding explicit formulas for roots
of polynomials appears arbitrary and inconsequential. After all, why exactly
are we allowing $\sqrt{}$ signs in these formulas, if computing $\sqrt[n]{a}$
is already tantamount to finding a root of a polynomial (namely, $x^{n}-a$) ?
Why do some roots count as explicit, but the ones we are looking for don't? In
the case of quadratic polynomials, at least the formula ends up quite useful;
for higher degrees, this is almost never the case. Expressions involving third
(and higher) roots are hard to work with (recall our difficulties recognizing
$\sqrt[3]{2+\sqrt{5}}+\sqrt[3]{2-\sqrt{5}}$ as $1$!), and if one wants
numerical results,
\href{https://en.wikipedia.org/wiki/Root-finding_algorithm}{the standard
numerical methods (such as Newton's)} are much simpler. Algebraists generally
want to compute precisely, but they don't care for the arbitrary limitations
of $+$, $-$, $\cdot$, $/$ and $\sqrt{}$ signs; thus, much of the time, they
end up formally adjoining their roots (using the $\mathbb{K}\left[  x\right]
/\mathbf{b}$ construction in Theorem \ref{thm.quot.ring/w.basis-of-quot}) and
computing in the resulting rings. Thus, despite giving birth to some of the
algebra we know and love, Cardano's formulas eventually became historical footnotes.

\subsection{Irreducible polynomials over finite fields}

I have told you that there exists a field of any prime-power size; but I only
showed this for the sizes $p$ and $p^{2}$ (where $p$ is a prime). Let me go
one step further and prove this for size $p^{3}$ as well, just to illustrate
the use of the $\mathbb{K}\left[  x\right]  /\mathbf{b}$ construction from
Theorem \ref{thm.quot.ring/w.basis-of-quot}. More generally, I claim the following:

\begin{lemma}
\label{lem.epilogue-19f.finf-23}Let $\mathbb{F}$ be a finite field.

\textbf{(a)} There exists an irreducible polynomial $\mathbf{a}\in
\mathbb{F}\left[  x\right]  $ of degree $2$.

\textbf{(b)} There exists an irreducible polynomial $\mathbf{a}\in
\mathbb{F}\left[  x\right]  $ of degree $3$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.epilogue-19f.finf-23} (sketched).]If $n\in\mathbb{N}%
$, then a polynomial $\mathbf{a}\in\mathbb{F}\left[  x\right]  $ is said to be
\textit{monic of degree }$n$ if and only if $\mathbf{a}\in\mathbb{F}\left[
x\right]  _{\leq n}$ and $\left[  x^{n}\right]  \mathbf{a}=1$. Thus, a
polynomial is monic of degree $n$ if and only if it can be written in the form
$x^{n}+a_{n-1}x^{n-1}+a_{n-2}x^{n-2}+\cdots+a_{0}x^{0}$ for some $a_{0}%
,a_{1},\ldots,a_{n-1}\in\mathbb{F}$. In particular, the monic polynomials of
degree $1$ have the form $x+b$ for $b\in\mathbb{F}$, while the monic
polynomials of degree $2$ have the form $x^{2}+bx+c$ for $b,c\in\mathbb{F}$.
It is clear that for each $n\in\mathbb{N}$, we have%
\begin{equation}
\left\vert \left\{  \text{monic polynomials }\mathbf{a}\in\mathbb{F}\left[
x\right]  \text{ of degree }n\right\}  \right\vert =\left\vert \mathbb{F}%
\right\vert ^{n} \label{pf.lem.epilogue-19f.finf-23.num-mon}%
\end{equation}
(because in order to choose a monic polynomial $x^{n}+a_{n-1}x^{n-1}%
+a_{n-2}x^{n-2}+\cdots+a_{0}x^{0}$, we just have to choose the $n$
coefficients $a_{0},a_{1},\ldots,a_{n-1}$, and we have $\left\vert
\mathbb{F}\right\vert $ options for each of these coefficients).

It is easy to see that if $n\in\mathbb{N}$ and if $\mathbf{a}\in
\mathbb{F}\left[  x\right]  $ has degree $n$, then
\begin{equation}
\text{there exists some }\lambda\in\mathbb{F}\text{ such that }\lambda
\mathbf{a}\text{ is monic of degree }n.
\label{pf.lem.epilogue-19f.finf-23.scale}%
\end{equation}
(Indeed, it suffices to choose $\lambda=\dfrac{1}{\left[  x^{n}\right]
\mathbf{a}}$; then, $\left[  x^{n}\right]  \left(  \lambda\mathbf{a}\right)
=1$, and therefore $\lambda\mathbf{a}$ is monic of degree $n$.)

\textbf{(a)} Assume the contrary. Thus, there exists no irreducible polynomial
$\mathbf{a}\in\mathbb{F}\left[  x\right]  $ of degree $2$.

As a consequence, I claim the following:

\begin{statement}
\textit{Claim 1:} Each monic polynomial $\mathbf{a}\in\mathbb{F}\left[
x\right]  $ of degree $2$ has the form $\left(  x+b\right)  \left(
x+c\right)  $ for some $b,c\in\mathbb{F}$.
\end{statement}

[\textit{Proof of Claim 1:} Let $\mathbf{a}\in\mathbb{F}\left[  x\right]  $ be
a monic polynomial of degree $2$. Then, $\left[  x^{2}\right]  \mathbf{a}=1$.
But we know that $\mathbf{a}$ is not irreducible (since we assumed that there
exists no irreducible polynomial $\mathbf{a}\in\mathbb{F}\left[  x\right]  $
of degree $2$). In other words, $\mathbf{a}$ can be written in the form
$\mathbf{a}=\mathbf{bc}$ for two polynomials $\mathbf{b}$ and $\mathbf{c}$
with $\deg\mathbf{b}>0$ and $\deg\mathbf{c}>0$. Consider these $\mathbf{b}$
and $\mathbf{c}$. From $\mathbf{a}=\mathbf{bc}$, we obtain $\deg
\mathbf{a}=\deg\left(  \mathbf{bc}\right)  =\deg\mathbf{b}+\deg\mathbf{c}$ and
thus $\deg\mathbf{b}+\deg\mathbf{c}=\deg\mathbf{a}=2$. In view of
$\deg\mathbf{b}>0$ and $\deg\mathbf{c}>0$, this leads to $\deg\mathbf{b}=1$
and $\deg\mathbf{c}=1$. Hence, (\ref{pf.lem.epilogue-19f.finf-23.scale})
(applied to $1$ and $\mathbf{b}$ instead of $n$ and $\mathbf{a}$) shows that
there exists some $\lambda\in\mathbb{F}$ such that $\lambda\mathbf{b}$ is
monic of degree $1$. Similarly, there exists some $\mu\in\mathbb{F}$ such that
$\mu\mathbf{c}$ is monic of degree $1$. Consider these $\lambda$ and $\mu$.
Now, $\lambda\mathbf{b}=x+b$ for some $b\in\mathbb{F}$ (since $\lambda
\mathbf{b}$ is monic of degree $1$), and $\mu\mathbf{c}=x+c$ for some
$c\in\mathbb{F}$ (similarly). Consider these $b$ and $c$. Now,
\[
\lambda\mu\underbrace{\mathbf{a}}_{=\mathbf{bc}}=\lambda\mu\mathbf{bc}%
=\underbrace{\left(  \lambda\mathbf{b}\right)  }_{=x+b}\underbrace{\left(
\mu\mathbf{c}\right)  }_{=x+c}=\left(  x+b\right)  \left(  x+c\right)  .
\]
Comparing the coefficients of $x^{2}$ on both sides of this equality, we find
$\lambda\mu=1$ (because the coefficient of $x^{2}$ in $\lambda\mu\mathbf{a}$
is $\lambda\mu\underbrace{\left[  x^{2}\right]  \mathbf{a}}_{=1}=\lambda\mu$,
but the coefficient of $x^{2}$ in $\left(  x+b\right)  \left(  x+c\right)  $
is $1$). Thus, $\lambda\mu\mathbf{a}=\left(  x+b\right)  \left(  x+c\right)  $
rewrites as $\mathbf{a}=\left(  x+b\right)  \left(  x+c\right)  $. Hence, we
have written our polynomial $\mathbf{a}$ in the form $\left(  x+b\right)
\left(  x+c\right)  $ for some $b,c\in\mathbb{F}$. This proves Claim 1.]

Claim 1 shows that the map%
\begin{align*}
\mathbb{F}\times\mathbb{F}  &  \rightarrow\left\{  \text{monic polynomials
}\mathbf{a}\in\mathbb{F}\left[  x\right]  \text{ of degree }2\right\}  ,\\
\left(  b,c\right)   &  \mapsto\left(  x+b\right)  \left(  x+c\right)
\end{align*}
is surjective. But this is a map between two finite sets of equal sizes
(because $\left\vert \mathbb{F}\times\mathbb{F}\right\vert =\left\vert
\mathbb{F}\right\vert ^{2}$, but (\ref{pf.lem.epilogue-19f.finf-23.num-mon})
(applied to $n=2$) shows that \newline$\left\vert \left\{  \text{monic
polynomials }\mathbf{a}\in\mathbb{F}\left[  x\right]  \text{ of degree
}2\right\}  \right\vert =\left\vert \mathbb{F}\right\vert ^{2}$ as well).
Thus, the Pigeonhole Principle for Surjections shows that this map is
bijective. Thus, in particular, this map is injective. But this is absurd,
because it sends the two different pairs $\left(  0,1\right)  $ and $\left(
1,0\right)  $ to one and the same polynomial $\left(  x+0\right)  \left(
x+1\right)  =\left(  x+1\right)  \left(  x+0\right)  $. This contradiction
shows that our assumption was wrong. Hence, Lemma
\ref{lem.epilogue-19f.finf-23} \textbf{(a)} is proven.

\textbf{(b)} This is similar to our proof of Lemma
\ref{lem.epilogue-19f.finf-23} \textbf{(a)}, with just one more little twist.
Here are the details:

\begin{fineprint}
Assume the contrary. Thus, there exists no irreducible polynomial
$\mathbf{a}\in\mathbb{F}\left[  x\right]  $ of degree $3$.

As a consequence, I claim the following:

\begin{statement}
\textit{Claim 2:} Each monic polynomial $\mathbf{a}\in\mathbb{F}\left[
x\right]  $ of degree $3$ has the form $\left(  x+b\right)  \left(
x^{2}+cx+d\right)  $ for some $b,c,d\in\mathbb{F}$.
\end{statement}

[\textit{Proof of Claim 2:} Let $\mathbf{a}\in\mathbb{F}\left[  x\right]  $ be
a monic polynomial of degree $3$. Then, $\left[  x^{3}\right]  \mathbf{a}=1$.
But we know that $\mathbf{a}$ is not irreducible (since we assumed that there
exists no irreducible polynomial $\mathbf{a}\in\mathbb{F}\left[  x\right]  $
of degree $3$). In other words, $\mathbf{a}$ can be written in the form
$\mathbf{a}=\mathbf{bc}$ for two polynomials $\mathbf{b}$ and $\mathbf{c}$
with $\deg\mathbf{b}>0$ and $\deg\mathbf{c}>0$. Consider these $\mathbf{b}$
and $\mathbf{c}$. From $\mathbf{a}=\mathbf{bc}$, we obtain $\deg
\mathbf{a}=\deg\left(  \mathbf{bc}\right)  =\deg\mathbf{b}+\deg\mathbf{c}$ and
thus $\deg\mathbf{b}+\deg\mathbf{c}=\deg\mathbf{a}=3$. In view of
$\deg\mathbf{b}>0$ and $\deg\mathbf{c}>0$, this shows that we have
\textbf{either }$\left(  \deg\mathbf{b}=1\text{ and }\deg\mathbf{c}=2\right)
$ \textbf{or} $\left(  \deg\mathbf{b}=2\text{ and }\deg\mathbf{c}=1\right)  $.
We WLOG assume that we are in the first of these two cases (since otherwise,
we can simply swap $\mathbf{b}$ with $\mathbf{c}$). Thus, $\deg\mathbf{b}=1$
and $\deg\mathbf{c}=2$. Hence, (\ref{pf.lem.epilogue-19f.finf-23.scale})
(applied to $1$ and $\mathbf{b}$ instead of $n$ and $\mathbf{a}$) shows that
there exists some $\lambda\in\mathbb{F}$ such that $\lambda\mathbf{b}$ is
monic of degree $1$. Similarly, there exists some $\mu\in\mathbb{F}$ such that
$\mu\mathbf{c}$ is monic of degree $2$. Consider these $\lambda$ and $\mu$.
Now, $\lambda\mathbf{b}=x+b$ for some $b\in\mathbb{F}$ (since $\lambda
\mathbf{b}$ is monic of degree $1$), and $\mu\mathbf{c}=x^{2}+cx+d$ for some
$c,d\in\mathbb{F}$ (since $\mu\mathbf{c}$ is monic of degree $2$). Consider
these $b,c,d$. Now,
\[
\lambda\mu\underbrace{\mathbf{a}}_{=\mathbf{bc}}=\lambda\mu\mathbf{bc}%
=\underbrace{\left(  \lambda\mathbf{b}\right)  }_{=x+b}\underbrace{\left(
\mu\mathbf{c}\right)  }_{=x^{2}+cx+d}=\left(  x+b\right)  \left(
x^{2}+cx+d\right)  .
\]
Comparing the coefficients of $x^{3}$ on both sides of this equality, we find
$\lambda\mu=1$ (because the coefficient of $x^{3}$ in $\lambda\mu\mathbf{a}$
is $\lambda\mu\underbrace{\left[  x^{3}\right]  \mathbf{a}}_{=1}=\lambda\mu$,
but the coefficient of $x^{3}$ in $\left(  x+b\right)  \left(  x^{2}%
+cx+d\right)  $ is $1$). Thus, $\lambda\mu\mathbf{a}=\left(  x+b\right)
\left(  x^{2}+cx+d\right)  $ rewrites as $\mathbf{a}=\left(  x+b\right)
\left(  x^{2}+cx+d\right)  $. Hence, we have written our polynomial
$\mathbf{a}$ in the form $\left(  x+b\right)  \left(  x^{2}+cx+d\right)  $ for
some $b,c,d\in\mathbb{F}$. This proves Claim 2.]

Claim 2 shows that the map%
\begin{align*}
\mathbb{F}\times\mathbb{F}\times\mathbb{F}  &  \rightarrow\left\{  \text{monic
polynomials }\mathbf{a}\in\mathbb{F}\left[  x\right]  \text{ of degree
}3\right\}  ,\\
\left(  b,c,d\right)   &  \mapsto\left(  x+b\right)  \left(  x^{2}%
+cx+d\right)
\end{align*}
is surjective. But this is a map between two finite sets of equal sizes
(because $\left\vert \mathbb{F}\times\mathbb{F}\times\mathbb{F}\right\vert
=\left\vert \mathbb{F}\right\vert ^{3}$, but
(\ref{pf.lem.epilogue-19f.finf-23.num-mon}) (applied to $n=3$) shows that
$\left\vert \left\{  \text{monic polynomials }\mathbf{a}\in\mathbb{F}\left[
x\right]  \text{ of degree }3\right\}  \right\vert =\left\vert \mathbb{F}%
\right\vert ^{3}$ as well). Thus, the Pigeonhole Principle for Surjections
shows that this map is bijective. Thus, in particular, this map is injective.
But this is absurd, because it sends the two different triples $\left(
0,2,1\right)  $ and $\left(  1,1,0\right)  $ to one and the same polynomial
$\left(  x+0\right)  \left(  x^{2}+2x+1\right)  =\left(  x+1\right)  \left(
x^{2}+1x+0\right)  $. This contradiction shows that our assumption was wrong.
Hence, Lemma \ref{lem.epilogue-19f.finf-23} \textbf{(b)} is proven.
\end{fineprint}
\end{proof}

Note that we could not use the same argument to prove the existence of an
irreducible polynomial $\mathbf{a}\in\mathbb{F}\left[  x\right]  $ of degree
$4$. Indeed, if we tried, we would have to deal with the two substantially
different possibilities $\left(  \deg\mathbf{b}=1\text{ and }\deg
\mathbf{c}=3\right)  $ and $\left(  \deg\mathbf{b}=2\text{ and }\deg
\mathbf{c}=2\right)  $, which would prevent us from obtaining a surjective map
from $\mathbb{F}\times\mathbb{F}\times\mathbb{F}\times\mathbb{F}$ to $\left\{
\text{monic polynomials }\mathbf{a}\in\mathbb{F}\left[  x\right]  \text{ of
degree }4\right\}  $.

\begin{corollary}
\label{cor.epilogue-19f.finf-23}Let $\mathbb{F}$ be a finite field, and let
$q=\left\vert \mathbb{F}\right\vert $. Then, there exist finite fields of
sizes $q^{2}$ and $q^{3}$.
\end{corollary}

\begin{proof}
[Proof of Corollary \ref{cor.epilogue-19f.finf-23} (sketched).]Lemma
\ref{lem.epilogue-19f.finf-23} \textbf{(a)} shows that there exists an
irreducible polynomial $\mathbf{a}\in\mathbb{F}\left[  x\right]  $ of degree
$2$. Consider this $\mathbf{a}$. Then, Theorem \ref{thm.quot.field/w.irred}
shows that the ring $\mathbb{F}\left[  x\right]  /\mathbf{a}$ is a field.
Moreover, $\mathbf{a}$ is a monic polynomial of degree $2$; thus,
$\mathbf{a}\in\mathbb{F}\left[  x\right]  _{\leq2}$, and the coefficient
$\left[  x^{2}\right]  \mathbf{a}=1$ is invertible. Hence, Theorem
\ref{thm.quot.ring/w.basis-of-quot} \textbf{(a)} (applied to $\mathbb{K}%
=\mathbb{F}$, $m=2$ and $\mathbf{b}=\mathbf{a}$) shows that each element of
$\mathbb{F}\left[  x\right]  /\mathbf{a}$ can be uniquely written in the form%
\[
\lambda_{0}\left[  x^{0}\right]  _{\mathbf{a}}+\lambda_{1}\left[
x^{1}\right]  _{\mathbf{a}}\ \ \ \ \ \ \ \ \ \ \text{with }\lambda_{0}%
,\lambda_{1}\in\mathbb{F}.
\]
Therefore, the number of elements of $\mathbb{F}\left[  x\right]  /\mathbf{a}$
is $\left\vert \mathbb{F}\right\vert ^{2}$ (since there are $\left\vert
\mathbb{F}\right\vert $ many choices for $\lambda_{0}$, and $\left\vert
\mathbb{F}\right\vert $ many choices for $\lambda_{1}$). In other words, the
field $\mathbb{F}\left[  x\right]  /\mathbf{a}$ has size $\left\vert
\mathbb{F}\right\vert ^{2}$. In other words, the field $\mathbb{F}\left[
x\right]  /\mathbf{a}$ has size $q^{2}$ (since $\left\vert \mathbb{F}%
\right\vert =q$). Thus, there exists a finite field of size $q^{2}$.

A similar argument (using Lemma \ref{lem.epilogue-19f.finf-23} \textbf{(b)}
instead of Lemma \ref{lem.epilogue-19f.finf-23} \textbf{(a)}) shows that there
exists a finite field of size $q^{3}$. Thus, Corollary
\ref{cor.epilogue-19f.finf-23} is proven.
\end{proof}

Now, if $p$ is a prime, then Corollary \ref{cor.epilogue-19f.finf-23} (applied
to $\mathbb{F}=\mathbb{Z}/p$ and $q=p$) shows that there exist finite fields
of sizes $p^{2}$ and $p^{3}$. Moreover, by applying Corollary
\ref{cor.epilogue-19f.finf-23} twice, we can see that there exists a finite
field of size $\left(  p^{2}\right)  ^{2}=p^{4}$. However, this method fails
at proving that there exists a finite field of size $p^{5}$.

For a proper proof of the existence of a finite field of size $p^{n}$ (for any
prime $p$ and integer $n\geq1$), see \cite[Theorem 2.5]{LidNie97},
\cite[Theorem 9.14]{Knapp1}, \cite[Exercise 12.126]{Loehr-BC}, \cite[Theorem
2.2]{Conrad-FF}, \cite[Corollary 11.26]{Hungerford}, \cite[Chapter V,
Proposition 5.6]{Hungerford-03}, \cite[Theorem 19.3]{Stewar15}, \cite[Theorem
6.2.11]{Walker87} or \cite[14.5.1]{Escofi01} or \cite{fpnexists}. However,
each of these proofs, except for the one in \cite{fpnexists}, uses at least
something we have not seen so far. (The proof in \cite{fpnexists}, on the
other hand, is fairly long.)

\bigskip

\begin{noncompile}
TODO: Further sections:

\begin{itemize}
\item Sums of algebraic integers.

Nonconstructive proof using linear algebra.

Constructive proof for $\alpha+\sqrt{u}$ by writing $P\left(  x-y\right)
P\left(  x+y\right)  $ as $R\left(  x,y^{2}\right)  $ and then setting
$y=\sqrt{u}$. (Needs multivariate polynomials, or at least $\left(
\mathbb{Q}\left[  x\right]  \right)  \left[  y\right]  $.)

\item If $p$ is prime, then $p\mid1^{k}+2^{k}+\cdots+\left(  p-1\right)  ^{k}$
for all $k\in\left\{  1,2,\ldots,p-2\right\}  $.
\end{itemize}
\end{noncompile}

\section{Solutions to the exercises}

\subsection{Solution to Exercise \ref{exe.ent.div.aabs}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.div.aabs}.]The definition of $\left\vert
a\right\vert $ shows that $\left\vert a\right\vert $ equals either $a$ or
$-a$. In other words, $\left\vert a\right\vert $ equals either $1a$ or
$\left(  -1\right)  a$. In other words, $\left\vert a\right\vert =qa$ for some
$q\in\left\{  1,-1\right\}  $. Consider this $q$. Clearly, $q$ is an integer.
Now, from $\left\vert a\right\vert =qa=aq$, we conclude that $a\mid\left\vert
a\right\vert $ (since $q$ is an integer). This solves Exercise
\ref{exe.ent.div.aabs} \textbf{(a)}.

\textbf{(b)} From $q\in\left\{  1,-1\right\}  $, we obtain $q^{2}\in\left\{
1^{2},\left(  -1\right)  ^{2}\right\}  =\left\{  1,1\right\}  =\left\{
1\right\}  $, so that $q^{2}=1$. Now, multiplying the equality $\left\vert
a\right\vert =qa$ by $q$, we obtain $q\left\vert a\right\vert =\underbrace{qq}%
_{=q^{2}=1}a=a$. Hence, $a=q\left\vert a\right\vert =\left\vert a\right\vert
\cdot q$. Thus, $\left\vert a\right\vert \mid a$ (since $q$ is an integer).
This solves Exercise \ref{exe.ent.div.aabs} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.div.abba}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.div.abba}.]We are in one of the following
two cases:

\textit{Case 1:} We have $b\neq0$.

\textit{Case 2:} We have $b=0$.

Let us first consider Case 1. In this case, we have $b\neq0$. Thus,
Proposition \ref{prop.ent.div.1} \textbf{(b)} yields $\left\vert a\right\vert
\leq\left\vert b\right\vert $ (since $a\mid b$).

We have $a\mid b$. In other words, there exists an integer $c$ such that
$b=ac$. Consider this $c$. If we had $a=0$, then we would have
$b=\underbrace{a}_{=0}c=0$, which would contradict $b\neq0$. Thus, we cannot
have $a=0$. Hence, $a\neq0$. Thus, Proposition \ref{prop.ent.div.1}
\textbf{(b)} (applied to $b$ and $a$ instead of $a$ and $b$) yields
$\left\vert b\right\vert \leq\left\vert a\right\vert $ (since $b\mid a$).
Combining this with $\left\vert a\right\vert \leq\left\vert b\right\vert $, we
obtain $\left\vert a\right\vert =\left\vert b\right\vert $. Thus, Exercise
\ref{exe.ent.div.abba} is solved in Case 1.

Let us now consider Case 2. In this case, we have $b=0$. But we have $b\mid
a$. In other words, there exists an integer $c$ such that $a=bc$. Consider
this $c$. Hence, $a=\underbrace{b}_{=0}c=0c=0=b$ (since $b=0$). Thus,
$\left\vert a\right\vert =\left\vert b\right\vert $. Hence, Exercise
\ref{exe.ent.div.abba} is solved in Case 2.

Now, we have solved Exercise \ref{exe.ent.div.abba} in both Cases 1 and 2.
Hence, Exercise \ref{exe.ent.div.abba} always holds.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.div.acbc}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.div.acbc}.]$\Longrightarrow:$ Assume that
$a\mid b$ holds. We must prove that $ac\mid bc$.

It is easy to do this straight from the definition of divisibility, but here
is a shorter argument: Proposition \ref{prop.ent.div.2} \textbf{(a)} (applied
to $c$ instead of $a$) yields $c\mid c$. Also, $a\mid b$. Hence, Proposition
\ref{prop.ent.div.2} \textbf{(c)} (applied to $a_{1}=a$, $b_{1}=b$, $a_{2}=c$
and $b_{2}=c$) yields $ac\mid bc$. This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Exercise
\ref{exe.ent.div.acbc}.

$\Longleftarrow:$ Assume that $ac\mid bc$ holds. We must prove that $a\mid b$.

We have $ac\mid bc$. In other words, there exists an integer $d$ such that
$bc=\left(  ac\right)  d$ (by Definition \ref{def.ent.div.div}). Consider this
$d$. We have $bc=\left(  ac\right)  d=adc$. We can divide both sides of this
equality by $c$ (since $c\neq0$), and thus obtain $b=ad$. Thus, there exists
an integer $e$ such that $b=ae$ (namely, $e=d$). In other words, $a\mid b$ (by
Definition \ref{def.ent.div.div}). This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Exercise
\ref{exe.ent.div.acbc}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.div.powers}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.div.powers}.]We have $b-a\geq0$ (since
$a\leq b$), thus $b-a\in\mathbb{N}$. Hence, $n^{b-a}$ is a well-defined
integer. Now, $n^{b}=n^{a}n^{b-a}$ (since $n^{a}n^{b-a}=n^{a+\left(
b-a\right)  }=n^{b}$). Hence, there exists an integer $c$ such that
$n^{b}=n^{a}c$ (namely, $c=n^{b-a}$). In other words, $n^{a}\mid n^{b}$ (by
the definition of divisibility). This solves Exercise \ref{exe.ent.div.powers}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.div.g|1}}

\begin{fineprint}
\begin{proof}
[First solution to Exercise \ref{exe.ent.div.g|1}.]Assume the contrary. Thus,
$g\neq1$. But Proposition \ref{prop.ent.div.1} \textbf{(b)} (applied to $g$
and $1$ instead of $a$ and $b$) yields $\left\vert g\right\vert \leq\left\vert
1\right\vert $ (since $g\mid1$ and $1\neq0$). But $g$ is nonnegative; hence,
$\left\vert g\right\vert =g$, so that $g=\left\vert g\right\vert
\leq\left\vert 1\right\vert =1$. Combining this with $g\neq1$, we obtain
$g<1$. Hence, $g=0$ (since $g$ is a nonnegative integer).

But $g\mid1$. In other words, there exists an integer $c$ such that $1=gc$ (by
Definition \ref{def.ent.div.div}). Consider this $c$. Now, $1=\underbrace{g}%
_{=0}c=0c=0$. This contradicts $1\neq0$. This contradiction shows that our
assumption was wrong. Hence, Exercise \ref{exe.ent.div.g|1} is solved.
\end{proof}
\end{fineprint}

\begin{fineprint}
\begin{proof}
[Second solution to Exercise \ref{exe.ent.div.g|1}.]We have $g=1g$. Hence,
there exists an integer $c$ such that $g=1c$ (namely, $c=g$). In other words,
$1\mid g$ (by the definition of divisibility). But we also have $g\mid1$ (by
assumption). Hence, Exercise \ref{exe.ent.div.abba} (applied to $a=g$ and
$b=1$) yields $\left\vert g\right\vert =\left\vert 1\right\vert =1$. But $g$
is nonnegative; thus, $\left\vert g\right\vert =g$. Hence, $g=\left\vert
g\right\vert =1$. Hence, Exercise \ref{exe.ent.div.g|1} is solved.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.div.powers-ab}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.div.powers-ab}.]We have $a\mid b$. In other
words, there exists an integer $d$ such that $b=ad$ (by Definition
\ref{def.ent.div.div}). Consider this $d$. Clearly, $d^{k}$ is an integer
(since $d$ is an integer and $k\in\mathbb{N}$). From $b=ad$, we obtain
$b^{k}=\left(  ad\right)  ^{k}=a^{k}d^{k}$. Hence, there exists an integer $c$
such that $b^{k}=a^{k}c$ (namely, $c=d^{k}$). In other words, $a^{k}\mid
b^{k}$ (by Definition \ref{def.ent.div.div}). This solves Exercise
\ref{exe.ent.div.powers-ab}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.a+b=a-b}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.a+b=a-b}.]According to Definition
\ref{def.ent.cong}, we have $a+b\equiv a-b\operatorname{mod}2$ if and only if
$2\mid\left(  a+b\right)  -\left(  a-b\right)  $. Thus, it remains to prove
that $2\mid\left(  a+b\right)  -\left(  a-b\right)  $. But this follows
immediately from $\left(  a+b\right)  -\left(  a-b\right)  =2b$. Thus Exercise
\ref{exe.ent.mod.a+b=a-b} is solved.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.basics-nope}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.basics-nope}.]There are many such
examples. Here is one:%
\[
n=8,\ \ \ \ \ \ \ \ \ \ a_{1}=10,\ \ \ \ \ \ \ \ \ \ a_{2}%
=2,\ \ \ \ \ \ \ \ \ \ b_{1}=10,\ \ \ \ \ \ \ \ \ \ b_{2}=10.
\]
These satisfy $a_{1}\equiv b_{1}\operatorname{mod}n$ and $a_{2}\equiv
b_{2}\operatorname{mod}n$ but neither $a_{1}/a_{2}\equiv b_{1}/b_{2}%
\operatorname{mod}n$ nor $a_{1}^{a_{2}}\equiv b_{1}^{b_{2}}\operatorname{mod}%
n$.

It is much easier to find examples which fail only one of the two congruences
$a_{1}/a_{2}\equiv b_{1}/b_{2}\operatorname{mod}n$ and $a_{1}^{a_{2}}\equiv
b_{1}^{b_{2}}\operatorname{mod}n$.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.basics.2}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.basics.2}.]We have $a\equiv
b\operatorname{mod}n$. In other words, $n\mid a-b$ (by the definition of
congruence). Note that all of $a/d$, $b/d$ and $n/d$ are integers (since $d$
divides each of $a,b,n$). Hence, $\left(  a-b\right)  /d=a/d-b/d$ is an
integer as well. Hence, Exercise \ref{exe.ent.div.acbc} (applied to $n/d$,
$\left(  a-b\right)  /d$ and $d$ instead of $a$, $b$ and $c$) shows that
$n/d\mid\left(  a-b\right)  /d$ holds if and only if $\left(  n/d\right)
d\mid\left(  \left(  a-b\right)  /d\right)  d$. Since $\left(  n/d\right)
d\mid\left(  \left(  a-b\right)  /d\right)  d$ does hold (indeed, this is just
a complicated way to say $n\mid a-b$), we thus conclude that $n/d\mid\left(
a-b\right)  /d$ holds. In other words, $n/d\mid a/d-b/d$ (since $\left(
a-b\right)  /d=a/d-b/d$). In other words, $a/d\equiv b/d\operatorname{mod}n/d$
(by the definition of congruence). This solves Exercise
\ref{exe.ent.mod.basics.2}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.basics.k-power}}

\begin{fineprint}
\begin{proof}
[First solution to Exercise \ref{exe.ent.mod.basics.k-power}.]We want to prove
that
\begin{equation}
a^{k}\equiv b^{k}\operatorname{mod}n\ \ \ \ \ \ \ \ \ \ \text{for each }%
k\in\mathbb{N}. \label{sol.ent.mod.basics.k-power.goal}%
\end{equation}
We shall prove this by induction on $k$:

\textit{Induction base:} Proposition \ref{prop.ent.mod.basics} \textbf{(a)}
yields $1\equiv1\operatorname{mod}n$. In view of $a^{0}=1$ and $b^{0}=1$, this
rewrites as $a^{0}\equiv b^{0}\operatorname{mod}n$. In other words,
(\ref{sol.ent.mod.basics.k-power.goal}) holds for $k=0$. This completes the
induction base.

\textit{Induction step:} Let $\ell\in\mathbb{N}$. Assume that
(\ref{sol.ent.mod.basics.k-power.goal}) holds for $k=\ell$. We must prove that
(\ref{sol.ent.mod.basics.k-power.goal}) holds for $k=\ell+1$.

We have assumed that (\ref{sol.ent.mod.basics.k-power.goal}) holds for
$k=\ell$. In other words, we have $a^{\ell}\equiv b^{\ell}\operatorname{mod}%
n$. Also, recall that $a\equiv b\operatorname{mod}n$. Hence,
(\ref{eq.prop.ent.mod.basics.d.3}) (applied to $c=a^{\ell}$ and $d=b^{\ell}$)
yields $aa^{\ell}\equiv bb^{\ell}\operatorname{mod}n$. In other words,
$a^{\ell+1}\equiv b^{\ell+1}\operatorname{mod}n$ (since $aa^{\ell}=a^{\ell+1}$
and $bb^{\ell}=b^{\ell+1}$). In other words,
(\ref{sol.ent.mod.basics.k-power.goal}) holds for $k=\ell+1$. This completes
the induction step. Thus, (\ref{sol.ent.mod.basics.k-power.goal}) is proven by
induction. Therefore, Exercise \ref{exe.ent.mod.basics.k-power} is solved.
\end{proof}

\begin{proof}
[Second solution to Exercise \ref{exe.ent.mod.basics.k-power}.]Recall that%
\begin{equation}
\left(  a-b\right)  \left(  a^{k-1}+a^{k-2}b+a^{k-3}b^{2}+\cdots
+ab^{k-2}+b^{k-1}\right)  =a^{k}-b^{k}
\label{sol.exe.ent.mod.basics.k-power.2nd.gs}%
\end{equation}
for every $k\in\mathbb{N}$. (This is a well-known identity, and it appears
(with $k$ renamed as $n$) as the first half of Exercise 1 on
\href{https://www.cip.ifi.lmu.de/~grinberg/t/19s/hw0s.pdf}{homework set \#0}.)

Now, let $k\in\mathbb{N}$. We have assumed that $a\equiv b\operatorname{mod}%
n$. In other words, $n\mid a-b$. In other words, there exists an integer $c$
such that $a-b=nc$. Consider this $c$. Now,
(\ref{sol.exe.ent.mod.basics.k-power.2nd.gs}) yields%
\begin{align*}
a^{k}-b^{k}  &  =\underbrace{\left(  a-b\right)  }_{=nc}\left(  a^{k-1}%
+a^{k-2}b+a^{k-3}b^{2}+\cdots+ab^{k-2}+b^{k-1}\right) \\
&  =nc\left(  a^{k-1}+a^{k-2}b+a^{k-3}b^{2}+\cdots+ab^{k-2}+b^{k-1}\right)  .
\end{align*}
The right hand side of this equality is clearly divisible by $n$. Hence, so is
the left hand side. In other words, $n\mid a^{k}-b^{k}$. In other words,
$a^{k}\equiv b^{k}\operatorname{mod}n$. Hence, Exercise
\ref{exe.ent.mod.basics.k-power} is solved again.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.k-sum}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.k-sum}.]\textbf{(a)} We shall solve
Exercise \ref{exe.ent.mod.k-sum} \textbf{(a)} by induction on $\left\vert
S\right\vert $:

\textit{Induction base:} Exercise \ref{exe.ent.mod.k-sum} \textbf{(a)} holds
whenever $\left\vert S\right\vert =0$\ \ \ \ \footnote{\textit{Proof.} Let
$n$, $S$, $a_{s}$ and $b_{s}$ be as in Exercise \ref{exe.ent.mod.k-sum}, and
assume that $\left\vert S\right\vert =0$. Then, the set $S$ is empty (since
$\left\vert S\right\vert =0$), and thus we have $\sum_{s\in S}a_{s}=\left(
\text{empty sum}\right)  =0$. Similarly, $\sum_{s\in S}b_{s}=0$. Now,
Proposition \ref{prop.ent.mod.basics} \textbf{(a)} yields $0\equiv
0\operatorname{mod}n$. In view of $\sum_{s\in S}a_{s}=0$ and $\sum_{s\in
S}b_{s}=0$, this rewrites as $\sum_{s\in S}a_{s}\equiv\sum_{s\in S}%
b_{s}\operatorname{mod}n$. Thus, Exercise \ref{exe.ent.mod.k-sum} \textbf{(a)}
holds in our case.
\par
So we have shown that Exercise \ref{exe.ent.mod.k-sum} \textbf{(a)} holds
whenever $\left\vert S\right\vert =0$.}. This completes the induction base.

\textit{Induction step:} Fix $k\in\mathbb{N}$. Assume that Exercise
\ref{exe.ent.mod.k-sum} \textbf{(a)} holds whenever $\left\vert S\right\vert
=k$. We must prove that Exercise \ref{exe.ent.mod.k-sum} \textbf{(a)} holds
whenever $\left\vert S\right\vert =k+1$.

We have assumed that Exercise \ref{exe.ent.mod.k-sum} \textbf{(a)} holds
whenever $\left\vert S\right\vert =k$. In other words, the following statement
is true:

\begin{statement}
\textit{Statement 1:} Let $n$, $S$, $a_{s}$ and $b_{s}$ be as in Exercise
\ref{exe.ent.mod.k-sum}. Assume that $\left\vert S\right\vert =k$. Then,
$\sum_{s\in S}a_{s}\equiv\sum_{s\in S}b_{s}\operatorname{mod}n$.
\end{statement}

Now, we must prove that Exercise \ref{exe.ent.mod.k-sum} \textbf{(a)} holds
whenever $\left\vert S\right\vert =k+1$. In other words, we must prove the
following statement:

\begin{statement}
\textit{Statement 2:} Let $n$, $S$, $a_{s}$ and $b_{s}$ be as in Exercise
\ref{exe.ent.mod.k-sum}. Assume that $\left\vert S\right\vert =k+1$. Then,
$\sum_{s\in S}a_{s}\equiv\sum_{s\in S}b_{s}\operatorname{mod}n$.
\end{statement}

[\textit{Proof of Statement 2:} We have $\left\vert S\right\vert =k+1>k\geq0$;
thus, the set $S$ is nonempty. Hence, there exists some $t\in S$. Pick such a
$t$. Thus, $\left\vert S\setminus\left\{  t\right\}  \right\vert =\left\vert
S\right\vert -1=k$ (since $\left\vert S\right\vert =k+1$). Moreover, from
(\ref{eq.exe.ent.mod.k-sum.ass}), we immediately obtain that
\[
a_{s}\equiv b_{s}\operatorname{mod}n\ \ \ \ \ \ \ \ \ \ \text{for each }s\in
S\setminus\left\{  t\right\}
\]
(since each $s\in S\setminus\left\{  t\right\}  $ belongs to $S$). Hence, we
can apply Statement 1 to $S\setminus\left\{  t\right\}  $ instead of $S$. We
thus obtain
\[
\sum_{s\in S\setminus\left\{  t\right\}  }a_{s}\equiv\sum_{s\in S\setminus
\left\{  t\right\}  }b_{s}\operatorname{mod}n.
\]
Also, we have
\[
a_{t}\equiv b_{t}\operatorname{mod}n
\]
(by (\ref{eq.exe.ent.mod.k-sum.ass}), applied to $s=t$). Adding these two
congruences together, we obtain%
\[
\sum_{s\in S\setminus\left\{  t\right\}  }a_{s}+a_{t}\equiv\sum_{s\in
S\setminus\left\{  t\right\}  }b_{s}+b_{t}\operatorname{mod}n.
\]
In view of%
\[
\sum_{s\in S}a_{s}=\sum_{s\in S\setminus\left\{  t\right\}  }a_{s}%
+a_{t}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split off the addend}\\
\text{for }s=t\text{ from the sum}%
\end{array}
\right)
\]
and%
\[
\sum_{s\in S}b_{s}=\sum_{s\in S\setminus\left\{  t\right\}  }b_{s}%
+b_{t}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split off the addend}\\
\text{for }s=t\text{ from the sum}%
\end{array}
\right)  ,
\]
this can be rewritten as%
\[
\sum_{s\in S}a_{s}\equiv\sum_{s\in S}b_{s}\operatorname{mod}n.
\]
This proves Statement 2.]

We have now proven Statement 2; this means that Exercise
\ref{exe.ent.mod.k-sum} \textbf{(a)} holds whenever $\left\vert S\right\vert
=k+1$. This completes the induction step; thus, Exercise
\ref{exe.ent.mod.k-sum} \textbf{(a)} is solved.

\textbf{(b)} The solution to Exercise \ref{exe.ent.mod.k-sum} \textbf{(b)} is
analogous to the one we gave above for Exercise \ref{exe.ent.mod.k-sum}
\textbf{(a)}; the main difference is that we have to replace sums by products
(and $0$ by $1$).
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.prod-wrong}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.prod-wrong}.]No, it is not true. For
example, $a_{1}=1$, $a_{2}=1$, $b_{1}=1$, $b_{2}=0$, $n_{1}=0$ and $n_{2}=1$
yield a counterexample.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.a+nd}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.a+nd}.]If $a\equiv b\operatorname{mod}%
n$, then $b\equiv a\operatorname{mod}n$ (by Proposition
\ref{prop.ent.mod.basics} \textbf{(c)}). In other words, the implication
$\left(  a\equiv b\operatorname{mod}n\right)  \Longrightarrow\left(  b\equiv
a\operatorname{mod}n\right)  $ holds. The same argument (but with the roles of
$a$ and $b$ swapped) shows that the implication $\left(  b\equiv
a\operatorname{mod}n\right)  \Longrightarrow\left(  a\equiv
b\operatorname{mod}n\right)  $ holds. Combining these two implications, we
obtain the logical equivalence $\left(  a\equiv b\operatorname{mod}n\right)
\Longleftrightarrow\left(  b\equiv a\operatorname{mod}n\right)  $. Thus, we
have the following chain of logical equivalences:%
\begin{align*}
\left(  a\equiv b\operatorname{mod}n\right)  \  &  \Longleftrightarrow
\ \left(  b\equiv a\operatorname{mod}n\right) \\
&  \Longleftrightarrow\ \left(  n\mid b-a\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of congruence}\right) \\
&  \Longleftrightarrow\ \left(  \text{there exists an integer }d\text{ such
that }b-a=nd\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of divisibility}\right)
\\
&  \Longleftrightarrow\ \left(  \text{there exists an integer }d\text{ such
that }b=a+nd\right)
\end{align*}
(since the equation $b-a=nd$ for an integer $d$ is equivalent to $b=a+nd$). In
other words, $a\equiv b\operatorname{mod}n$ if and only if there exists some
$d\in\mathbb{Z}$ such that $b=a+nd$. This solves Exercise
\ref{exe.ent.mod.a+nd}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.diff}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.diff}.]We have $a-b\equiv
c\operatorname{mod}n$ if and only if $n\mid\left(  a-b\right)  -c$ (by the
definition of congruence). Thus, we have the logical equivalence%
\begin{equation}
\left(  a-b\equiv c\operatorname{mod}n\right)  \ \Longleftrightarrow\ \left(
n\mid\left(  a-b\right)  -c\right)  . \label{sol.ent.mod.diff.1}%
\end{equation}


On the other hand, we have $a\equiv b+c\operatorname{mod}n$ if and only if
$n\mid a-\left(  b+c\right)  $ (by the definition of congruence). Thus, we
have the logical equivalence%
\begin{equation}
\left(  a\equiv b+c\operatorname{mod}n\right)  \ \Longleftrightarrow\ \left(
n\mid a-\left(  b+c\right)  \right)  . \label{sol.ent.mod.diff.2}%
\end{equation}


Now, we have the following chain of logical equivalences:%
\begin{align*}
\left(  a-b\equiv c\operatorname{mod}n\right)  \  &  \Longleftrightarrow
\ \left(  n\mid\underbrace{\left(  a-b\right)  -c}_{=a-\left(  b+c\right)
}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.ent.mod.diff.1}%
)}\right) \\
&  \Longleftrightarrow\ \left(  n\mid a-\left(  b+c\right)  \right)
\ \Longleftrightarrow\ \left(  a\equiv b+c\operatorname{mod}n\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.ent.mod.diff.2})}\right)  .
\end{align*}
In other words, we have $a-b\equiv c\operatorname{mod}n$ if and only if
$a\equiv b+c\operatorname{mod}n$. This solves Exercise \ref{exe.ent.mod.diff}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.-}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.-}.]Let us first prove the logical
implication%
\begin{equation}
\left(  a\equiv b\operatorname{mod}n\right)  \ \Longrightarrow\ \left(
a\equiv b\operatorname{mod}-n\right)  . \label{sol.ent.mod.-.fwd}%
\end{equation}


[\textit{Proof of (\ref{sol.ent.mod.-.fwd}):} Assume that $a\equiv
b\operatorname{mod}n$. We must show that $a\equiv b\operatorname{mod}-n$.

We have $n=\left(  -n\right)  \left(  -1\right)  $. Since $-1$ is an integer,
this shows that $-n\mid n$ (by the definition of divisibility). Thus,
Proposition \ref{prop.ent.mod.basics} \textbf{(e)} (applied to $m=-n$) yields
$a\equiv b\operatorname{mod}-n$. This proves (\ref{sol.ent.mod.-.fwd}).]

So we have proven the logical implication (\ref{sol.ent.mod.-.fwd}). The same
reasoning (applied to $-n$ instead of $n$) yields the logical implication%
\[
\left(  a\equiv b\operatorname{mod}-n\right)  \ \Longrightarrow\ \left(
a\equiv b\operatorname{mod}-\left(  -n\right)  \right)  .
\]
Since $-\left(  -n\right)  =n$, this rewrites as follows:%
\[
\left(  a\equiv b\operatorname{mod}-n\right)  \ \Longrightarrow\ \left(
a\equiv b\operatorname{mod}n\right)  .
\]
Combining this implication with the implication (\ref{sol.ent.mod.-.fwd}), we
obtain the equivalence
\[
\left(  a\equiv b\operatorname{mod}n\right)  \ \Longleftrightarrow\ \left(
a\equiv b\operatorname{mod}-n\right)  .
\]
This solves Exercise \ref{exe.ent.mod.-}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.mod.substitutivity.7div}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.mod.substitutivity.7div}.]We have
$3^{2n+1}=\left(  \underbrace{3^{2}}_{=9\equiv2\operatorname{mod}7}\right)
^{n}\cdot3\equiv2^{n}\cdot3\operatorname{mod}7$. (This follows from the PSC,
in its extended form that allows $k$-th powers in the expression $A$.
Alternatively, you can argue by hand as follows: We have $3^{2}=9\equiv
2\operatorname{mod}7$. Thus, Exercise \ref{exe.ent.mod.basics.k-power}
(applied to $7$, $3^{2}$, $2$ and $n$ instead of $n$, $a$, $b$ and $k$) yields
$\left(  3^{2}\right)  ^{n}\equiv2^{n}\operatorname{mod}7$. Multiplying this
congruence by the obvious congruence $3\equiv3\operatorname{mod}7$, we obtain
$\left(  3^{2}\right)  ^{n}\cdot3\equiv2^{n}\cdot3\operatorname{mod}7$. Thus,
$3^{2n+1}=\left(  3^{2}\right)  ^{n}\cdot3\equiv2^{n}\cdot3\operatorname{mod}%
7$.)

Hence, again using the PSC, we obtain%
\[
\underbrace{3^{2n+1}}_{\equiv2^{n}\cdot3\operatorname{mod}7}%
+\underbrace{2^{n+2}}_{=2^{n}\cdot2^{2}=2^{n}\cdot4}\equiv2^{n}\cdot
3+2^{n}\cdot4=2^{n}\cdot\underbrace{\left(  3+4\right)  }_{=7}=2^{n}%
\cdot7\equiv0\operatorname{mod}7
\]
(since $2^{n}\cdot7$ is clearly divisible by $7$). In other words,
$7\mid3^{2n+1}+2^{n+2}$. This solves Exercise
\ref{exe.ent.mod.substitutivity.7div}.

[\textit{Remark:} Here is a sketch of a different solution: If we set
$a_{n}=3^{2n+1}+2^{n+2}$ for each $n\in\mathbb{N}$, then we must prove that
$7\mid a_{n}$ for all $n\in\mathbb{N}$. But a straightforward computation
reveals that%
\begin{equation}
a_{n}=11a_{n-1}-18a_{n-2}\ \ \ \ \ \ \ \ \ \ \text{for each }n\geq2.
\label{sol.ent.mod.substitutivity.7div.rec}%
\end{equation}
Thus, once we check that $7\mid a_{0}$ and $7\mid a_{1}$, we can use a
straightforward strong induction on $n$ to see that $7\mid a_{n}$ for all
$n\in\mathbb{N}$, which is exactly the claim of Exercise
\ref{exe.ent.mod.substitutivity.7div}. Of course, \textbf{finding} the
relation (\ref{sol.ent.mod.substitutivity.7div.rec}) was the main trick in
this solution; it becomes somewhat natural once you know the theory of linear
recurrences (such as the Fibonacci sequence).]
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.quo-rem.mod=rem}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.quo-rem.mod=rem}.]$\Longrightarrow:$ Assume
that $u\equiv v\operatorname{mod}n$. We must prove that $u\%n=v\%n$.

Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} yields that $u\%n\in
\left\{  0,1,\ldots,n-1\right\}  $ and $u\%n\equiv u\operatorname{mod}n$.
Hence, $u\%n\equiv u\equiv v\operatorname{mod}n$.

But Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $v$
instead of $u$) yields that if $c\in\left\{  0,1,\ldots,n-1\right\}  $ is such
that $c\equiv v\operatorname{mod}n$, then $c=v\%n$. Applying this to $c=u\%n$,
we obtain $u\%n=v\%n$ (since $u\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and
$u\%n\equiv v\operatorname{mod}n$). This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Exercise
\ref{exe.ent.quo-rem.mod=rem}.

$\Longleftarrow:$ Assume that $u\%n=v\%n$. We must prove that $u\equiv
v\operatorname{mod}n$.

Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} yields that $u\%n\in
\left\{  0,1,\ldots,n-1\right\}  $ and $u\%n\equiv u\operatorname{mod}n$.
Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $v$ instead of
$u$) yields that $v\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and $v\%n\equiv
v\operatorname{mod}n$.

From $u\%n\equiv u\operatorname{mod}n$, we obtain $u\equiv u\%n=v\%n\equiv
v\operatorname{mod}n$. Thus, we have proven $u\equiv v\operatorname{mod}n$.
This proves the \textquotedblleft$\Longleftarrow$\textquotedblright\ direction
of Exercise \ref{exe.ent.quo-rem.mod=rem}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.quo-rem.minrem}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.quo-rem.minrem}.]\textbf{(a)} Theorem
\ref{thm.ent.quorem.full} shows that there exists a unique pair $\left(
q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that
$u=qn+r$. Consider this pair $\left(  q,r\right)  $, and denote it by $\left(
s,t\right)  $. Thus, $\left(  s,t\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $ is a pair satisfying $u=sn+t$. From $\left(
s,t\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $, we obtain
$s\in\mathbb{Z}$ and $t\in\left\{  0,1,\ldots,n-1\right\}  \subseteq
\mathbb{Z}$.

We are in one of the following two cases:

\textit{Case 1:} We have $t\leq n/2$.

\textit{Case 2:} We have $t>n/2$.

Let us first consider Case 1. In this case, we have $t\leq n/2$. But $t$ is
nonnegative (since $t\in\left\{  0,1,\ldots,n-1\right\}  $); thus, $\left\vert
t\right\vert =t\leq n/2$. So we have $\left(  s,t\right)  \in\mathbb{Z}%
\times\mathbb{Z}$ (since $s\in\mathbb{Z}$ and $t\in\mathbb{Z}$) and $u=sn+t$
and $\left\vert t\right\vert \leq n/2$. Hence, there exists a pair $\left(
q,r\right)  \in\mathbb{Z}\times\mathbb{Z}$ such that $u=qn+r$ and $\left\vert
r\right\vert \leq n/2$ (namely, $\left(  q,r\right)  =\left(  s,t\right)  $).
Thus, Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)} is solved in Case 1.

Let us now consider Case 2. In this case, we have $t>n/2$. But $t\in\left\{
0,1,\ldots,n-1\right\}  $, thus $t\leq n-1\leq n$. Hence, $t-n\leq0$. Hence,
$\left\vert t-n\right\vert =-\left(  t-n\right)  =n-\underbrace{t}%
_{>n/2}<n-n/2=n/2$. Therefore, $\left\vert t-n\right\vert \leq n/2$.
Furthermore, $t-n\in\mathbb{Z}$ (since $t\in\mathbb{Z}$ and $n\in\mathbb{Z}$)
and $s+1\in\mathbb{Z}$ (since $s\in\mathbb{Z}$). So we have $\left(
s+1,t-n\right)  \in\mathbb{Z}\times\mathbb{Z}$ (since $s+1\in\mathbb{Z}$ and
$t-n\in\mathbb{Z}$) and $u=\left(  s+1\right)  n+\left(  t-n\right)  $ (since
$\left(  s+1\right)  n+\left(  t-n\right)  =sn+t=u$) and $\left\vert
t-n\right\vert \leq n/2$. Hence, there exists a pair $\left(  q,r\right)
\in\mathbb{Z}\times\mathbb{Z}$ such that $u=qn+r$ and $\left\vert r\right\vert
\leq n/2$ (namely, $\left(  q,r\right)  =\left(  s+1,t-n\right)  $). Thus,
Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)} is solved in Case 2.

We have now solved Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)} in each
of the two Cases 1 and 2. Since these two Cases cover all possibilities, we
thus conclude that Exercise \ref{exe.ent.quo-rem.minrem} \textbf{(a)} always holds.

\textbf{(b)} For example, if $n=2$ and $u=5$, then both $\left(  2,1\right)  $
and $\left(  3,-1\right)  $ are pairs $\left(  q,r\right)  \in\mathbb{Z}%
\times\mathbb{Z}$ such that $u=qn+r$ and $\left\vert r\right\vert \leq n/2$.

More generally: If $n=2k$ for some positive integer $k$, and if $u\equiv
k\operatorname{mod}n$, then both $\left(  \left(  u-k\right)  /n,k\right)  $
and $\left(  \left(  u+k\right)  /n,-k\right)  $ are pairs $\left(
q,r\right)  \in\mathbb{Z}\times\mathbb{Z}$ such that $u=qn+r$ and $\left\vert
r\right\vert \leq n/2$.

[It is not hard to see that these are the \textbf{only} cases in which the
pair $\left(  q,r\right)  $ from Exercise \ref{exe.ent.quo-rem.minrem}
\textbf{(a)} is not unique.]
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.quo-rem.u+v}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.quo-rem.u+v}.]\textbf{(a)} Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(a)} yields that $u\%n\in\left\{
0,1,\ldots,n-1\right\}  $ and $u\%n\equiv u\operatorname{mod}n$. From
$u\%n\in\left\{  0,1,\ldots,n-1\right\}  $, we conclude that $u\%n$ is an
integer satisfying $0\leq u\%n\leq n-1$.

Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $v$ instead of
$u$) yields that $v\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and $v\%n\equiv
v\operatorname{mod}n$. From $v\%n\in\left\{  0,1,\ldots,n-1\right\}  $, we
conclude that $v\%n$ is an integer satisfying $0\leq v\%n\leq n-1$.

Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $u+v$ instead
of $u$) yields that $\left(  u+v\right)  \%n\in\left\{  0,1,\ldots
,n-1\right\}  $ and $\left(  u+v\right)  \%n\equiv u+v\operatorname{mod}n$.
From $\left(  u+v\right)  \%n\in\left\{  0,1,\ldots,n-1\right\}  $, we
conclude that $\left(  u+v\right)  \%n$ is an integer satisfying $0\leq\left(
u+v\right)  \%n\leq n-1$.

Adding the congruences $u\%n\equiv u\operatorname{mod}n$ and $v\%n\equiv
v\operatorname{mod}n$ together, we obtain $u\%n+v\%n\equiv
u+v\operatorname{mod}n$. Subtracting the congruence $\left(  u+v\right)
\%n\equiv u+v\operatorname{mod}n$ from this congruence, we obtain
$u\%n+v\%n-\left(  u+v\right)  \%n\equiv\left(  u+v\right)  -\left(
u+v\right)  =0\operatorname{mod}n$. By Proposition \ref{prop.ent.mod.0}
(applied to $a=u\%n+v\%n-\left(  u+v\right)  \%n$), this entails $n\mid
u\%n+v\%n-\left(  u+v\right)  \%n$. In other words, there exists an integer
$c$ such that $u\%n+v\%n-\left(  u+v\right)  \%n=nc$. Consider this $c$.

Hence,%
\[
nc=\underbrace{u\%n}_{\leq n-1<n}+\underbrace{v\%n}_{\leq n-1<n}%
-\underbrace{\left(  u+v\right)  \%n}_{\geq0}<n+n-0=2n=n\cdot2.
\]
We can divide this inequality by $n$ (since $n$ is positive). We thus obtain
$c<2$. Hence, $c\leq1$ (since $c$ is an integer).

On the other hand,
\[
nc=\underbrace{u\%n}_{\geq0}+\underbrace{v\%n}_{\geq0}-\underbrace{\left(
u+v\right)  \%n}_{\leq n-1<n}>0+0-n=-n=n\cdot\left(  -1\right)  .
\]
We can divide this inequality by $n$ (since $n$ is positive). We thus obtain
$c>-1$. Hence, $c\geq0$ (since $c$ is an integer).

Combining $c\geq0$ with $c\leq1$, we obtain $c\in\left\{  0,1\right\}  $
(since $c$ is an integer). In other words, we have $c=0$ or $c=1$. Hence, we
have $nc=n\cdot0=0$ or $nc=n\cdot1=n$. In other words, $nc\in\left\{
0,n\right\}  $. Now, recall that $u\%n+v\%n-\left(  u+v\right)  \%n=nc\in
\left\{  0,n\right\}  $. This solves Exercise \ref{exe.ent.quo-rem.u+v}
\textbf{(a)}.

\textbf{(b)} Exercise \ref{exe.ent.quo-rem.u+v} \textbf{(a)} yields
$u\%n+v\%n-\left(  u+v\right)  \%n\in\left\{  0,n\right\}  $.

The integer $n$ is positive and thus nonzero. Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(d)} yields $u=\left(  u//n\right)
n+\left(  u\%n\right)  $. Solving this equation for $u//n$, we find%
\begin{equation}
u//n=\dfrac{u-u\%n}{n} \label{sol.ent.quo-rem.u+v.b.1}%
\end{equation}
(since $n$ is nonzero). The same argument (applied to $v$ instead of $u$)
yields%
\begin{equation}
v//n=\dfrac{v-v\%n}{n}. \label{sol.ent.quo-rem.u+v.b.2}%
\end{equation}
Finally, the same argument that we used to prove
(\ref{sol.ent.quo-rem.u+v.b.1}) can be applied to $u+v$ instead of $u$, and
thus we obtain%
\begin{equation}
\left(  u+v\right)  //n=\dfrac{\left(  u+v\right)  -\left(  u+v\right)
\%n}{n}. \label{sol.ent.quo-rem.u+v.b.3}%
\end{equation}
Now,%
\begin{align*}
&  \underbrace{\left(  u+v\right)  //n}_{\substack{=\dfrac{\left(  u+v\right)
-\left(  u+v\right)  \%n}{n}\\\text{(by (\ref{sol.ent.quo-rem.u+v.b.3}))}%
}}-\underbrace{u//n}_{\substack{=\dfrac{u-u\%n}{n}\\\text{(by
(\ref{sol.ent.quo-rem.u+v.b.1}))}}}-\underbrace{v//n}_{\substack{=\dfrac
{v-v\%n}{n}\\\text{(by (\ref{sol.ent.quo-rem.u+v.b.2}))}}}\\
&  =\dfrac{\left(  u+v\right)  -\left(  u+v\right)  \%n}{n}-\dfrac{u-u\%n}%
{n}-\dfrac{v-v\%n}{n}\\
&  =\dfrac{1}{n}\underbrace{\left(  \left(  \left(  u+v\right)  -\left(
u+v\right)  \%n\right)  -\left(  u-u\%n\right)  -\left(  v-v\%n\right)
\right)  }_{=u\%n+v\%n-\left(  u+v\right)  \%n}\\
&  =\dfrac{1}{n}\left(  u\%n+v\%n-\left(  u+v\right)  \%n\right) \\
&  \in\left\{  \dfrac{1}{n}0,\dfrac{1}{n}n\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }u\%n+v\%n-\left(  u+v\right)
\%n\in\left\{  0,n\right\}  \right) \\
&  =\left\{  0,1\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\dfrac
{1}{n}0=0\text{ and }\dfrac{1}{n}n=1\right)  .
\end{align*}
This solves Exercise \ref{exe.ent.quo-rem.u+v} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.quo-rem.bijs}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.quo-rem.bijs}.]\textbf{(a)} The map%
\begin{align*}
\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}   &  \rightarrow\mathbb{Z},\\
\left(  q,r\right)   &  \mapsto qn+r
\end{align*}
is clearly well-defined. Let us denote this map by $A$. Then, in order to
solve Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(a)}, we must prove that
this map $A$ is a bijection.

We shall achieve this by showing that $A$ is injective and surjective:

[\textit{Proof of the injectivity of }$A$\textit{:} Let $x$ and $y$ be two
elements of $\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that
$A\left(  x\right)  =A\left(  y\right)  $. We shall show that $x=y$.

Define a $u\in\mathbb{Z}$ by $u=A\left(  x\right)  $. Then, $u=A\left(
x\right)  =A\left(  y\right)  $.

Now, $x$ is an element of $\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $.
In other words, $x$ is a pair $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $. Moreover, if we write $x$ in the form $x=\left(
q,r\right)  $ for some $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $, then
\[
u=A\left(  \underbrace{x}_{=\left(  q,r\right)  }\right)  =A\left(  \left(
q,r\right)  \right)  =qn+r\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition
of }A\right)  .
\]
Hence, $x$ is a pair $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $ such that $u=qn+r$. Similarly, $y$ is a pair
$\left(  q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $
such that $u=qn+r$ (since $u=A\left(  y\right)  $).

But Lemma \ref{lem.ent.quorem.unique} shows that there exists \textbf{at most
one} pair $\left(  q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots
,n-1\right\}  $ such that $u=qn+r$. Hence, any two such pairs $\left(
q,r\right)  $ must be equal. Thus, $x$ and $y$ must be equal (since $x$ and
$y$ are two pairs $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $ such that $u=qn+r$). In other words, $x=y$.

Now, forget that we fixed $x$ and $y$. We thus have shown that if $x$ and $y$
are two elements of $\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such
that $A\left(  x\right)  =A\left(  y\right)  $, then $x=y$. In other words,
the map $A$ is injective.]

[\textit{Proof of the surjectivity of }$A$\textit{:} Let $u\in\mathbb{Z}$. We
shall find an $x\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such
that $u=A\left(  x\right)  $.

Indeed, Lemma \ref{lem.ent.quorem.exist} shows that there exists \textbf{at
least one} pair $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $ such that $u=qn+r$. Consider this $\left(
q,r\right)  $. Now, the definition of $A$ yields $A\left(  \left(  q,r\right)
\right)  =qn+r=u$. Hence, $u=A\left(  \left(  q,r\right)  \right)  $. Thus,
there exists an $x\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such
that $u=A\left(  x\right)  $ (namely, $x=\left(  q,r\right)  $).

Now, forget that we fixed $u$. We thus have shown that for each $u\in
\mathbb{Z}$, there exists an $x\in\mathbb{Z}\times\left\{  0,1,\ldots
,n-1\right\}  $ such that $u=A\left(  x\right)  $. In other words, the map $A$
is surjective.]

We have now shown that the map $A$ is injective and surjective. Hence, $A$ is
bijective. In other words, $A$ is a bijection. As we explained above, this
solves Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(a)}.

\textbf{(b)} The map%
\begin{align*}
\mathbb{N}\times\left\{  0,1,\ldots,n-1\right\}   &  \rightarrow\mathbb{N},\\
\left(  q,r\right)   &  \mapsto qn+r
\end{align*}
is clearly well-defined\footnote{since $qn+r\in\mathbb{N}$ for each $\left(
q,r\right)  \in\mathbb{N}\times\left\{  0,1,\ldots,n-1\right\}  $ (because $n$
is positive)}. Let us denote this map by $B$. Then, in order to solve Exercise
\ref{exe.ent.quo-rem.bijs} \textbf{(b)}, we must prove that this map $B$ is a bijection.

We shall achieve this by showing that $B$ is injective and surjective:

[\textit{Proof of the injectivity of }$B$\textit{:} In our solution to
Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(a)}, we have defined a map $A$
and proven that this map $A$ is injective. The very same argument (with $A$
replaced by $B$, and $\mathbb{Z}$ replaced by $\mathbb{N}$) shows that the map
$B$ is injective.]

[\textit{Proof of the surjectivity of }$B$\textit{:} Let $u\in\mathbb{N}$. We
shall find an $x\in\mathbb{N}\times\left\{  0,1,\ldots,n-1\right\}  $ such
that $u=B\left(  x\right)  $.

Indeed, Lemma \ref{lem.ent.quorem.exist} shows that there exists \textbf{at
least one} pair $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $ such that $u=qn+r$. Consider this $\left(
q,r\right)  $. From $\left(  q,r\right)  \in\mathbb{Z}\times\left\{
0,1,\ldots,n-1\right\}  $, we obtain $q\in\mathbb{Z}$ and $r\in\left\{
0,1,\ldots,n-1\right\}  $. From $r\in\left\{  0,1,\ldots,n-1\right\}  $, we
obtain $r\leq n-1<n$, so that $u=qn+\underbrace{r}_{<n}<qn+n=\left(
q+1\right)  n$. Thus, $\left(  q+1\right)  n>u\geq0$ (since $u\in\mathbb{N}$).
But if we had $q+1\leq0$, then we would have $\underbrace{\left(  q+1\right)
}_{\leq0}n\leq0$ (since $n$ is positive), which would contradict $\left(
q+1\right)  n>0$. Thus, we cannot have $q+1\leq0$. Hence, we have $q+1>0$, and
therefore $q+1\geq1$ (since $q+1$ is an integer), so that $q\geq0$. In other
words, $q\in\mathbb{N}$. Combining this with $r\in\left\{  0,1,\ldots
,n-1\right\}  $, we obtain $\left(  q,r\right)  \in\mathbb{N}\times\left\{
0,1,\ldots,n-1\right\}  $. Thus, $B\left(  \left(  q,r\right)  \right)  $ is
well-defined. The definition of $B$ yields $B\left(  \left(  q,r\right)
\right)  =qn+r=u$. Hence, $u=B\left(  \left(  q,r\right)  \right)  $. Thus,
there exists an $x\in\mathbb{N}\times\left\{  0,1,\ldots,n-1\right\}  $ such
that $u=B\left(  x\right)  $ (namely, $x=\left(  q,r\right)  $).

Now, forget that we fixed $u$. We thus have shown that for each $u\in
\mathbb{N}$, there exists an $x\in\mathbb{N}\times\left\{  0,1,\ldots
,n-1\right\}  $ such that $u=B\left(  x\right)  $. In other words, the map $B$
is surjective.]

We have now shown that the map $B$ is injective and surjective. Hence, $B$ is
bijective. In other words, $B$ is a bijection. As we explained above, this
solves Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(b)}.

\textbf{(c)} Let $a\in\mathbb{Z}$ and $b\in\left\{  0,1,\ldots,n-1\right\}  $.
We shall show that $\left(  an+b\right)  //n=a$. (This is, of course, the
claim of Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(c)} with $q$ and $r$
renamed as $a$ and $b$.)

Let $u=an+b$. Then, $u\in\mathbb{Z}$ (since $a$, $n$ and $b$ are integers). We
have $\left(  a,b\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}
$ (since $a\in\mathbb{Z}$ and $b\in\left\{  0,1,\ldots,n-1\right\}  $) and
$u=an+b$. Hence, $\left(  a,b\right)  $ is a pair $\left(  q,r\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that $u=qn+r$. But
Theorem \ref{thm.ent.quorem.full} shows that there exists a unique pair
$\left(  q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $
such that $u=qn+r$. This unique pair $\left(  q,r\right)  $ must be $\left(
a,b\right)  $ (because we have just shown that $\left(  a,b\right)  $ is such
a pair). Hence, Definition \ref{def.ent.quorem} \textbf{(a)} yields $u//n=a$.
In view of $u=an+b$, this rewrites as $\left(  an+b\right)  //n=a$.

Now, forget that we fixed $a$ and $b$. We thus have shown that any
$a\in\mathbb{Z}$ and $b\in\left\{  0,1,\ldots,n-1\right\}  $ satisfy $\left(
an+b\right)  //n=a$. Renaming $a$ and $b$ as $q$ and $r$ in this statement, we
obtain the following: Any $q\in\mathbb{Z}$ and $r\in\left\{  0,1,\ldots
,n-1\right\}  $ satisfy $\left(  qn+r\right)  //n=q$. This solves Exercise
\ref{exe.ent.quo-rem.bijs} \textbf{(c)}.

\textbf{(d)} Let $a\in\mathbb{Z}$ and $b\in\left\{  0,1,\ldots,n-1\right\}  $.
We shall show that $\left(  an+b\right)  \%n=b$. (This is, of course, the
claim of Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(d)} with $q$ and $r$
renamed as $a$ and $b$.)

Let $u=an+b$. Then, $u\in\mathbb{Z}$ (since $a$, $n$ and $b$ are integers). We
have $\left(  a,b\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}
$ (since $a\in\mathbb{Z}$ and $b\in\left\{  0,1,\ldots,n-1\right\}  $) and
$u=an+b$. Hence, $\left(  a,b\right)  $ is a pair $\left(  q,r\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $ such that $u=qn+r$. But
Theorem \ref{thm.ent.quorem.full} shows that there exists a unique pair
$\left(  q,r\right)  \in\mathbb{Z}\times\left\{  0,1,\ldots,n-1\right\}  $
such that $u=qn+r$. This unique pair $\left(  q,r\right)  $ must be $\left(
a,b\right)  $ (because we have just shown that $\left(  a,b\right)  $ is such
a pair). Hence, Definition \ref{def.ent.quorem} \textbf{(b)} yields $u\%n=b$.
In view of $u=an+b$, this rewrites as $\left(  an+b\right)  \%n=b$.

Now, forget that we fixed $a$ and $b$. We thus have shown that any
$a\in\mathbb{Z}$ and $b\in\left\{  0,1,\ldots,n-1\right\}  $ satisfy $\left(
an+b\right)  \%n=b$. Renaming $a$ and $b$ as $q$ and $r$ in this statement, we
obtain the following: Any $q\in\mathbb{Z}$ and $r\in\left\{  0,1,\ldots
,n-1\right\}  $ satisfy $\left(  qn+r\right)  \%n=r$. This solves Exercise
\ref{exe.ent.quo-rem.bijs} \textbf{(d)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.even-odd.1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.even-odd.1}.]Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(b)} (applied to $n=2$) shows that we
have $2\mid u$ if and only if $u\%2=0$. In other words, we have the logical
equivalence
\begin{equation}
\left(  2\mid u\right)  \ \Longleftrightarrow\ \left(  u\%2=0\right)  .
\label{sol.ent.even-odd.1.1}%
\end{equation}


Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $n=2$) yields
that $u\%2\in\left\{  0,1,\ldots,2-1\right\}  $ and $u\%2\equiv
u\operatorname{mod}2$. Thus, in particular, $u\%2\in\left\{  0,1,\ldots
,2-1\right\}  =\left\{  0,1\right\}  $. Hence, $u\%2$ is either $0$ or $1$.
Thus, the number $u\%2$ is $1$ if and only if it is not $0$. In other words,
we have the equivalence%
\begin{equation}
\left(  u\%2=1\right)  \ \Longleftrightarrow\ \left(  u\%2\neq0\right)  .
\label{sol.ent.even-odd.1.2}%
\end{equation}


Proposition \ref{prop.ent.mod.0} (applied to $a=u$ and $n=2$) shows that
$u\equiv0\operatorname{mod}2$ if and only if $2\mid u$. In other words, we
have the equivalence%
\begin{equation}
\left(  u\equiv0\operatorname{mod}2\right)  \ \Longleftrightarrow\ \left(
2\mid u\right)  . \label{sol.ent.even-odd.1.3}%
\end{equation}


\textbf{(a)} We have the following chain of equivalences:%
\begin{align*}
\left(  u\text{ is even}\right)  \  &  \Longleftrightarrow\ \left(  u\text{ is
divisible by }2\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
\textquotedblleft even\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  2\mid u\right)  \ \Longleftrightarrow\ \left(
u\%2=0\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.ent.even-odd.1.1})}\right)  .
\end{align*}
In other words, $u$ is even if and only if $u\%2=0$. This solves Exercise
\ref{exe.ent.even-odd.1} \textbf{(a)}.

\textbf{(b)} We have the following chain of equivalences:%
\begin{align}
\left(  u\text{ is odd}\right)  \  &  \Longleftrightarrow\ \left(  u\text{ is
not divisible by }2\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the
definition of \textquotedblleft odd\textquotedblright}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \text{we don't have }2\mid u\right)
\ \Longleftrightarrow\ \left(  \text{we don't have }u\%2=0\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{because of the equivalence }\left(  2\mid
u\right)  \ \Longleftrightarrow\ \left(  u\%2=0\right)  \right) \nonumber\\
&  \Longleftrightarrow\ \left(  u\%2\neq0\right)
\label{sol.ent.even-odd.1.b.1}\\
&  \Longleftrightarrow\ \left(  u\%2=1\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by (\ref{sol.ent.even-odd.1.2})}\right)  .\nonumber
\end{align}
In other words, $u$ is odd if and only if $u\%2=1$. This solves Exercise
\ref{exe.ent.even-odd.1} \textbf{(b)}.

\textbf{(c)} We have the following chain of equivalences:%
\begin{align*}
\left(  u\text{ is even}\right)  \  &  \Longleftrightarrow\ \left(  u\text{ is
divisible by }2\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
\textquotedblleft even\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  2\mid u\right)  \ \Longleftrightarrow\ \left(
u\equiv0\operatorname{mod}2\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.ent.even-odd.1.3})}\right)  .
\end{align*}
In other words, $u$ is even if and only if $u\equiv0\operatorname{mod}2$. This
solves Exercise \ref{exe.ent.even-odd.1} \textbf{(c)}.

\textbf{(d)} $\Longrightarrow:$ Assume that $u$ is odd. We must prove that
$u\equiv1\operatorname{mod}2$.

We know that $u$ is odd. In other words, $u\%2=1$ (by Exercise
\ref{exe.ent.even-odd.1} \textbf{(b)}). But recall that $u\%2\equiv
u\operatorname{mod}2$. Thus, $u\equiv u\%2=1\operatorname{mod}2$. This proves
the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction of
Exercise \ref{exe.ent.even-odd.1} \textbf{(d)}.

$\Longleftarrow:$ Assume that $u\equiv1\operatorname{mod}2$. We must prove
that $u$ is odd.

We have $1\equiv u\operatorname{mod}2$ (since $u\equiv1\operatorname{mod}2$)
and $1\in\left\{  0,1,\ldots,2-1\right\}  $. But Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $n=2$) says that if
$c\in\left\{  0,1,\ldots,2-1\right\}  $ satisfies $c\equiv u\operatorname{mod}%
2$, then $c=u\%2$. Applying this to $c=1$, we find $1=u\%2$ (since
$1\in\left\{  0,1,\ldots,2-1\right\}  $ and $1\equiv u\operatorname{mod}2$).
In other words, $u\%2=1$. According to Exercise \ref{exe.ent.even-odd.1}
\textbf{(b)}, this means that $u$ is odd. This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Exercise
\ref{exe.ent.even-odd.1} \textbf{(d)}.

\textbf{(e)} $\Longrightarrow:$ Assume that $u$ is odd. We must prove that
$u+1$ is even.

We have assumed that $u$ is odd. According to Exercise
\ref{exe.ent.even-odd.1} \textbf{(d)}, this means that $u\equiv
1\operatorname{mod}2$. On the other hand, $1\equiv-1\operatorname{mod}2$
(since $2\mid1-\left(  -1\right)  $). Adding these two congruences together,
we find $u+1\equiv1+\left(  -1\right)  =0\operatorname{mod}2$.

But Exercise \ref{exe.ent.even-odd.1} \textbf{(c)} (applied to $u+1$ instead
of $u$) shows that $u+1$ is even if and only if $u+1\equiv0\operatorname{mod}%
2$. Hence, $u+1$ is even (since $u+1\equiv0\operatorname{mod}2$). This proves
the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction of
Exercise \ref{exe.ent.even-odd.1} \textbf{(e)}.

$\Longleftarrow:$ Assume that $u+1$ is even. We must prove that $u$ is odd.

We know that $u+1$ is even. But Exercise \ref{exe.ent.even-odd.1} \textbf{(c)}
(applied to $u+1$ instead of $u$) shows that $u+1$ is even if and only if
$u+1\equiv0\operatorname{mod}2$. Hence, $u+1\equiv0\operatorname{mod}2$ (since
$u+1$ is even). On the other hand, $-1\equiv1\operatorname{mod}2$ (since
$2\mid\left(  -1\right)  -1$). Adding these two congruences together, we
obtain $\left(  u+1\right)  +\left(  -1\right)  \equiv0+1=1\operatorname{mod}%
2$. In view of $\left(  u+1\right)  +\left(  -1\right)  =u$, this rewrites as
$u\equiv1\operatorname{mod}2$. According to Exercise \ref{exe.ent.even-odd.1}
\textbf{(d)}, this means that $u$ is odd. This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Exercise
\ref{exe.ent.even-odd.1} \textbf{(e)}.

\textbf{(f)} We have the equivalence $\left(  u\text{ is divisible by
}2\right)  \ \Longleftrightarrow\ \left(  u\text{ is even}\right)  $ (by the
definition of \textquotedblleft even\textquotedblright).

Exercise \ref{exe.ent.even-odd.1} \textbf{(e)} shows that $u$ is odd if and
only if $u+1$ is even. Thus, we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  u+1\text{ is even}\right) \\
&  \Longleftrightarrow\ \left(  u\text{ is odd}\right)  \ \Longleftrightarrow
\ \left(  u\text{ is not divisible by }2\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of \textquotedblleft odd\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  u\text{ is not even}\right)
\end{align*}
(because of the equivalence $\left(  u\text{ is divisible by }2\right)
\ \Longleftrightarrow\ \left(  u\text{ is even}\right)  $). In other words,
$u+1$ is even if and only if $u$ is not. In other words, exactly one of the
two numbers $u$ and $u+1$ is even. This solves Exercise
\ref{exe.ent.even-odd.1} \textbf{(f)}.

\textbf{(g)} Exercise \ref{exe.ent.even-odd.1} \textbf{(f)} shows that exactly
one of the two numbers $u$ and $u+1$ is even. Thus, in particular, \textbf{at
least} one of these two numbers is even. Hence, the product $u\left(
u+1\right)  $ has \textbf{at least} one even factor. But a product of any even
integer with any integer is even\footnote{\textit{Proof.} We must prove that
if $a$ is an even integer, and if $b$ is an integer, then the product $ab$ is
even.
\par
So let $a$ be an even integer, and let $b$ be an integer. Then, $a$ is even;
in other words, $2\mid a$ (by the definition of \textquotedblleft
even\textquotedblright). But $a\mid ab$. Hence, $2\mid a\mid ab$; in other
words, $ab$ is even. Qed.}. Hence, a product that has at least one even factor
is always even. Thus, $u\left(  u+1\right)  $ is even (since $u\left(
u+1\right)  $ is a product that has at least one even factor). In other words,
$2\mid u\left(  u+1\right)  $. In other words, $u\left(  u+1\right)
\equiv0\operatorname{mod}2$. This solves Exercise \ref{exe.ent.even-odd.1}
\textbf{(g)}.

\textbf{(h)} We have $u^{2}-\left(  -u\right)  =u^{2}+u=u\left(  u+1\right)
\equiv0\operatorname{mod}2$ (by Exercise \ref{exe.ent.even-odd.1}
\textbf{(g)}). In other words, $2\mid u^{2}-\left(  -u\right)  $. In other
words, $u^{2}\equiv-u\operatorname{mod}2$.

Also, $2\mid\left(  -u\right)  -u$ (since $\left(  -u\right)  -u=2\left(
-u\right)  $ is clearly divisible by $2$); in other words, $-u\equiv
u\operatorname{mod}2$. Hence, $u^{2}\equiv-u\equiv u\operatorname{mod}2$. This
solves Exercise \ref{exe.ent.even-odd.1} \textbf{(h)}.

\textbf{(i)} Exercise \ref{exe.ent.quo-rem.mod=rem} (applied to $n=2$) shows
that $u\equiv v\operatorname{mod}2$ if and only if $u\%2=v\%2$.

We are in one of the following four cases:

\textit{Case 1:} We have $u\%2=0$ and $v\%2=0$.

\textit{Case 2:} We have $u\%2=0$ and $v\%2\neq0$.

\textit{Case 3:} We have $u\%2\neq0$ and $v\%2=0$.

\textit{Case 4:} We have $u\%2\neq0$ and $v\%2\neq0$.

Let us first consider Case 1. In this case, we have $u\%2=0$ and $v\%2=0$.
Thus, $u\%2=0=v\%2$ and therefore $u\equiv v\operatorname{mod}2$ (since we
know that $u\equiv v\operatorname{mod}2$ if and only if $u\%2=v\%2$). But
recall that $u\%2=0$. Equivalently, $u$ is even (because of Exercise
\ref{exe.ent.even-odd.1} \textbf{(a)}). Similarly, from $v\%2=0$, we conclude
that $v$ is even. Thus, $u$ and $v$ are either both odd or both even (namely,
they are both even).

Thus, $u\equiv v\operatorname{mod}2$ holds if and only if $u$ and $v$ are
either both odd or both even (because both statements \textquotedblleft%
$u\equiv v\operatorname{mod}2$\textquotedblright\ and \textquotedblleft$u$ and
$v$ are either both odd or both even\textquotedblright\ hold). Hence, Exercise
\ref{exe.ent.even-odd.1} \textbf{(i)} is solved in Case 1.

Let us now consider Case 2. In this case, we have $u\%2=0$ and $v\%2\neq0$.
Thus, $u\%2=0\neq v\%2$. In other words, \textquotedblleft$u\%2=v\%2$%
\textquotedblright\ is false. Thus, \textquotedblleft$u\equiv
v\operatorname{mod}2$\textquotedblright\ is false as well (since we know that
$u\equiv v\operatorname{mod}2$ if and only if $u\%2=v\%2$). But recall that
$u\%2=0$. Equivalently, $u$ is even (because of Exercise
\ref{exe.ent.even-odd.1} \textbf{(a)}). Hence, $u$ is not odd\footnote{because
an integer is either even or odd (but not both at the same time)}. Thus, $u$
and $v$ are not both odd. Also, Exercise \ref{exe.ent.even-odd.1} \textbf{(a)}
(applied to $v$ instead of $u$) shows that $v$ is even if and only if
$v\%2=0$. Since we don't have $v\%2=0$ (because $v\%2\neq0$), we thus conclude
that $v$ is not even. Thus, $u$ and $v$ are not both even.

So $u$ and $v$ are neither both odd nor both even. In other words, the
statement \textquotedblleft$u$ and $v$ are either both odd or both
even\textquotedblright\ is false.

Thus, $u\equiv v\operatorname{mod}2$ holds if and only if $u$ and $v$ are
either both odd or both even (because both statements \textquotedblleft%
$u\equiv v\operatorname{mod}2$\textquotedblright\ and \textquotedblleft$u$ and
$v$ are either both odd or both even\textquotedblright\ are false). Hence,
Exercise \ref{exe.ent.even-odd.1} \textbf{(i)} is solved in Case 2.

Case 3 is analogous to Case 2 (it differs from Case 2 only in that $u$ and $v$
trade places).

Let us finally consider Case 4. In this case, we have $u\%2\neq0$ and
$v\%2\neq0$. By (\ref{sol.ent.even-odd.1.b.1}), we have the logical
equivalence $\left(  u\text{ is odd}\right)  \ \Longleftrightarrow\ \left(
u\%2\neq0\right)  $. Hence, $u$ is odd (since $u\%2\neq0$). Similarly, $v$ is
odd. Thus, $u$ and $v$ are both odd. Thus, $u$ and $v$ are either both odd or
both even (namely, they are both odd). Moreover, we know that $u$ is odd;
equivalently, $u\%2=1$ (by Exercise \ref{exe.ent.even-odd.1} \textbf{(b)}).
Similarly, $v\%2=1$. Hence, $u\%2=1=v\%2$. Therefore, $u\equiv
v\operatorname{mod}2$ (since we know that $u\equiv v\operatorname{mod}2$ if
and only if $u\%2=v\%2$).

Thus, $u\equiv v\operatorname{mod}2$ holds if and only if $u$ and $v$ are
either both odd or both even (because both statements \textquotedblleft%
$u\equiv v\operatorname{mod}2$\textquotedblright\ and \textquotedblleft$u$ and
$v$ are either both odd or both even\textquotedblright\ hold). Hence, Exercise
\ref{exe.ent.even-odd.1} \textbf{(i)} is solved in Case 4.

We have now solved Exercise \ref{exe.ent.even-odd.1} \textbf{(i)} in all four
Cases 1, 2, 3 and 4. Hence, Exercise \ref{exe.ent.even-odd.1} \textbf{(i)} is solved.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.even-odd-sumsq}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.even-odd-sumsq}.]\textbf{(a)} Let $u$ be an
even integer. Thus, $u$ is even. In other words, $u$ is divisible by $2$. In
other words, there exists some integer $c$ such that $u=2c$. Consider this $c$.

From $u=2c$, we obtain $u^{2}=\left(  2c\right)  ^{2}=4c^{2}$, which is
clearly divisible by $4$. So we have $4\mid u^{2}=u^{2}-0$. In other words,
$u^{2}\equiv0\operatorname{mod}4$. This solves Exercise
\ref{exe.ent.even-odd-sumsq} \textbf{(a)}.

\textbf{(b)} Let $u$ be an odd integer. Thus, $u$ is odd. Equivalently,
$u\equiv1\operatorname{mod}2$ (by Exercise \ref{exe.ent.even-odd.1}
\textbf{(d)}). In other words, $2\mid u-1$. In other words, there exists some
integer $c$ such that $u-1=2c$. Consider this $c$.

From $u-1=2c$, we obtain $u=2c+1$ and thus $u^{2}=\left(  2c+1\right)
^{2}=4c^{2}+4c+1$. Hence, $u^{2}-1=4c^{2}+4c=4\left(  c^{2}+c\right)  $, which
is clearly divisible by $4$. So we have $4\mid u^{2}-1$. In other words,
$u^{2}\equiv1\operatorname{mod}4$. This solves Exercise
\ref{exe.ent.even-odd-sumsq} \textbf{(b)}.

\textbf{(c)} Let $x$ and $y$ be two integers such that $x^{2}+y^{2}%
\equiv3\operatorname{mod}4$. We shall derive a contradiction.

Recall that an integer is always either even or odd. Thus, $x$ is either even
or odd. Similarly, $y$ is either even or odd. Thus, we are in one of the
following four cases:

\textit{Case 1:} The integer $x$ is even, and the integer $y$ is even.

\textit{Case 2:} The integer $x$ is even, and the integer $y$ is odd.

\textit{Case 3:} The integer $x$ is odd, and the integer $y$ is even.

\textit{Case 4:} The integer $x$ is odd, and the integer $y$ is odd.

Let us first consider Case 1. In this case, the integer $x$ is even, and the
integer $y$ is even. Hence, Exercise \ref{exe.ent.even-odd-sumsq} \textbf{(a)}
(applied to $u=x$) yields $x^{2}\equiv0\operatorname{mod}4$ (since $x$ is
even). Also, Exercise \ref{exe.ent.even-odd-sumsq} \textbf{(a)} (applied to
$u=y$) yields $y^{2}\equiv0\operatorname{mod}4$ (since $y$ is even). Thus,
$\underbrace{x^{2}}_{\equiv0\operatorname{mod}4}+\underbrace{y^{2}}%
_{\equiv0\operatorname{mod}4}\equiv0+0=0\operatorname{mod}4$. Hence, $0\equiv
x^{2}+y^{2}\equiv3\operatorname{mod}4$. But Exercise
\ref{exe.ent.quo-rem.mod=rem} (applied to $n=4$, $u=0$ and $v=3$) shows that
$0\equiv3\operatorname{mod}4$ if and only if $0\%4=3\%4$. Hence, $0\%4=3\%4$
(since $0\equiv3\operatorname{mod}4$). This contradicts the fact that
$0\%4=0\neq3=3\%4$. Hence, we have obtained a contradiction in Case 1.

Let us next consider Case 2. In this case, the integer $x$ is even, and the
integer $y$ is odd. Hence, Exercise \ref{exe.ent.even-odd-sumsq} \textbf{(a)}
(applied to $u=x$) yields $x^{2}\equiv0\operatorname{mod}4$ (since $x$ is
even). Also, Exercise \ref{exe.ent.even-odd-sumsq} \textbf{(b)} (applied to
$u=y$) yields $y^{2}\equiv1\operatorname{mod}4$ (since $y$ is odd). Thus,
$\underbrace{x^{2}}_{\equiv0\operatorname{mod}4}+\underbrace{y^{2}}%
_{\equiv1\operatorname{mod}4}\equiv0+1=1\operatorname{mod}4$. Hence, $1\equiv
x^{2}+y^{2}\equiv3\operatorname{mod}4$. But Exercise
\ref{exe.ent.quo-rem.mod=rem} (applied to $n=4$, $u=1$ and $v=3$) shows that
$1\equiv3\operatorname{mod}4$ if and only if $1\%4=3\%4$. Hence, $1\%4=3\%4$
(since $1\equiv3\operatorname{mod}4$). This contradicts the fact that
$1\%4=1\neq3=3\%4$. Hence, we have obtained a contradiction in Case 2.

The arguments in Cases 3 and 4 are completely analogous (in Case 3, we obtain
$x^{2}+y^{2}\equiv1\operatorname{mod}4$ again, whereas in Case 4 we obtain
$x^{2}+y^{2}\equiv2\operatorname{mod}4$). Thus, we have obtained a
contradiction in each of the four Cases 1, 2, 3 and 4. Hence, we always have a contradiction.

Now, forget that we fixed $x$ and $y$. We thus have obtained a contradiction
whenever $x$ and $y$ are two integers such that $x^{2}+y^{2}\equiv
3\operatorname{mod}4$. Thus, there are no such two integers. This solves
Exercise \ref{exe.ent.even-odd-sumsq} \textbf{(c)}.

\textbf{(d)} The solution of Exercise \ref{exe.ent.even-odd-sumsq}
\textbf{(d)} is very similar to the above solution of Exercise
\ref{exe.ent.even-odd-sumsq} \textbf{(c)} (indeed, we have to consider the
same four cases, but this time we don't get a contradiction in Case 4) and is
left to the reader.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.13mod4}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.13mod4}.]\textbf{(a)} Define two sets $A$
and $B$ by%
\begin{equation}
A=\left\{  i\in\mathbb{N}\ \mid\ i\text{ is even}\right\}
\label{sol.ent.13mod4.a.defA}%
\end{equation}
and%
\begin{equation}
B=\left\{  d\in\mathbb{N}\ \mid\ d\equiv1\operatorname{mod}4\right\}  .
\label{sol.ent.13mod4.a.defB}%
\end{equation}


For each $u\in A$, we have $2u+1\in B$\ \ \ \ \footnote{\textit{Proof.} Let
$u\in A$. Thus, $u\in A=\left\{  i\in\mathbb{N}\ \mid\ i\text{ is
even}\right\}  $. In other words, $u$ is an $i\in\mathbb{N}$ such that $i$ is
even. In other words, $u$ is an element of $\mathbb{N}$ and is even. Thus,
$u\in\mathbb{N}$, so that $2u+1\in\mathbb{N}$. Moreover, $u$ is even; in other
words, $u\equiv0\operatorname{mod}2$ (by Exercise \ref{exe.ent.even-odd.1}
\textbf{(c)}). In other words, $2\mid u-0$. In other words, there exists an
integer $c$ such that $u-0=2c$. Consider this $c$. Now, $u=u-0=2c$, so that
$2\underbrace{u}_{=2c}=2\cdot2c=4c\equiv0\operatorname{mod}4$ (since we
clearly have $4\mid4c$). Hence,%
\[
\underbrace{2u}_{\equiv0\operatorname{mod}4}+1\equiv0+1=1\operatorname{mod}4.
\]
Hence, $2u+1$ is an element of $\mathbb{N}$ (since $2u+1\in\mathbb{N}$) and
satisfies $2u+1\equiv1\operatorname{mod}4$. In other words, $2u+1$ is a
$d\in\mathbb{N}$ satisfying $d\equiv1\operatorname{mod}4$. In other words,
$2u+1\in\left\{  d\in\mathbb{N}\ \mid\ d\equiv1\operatorname{mod}4\right\}  $.
In view of (\ref{sol.ent.13mod4.a.defB}), this rewrites as $2u+1\in B$. Qed.}.
Renaming the variable $u$ as $i$ in this statement, we obtain the following:
For each $i\in A$, we have $2i+1\in B$. Thus, the map%
\begin{align*}
A  &  \rightarrow B,\\
i  &  \mapsto2i+1
\end{align*}
is well-defined. Let us denote this map by $f$.

For each $v\in B$, we have $\left(  v-1\right)  /2\in A$%
\ \ \ \ \footnote{\textit{Proof.} Let $v\in B$. Thus, $v\in B=\left\{
d\in\mathbb{N}\ \mid\ d\equiv1\operatorname{mod}4\right\}  $. In other words,
$v$ is a $d\in\mathbb{N}$ satisfying $d\equiv1\operatorname{mod}4$. In other
words, $v$ is an element of $\mathbb{N}$ and satisfies $v\equiv
1\operatorname{mod}4$. Thus, in particular, $v\equiv1\operatorname{mod}4$; in
other words, $4\mid v-1$. In other words, there exists an integer $w$ such
that $v-1=4w$. Consider this $w$. We have $v\geq0$ (since $v$ is an element of
$\mathbb{N}$) and thus $\underbrace{v}_{\geq0}-1\geq-1$. If we had $w\leq-1$,
then we would have $v-1=4\underbrace{w}_{\leq-1}\leq4\left(  -1\right)
=-4<-1$, which would contradict $v-1\geq-1$. Thus, we cannot have $w\leq-1$.
Hence, we have $w>-1$. Thus, $w\geq0$ (since $w$ is an integer), so that
$w\in\mathbb{N}$. Hence, $2w\in\mathbb{N}$. Moreover, $2\mid2w$ (since $w$ is
an integer). Thus, $2w$ is even. Hence, $2w$ is an $i\in\mathbb{N}$ such that
$i$ is even (since $2w\in\mathbb{N}$). In other words, $2w\in\left\{
i\in\mathbb{N}\ \mid\ i\text{ is even}\right\}  $. In view of
(\ref{sol.ent.13mod4.a.defA}), this rewrites as $2w\in A$. But $v-1=4w=2\cdot
2w$, so that $\left(  v-1\right)  /2=2w\in A$. Qed.}. Hence, the map%
\begin{align*}
B  &  \rightarrow A,\\
v  &  \mapsto\left(  v-1\right)  /2
\end{align*}
is well-defined. Let us denote this map by $g$.

We have $f\circ g=\operatorname*{id}$\ \ \ \ \footnote{\textit{Proof.} Let
$v\in B$. Then, the definition of $g$ yields $g\left(  v\right)  =\left(
v-1\right)  /2$. But the definition of $f$ yields $f\left(  g\left(  v\right)
\right)  =2\underbrace{g\left(  v\right)  }_{=\left(  v-1\right)
/2}+1=2\left(  v-1\right)  /2+1=v=\operatorname*{id}\left(  v\right)  $.
Comparing this with $f\left(  g\left(  v\right)  \right)  =\left(  f\circ
g\right)  \left(  v\right)  $, we obtain $\left(  f\circ g\right)  \left(
v\right)  =\operatorname*{id}\left(  v\right)  $.
\par
Now, forget that we fixed $v$. We thus have proven that $\left(  f\circ
g\right)  \left(  v\right)  =\operatorname*{id}\left(  v\right)  $ for each
$v\in B$. In other words, $f\circ g=\operatorname*{id}$.} and $g\circ
f=\operatorname*{id}$\ \ \ \ \footnote{\textit{Proof.} Let $i\in A$. Then, the
definition of $f$ yields $f\left(  i\right)  =2i+1$. But the definition of $g$
yields $g\left(  f\left(  i\right)  \right)  =\left(  \underbrace{f\left(
i\right)  }_{=2i+1}-1\right)  /2=\left(  2i+1-1\right)
/2=i=\operatorname*{id}\left(  i\right)  $. Comparing this with $g\left(
f\left(  i\right)  \right)  =\left(  g\circ f\right)  \left(  i\right)  $, we
obtain $\left(  g\circ f\right)  \left(  i\right)  =\operatorname*{id}\left(
i\right)  $.
\par
Now, forget that we fixed $i$. We thus have proven that $\left(  g\circ
f\right)  \left(  i\right)  =\operatorname*{id}\left(  i\right)  $ for each
$i\in A$. In other words, $g\circ f=\operatorname*{id}$.}. Thus, the maps $f$
and $g$ are mutually inverse. Hence, the map $f$ is invertible, i.e.,
bijective. In other words, the map $f$ is a bijection.

So we have proven that the map $f$ is well-defined and is a bijection. In
other words, the map%
\begin{align*}
A  &  \rightarrow B,\\
i  &  \mapsto2i+1
\end{align*}
is well-defined and is a bijection\footnote{since the map $f$ is the map
\begin{align*}
A  &  \rightarrow B,\\
i  &  \mapsto2i+1
\end{align*}
}. Using (\ref{sol.ent.13mod4.a.defA}) and (\ref{sol.ent.13mod4.a.defB}), we
can rewrite this as follows: The map%
\begin{align*}
\left\{  i\in\mathbb{N}\ \mid\ i\text{ is even}\right\}   &  \rightarrow
\left\{  d\in\mathbb{N}\ \mid\ d\equiv1\operatorname{mod}4\right\}  ,\\
i  &  \mapsto2i+1
\end{align*}
is well-defined and is a bijection. This solves Exercise \ref{exe.ent.13mod4}
\textbf{(a)}.

\textbf{(b)} Define two sets $A$ and $B$ by%
\begin{equation}
A=\left\{  i\in\mathbb{N}\ \mid\ i\text{ is odd}\right\}
\label{sol.ent.13mod4.b.defA}%
\end{equation}
and%
\begin{equation}
B=\left\{  d\in\mathbb{N}\ \mid\ d\equiv3\operatorname{mod}4\right\}  .
\label{sol.ent.13mod4.b.defB}%
\end{equation}


For each $u\in A$, we have $2u+1\in B$\ \ \ \ \footnote{\textit{Proof.} Let
$u\in A$. Thus, $u\in A=\left\{  i\in\mathbb{N}\ \mid\ i\text{ is
odd}\right\}  $. In other words, $u$ is an $i\in\mathbb{N}$ such that $i$ is
odd. In other words, $u$ is an element of $\mathbb{N}$ and is odd. Thus,
$u\in\mathbb{N}$, so that $2u+1\in\mathbb{N}$. Moreover, $u$ is odd; in other
words, $u\equiv1\operatorname{mod}2$ (by Exercise \ref{exe.ent.even-odd.1}
\textbf{(d)}). In other words, $2\mid u-1$. In other words, there exists an
integer $c$ such that $u-1=2c$. Consider this $c$. Now,
$2u-2=2\underbrace{\left(  u-1\right)  }_{=2c}=2\cdot2c=4c\equiv
0\operatorname{mod}4$ (since we clearly have $4\mid4c$). Hence,%
\[
2u+1=\underbrace{2u-2}_{\equiv0\operatorname{mod}4}+3\equiv
0+3=3\operatorname{mod}4.
\]
Hence, $2u+1$ is an element of $\mathbb{N}$ (since $2u+1\in\mathbb{N}$) and
satisfies $2u+1\equiv3\operatorname{mod}4$. In other words, $2u+1$ is a
$d\in\mathbb{N}$ satisfying $d\equiv3\operatorname{mod}4$. In other words,
$2u+1\in\left\{  d\in\mathbb{N}\ \mid\ d\equiv3\operatorname{mod}4\right\}  $.
In view of (\ref{sol.ent.13mod4.b.defB}), this rewrites as $2u+1\in B$. Qed.}.
Renaming the variable $u$ as $i$ in this statement, we obtain the following:
For each $i\in A$, we have $2i+1\in B$. Thus, the map%
\begin{align*}
A  &  \rightarrow B,\\
i  &  \mapsto2i+1
\end{align*}
is well-defined. Let us denote this map by $f$.

For each $v\in B$, we have $\left(  v-1\right)  /2\in A$%
\ \ \ \ \footnote{\textit{Proof.} Let $v\in B$. Thus, $v\in B=\left\{
d\in\mathbb{N}\ \mid\ d\equiv3\operatorname{mod}4\right\}  $. In other words,
$v$ is a $d\in\mathbb{N}$ satisfying $d\equiv3\operatorname{mod}4$. In other
words, $v$ is an element of $\mathbb{N}$ and satisfies $v\equiv
3\operatorname{mod}4$. Thus, in particular, $v\equiv3\operatorname{mod}4$; in
other words, $4\mid v-3$. In other words, there exists an integer $w$ such
that $v-3=4w$. Consider this $w$. We have $v\geq0$ (since $v$ is an element of
$\mathbb{N}$) and thus $\underbrace{v}_{\geq0}-3\geq-3$. If we had $w\leq-1$,
then we would have $v-3=4\underbrace{w}_{\leq-1}\leq4\left(  -1\right)
=-4<-3$, which would contradict $v-3\geq-3$. Thus, we cannot have $w\leq-1$.
Hence, we have $w>-1$. Thus, $w\geq0$ (since $w$ is an integer), so that
$w\in\mathbb{N}$. Hence, $2w+1\in\mathbb{N}$. Moreover, $\underbrace{2}%
_{\equiv0\operatorname{mod}2}w+1\equiv0w+1=1\operatorname{mod}2$. But Exercise
\ref{exe.ent.even-odd.1} \textbf{(d)} (applied to $u=2w+1$) shows that $2w+1$
is odd if and only if $2w+1\equiv1\operatorname{mod}2$. Hence, $2w+1$ is odd
(since $2w+1\equiv1\operatorname{mod}2$). Hence, $2w+1$ is an $i\in\mathbb{N}$
such that $i$ is odd (since $2w+1\in\mathbb{N}$). In other words,
$2w+1\in\left\{  i\in\mathbb{N}\ \mid\ i\text{ is odd}\right\}  $. In view of
(\ref{sol.ent.13mod4.b.defA}), this rewrites as $2w+1\in A$. But
$v-1=\underbrace{v-3}_{=4w}+2=4w+2=2\left(  2w+1\right)  $, so that $\left(
v-1\right)  /2=2w+1\in A$. Qed.}. Hence, the map%
\begin{align*}
B  &  \rightarrow A,\\
v  &  \mapsto\left(  v-1\right)  /2
\end{align*}
is well-defined. Let us denote this map by $g$.

The maps $f$ and $g$ are mutually inverse\footnote{This can be proven in the
exact same way as the analogous statement was shown in our above solution to
Exercise \ref{exe.ent.13mod4} \textbf{(a)}. In fact, the maps $f$ and $g$ here
act in the exact same way as the maps $f$ and $g$ in our solution to Exercise
\ref{exe.ent.13mod4} \textbf{(a)}; the only thing that is different are their
domains and codomains $A$ and $B$.}. Hence, the map $f$ is invertible, i.e.,
bijective. In other words, the map $f$ is a bijection.

So we have proven that the map $f$ is well-defined and is a bijection. In
other words, the map%
\begin{align*}
A  &  \rightarrow B,\\
i  &  \mapsto2i+1
\end{align*}
is well-defined and is a bijection\footnote{since the map $f$ is the map
\begin{align*}
A  &  \rightarrow B,\\
i  &  \mapsto2i+1
\end{align*}
}. Using (\ref{sol.ent.13mod4.b.defA}) and (\ref{sol.ent.13mod4.b.defB}), we
can rewrite this as follows: The map%
\begin{align*}
\left\{  i\in\mathbb{N}\ \mid\ i\text{ is odd}\right\}   &  \rightarrow
\left\{  d\in\mathbb{N}\ \mid\ d\equiv3\operatorname{mod}4\right\}  ,\\
i  &  \mapsto2i+1
\end{align*}
is well-defined and is a bijection. This solves Exercise \ref{exe.ent.13mod4}
\textbf{(b)}.

[\textit{Remark:} The reader can easily find an alternative solution to
Exercise \ref{exe.ent.13mod4}, which proceeds by restricting the bijection
from Exercise \ref{exe.ent.quo-rem.bijs} \textbf{(b)}. We chose to give the
above solution instead since it is more explicit.]
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.Div.set}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.Div.set}.]Assume that $\left\{  b_{1}%
,b_{2},\ldots,b_{k}\right\}  =\left\{  c_{1},c_{2},\ldots,c_{\ell}\right\}  $.

Let $a$ be an integer. Then, $a$ is a common divisor of $b_{1},b_{2}%
,\ldots,b_{k}$ if and only if $a$ satisfies $\left(  a\mid b_{i}\text{ for all
}i\in\left\{  1,2,\ldots,k\right\}  \right)  $ (by the definition of
\textquotedblleft common divisor\textquotedblright). Hence, we have the
following chain of equivalences:%
\begin{align*}
&  \ \left(  a\text{ is a common divisor of }b_{1},b_{2},\ldots,b_{k}\right)
\\
&  \Longleftrightarrow\ \left(  a\mid b_{i}\text{ for all }i\in\left\{
1,2,\ldots,k\right\}  \right) \\
&  \Longleftrightarrow\ \left(  a\mid b_{1}\text{ and }a\mid b_{2}\text{ and
}\cdots\text{ and }a\mid b_{k}\right) \\
&  \Longleftrightarrow\ \left(  a\mid u\text{ for each }u\in\left\{
b_{1},b_{2},\ldots,b_{k}\right\}  \right)  .
\end{align*}
But $\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ is the set
of all common divisors of $b_{1},b_{2},\ldots,b_{k}$. Hence, we have
$a\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ if and only
if $a$ is a common divisor of $b_{1},b_{2},\ldots,b_{k}$. Thus, we have the
following chain of equivalences:%
\begin{align}
&  \ \left(  a\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right) \nonumber\\
&  \Longleftrightarrow\ \left(  a\text{ is a common divisor of }b_{1}%
,b_{2},\ldots,b_{k}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  a\mid u\text{ for each }u\in\left\{
b_{1},b_{2},\ldots,b_{k}\right\}  \right)  . \label{sol.ent.Div.set.1}%
\end{align}
The same argument (applied to $\ell$ and $\left(  c_{1},c_{2},\ldots,c_{\ell
}\right)  $ instead of $k$ and $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $)
yields the equivalence%
\begin{align}
&  \ \left(  a\in\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell
}\right)  \right) \nonumber\\
&  \Longleftrightarrow\ \left(  a\mid u\text{ for each }u\in\left\{
c_{1},c_{2},\ldots,c_{\ell}\right\}  \right)  . \label{sol.ent.Div.set.2}%
\end{align}


Now, we have the following chain of equivalences:%
\begin{align*}
&  \ \left(  a\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right) \\
&  \Longleftrightarrow\ \left(  a\mid u\text{ for each }u\in
\underbrace{\left\{  b_{1},b_{2},\ldots,b_{k}\right\}  }_{=\left\{
c_{1},c_{2},\ldots,c_{\ell}\right\}  }\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by (\ref{sol.ent.Div.set.1})}\right) \\
&  \Longleftrightarrow\ \left(  a\mid u\text{ for each }u\in\left\{
c_{1},c_{2},\ldots,c_{\ell}\right\}  \right) \\
&  \Longleftrightarrow\ \left(  a\in\operatorname*{Div}\left(  c_{1}%
,c_{2},\ldots,c_{\ell}\right)  \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.ent.Div.set.2})}\right)  .
\end{align*}


Now, forget that we fixed $a$. We thus have proven the equivalence
\[
\left(  a\in\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)
\right)  \ \Longleftrightarrow\ \left(  a\in\operatorname*{Div}\left(
c_{1},c_{2},\ldots,c_{\ell}\right)  \right)
\]
for each integer $a$. In other words, an integer $a$ belongs to the set
$\operatorname*{Div}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $ if and only if
it belongs to the set $\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell
}\right)  $. In other words, the two sets $\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{k}\right)  $ and $\operatorname*{Div}\left(  c_{1}%
,c_{2},\ldots,c_{\ell}\right)  $ contain the exact same integers. Since both
of these sets consist of integers only, this entails that these two sets are
equal. In other words, $\operatorname*{Div}\left(  b_{1},b_{2},\ldots
,b_{k}\right)  =\operatorname*{Div}\left(  c_{1},c_{2},\ldots,c_{\ell}\right)
$. This solves Exercise \ref{exe.ent.Div.set}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.gcd.set}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.gcd.set}.]Assume that $\left\{  b_{1}%
,b_{2},\ldots,b_{k}\right\}  =\left\{  c_{1},c_{2},\ldots,c_{\ell}\right\}  $.
Then, Exercise \ref{exe.ent.Div.set} yields $\operatorname*{Div}\left(
b_{1},b_{2},\ldots,b_{k}\right)  =\operatorname*{Div}\left(  c_{1}%
,c_{2},\ldots,c_{\ell}\right)  $. Hence, Lemma \ref{lem.ent.gcd.through-Divc}
yields $\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\gcd\left(  c_{1}%
,c_{2},\ldots,c_{\ell}\right)  $. This solves Exercise \ref{exe.ent.gcd.set}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.gcd.an-1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.gcd.an-1}.]\textbf{(a)} Let $a\in
\mathbb{N}$ and $b\in\mathbb{N}$ be such that $b\geq a$.

We have $b-a\geq0$ (since $b\geq a$), hence $b-a\in\mathbb{N}$. Thus,
$u^{b-a}$ is an integer. We have%
\begin{align*}
\left(  u^{b}-1\right)  -\left(  u^{a}-1\right)   &  =u^{b}-u^{a}%
=\underbrace{u^{\left(  b-a\right)  +a}}_{=u^{b-a}u^{a}}-u^{a}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }b=\left(  b-a\right)  +a\right) \\
&  =u^{b-a}u^{a}-u^{a}=\left(  u^{b-a}-1\right)  u^{a}.
\end{align*}
Thus, $u^{b-a}-1\mid\left(  u^{b}-1\right)  -\left(  u^{a}-1\right)  $ (since
$u^{a}$ is an integer). In other words, $u^{b}-1\equiv u^{a}%
-1\operatorname{mod}u^{b-a}-1$. This solves Exercise \ref{exe.ent.gcd.an-1}
\textbf{(a)}.

\begin{noncompile}
(Old version of the proof, longer:)

We have $b-a\geq0$ (since $b\geq a$), hence $b-a\in\mathbb{N}$. Thus,
$u^{b-a}$ is an integer. Moreover, $u^{a}u^{b-a}=u^{a+\left(  b-a\right)
}=u^{b}$ (since $a+\left(  b-a\right)  =b$). Now,%
\[
\underbrace{u^{a}\left(  u^{b-a}-1\right)  }_{=u^{a}u^{b-a}-u^{a}}+\left(
u^{a}-1\right)  =u^{a}u^{b-a}-u^{a}+\left(  u^{a}-1\right)  =\underbrace{u^{a}%
u^{b-a}}_{=u^{b}}-1=u^{b}-1.
\]
Hence, $\left(  u^{b}-1\right)  -\left(  u^{a}-1\right)  =u^{a}\left(
u^{b-a}-1\right)  =\left(  u^{b-a}-1\right)  u^{a}$. Thus, $u^{b-a}%
-1\mid\left(  u^{b}-1\right)  -\left(  u^{a}-1\right)  $ (since $u^{a}$ is an
integer). In other words, $u^{b}-1\equiv u^{a}-1\operatorname{mod}u^{b-a}-1$.
This solves Exercise \ref{exe.ent.gcd.an-1} \textbf{(a)}.
\end{noncompile}

\textbf{(b)} The following argument will imitate our proof of Lemma
\ref{lem.ent.gcd.bezout.++} above.

We use strong induction on $a+b$. Thus, we fix an $n\in\mathbb{N}$, and assume
(as induction hypothesis) that Exercise \ref{exe.ent.gcd.an-1} \textbf{(b)}
holds whenever $a+b<n$. We must now prove that Exercise \ref{exe.ent.gcd.an-1}
\textbf{(b)} holds whenever $a+b=n$.

We have assumed that Exercise \ref{exe.ent.gcd.an-1} \textbf{(b)} holds
whenever $a+b<n$. In other words, the following statement holds:

\begin{statement}
\textit{Statement 1:} Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$ be such that
$a+b<n$. Then, $\gcd\left(  u^{a}-1,u^{b}-1\right)  =\left\vert u^{\gcd\left(
a,b\right)  }-1\right\vert $.
\end{statement}

Now, we must prove that Exercise \ref{exe.ent.gcd.an-1} \textbf{(b)} holds
whenever $a+b=n$. Let us first prove this in the case when $b\geq a$:

\begin{statement}
\textit{Statement 2:} Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$ be such that
$a+b=n$ and $b\geq a$. Then, $\gcd\left(  u^{a}-1,u^{b}-1\right)  =\left\vert
u^{\gcd\left(  a,b\right)  }-1\right\vert $.
\end{statement}

[\textit{Proof of Statement 2:} We are in one of the following two cases:

\textit{Case 1:} We have $a=0$.

\textit{Case 2:} We have $a\neq0$.

Let us first consider Case 1. In this case, we have $a=0$. Hence, $u^{a}%
=u^{0}=1$ and thus $u^{a}-1=0$. Thus,%
\begin{align}
\gcd\left(  \underbrace{u^{a}-1}_{=0},u^{b}-1\right)   &  =\gcd\left(
0,u^{b}-1\right)  =\gcd\left(  u^{b}-1,0\right) \nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.ent.gcd.props1} \textbf{(b)}, applied to
}0\text{ and }u^{b}-1\\
\text{instead of }a\text{ and }b
\end{array}
\right) \nonumber\\
&  =\left\vert u^{b}-1\right\vert \label{sol.ent.gcd.an-1.b.s2.pf.1}%
\end{align}
(since Proposition \ref{prop.ent.gcd.props1} \textbf{(a)} (applied to
$u^{b}-1$ instead of $a$) yields $\gcd\left(  u^{b}-1,0\right)  =\gcd\left(
u^{b}-1\right)  =\left\vert u^{b}-1\right\vert $).

But Proposition \ref{prop.ent.gcd.props1} \textbf{(b)} yields $\gcd\left(
a,b\right)  =\gcd\left(  b,\underbrace{a}_{=0}\right)  =\gcd\left(
b,0\right)  $. Now, Proposition \ref{prop.ent.gcd.props1} \textbf{(a)}
(applied to $b$ instead of $a$) yields $\gcd\left(  b,0\right)  =\gcd\left(
b\right)  =\left\vert b\right\vert $. Hence, $\gcd\left(  a,b\right)
=\gcd\left(  b,0\right)  =\left\vert b\right\vert =b$ (since $b$ is
nonnegative). Hence, $\left\vert u^{\gcd\left(  a,b\right)  }-1\right\vert
=\left\vert u^{b}-1\right\vert $. Comparing this equality with
(\ref{sol.ent.gcd.an-1.b.s2.pf.1}), we obtain $\gcd\left(  u^{a}%
-1,u^{b}-1\right)  =\left\vert u^{\gcd\left(  a,b\right)  }-1\right\vert $.
Thus, Statement 2 is proven in Case 1.

Let us next consider Case 2. In this case, we have $a\neq0$. Hence, $a>0$
(since $a\in\mathbb{N}$), so that $a+b>b$. Hence, $b<a+b=n$.

From $b\geq a$, we obtain $b-a\in\mathbb{N}$. Moreover, $a\in\mathbb{N}$ and
$b-a\in\mathbb{N}$ satisfy $a+\left(  b-a\right)  =b<n$. Therefore, we can
apply Statement 1 \textbf{to }$b-a$ \textbf{instead of }$b$. Thus we obtain
that $\gcd\left(  u^{a}-1,u^{b-a}-1\right)  =\left\vert u^{\gcd\left(
a,b-a\right)  }-1\right\vert $.

But Proposition \ref{prop.ent.gcd.props1} \textbf{(c)} (applied to $u=-1$)
yields $\gcd\left(  a,\left(  -1\right)  a+b\right)  =\gcd\left(  a,b\right)
$. This rewrites as $\gcd\left(  a,b-a\right)  =\gcd\left(  a,b\right)  $
(since $\left(  -1\right)  a+b=b-a$).

Recall that $b-a\in\mathbb{N}$. Also, $b\geq b-a$ (since $a\geq0$). Hence,
Exercise \ref{exe.ent.gcd.an-1} \textbf{(a)} (applied to $b-a$ instead of $a$)
yields $u^{b}-1\equiv u^{b-a}-1\operatorname{mod}u^{b-\left(  b-a\right)  }%
-1$. Since $b-\left(  b-a\right)  =a$, this rewrites as $u^{b}-1\equiv
u^{b-a}-1\operatorname{mod}u^{a}-1$. Hence, Proposition
\ref{prop.ent.gcd.props1} \textbf{(d)} (applied to $u^{a}-1$, $u^{b}-1$ and
$u^{b-a}-1$ instead of $a$, $b$ and $c$) yields
\begin{align*}
\gcd\left(  u^{a}-1,u^{b}-1\right)   &  =\gcd\left(  u^{a}-1,u^{b-a}-1\right)
=\left\vert u^{\gcd\left(  a,b-a\right)  }-1\right\vert \\
&  =\left\vert u^{\gcd\left(  a,b\right)  }-1\right\vert
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\gcd\left(  a,b-a\right)
=\gcd\left(  a,b\right)  \right)  .
\end{align*}
Thus, Statement 2 is proven in Case 2.

We have now proven Statement 2 in both Cases 1 and 2. Hence, Statement 2 is
always proven.]

Now, we can prove that Exercise \ref{exe.ent.gcd.an-1} \textbf{(b)} holds
whenever $a+b=n$:

\begin{statement}
\textit{Statement 3:} Let $a\in\mathbb{N}$ and $b\in\mathbb{N}$ be such that
$a+b=n$. Then, $\gcd\left(  u^{a}-1,u^{b}-1\right)  =\left\vert u^{\gcd\left(
a,b\right)  }-1\right\vert $.
\end{statement}

[\textit{Proof of Statement 3:} We are in one of the following two cases:

\textit{Case 1:} We have $b\geq a$.

\textit{Case 2:} We have $b<a$.

Let us first consider Case 1. In this case, we have $b\geq a$. Hence,
Statement 2 shows that $\gcd\left(  u^{a}-1,u^{b}-1\right)  =\left\vert
u^{\gcd\left(  a,b\right)  }-1\right\vert $. Thus, Statement 3 is proven in
Case 1.

Let us next consider Case 2. In this case, we have $b<a$. Hence, $a>b$, so
that $a\geq b$. This shows that we can apply Statement 2 \textbf{to }%
$b$\textbf{ and }$a$ \textbf{instead of }$a$ \textbf{and }$b$. Thus we obtain
$\gcd\left(  u^{b}-1,u^{a}-1\right)  =\left\vert u^{\gcd\left(  b,a\right)
}-1\right\vert $. But Proposition \ref{prop.ent.gcd.props1} \textbf{(b)}
yields $\gcd\left(  a,b\right)  =\gcd\left(  b,a\right)  $. Moreover,
Proposition \ref{prop.ent.gcd.props1} \textbf{(b)} (applied to $u^{a}-1$ and
$u^{b}-1$ instead of $a$ and $b$) yields%
\[
\gcd\left(  u^{a}-1,u^{b}-1\right)  =\gcd\left(  u^{b}-1,u^{a}-1\right)
=\left\vert u^{\gcd\left(  b,a\right)  }-1\right\vert =\left\vert
u^{\gcd\left(  a,b\right)  }-1\right\vert
\]
(since $\gcd\left(  b,a\right)  =\gcd\left(  a,b\right)  $). Thus, Statement 3
is proven in Case 2.

We have now proven Statement 3 in both Cases 1 and 2. Hence, Statement 3 is
always proven.]

By proving Statement 3, we have shown that Exercise \ref{exe.ent.gcd.an-1}
\textbf{(b)} holds whenever $a+b=n$. This completes the induction step. Thus,
Exercise \ref{exe.ent.gcd.an-1} \textbf{(b)} is proven by strong induction.

[See also \url{https://math.stackexchange.com/questions/7473/} for various
solutions of Exercise \ref{exe.ent.gcd.an-1} \textbf{(b)}.]
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.gcd.div}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.gcd.div}.]Proposition
\ref{prop.ent.gcd.props1} \textbf{(f)} (applied to $a=a_{1}$ and $b=a_{2}$)
yields that we have $\gcd\left(  a_{1},a_{2}\right)  \mid a_{1}$ and
$\gcd\left(  a_{1},a_{2}\right)  \mid a_{2}$. Thus, $\gcd\left(  a_{1}%
,a_{2}\right)  \mid a_{1}\mid b_{1}$ and $\gcd\left(  a_{1},a_{2}\right)  \mid
a_{2}\mid b_{2}$.

So we know that $\gcd\left(  a_{1},a_{2}\right)  \mid b_{1}$ and $\gcd\left(
a_{1},a_{2}\right)  \mid b_{2}$. Hence, Lemma \ref{lem.ent.gcd.uniprop}
(applied to $m=\gcd\left(  a_{1},a_{2}\right)  $, $a=b_{1}$ and $b=b_{2}$)
yields $\gcd\left(  a_{1},a_{2}\right)  \mid\gcd\left(  b_{1},b_{2}\right)  $.
This solves Exercise \ref{exe.ent.gcd.div}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.gcd.abs}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.gcd.abs}.]\textbf{(a)} If $b\geq0$, then
$\left\vert b\right\vert =b$. Hence, if $b\geq0$, then Exercise
\ref{exe.ent.gcd.abs} \textbf{(a)} holds (since $\gcd\left(
a,\underbrace{\left\vert b\right\vert }_{=b}\right)  =\gcd\left(  a,b\right)
$). Thus, for the rest of this solution to Exercise \ref{exe.ent.gcd.abs}
\textbf{(a)}, we WLOG assume that we don't have $b\geq0$. Hence, we have
$b<0$. Thus, $\left\vert b\right\vert =-b$ and therefore $\gcd\left(
a,\underbrace{\left\vert b\right\vert }_{=-b}\right)  =\gcd\left(
a,-b\right)  =\gcd\left(  a,b\right)  $ (by Proposition
\ref{prop.ent.gcd.props1} \textbf{(h)}). This solves Exercise
\ref{exe.ent.gcd.abs} \textbf{(a)}.

\textbf{(b)} If $a\geq0$, then $\left\vert a\right\vert =a$. Hence, if
$a\geq0$, then Exercise \ref{exe.ent.gcd.abs} \textbf{(b)} holds (since
$\gcd\left(  \underbrace{\left\vert a\right\vert }_{=a},b\right)  =\gcd\left(
a,b\right)  $). Thus, for the rest of this solution to Exercise
\ref{exe.ent.gcd.abs} \textbf{(b)}, we WLOG assume that we don't have $a\geq
0$. Hence, we have $a<0$. Thus, $\left\vert a\right\vert =-a$ and therefore
$\gcd\left(  \underbrace{\left\vert a\right\vert }_{=-a},b\right)
=\gcd\left(  -a,b\right)  =\gcd\left(  a,b\right)  $ (by Proposition
\ref{prop.ent.gcd.props1} \textbf{(g)}). This solves Exercise
\ref{exe.ent.gcd.abs} \textbf{(b)}.

\textbf{(c)} Exercise \ref{exe.ent.gcd.abs} \textbf{(b)} (applied to
$\left\vert b\right\vert $ instead of $b$) yields $\gcd\left(  \left\vert
a\right\vert ,\left\vert b\right\vert \right)  =\gcd\left(  a,\left\vert
b\right\vert \right)  =\gcd\left(  a,b\right)  $ (by Exercise
\ref{exe.ent.gcd.abs} \textbf{(a)}). This solves Exercise
\ref{exe.ent.gcd.abs} \textbf{(c)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.gcd.sa,sb,sc}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.gcd.sa,sb,sc}.]Theorem
\ref{thm.ent.gcd.sa,sb} yields
\begin{equation}
\gcd\left(  sa,sb\right)  =\left\vert s\right\vert \gcd\left(  a,b\right)  .
\label{sol.ent.gcd.sa,sb,sc.1}%
\end{equation}
But $\gcd\left(  a,b\right)  $ is a nonnegative integer (by the definition of
$\gcd\left(  a,b\right)  $). The equality (\ref{eq.ent.div.abs(xy)}) (applied
to $x=s$ and $y=\gcd\left(  a,b\right)  $) yields%
\begin{align}
\left\vert s\gcd\left(  a,b\right)  \right\vert  &  =\left\vert s\right\vert
\cdot\underbrace{\left\vert \gcd\left(  a,b\right)  \right\vert }%
_{\substack{=\gcd\left(  a,b\right)  \\\text{(since }\gcd\left(  a,b\right)
\text{ is nonnegative)}}}=\left\vert s\right\vert \gcd\left(  a,b\right)
\nonumber\\
&  =\gcd\left(  sa,sb\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.ent.gcd.sa,sb,sc.1})}\right)  . \label{sol.ent.gcd.sa,sb,sc.2}%
\end{align}


Now, Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} (applied to $3$ and
$\left(  a,b,c\right)  $ instead of $k$ and $\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $) yields%
\begin{equation}
\gcd\left(  a,b,c\right)  =\gcd\left(  \gcd\left(  a,b\right)  ,c\right)  .
\label{sol.ent.gcd.sa,sb,sc.3}%
\end{equation}
The same argument (applied to $sa,sb,sc$ instead of $a,b,c$) yields%
\begin{align*}
&  \gcd\left(  sa,sb,sc\right) \\
&  =\gcd\left(  \underbrace{\gcd\left(  sa,sb\right)  }_{\substack{=\left\vert
s\gcd\left(  a,b\right)  \right\vert \\\text{(by (\ref{sol.ent.gcd.sa,sb,sc.2}%
))}}},sc\right)  =\gcd\left(  \left\vert s\gcd\left(  a,b\right)  \right\vert
,sc\right) \\
&  =\gcd\left(  s\gcd\left(  a,b\right)  ,sc\right)
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Exercise \ref{exe.ent.gcd.abs} \textbf{(b)}, applied to }s\gcd\left(
a,b\right) \\
\text{and }sc\text{ instead of }a\text{ and }b
\end{array}
\right) \\
&  =\left\vert s\right\vert \underbrace{\gcd\left(  \gcd\left(  a,b\right)
,c\right)  }_{\substack{=\gcd\left(  a,b,c\right)  \\\text{(by
(\ref{sol.ent.gcd.sa,sb,sc.3}))}}}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.ent.gcd.sa,sb}, applied to }\gcd\left(  a,b\right)
\\
\text{and }c\text{ instead of }a\text{ and }b
\end{array}
\right) \\
&  =\left\vert s\right\vert \gcd\left(  a,b,c\right)  .
\end{align*}
This solves Exercise \ref{exe.ent.gcd.sa,sb,sc}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.gcd.sak}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.gcd.sak}.]We shall show that%
\begin{equation}
\gcd\left(  sa_{1},sa_{2},\ldots,sa_{i}\right)  =\left\vert s\right\vert
\gcd\left(  a_{1},a_{2},\ldots,a_{i}\right)  \label{sol.ent.gcd.sak.1}%
\end{equation}
for each $i\in\left\{  0,1,\ldots,k\right\}  $.

[\textit{Proof of (\ref{sol.ent.gcd.sak.1}):} We proceed by induction on $i$:

\textit{Induction base:} Proposition \ref{prop.ent.gcd.props1} \textbf{(j)}
shows that the greatest common divisor of the empty list of integers is
$\gcd\left(  {}\right)  =0$. Now, comparing $\gcd\left(  sa_{1},sa_{2}%
,\ldots,sa_{0}\right)  =\gcd\left(  {}\right)  =0$ with $\left\vert
s\right\vert \underbrace{\gcd\left(  a_{1},a_{2},\ldots,a_{0}\right)  }%
_{=\gcd\left(  {}\right)  =0}=0$, we obtain $\gcd\left(  sa_{1},sa_{2}%
,\ldots,sa_{0}\right)  =\left\vert s\right\vert \gcd\left(  a_{1},a_{2}%
,\ldots,a_{0}\right)  $. In other words, (\ref{sol.ent.gcd.sak.1}) holds for
$i=0$. This completes the induction base.

\textit{Induction step:} Let $j\in\left\{  1,2,\ldots,k\right\}  $. Assume
that (\ref{sol.ent.gcd.sak.1}) holds for $i=j-1$. We must prove that
(\ref{sol.ent.gcd.sak.1}) holds for $i=j$.

We have assumed that (\ref{sol.ent.gcd.sak.1}) holds for $i=j-1$. In other
words, we have%
\begin{equation}
\gcd\left(  sa_{1},sa_{2},\ldots,sa_{j-1}\right)  =\left\vert s\right\vert
\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)  .
\label{sol.ent.gcd.sak.1.pf.2}%
\end{equation}
But $\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)  $ is a nonnegative integer
(by the definition of $\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)  $). The
equality (\ref{eq.ent.div.abs(xy)}) (applied to $x=s$ and $y=\gcd\left(
a_{1},a_{2},\ldots,a_{j-1}\right)  $) yields%
\begin{align}
\left\vert s\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)  \right\vert  &
=\left\vert s\right\vert \cdot\underbrace{\left\vert \gcd\left(  a_{1}%
,a_{2},\ldots,a_{j-1}\right)  \right\vert }_{\substack{=\gcd\left(
a_{1},a_{2},\ldots,a_{j-1}\right)  \\\text{(since }\gcd\left(  a_{1}%
,a_{2},\ldots,a_{j-1}\right)  \text{ is nonnegative)}}}=\left\vert
s\right\vert \gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right) \nonumber\\
&  =\gcd\left(  sa_{1},sa_{2},\ldots,sa_{j-1}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.ent.gcd.sak.1.pf.2})}\right)  .
\label{sol.ent.gcd.sak.1.pf.3}%
\end{align}


Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} (applied to $j$ and $a_{i}$
instead of $k$ and $b_{i}$) yields
\begin{equation}
\gcd\left(  a_{1},a_{2},\ldots,a_{j}\right)  =\gcd\left(  \gcd\left(
a_{1},a_{2},\ldots,a_{j-1}\right)  ,a_{j}\right)  .
\label{sol.ent.gcd.sak.1.pf.5}%
\end{equation}
Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} (applied to $j$ and
$sa_{i}$ instead of $k$ and $b_{i}$) yields
\begin{align*}
&  \gcd\left(  sa_{1},sa_{2},\ldots,sa_{j}\right) \\
&  =\gcd\left(  \underbrace{\gcd\left(  sa_{1},sa_{2},\ldots,sa_{j-1}\right)
}_{\substack{=\left\vert s\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)
\right\vert \\\text{(by (\ref{sol.ent.gcd.sak.1.pf.3}))}}},sa_{j}\right) \\
&  =\gcd\left(  \left\vert s\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)
\right\vert ,sa_{j}\right) \\
&  =\gcd\left(  s\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)  ,sa_{j}\right)
\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.ent.gcd.abs}
\textbf{(b)}, applied to }s\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)
\text{ and }sa_{j}\text{ instead of }a\text{ and }b\right) \\
&  =\left\vert s\right\vert \underbrace{\gcd\left(  \gcd\left(  a_{1}%
,a_{2},\ldots,a_{j-1}\right)  ,a_{j}\right)  }_{\substack{=\gcd\left(
a_{1},a_{2},\ldots,a_{j}\right)  \\\text{(by (\ref{sol.ent.gcd.sak.1.pf.5}))}%
}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.ent.gcd.sa,sb},
applied to }\gcd\left(  a_{1},a_{2},\ldots,a_{j-1}\right)  \text{ and }%
a_{j}\text{ instead of }a\text{ and }b\right) \\
&  =\left\vert s\right\vert \gcd\left(  a_{1},a_{2},\ldots,a_{j}\right)  .
\end{align*}
In other words, (\ref{sol.ent.gcd.sak.1}) holds for $i=j$. This completes the
induction step. Thus, (\ref{sol.ent.gcd.sak.1}) is proven.]

Now, (\ref{sol.ent.gcd.sak.1}) (applied to $i=k$) yields $\gcd\left(
sa_{1},sa_{2},\ldots,sa_{k}\right)  =\left\vert s\right\vert \gcd\left(
a_{1},a_{2},\ldots,a_{k}\right)  $. This solves Exercise \ref{exe.ent.gcd.sak}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.01}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.01}.]\textbf{(a)} We have $1\mid a$
(since $a=1\cdot a$). Thus, Proposition \ref{prop.ent.gcd.props1} \textbf{(i)}
(applied to $1$ and $a$ instead of $a$ and $b$) yields $\gcd\left(
1,a\right)  =\left\vert 1\right\vert =1$. In other words, $1\perp a$ (by the
definition of \textquotedblleft coprime\textquotedblright). This solves
Exercise \ref{exe.ent.coprime.01} \textbf{(a)}.

\textbf{(b)} Proposition \ref{prop.ent.gcd.props1} \textbf{(a)} yields
$\gcd\left(  a,0\right)  =\gcd\left(  a\right)  =\left\vert a\right\vert $.
But Proposition \ref{prop.ent.gcd.props1} \textbf{(b)} (applied to $b=0$)
yields $\gcd\left(  a,0\right)  =\gcd\left(  0,a\right)  $. Hence,
$\gcd\left(  0,a\right)  =\gcd\left(  a,0\right)  =\left\vert a\right\vert $.
Now, we have the following chain of logical equivalences:%
\begin{align*}
\left(  0\perp a\right)  \  &  \Longleftrightarrow\ \left(  \gcd\left(
0,a\right)  =1\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of
\textquotedblleft coprime\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \left\vert a\right\vert =1\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\gcd\left(  0,a\right)  =\left\vert
a\right\vert \right)  .
\end{align*}
In other words, we have $0\perp a$ if and only if $\left\vert a\right\vert
=1$. This solves Exercise \ref{exe.ent.coprime.01} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.ab-to-ck}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.ab-to-ck}.]Let us prove that%
\begin{equation}
a_{1}a_{2}\cdots a_{i}\perp c\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left\{
0,1,\ldots,k\right\}  . \label{sol.ent.coprime.ab-to-ck.goal}%
\end{equation}


\textit{Proof of (\ref{sol.ent.coprime.ab-to-ck.goal}):} We shall prove
(\ref{sol.ent.coprime.ab-to-ck.goal}) by induction on $i$:

\textit{Induction base:} Exercise \ref{exe.ent.coprime.01} \textbf{(a)}
(applied to $a=c$) yields $1\perp c$. Now, $a_{1}a_{2}\cdots a_{0}=\left(
\text{empty product}\right)  =1\perp c$. Hence,
(\ref{sol.ent.coprime.ab-to-ck.goal}) holds for $i=0$. This completes the
induction base.

\textit{Induction step:} Let $j\in\left\{  1,2,\ldots,k\right\}  $. Assume
that (\ref{sol.ent.coprime.ab-to-ck.goal}) holds for $i=j-1$. We must now
prove that (\ref{sol.ent.coprime.ab-to-ck.goal}) holds for $i=j$.

We have assumed that (\ref{sol.ent.coprime.ab-to-ck.goal}) holds for $i=j-1$.
In other words, $a_{1}a_{2}\cdots a_{j-1}\perp c$.

We have assumed that each $i\in\left\{  1,2,\ldots,k\right\}  $ satisfies
$a_{i}\perp c$. Applying this to $i=j$, we find $a_{j}\perp c$.

Now we know that $a_{1}a_{2}\cdots a_{j-1}\perp c$ and $a_{j}\perp c$. Hence,
Theorem \ref{thm.ent.coprime.ab-to-c} (applied to $a=a_{1}a_{2}\cdots a_{j-1}$
and $b=a_{j}$) yields $\left(  a_{1}a_{2}\cdots a_{j-1}\right)  a_{j}\perp c$.
In other words, $a_{1}a_{2}\cdots a_{j}\perp c$ (since $a_{1}a_{2}\cdots
a_{j}=\left(  a_{1}a_{2}\cdots a_{j-1}\right)  a_{j}$). In other words,
(\ref{sol.ent.coprime.ab-to-ck.goal}) holds for $i=j$. This completes the
induction step. Thus, (\ref{sol.ent.coprime.ab-to-ck.goal}) is proven by induction.

Now, we can apply (\ref{sol.ent.coprime.ab-to-ck.goal}) to $i=k$. We thus
obtain $a_{1}a_{2}\cdots a_{k}\perp c$. This proves Exercise
\ref{exe.ent.coprime.ab-to-ck}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.combinek}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.combinek}.]We assumed that the
integers $b_{1},b_{2},\ldots,b_{k}$ are mutually coprime. In other words, we
have%
\begin{equation}
b_{i}\perp b_{j}\text{ for all }i,j\in\left\{  1,2,\ldots,k\right\}  \text{
satisfying }i\neq j. \label{sol.ent.coprime.combinek.copr}%
\end{equation}


Let us prove that%
\begin{equation}
b_{1}b_{2}\cdots b_{i}\mid c\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left\{
0,1,\ldots,k\right\}  . \label{sol.ent.coprime.combinek.goal}%
\end{equation}


\textit{Proof of (\ref{sol.ent.coprime.combinek.goal}):} We shall prove
(\ref{sol.ent.coprime.combinek.goal}) by induction on $i$:

\textit{Induction base:} We have $b_{1}b_{2}\cdots b_{0}=\left(  \text{empty
product}\right)  =1\mid c$. Hence, (\ref{sol.ent.coprime.combinek.goal}) holds
for $i=0$. This completes the induction base.

\textit{Induction step:} Let $j\in\left\{  1,2,\ldots,k\right\}  $. Assume
that (\ref{sol.ent.coprime.combinek.goal}) holds for $i=j-1$. We must now
prove that (\ref{sol.ent.coprime.combinek.goal}) holds for $i=j$.

We have assumed that (\ref{sol.ent.coprime.combinek.goal}) holds for $i=j-1$.
In other words, $b_{1}b_{2}\cdots b_{j-1}\mid c$.

We have assumed that each $i\in\left\{  1,2,\ldots,k\right\}  $ satisfies
$b_{i}\mid c$. Applying this to $i=j$, we find $b_{j}\mid c$.

For each $i\in\left\{  1,2,\ldots,j-1\right\}  $, we have $i\leq j-1<j$ and
thus $i\neq j$ and therefore $b_{i}\perp b_{j}$ (by
(\ref{sol.ent.coprime.combinek.copr})). Hence, Exercise
\ref{exe.ent.coprime.combinek} (applied to $j-1$, $b_{j}$ and $\left(
b_{1},b_{2},\ldots,b_{j-1}\right)  $ instead of $k$, $c$ and $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $) yields $b_{1}b_{2}\cdots b_{j-1}\perp
b_{j}$.

Now we know that $b_{1}b_{2}\cdots b_{j-1}\mid c$ and $b_{j}\mid c$ and
$b_{1}b_{2}\cdots b_{j-1}\perp b_{j}$. Hence, Theorem
\ref{thm.ent.coprime.combine} (applied to $a=b_{1}b_{2}\cdots b_{j-1}$ and
$b=b_{j}$) yields $\left(  b_{1}b_{2}\cdots b_{j-1}\right)  b_{j}\mid c$. In
other words, $b_{1}b_{2}\cdots b_{j}\mid c$ (since $b_{1}b_{2}\cdots
b_{j}=\left(  b_{1}b_{2}\cdots b_{j-1}\right)  b_{j}$). In other words,
(\ref{sol.ent.coprime.combinek.goal}) holds for $i=j$. This completes the
induction step. Thus, (\ref{sol.ent.coprime.combinek.goal}) is proven by induction.

Now, we can apply (\ref{sol.ent.coprime.combinek.goal}) to $i=k$. We thus
obtain $b_{1}b_{2}\cdots b_{k}\mid c$. This proves Exercise
\ref{exe.ent.coprime.combinek}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.powers}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.powers}.]We have $a\perp b$. Thus,
Exercise \ref{exe.ent.coprime.ab-to-ck} (applied to $n$, $b$ and $\left(
\underbrace{a,a,\ldots,a}_{n\text{ times}}\right)  $ instead of $k$, $c$ and
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  $) yields that $\underbrace{aa\cdots
a}_{n\text{ times}}\perp b$. In other words, $a^{n}\perp b$.

According to Proposition \ref{prop.ent.coprime.perp-symm} (applied to $a^{n}$
instead of $a$), we have $a^{n}\perp b$ if and only if $b\perp a^{n}$. Thus,
$b\perp a^{n}$ (since $a^{n}\perp b$). Hence, Exercise
\ref{exe.ent.coprime.ab-to-ck} (applied to $m$, $a^{n}$ and $\left(
\underbrace{b,b,\ldots,b}_{m\text{ times}}\right)  $ instead of $k$, $c$ and
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  $) yields that $\underbrace{bb\cdots
b}_{m\text{ times}}\perp a^{n}$. In other words, $b^{m}\perp a^{n}$.

According to Proposition \ref{prop.ent.coprime.perp-symm} (applied to $a^{n}$
and $b^{m}$ instead of $a$ and $b$), we have $a^{n}\perp b^{m}$ if and only if
$b^{m}\perp a^{n}$. Hence, $a^{n}\perp b^{m}$ (since $b^{m}\perp a^{n}$). This
solves Exercise \ref{exe.ent.coprime.powers}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.ab-to-cI}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.ab-to-cI}.]Exercise
\ref{exe.ent.coprime.ab-to-ck} and Exercise \ref{exe.ent.coprime.ab-to-cI} say
the same thing: They say that if $c$ is a fixed integer, then a product of
finitely many integers that are coprime to $c$ will also be coprime to $c$.
The difference between these two exercises is merely how the product is
indexed. Thus, deriving Exercise \ref{exe.ent.coprime.ab-to-cI} from Exercise
\ref{exe.ent.coprime.ab-to-ck} is merely a matter of bookkeeping. Let us do
this bookkeeping:

By assumption, we have
\begin{equation}
b_{i}\perp c\ \ \ \ \ \ \ \ \ \ \text{for each }i\in I.
\label{sol.ent.coprime.ab-to-cI.copri}%
\end{equation}


The set $I$ is finite; thus, we can define some $k\in\mathbb{N}$ by
$k=\left\vert I\right\vert $. Consider this $k$. There exists a bijection
$f:\left\{  1,2,\ldots,k\right\}  \rightarrow I$ (since $k=\left\vert
I\right\vert $). Pick such an $f$. Thus, $f\left(  1\right)  ,f\left(
2\right)  ,\ldots,f\left(  k\right)  $ are the $k$ elements of $I$; hence,
$b_{f\left(  1\right)  },b_{f\left(  2\right)  },\ldots,b_{f\left(  k\right)
}$ are $k$ integers. Moreover, each $j\in\left\{  1,2,\ldots,k\right\}  $
satisfies $b_{f\left(  j\right)  }\perp c$ (by
(\ref{sol.ent.coprime.ab-to-cI.copri}), applied to $i=f\left(  j\right)  $).
Renaming the index $j$ as $i$ in this statement, we obtain: Each $i\in\left\{
1,2,\ldots,k\right\}  $ satisfies $b_{f\left(  i\right)  }\perp c$. Hence,
Exercise \ref{exe.ent.coprime.ab-to-ck} (applied to $a_{i}=b_{f\left(
i\right)  }$) shows that
\begin{equation}
b_{f\left(  1\right)  }b_{f\left(  2\right)  }\cdots b_{f\left(  k\right)
}\perp c. \label{sol.ent.coprime.ab-to-cI.copri3}%
\end{equation}


The map $f:\left\{  1,2,\ldots,k\right\}  \rightarrow I$ is a bijection.
Hence, we can substitute $f\left(  j\right)  $ for $i$ in the product
$\prod_{i\in I}b_{i}$. We thus find%
\[
\prod_{i\in I}b_{i}=\prod_{j\in\left\{  1,2,\ldots,k\right\}  }b_{f\left(
j\right)  }=\prod_{j=1}^{k}b_{f\left(  j\right)  }=b_{f\left(  1\right)
}b_{f\left(  2\right)  }\cdots b_{f\left(  k\right)  }.
\]
Thus, (\ref{sol.ent.coprime.ab-to-cI.copri3}) can be rewritten as $\prod_{i\in
I}b_{i}\perp c$. This solves Exercise \ref{exe.ent.coprime.ab-to-cI}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.b==c}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.b==c}.]Assume that $a\perp c$. But
Proposition \ref{prop.ent.coprime.perp-symm} (applied to $c$ instead of $b$)
shows that $a\perp c$ if and only if $c\perp a$. Thus, we have $c\perp a$
(since $a\perp c$). In other words, $c$ is coprime to $a$. In other words,
$\gcd\left(  c,a\right)  =1$ (by the definition of \textquotedblleft
coprime\textquotedblright).

But $a\equiv b\operatorname{mod}c$. Hence, Proposition
\ref{prop.ent.gcd.props1} \textbf{(d)} (applied to $c$, $a$ and $b$ instead of
$a$, $b$ and $c$) yields $\gcd\left(  c,a\right)  =\gcd\left(  c,b\right)  $.
Hence, $\gcd\left(  c,b\right)  =\gcd\left(  c,a\right)  =1$. In other words,
$c$ is coprime to $b$. In other words, $c\perp b$. But Proposition
\ref{prop.ent.coprime.perp-symm} (applied to $c$ instead of $a$) shows that
$c\perp b$ if and only if $b\perp c$. Hence, $b\perp c$ (since $c\perp b$).
This solves Exercise \ref{exe.ent.coprime.b==c}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.b-a}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.b-a}.]Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)} (applied to $b-a$ instead of $a$)
yields%
\begin{align*}
\gcd\left(  b-a,b\right)   &  =\gcd\left(  b,\underbrace{b-a}_{=1b+\left(
-a\right)  }\right)  =\gcd\left(  b,1b+\left(  -a\right)  \right) \\
&  =\gcd\left(  b,-a\right)  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.ent.gcd.props1} \textbf{(c)},}\\
\text{applied to }b\text{, }-a\text{ and }1\text{ instead of }a\text{,
}b\text{ and }u
\end{array}
\right) \\
&  =\gcd\left(  b,a\right)  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Proposition \ref{prop.ent.gcd.props1} \textbf{(h)},}\\
\text{applied to }b\text{ and }a\text{ instead of }a\text{ and }b
\end{array}
\right) \\
&  =\gcd\left(  a,b\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)}}\right)  .
\end{align*}
Now, we have the following chain of logical equivalences:%
\begin{align*}
\left(  b-a\perp b\right)  \  &  \Longleftrightarrow\ \left(  \underbrace{\gcd
\left(  b-a,b\right)  }_{=\gcd\left(  a,b\right)  }=1\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of \textquotedblleft
coprime\textquotedblright}\right) \\
&  \Longleftrightarrow\ \left(  \gcd\left(  a,b\right)  =1\right)
\ \Longleftrightarrow\ \left(  a\perp b\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of \textquotedblleft coprime\textquotedblright%
}\right)  .
\end{align*}
In other words, $b-a\perp b$ holds if and only if $a\perp b$. This solves
Exercise \ref{exe.ent.coprime.b-a}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.1+2+...+n}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.1+2+...+n}.]Proposition
\ref{prop.ent.1+2+...+n} yields $1+2+\cdots+n=\dfrac{n\left(  n+1\right)  }%
{2}$. Thus, we need to prove that%
\[
\dfrac{n\left(  n+1\right)  }{2}\mid1^{d}+2^{d}+\cdots+n^{d}.
\]
This is equivalent to%
\begin{equation}
n\left(  n+1\right)  \mid2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)
\label{sol.ent.coprime.1+2+...+n.g}%
\end{equation}
(by Exercise \ref{exe.ent.div.acbc}, applied to $a=\dfrac{n\left(  n+1\right)
}{2}$, $b=1^{d}+2^{d}+\cdots+n^{d}$ and $c=2$). Hence, it suffices to prove
(\ref{sol.ent.coprime.1+2+...+n.g}).

In order to prove (\ref{sol.ent.coprime.1+2+...+n.g}), it suffices to show
that%
\begin{align}
n  &  \mid2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)
\ \ \ \ \ \ \ \ \ \ \text{and}\label{sol.ent.coprime.1+2+...+n.g1}\\
n+1  &  \mid2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)  .
\label{sol.ent.coprime.1+2+...+n.g2}%
\end{align}
Indeed, the integers $n$ and $n+1$ are coprime (by Example
\ref{exa.ent.coprime.1} \textbf{(c)}, applied to $a=n$); in other words,
$n\perp n+1$. Hence, if we can prove (\ref{sol.ent.coprime.1+2+...+n.g1}) and
(\ref{sol.ent.coprime.1+2+...+n.g2}), then Theorem
\ref{thm.ent.coprime.combine} (applied to $a=n$, $b=n+1$ and $c=2\left(
1^{d}+2^{d}+\cdots+n^{d}\right)  $) will yield $n\left(  n+1\right)
\mid2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)  $; this will prove
(\ref{sol.ent.coprime.1+2+...+n.g}) and therefore complete our solution.

We shall prove (\ref{sol.ent.coprime.1+2+...+n.g2}) first:

\textit{Proof of (\ref{sol.ent.coprime.1+2+...+n.g2}):} We have%
\begin{align}
2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)   &  =\left(  1^{d}+2^{d}%
+\cdots+n^{d}\right)  +\left(  1^{d}+2^{d}+\cdots+n^{d}\right) \nonumber\\
&  =\left(  1^{d}+2^{d}+\cdots+n^{d}\right)  +\left(  n^{d}+\left(
n-1\right)  ^{d}+\cdots+1^{d}\right) \nonumber\\
&  =\sum_{k=1}^{n}k^{d}+\sum_{k=1}^{n}\left(  n+1-k\right)  ^{d}\nonumber\\
&  =\sum_{k=1}^{n}\left(  k^{d}+\left(  n+1-k\right)  ^{d}\right)  .
\label{sol.ent.coprime.1+2+...+n.5}%
\end{align}


But if $k\in\mathbb{Z}$, then Lemma \ref{lem.ent.xd-yd} \textbf{(b)} (applied
to $x=k$ and $y=n+1-k$) shows that $k^{d}+\left(  n+1-k\right)  ^{d}$ is
divisible by $k+\left(  n+1-k\right)  =n+1$. Hence, each addend in the sum on
the right hand side of (\ref{sol.ent.coprime.1+2+...+n.5}) is divisible by
$n+1$. Therefore, the whole sum is divisible by $n+1$ as well. Thus, the left
hand side is divisible by $n+1$, too. In other words, $n+1\mid2\left(
1^{d}+2^{d}+\cdots+n^{d}\right)  $. Thus, (\ref{sol.ent.coprime.1+2+...+n.g2})
is proven.

\textit{Proof of} \textit{(\ref{sol.ent.coprime.1+2+...+n.g1}):} If $n=0$,
then (\ref{sol.ent.coprime.1+2+...+n.g1}) boils down to $0\mid2\cdot0$ (since
empty sums are $0$); this is obvious. Thus, for the rest of this proof, we
WLOG assume that $n\neq0$. Hence, $n$ is a positive integer, and thus
$n-1\in\mathbb{N}$. Therefore, we can apply
(\ref{sol.ent.coprime.1+2+...+n.g2}) to $n-1$ instead of $n$ (since we have
already proven (\ref{sol.ent.coprime.1+2+...+n.g2}) for each $n\in\mathbb{N}%
$). We thus obtain%
\[
n\mid2\left(  1^{d}+2^{d}+\cdots+\left(  n-1\right)  ^{d}\right)  .
\]
In other words, $2\left(  1^{d}+2^{d}+\cdots+\left(  n-1\right)  ^{d}\right)
\equiv0\operatorname{mod}n$. Now,%
\begin{align*}
&  2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)  -2\left(  1^{d}+2^{d}%
+\cdots+\left(  n-1\right)  ^{d}\right) \\
&  =2\cdot\underbrace{\left(  \left(  1^{d}+2^{d}+\cdots+n^{d}\right)
-\left(  1^{d}+2^{d}+\cdots+\left(  n-1\right)  ^{d}\right)  \right)
}_{=n^{d}}\\
&  =2n^{d}=n\cdot2n^{d-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }d\geq1\text{
(because }d\text{ is odd)}\right)
\end{align*}
is clearly divisible by $n$. In other words,%
\[
2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)  \equiv2\left(  1^{d}+2^{d}%
+\cdots+\left(  n-1\right)  ^{d}\right)  \operatorname{mod}n.
\]
Hence,
\[
2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)  \equiv2\left(  1^{d}+2^{d}%
+\cdots+\left(  n-1\right)  ^{d}\right)  \equiv0\operatorname{mod}n.
\]
That is, $n\mid2\left(  1^{d}+2^{d}+\cdots+n^{d}\right)  $. This proves
(\ref{sol.ent.coprime.1+2+...+n.g1}).

We have now proven both (\ref{sol.ent.coprime.1+2+...+n.g1}) and
(\ref{sol.ent.coprime.1+2+...+n.g2}). As we have explained, this yields
(\ref{sol.ent.coprime.1+2+...+n.g}), which in turn solves Exercise
\ref{exe.ent.coprime.1+2+...+n}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.bezout-conv}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.bezout-conv}.]Proposition
\ref{prop.ent.gcd.bezout-conv} yields $\gcd\left(  a,b\right)  \mid xa+yb=1$.
But $\gcd\left(  a,b\right)  $ is a nonnegative integer. Hence, Exercise
\ref{exe.ent.div.g|1} (applied to $g=\gcd\left(  a,b\right)  $) yields
$\gcd\left(  a,b\right)  =1$ (since $\gcd\left(  a,b\right)  \mid1$). In other
words, $a$ is coprime to $b$. In other words, $a\perp b$. This solves Exercise
\ref{exe.ent.coprime.bezout-conv}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.gcdgcd1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.gcdgcd1}.]Let $g=\gcd\left(
x,y\right)  $. Then, $g$ is a nonnegative integer (since any gcd is a
nonnegative integer); thus, $\left\vert g\right\vert =g$.

Theorem \ref{thm.ent.gcd.split} (applied to $2$, $\left(  ux,uy\right)  $, $2$
and $\left(  vx,vy\right)  $ instead of $k$, $\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $, $\ell$ and $\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $)
yields
\begin{equation}
\gcd\left(  ux,uy,vx,vy\right)  =\gcd\left(  \gcd\left(  ux,uy\right)
,\gcd\left(  vx,vy\right)  \right)  . \label{sol.ent.coprime.gcdgcd1.3}%
\end{equation}


Theorem \ref{thm.ent.gcd.sa,sb} (applied to $s=u$, $a=x$ and $b=y$) yields%
\[
\gcd\left(  ux,uy\right)  =\left\vert u\right\vert \underbrace{\gcd\left(
x,y\right)  }_{=g}=\left\vert u\right\vert g=g\left\vert u\right\vert .
\]
The same argument (applied to $v$ instead of $u$) yields%
\[
\gcd\left(  vx,vy\right)  =g\left\vert v\right\vert .
\]
Now, (\ref{sol.ent.coprime.gcdgcd1.3}) becomes%
\begin{align*}
\gcd\left(  ux,uy,vx,vy\right)   &  =\gcd\left(  \underbrace{\gcd\left(
ux,uy\right)  }_{=g\left\vert u\right\vert },\underbrace{\gcd\left(
vx,vy\right)  }_{=g\left\vert v\right\vert }\right)  =\gcd\left(  g\left\vert
u\right\vert ,g\left\vert v\right\vert \right) \\
&  =\underbrace{\left\vert g\right\vert }_{\substack{=g\\=\gcd\left(
x,y\right)  }}\underbrace{\gcd\left(  \left\vert u\right\vert ,\left\vert
v\right\vert \right)  }_{\substack{=\gcd\left(  u,v\right)  \\\text{(by
Exercise \ref{exe.ent.gcd.abs} \textbf{(c)},}\\\text{applied to }a=u\text{ and
}b=v\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.ent.gcd.sa,sb},
applied to }s=g\text{, }a=\left\vert u\right\vert \text{ and }b=\left\vert
v\right\vert \right) \\
&  =\gcd\left(  x,y\right)  \cdot\gcd\left(  u,v\right)  =\gcd\left(
u,v\right)  \cdot\gcd\left(  x,y\right)  .
\end{align*}
This solves Exercise \ref{exe.ent.coprime.gcdgcd1}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.gcdgcd2}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.gcdgcd2}.]\textbf{(a)} Let
$g=\gcd\left(  a,b,c\right)  $. Then, $g=\gcd\left(  a,b,c\right)  \geq0$
(since any gcd is a nonnegative integer) and thus $\left\vert g\right\vert
=g$. But Exercise \ref{exe.ent.gcd.sa,sb,sc} (applied to $s=a$) yields%
\begin{equation}
\gcd\left(  aa,ab,ac\right)  =\left\vert a\right\vert \underbrace{\gcd\left(
a,b,c\right)  }_{=g=\left\vert g\right\vert }=\left\vert a\right\vert
\cdot\left\vert g\right\vert =\left\vert ag\right\vert
\label{sol.ent.coprime.gcdgcd2.a.1}%
\end{equation}
(since (\ref{eq.ent.div.abs(xy)}) yields $\left\vert ag\right\vert =\left\vert
a\right\vert \cdot\left\vert g\right\vert $).

Exercise \ref{exe.ent.coprime.gcdgcd1} (applied to $u=a$, $v=c$, $x=a$ and
$y=b$) yields%
\begin{align*}
&  \gcd\left(  a,c\right)  \cdot\gcd\left(  a,b\right) \\
&  =\gcd\left(  aa,ab,\underbrace{ca}_{=ac},\underbrace{cb}_{=bc}\right)
=\gcd\left(  aa,ab,ac,bc\right)  =\gcd\left(  \underbrace{\gcd\left(
aa,ab,ac\right)  }_{\substack{=\left\vert ag\right\vert \\\text{(by
(\ref{sol.ent.coprime.gcdgcd2.a.1}))}}},bc\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)}}\\
\text{(applied to }4\text{ and }\left(  aa,ab,ac,bc\right)  \text{ instead of
}k\text{ and }\left(  b_{1},b_{2},\ldots,b_{k}\right)  \text{)}%
\end{array}
\right) \\
&  =\gcd\left(  \left\vert ag\right\vert ,bc\right)  =\gcd\left(
ag,bc\right)
\end{align*}
(by Exercise \ref{exe.ent.gcd.abs} \textbf{(b)}, applied to $ag$ and $bc$
instead of $a$ and $b$). In other words, $\gcd\left(  a,b\right)  \cdot
\gcd\left(  a,c\right)  =\gcd\left(  ag,bc\right)  $. This solves Exercise
\ref{exe.ent.coprime.gcdgcd2} \textbf{(a)}.

\textbf{(b)} Assume that $b\perp c$. Thus, $\gcd\left(  b,c\right)  =1$.

Let $g=\gcd\left(  a,b,c\right)  $. Theorem \ref{thm.ent.gcd.split} (applied
to $1$, $\left(  a\right)  $, $2$ and $\left(  b,c\right)  $ instead of $k$,
$\left(  b_{1},b_{2},\ldots,b_{k}\right)  $, $\ell$ and $\left(  c_{1}%
,c_{2},\ldots,c_{\ell}\right)  $) yields%
\[
\gcd\left(  a,b,c\right)  =\gcd\left(  \gcd\left(  a\right)  ,\underbrace{\gcd
\left(  b,c\right)  }_{=1}\right)  =\gcd\left(  \gcd\left(  a\right)
,1\right)  \mid1
\]
(by Proposition \ref{prop.ent.gcd.props1} \textbf{(f)}, applied to
$\gcd\left(  a\right)  $ and $1$ instead of $a$ and $b$). This rewrites as
$g\mid1$ (since $g=\gcd\left(  a,b,c\right)  $).

But $g=\gcd\left(  a,b,c\right)  $ is a nonnegative integer (since any gcd is
a nonnegative integer). Hence, Exercise \ref{exe.ent.div.g|1} yields $g=1$
(since $g\mid1$). Now, Exercise \ref{exe.ent.coprime.gcdgcd2} \textbf{(a)}
yields
\[
\gcd\left(  a,b\right)  \cdot\gcd\left(  a,c\right)  =\gcd\left(
a\underbrace{g}_{=1},bc\right)  =\gcd\left(  a,bc\right)  .
\]
This solves Exercise \ref{exe.ent.coprime.gcdgcd2} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.a/g}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.a/g}.]We have assumed that $a$ and
$b$ are not both zero. In other words, the two integers $a,b$ are not all
zero. Hence, Definition \ref{def.ent.gcd.gcd} shows that $\gcd\left(
a,b\right)  $ is defined as the largest element of the set
$\operatorname*{Div}\left(  a,b\right)  $ and is a positive integer.

Now, $g=\gcd\left(  a,b\right)  $. Hence, $g$ is a positive integer (since
$\gcd\left(  a,b\right)  $ is a positive integer). Thus, $\left\vert
g\right\vert =g$. Also, $g\neq0$ (since $g$ is positive).

Proposition \ref{prop.ent.gcd.props1} \textbf{(f)} yields $\gcd\left(
a,b\right)  \mid a$ and $\gcd\left(  a,b\right)  \mid b$. Hence,
$g=\gcd\left(  a,b\right)  \mid a$. But Proposition \ref{prop.ent.div.1}
\textbf{(c)} (applied to $g$ and $a$ instead of $a$ and $b$) shows that $g\mid
a$ if and only if $\dfrac{a}{g}\in\mathbb{Z}$. Hence, we have $\dfrac{a}{g}%
\in\mathbb{Z}$ (since $g\mid a$). Similarly, $\dfrac{b}{g}\in\mathbb{Z}$.
Thus, $\dfrac{a}{g}$ and $\dfrac{b}{g}$ are integers.

It remains to prove that $\dfrac{a}{g}\perp\dfrac{b}{g}$. But Theorem
\ref{thm.ent.gcd.sa,sb} (applied to $g$, $\dfrac{a}{g}$ and $\dfrac{b}{g}$
instead of $s$, $a$ and $b$) shows that%
\[
\gcd\left(  g\cdot\dfrac{a}{g},g\cdot\dfrac{b}{g}\right)
=\underbrace{\left\vert g\right\vert }_{=g}\gcd\left(  \dfrac{a}{g},\dfrac
{b}{g}\right)  =g\gcd\left(  \dfrac{a}{g},\dfrac{b}{g}\right)  .
\]
Comparing this with%
\[
\gcd\left(  \underbrace{g\cdot\dfrac{a}{g}}_{=a},\underbrace{g\cdot\dfrac
{b}{g}}_{=b}\right)  =\gcd\left(  a,b\right)  =g,
\]
we obtain $g\gcd\left(  \dfrac{a}{g},\dfrac{b}{g}\right)  =g$. We can cancel
$g$ from this equality (since $g\neq0$), and thus obtain $\gcd\left(
\dfrac{a}{g},\dfrac{b}{g}\right)  =1$. In other words, $\dfrac{a}{g}%
\perp\dfrac{b}{g}$. Thus, the solution of Exercise \ref{exe.ent.coprime.a/g}
is finished.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.gcd.akbk}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.gcd.akbk}.]If $k=0$, then Exercise
\ref{exe.ent.gcd.akbk} holds\footnote{\textit{Proof.} Assume that $k=0$. Thus,
$\left(  \gcd\left(  a,b\right)  \right)  ^{k}=\left(  \gcd\left(  a,b\right)
\right)  ^{0}=1$.
\par
But $1\mid1$. Thus, Proposition \ref{prop.ent.gcd.props1} \textbf{(i)}
(applied to $1$ and $1$ instead of $a$ and $b$) yields $\gcd\left(
1,1\right)  =\left\vert 1\right\vert =1$. From $k=0$, we obtain $\gcd\left(
a^{k},b^{k}\right)  =\gcd\left(  \underbrace{a^{0}}_{=1},\underbrace{b^{0}%
}_{=1}\right)  =\gcd\left(  1,1\right)  =1$. Comparing this with $\left(
\gcd\left(  a,b\right)  \right)  ^{k}=1$, we obtain $\gcd\left(  a^{k}%
,b^{k}\right)  =\left(  \gcd\left(  a,b\right)  \right)  ^{k}$. Hence,
Exercise \ref{exe.ent.gcd.akbk} holds (under the assumption that $k=0$).}.
Hence, for the rest of this solution, we WLOG assume that $k\neq0$. Thus, $k$
is a positive integer (since $k\in\mathbb{N}$); therefore, $0^{k}=0$.

If the integers $a$ and $b$ are both zero, then Exercise
\ref{exe.ent.gcd.akbk} holds\footnote{\textit{Proof.} Assume that $a$ and $b$
are both zero. In other words, $a=0$ and $b=0$. Thus,
\[
\gcd\left(  a^{k},b^{k}\right)  =\gcd\left(  \underbrace{0^{k}}_{=0}%
,\underbrace{0^{k}}_{=0}\right)  =\gcd\left(  0,0\right)  =\left\vert
0\right\vert
\]
(by Proposition \ref{prop.ent.gcd.props1} \textbf{(i)}, applied to $0$ and $0$
instead of $a$ and $b$). Thus, $\gcd\left(  a^{k},b^{k}\right)  =\left\vert
0\right\vert =0$.
\par
But the integers $a,b$ are all zero (since $a=0$ and $b=0$). Thus, the
definition of gcd yields $\gcd\left(  a,b\right)  =0$. Hence, $\left(
\gcd\left(  a,b\right)  \right)  ^{k}=0^{k}=0$. Comparing this with
$\gcd\left(  a^{k},b^{k}\right)  =0$, we obtain $\gcd\left(  a^{k}%
,b^{k}\right)  =\left(  \gcd\left(  a,b\right)  \right)  ^{k}$. Hence,
Exercise \ref{exe.ent.gcd.akbk} holds (under the assumption that $a$ and $b$
are both zero).}. Thus, for the rest of this solution, we WLOG assume that $a$
and $b$ are not both zero. Let $g=\gcd\left(  a,b\right)  $. Then, $g\geq0$
(since any gcd is nonnegative) and therefore $g^{k}\geq0$. But Exercise
\ref{exe.ent.coprime.a/g} yields that $\dfrac{a}{g}$ and $\dfrac{b}{g}$ are
integers satisfying $\dfrac{a}{g}\perp\dfrac{b}{g}$. Therefore, Exercise
\ref{exe.ent.coprime.powers} (applied to $\dfrac{a}{g}$, $\dfrac{b}{g}$, $k$
and $k$ instead of $a$, $b$, $n$ and $m$) yields $\left(  \dfrac{a}{g}\right)
^{k}\perp\left(  \dfrac{b}{g}\right)  ^{k}$. In other words, $\gcd\left(
\left(  \dfrac{a}{g}\right)  ^{k},\left(  \dfrac{b}{g}\right)  ^{k}\right)
=1$.

Note that $\left(  \dfrac{a}{g}\right)  ^{k}$ and $\left(  \dfrac{b}%
{g}\right)  ^{k}$ are integers (since $\dfrac{a}{g}$ and $\dfrac{b}{g}$ are
integers). Thus, Theorem \ref{thm.ent.gcd.sa,sb} (applied to $g^{k}$, $\left(
\dfrac{a}{g}\right)  ^{k}$ and $\left(  \dfrac{b}{g}\right)  ^{k}$ instead of
$s$, $a$ and $b$) yields%
\[
\gcd\left(  g^{k}\left(  \dfrac{a}{g}\right)  ^{k},g^{k}\left(  \dfrac{b}%
{g}\right)  ^{k}\right)  =\underbrace{\left\vert g^{k}\right\vert
}_{\substack{=g^{k}\\\text{(since }g^{k}\geq0\text{)}}}\underbrace{\gcd\left(
\left(  \dfrac{a}{g}\right)  ^{k},\left(  \dfrac{b}{g}\right)  ^{k}\right)
}_{=1}=g^{k}=\left(  \gcd\left(  a,b\right)  \right)  ^{k}%
\]
(since $g=\gcd\left(  a,b\right)  $). Comparing this with%
\[
\gcd\left(  \underbrace{g^{k}\left(  \dfrac{a}{g}\right)  ^{k}}_{=a^{k}%
},\underbrace{g^{k}\left(  \dfrac{b}{g}\right)  ^{k}}_{=b^{k}}\right)
=\gcd\left(  a^{k},b^{k}\right)  ,
\]
we obtain $\gcd\left(  a^{k},b^{k}\right)  =\left(  \gcd\left(  a,b\right)
\right)  ^{k}$. This solves Exercise \ref{exe.ent.gcd.akbk}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.frac-red}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.frac-red}.]We have $r\in\mathbb{Q}%
$. In other words, $r$ is a rational number. Thus, $r$ can be written in the
form $r=x/y$ for some $x\in\mathbb{Z}$ and some nonzero $y\in\mathbb{Z}$ (by
the definition of a rational number). Consider these $x$ and $y$. The integers
$x$ and $y$ are not both zero (since $y$ is nonzero). Let $g=\gcd\left(
x,y\right)  $. Exercise \ref{exe.ent.coprime.a/g} (applied to $a=x$ and $b=y$)
yields that $\dfrac{x}{g}$ and $\dfrac{y}{g}$ are integers satisfying
$\dfrac{x}{g}\perp\dfrac{y}{g}$. These two integers $\dfrac{x}{g}$ and
$\dfrac{y}{g}$ are coprime (since $\dfrac{x}{g}\perp\dfrac{y}{g}$) and satisfy
$r=\dfrac{x}{g}/\dfrac{y}{g}$ (since $\dfrac{x}{g}/\dfrac{y}{g}=x/y=r$).
Hence, there exist two \textbf{coprime} integers $a$ and $b$ satisfying
$r=a/b$ (namely, $a=\dfrac{x}{g}$ and $b=\dfrac{y}{g}$). This solves Exercise
\ref{exe.ent.coprime.frac-red}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.sqrtu+sqrtv}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.sqrtu+sqrtv}.]\textbf{(a)} Let $u$
be a positive integer that is not a perfect square. We must prove that
$\sqrt{u}$ is irrational.

Assume the contrary. Thus, $\sqrt{u}$ is rational. In other words, $\sqrt
{u}\in\mathbb{Q}$. Hence, Exercise \ref{exe.ent.coprime.frac-red} (applied to
$r=\sqrt{u}$) yields that there exist two \textbf{coprime} integers $a$ and
$b$ satisfying $\sqrt{u}=a/b$. Consider these $a$ and $b$.

We have $a\perp b$ (since $a$ and $b$ are coprime). Thus, Exercise
\ref{exe.ent.coprime.powers} (applied to $n=2$ and $m=2$) yields $a^{2}\perp
b^{2}$. In other words, $b^{2}\perp a^{2}$ (by Proposition
\ref{prop.ent.coprime.perp-symm}). In other words, $\gcd\left(  b^{2}%
,a^{2}\right)  =1$. Also, $b^{2}$ is nonnegative (since the square of any real
number is nonnegative).

Squaring both sides of the equality $\sqrt{u}=a/b$, we obtain $u=\left(
a/b\right)  ^{2}=a^{2}/b^{2}$, so that $a^{2}=b^{2}u$. Hence, $b^{2}\mid
a^{2}$ (since $u$ is an integer). Thus, Proposition \ref{prop.ent.gcd.props1}
\textbf{(i)} (applied to $b^{2}$ and $a^{2}$ instead of $a$ and $b$) yields
$\gcd\left(  b^{2},a^{2}\right)  =\left\vert b^{2}\right\vert =b^{2}$ (since
$b^{2}$ is nonnegative). Comparing this with $\gcd\left(  b^{2},a^{2}\right)
=1$, we obtain $b^{2}=1$. Hence, $u=a^{2}/\underbrace{b^{2}}_{=1}=a^{2}$.
Thus, $u$ is a perfect square (since $a$ is an integer). This contradicts the
fact that $u$ is not a perfect square.

This contradiction shows that our assumption was false. Hence, $\sqrt{u}$ is
irrational. This solves Exercise \ref{exe.ent.coprime.sqrtu+sqrtv}
\textbf{(a)}.

\textbf{(b)} Let $u$ and $v$ be two positive integers that are not both
perfect squares. We must prove that $\sqrt{u}+\sqrt{v}$ is irrational.

Assume the contrary. Thus, $\sqrt{u}+\sqrt{v}$ is rational. Denote this
rational number $\sqrt{u}+\sqrt{v}$ by $x$. Thus, $x=\sqrt{u}+\sqrt{v}$, so
that $x-\sqrt{u}=\sqrt{v}$. Squaring both sides of this equality, we obtain
$\left(  x-\sqrt{u}\right)  ^{2}=v$. Hence,%
\[
v=\left(  x-\sqrt{u}\right)  ^{2}=x^{2}-2x\sqrt{u}+\left(  \sqrt{u}\right)
^{2}=x^{2}-2x\sqrt{u}+u.
\]
Subtracting $x^{2}+u$ from both sides of this equation, we obtain%
\begin{equation}
v-\left(  x^{2}+u\right)  =-2x\sqrt{u}.
\label{sol.ent.coprime.sqrtu+sqrtv.b.2}%
\end{equation}


But $x=\sqrt{u}+\sqrt{v}>0$ (since $u$ and $v$ are positive) and thus $x\neq
0$, so that $-2x\neq0$. Hence, we can solve the equation
(\ref{sol.ent.coprime.sqrtu+sqrtv.b.2}) for $\sqrt{u}$; we thus obtain%
\[
\sqrt{u}=\dfrac{v-\left(  x^{2}+u\right)  }{-2x}.
\]
Thus, $\sqrt{u}$ is rational (since $v$, $x$ and $u$ are rational). Therefore,
$u$ must be a perfect square (since otherwise, Exercise
\ref{exe.ent.coprime.sqrtu+sqrtv} \textbf{(a)} would yield that $\sqrt{u}$ is
irrational). Similarly, $v$ must be a perfect square. This shows that both $u$
and $v$ are perfect squares; but this contradicts the fact that $u$ and $v$
are not both perfect squares.

This contradiction shows that our assumption was false. Hence, $\sqrt{u}%
+\sqrt{v}$ is irrational. This solves Exercise
\ref{exe.ent.coprime.sqrtu+sqrtv} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.gcdgcd1k}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.gcdgcd1k}.]A gcd of a list of
integers is always a nonnegative integer (by the definition of a gcd). Hence,
in particular, $\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a
nonnegative integer. Thus, we can define a nonnegative integer $h$ by
$h=\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  $. Consider this $h$. We have
$\left\vert h\right\vert =h$ (since $h$ is nonnegative).

Theorem \ref{thm.ent.gcd.split} (applied to $\left(  a_{1}x,a_{2}%
x,\ldots,a_{k}x\right)  $, $k$ and $\left(  a_{1}y,a_{2}y,\ldots
,a_{k}y\right)  $ instead of $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $,
$\ell$ and $\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields%
\begin{align}
&  \gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x,a_{1}y,a_{2}y,\ldots,a_{k}y\right)
\nonumber\\
&  =\gcd\left(  \gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x\right)  ,\gcd\left(
a_{1}y,a_{2}y,\ldots,a_{k}y\right)  \right)  .
\label{sol.ent.coprime.gcdgcd1k.1}%
\end{align}


But $\left(  a_{1}x,a_{2}x,\ldots,a_{k}x\right)  =\left(  xa_{1},xa_{2}%
,\ldots,xa_{k}\right)  $ (since $a_{i}x=xa_{i}$ for each $i\in\left\{
1,2,\ldots,k\right\}  $) and thus%
\begin{align*}
\gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x\right)   &  =\gcd\left(  xa_{1}%
,xa_{2},\ldots,xa_{k}\right)  =\left\vert x\right\vert \gcd\left(  a_{1}%
,a_{2},\ldots,a_{k}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.ent.gcd.sak},
applied to }s=x\right)  .
\end{align*}
Comparing this with%
\begin{align*}
\left\vert xh\right\vert  &  =\left\vert x\right\vert \cdot
\underbrace{\left\vert h\right\vert }_{=h}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.ent.div.abs(xy)}) (applied to }h\text{ instead of }y\text{)}\right)
\\
&  =\left\vert x\right\vert \cdot\underbrace{h}_{=\gcd\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  }=\left\vert x\right\vert \gcd\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  ,
\end{align*}
we obtain
\[
\gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x\right)  =\left\vert xh\right\vert .
\]
The same argument (applied to $y$ instead of $x$) yields%
\[
\gcd\left(  a_{1}y,a_{2}y,\ldots,a_{k}y\right)  =\left\vert yh\right\vert .
\]
Thus, (\ref{sol.ent.coprime.gcdgcd1k.1}) becomes%
\begin{align*}
&  \gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x,a_{1}y,a_{2}y,\ldots,a_{k}y\right)
\\
&  =\gcd\left(  \underbrace{\gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x\right)
}_{=\left\vert xh\right\vert },\underbrace{\gcd\left(  a_{1}y,a_{2}%
y,\ldots,a_{k}y\right)  }_{=\left\vert yh\right\vert }\right)  =\gcd\left(
\left\vert xh\right\vert ,\left\vert yh\right\vert \right) \\
&  =\gcd\left(  \underbrace{xh}_{=hx},\underbrace{yh}_{=hy}\right)
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Exercise \ref{exe.ent.gcd.abs} \textbf{(c)} (applied to }xh\text{ and
}yh\\
\text{instead of }a\text{ and }b\text{)}%
\end{array}
\right) \\
&  =\gcd\left(  hx,hy\right)  =\underbrace{\left\vert h\right\vert }_{=h}%
\gcd\left(  x,y\right)  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.ent.gcd.sa,sb} (applied to }h\text{, }x\text{ and
}y\\
\text{instead of }s\text{, }a\text{ and }b\text{)}%
\end{array}
\right) \\
&  =\underbrace{h}_{=\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  }\gcd\left(
x,y\right)  =\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  \cdot\gcd\left(
x,y\right)  .
\end{align*}
This solves Exercise \ref{exe.ent.coprime.gcdgcd1k}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.gcdgcd1k3}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.gcdgcd1k3}.]Theorem
\ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} (applied to $3$ and $\left(
x,y,z\right)  $ instead of $k$ and $\left(  b_{1},b_{2},\ldots,b_{k}\right)
$) yields $\gcd\left(  x,y,z\right)  =\gcd\left(  \gcd\left(  x,y\right)
,z\right)  $. But Exercise \ref{exe.ent.gcd.abs} \textbf{(a)} (applied to
$\gcd\left(  x,y\right)  $ and $z$ instead of $a$ and $b$) yields $\gcd\left(
\gcd\left(  x,y\right)  ,\left\vert z\right\vert \right)  =\gcd\left(
\gcd\left(  x,y\right)  ,z\right)  $. Comparing these two equalities, we
obtain%
\begin{equation}
\gcd\left(  \gcd\left(  x,y\right)  ,\left\vert z\right\vert \right)
=\gcd\left(  x,y,z\right)  . \label{sol.ent.coprime.gcdgcd1k3.0}%
\end{equation}


A gcd of a list of integers is always a nonnegative integer (by the definition
of a gcd). Hence, in particular, $\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)
$ is a nonnegative integer. Thus, we can define a nonnegative integer $h$ by
$h=\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  $. Consider this $h$. We have
$\left\vert h\right\vert =h$ (since $h$ is nonnegative).

Multiplying both sides of the equality $h=\gcd\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $ by $\gcd\left(  x,y\right)  $, we obtain%
\begin{align}
h\gcd\left(  x,y\right)   &  =\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)
\cdot\gcd\left(  x,y\right) \nonumber\\
&  =\gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x,a_{1}y,a_{2}y,\ldots
,a_{k}y\right)  \label{sol.ent.coprime.gcdgcd1k3.IH}%
\end{align}
(by Exercise \ref{exe.ent.coprime.gcdgcd1k}).

But $\left(  a_{1}z,a_{2}z,\ldots,a_{k}z\right)  =\left(  za_{1},za_{2}%
,\ldots,za_{k}\right)  $ (since $a_{i}z=za_{i}$ for each $i\in\left\{
1,2,\ldots,k\right\}  $) and thus%
\[
\gcd\left(  a_{1}z,a_{2}z,\ldots,a_{k}z\right)  =\gcd\left(  za_{1}%
,za_{2},\ldots,za_{k}\right)  =\left\vert z\right\vert \gcd\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)
\]
(by Exercise \ref{exe.ent.gcd.sak}, applied to $s=z$). Thus,%
\begin{equation}
\gcd\left(  a_{1}z,a_{2}z,\ldots,a_{k}z\right)  =\left\vert z\right\vert
\underbrace{\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  }_{=h}=\left\vert
z\right\vert h=h\left\vert z\right\vert . \label{sol.ent.coprime.gcdgcd1k3.hz}%
\end{equation}


Theorem \ref{thm.ent.gcd.split} (applied to $2k$, $\left(  a_{1}%
x,a_{2}x,\ldots,a_{k}x,a_{1}y,a_{2}y,\ldots,a_{k}y\right)  $, $k$ and $\left(
a_{1}z,a_{2}z,\ldots,a_{k}z\right)  $ instead of $k$, $\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $, $\ell$ and $\left(  c_{1},c_{2},\ldots,c_{\ell
}\right)  $) yields%
\begin{align*}
&  \gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}x,a_{1}y,a_{2}y,\ldots,a_{k}%
y,a_{1}z,a_{2}z,\ldots,a_{k}z\right) \\
&  =\gcd\left(  \underbrace{\gcd\left(  a_{1}x,a_{2}x,\ldots,a_{k}%
x,a_{1}y,a_{2}y,\ldots,a_{k}y\right)  }_{\substack{=h\gcd\left(  x,y\right)
\\\text{(by (\ref{sol.ent.coprime.gcdgcd1k3.IH}))}}},\underbrace{\gcd\left(
a_{1}z,a_{2}z,\ldots,a_{k}z\right)  }_{\substack{=h\left\vert z\right\vert
\\\text{(by (\ref{sol.ent.coprime.gcdgcd1k3.hz}))}}}\right) \\
&  =\gcd\left(  h\gcd\left(  x,y\right)  ,h\left\vert z\right\vert \right)
=\underbrace{\left\vert h\right\vert }_{\substack{=h\\=\gcd\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  }}\underbrace{\gcd\left(  \gcd\left(  x,y\right)
,\left\vert z\right\vert \right)  }_{\substack{=\gcd\left(  x,y,z\right)
\\\text{(by (\ref{sol.ent.coprime.gcdgcd1k3.0}))}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.ent.gcd.sa,sb}
(applied to }h\text{, }\gcd\left(  x,y\right)  \text{ and }\left\vert
z\right\vert \text{ instead of }s\text{, }a\text{ and }b\text{)}\right) \\
&  =\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  \cdot\gcd\left(
x,y,z\right)  .
\end{align*}
This solves Exercise \ref{exe.ent.coprime.gcdgcd1k3}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.coprime.gcd-distrib1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.coprime.gcd-distrib1}.]Exercise
\ref{exe.ent.coprime.gcdgcd1} (applied to $u=b$, $v=c$, $x=c$ and $y=a$)
yields
\begin{equation}
\gcd\left(  b,c\right)  \cdot\gcd\left(  c,a\right)  =\gcd\left(
bc,ba,cc,ca\right)  . \label{sol.ent.coprime.gcd-distrib1.1}%
\end{equation}
Multiplying both sides of this equality by $\gcd\left(  a,b\right)  $, we find%
\begin{align}
&  \gcd\left(  b,c\right)  \cdot\gcd\left(  c,a\right)  \cdot\gcd\left(
a,b\right) \nonumber\\
&  =\gcd\left(  bc,ba,cc,ca\right)  \cdot\gcd\left(  a,b\right) \nonumber\\
&  =\gcd\left(  bca,baa,cca,caa,bcb,bab,ccb,cab\right)
\label{sol.ent.coprime.gcd-distrib1.3}%
\end{align}
(by Exercise \ref{exe.ent.coprime.gcdgcd1k}, applied to $a$, $b$, $4$ and
$\left(  bc,ba,cc,ca\right)  $ instead of $x$, $y$, $k$ and $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $).

On the other hand, Exercise \ref{exe.ent.coprime.gcdgcd1k3} (applied to $bc$,
$ca$, $ab$, $3$ and $\left(  a,b,c\right)  $ instead of $x$, $y$, $z$, $k$ and
$\left(  a_{1},a_{2},\ldots,a_{k}\right)  $) yields%
\begin{align}
&  \gcd\left(  a,b,c\right)  \cdot\gcd\left(  bc,ca,ab\right) \nonumber\\
&  =\gcd\left(  abc,bbc,cbc,aca,bca,cca,aab,bab,cab\right)  .
\label{sol.ent.coprime.gcd-distrib1.5}%
\end{align}


But comparing
\begin{align*}
&  \left\{  \underbrace{bca}_{=abc},\underbrace{baa}_{=a^{2}b}%
,\underbrace{cca}_{=c^{2}a},\underbrace{caa}_{=a^{2}c},\underbrace{bcb}%
_{=b^{2}c},\underbrace{bab}_{=b^{2}a},\underbrace{ccb}_{=c^{2}b}%
,\underbrace{cab}_{=abc}\right\} \\
&  =\left\{  abc,a^{2}b,c^{2}a,a^{2}c,b^{2}c,b^{2}a,c^{2}b,abc\right\}
=\left\{  abc,b^{2}c,c^{2}b,c^{2}a,a^{2}c,a^{2}b,b^{2}a\right\}
\end{align*}
with%
\begin{align*}
&  \left\{  abc,\underbrace{bbc}_{=b^{2}c},\underbrace{cbc}_{=c^{2}%
b},\underbrace{aca}_{=a^{2}c},\underbrace{bca}_{=abc},\underbrace{cca}%
_{=c^{2}a},\underbrace{aab}_{=a^{2}b},\underbrace{bab}_{=b^{2}a}%
,\underbrace{cab}_{=abc}\right\} \\
&  =\left\{  abc,b^{2}c,c^{2}b,a^{2}c,abc,c^{2}a,a^{2}b,b^{2}a,abc\right\}
=\left\{  abc,b^{2}c,c^{2}b,c^{2}a,a^{2}c,a^{2}b,b^{2}a\right\}  ,
\end{align*}
we obtain%
\[
\left\{  bca,baa,cca,caa,bcb,bab,ccb,cab\right\}  =\left\{
abc,bbc,cbc,aca,bca,cca,aab,bab,cab\right\}  .
\]
Hence, Exercise \ref{exe.ent.gcd.set} (applied to $8$, $\left(
bca,baa,cca,caa,bcb,bab,ccb,cab\right)  $, $9$ and \newline$\left(
abc,bbc,cbc,aca,bca,cca,aab,bab,cab\right)  $ instead of $k$, $\left(
b_{1},b_{2},\ldots,b_{k}\right)  $, $\ell$ and $\left(  c_{1},c_{2}%
,\ldots,c_{\ell}\right)  $) yields%
\[
\gcd\left(  bca,baa,cca,caa,bcb,bab,ccb,cab\right)  =\gcd\left(
abc,bbc,cbc,aca,bca,cca,aab,bab,cab\right)  .
\]
Comparing this with (\ref{sol.ent.coprime.gcd-distrib1.5}), we obtain%
\[
\gcd\left(  a,b,c\right)  \cdot\gcd\left(  bc,ca,ab\right)  =\gcd\left(
bca,baa,cca,caa,bcb,bab,ccb,cab\right)  .
\]
Comparing this with (\ref{sol.ent.coprime.gcd-distrib1.3}), we obtain%
\[
\gcd\left(  b,c\right)  \cdot\gcd\left(  c,a\right)  \cdot\gcd\left(
a,b\right)  =\gcd\left(  a,b,c\right)  \cdot\gcd\left(  bc,ca,ab\right)  .
\]
This solves Exercise \ref{exe.ent.coprime.gcd-distrib1}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.sum1xy-eng}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.sum1xy-eng}.]Let $W$ be the set of all
pairs $\left(  x,y\right)  \in\left[  n\right]  ^{2}$ satisfying $x\perp y$
and $x+y\leq n$. Any pair $\left(  x,y\right)  \in\left[  n\right]  ^{2}$
satisfying $x\perp y$ must satisfy either $x+y\leq n$ or $x+y>n$ (but not both
at the same time). Hence, we can split the sum $\sum_{\substack{\left(
x,y\right)  \in\left[  n\right]  ^{2};\\x\perp y}}\ \ \dfrac{1}{xy}$ as
follows:%
\begin{align}
\sum_{\substack{\left(  x,y\right)  \in\left[  n\right]  ^{2};\\x\perp
y}}\ \ \dfrac{1}{xy}  &  =\underbrace{\sum_{\substack{\left(  x,y\right)
\in\left[  n\right]  ^{2};\\x\perp y;\\x+y\leq n}}}_{\substack{=\sum_{\left(
x,y\right)  \in W}\\\text{(since }W\text{ is the set of}\\\text{all pairs
}\left(  x,y\right)  \in\left[  n\right]  ^{2}\\\text{satisfying }x\perp
y\text{ and }x+y\leq n\text{)}}}\dfrac{1}{xy}+\underbrace{\sum
_{\substack{\left(  x,y\right)  \in\left[  n\right]  ^{2};\\x\perp
y;\\x+y>n}}}_{\substack{=\sum_{\left(  x,y\right)  \in Z}\\\text{(since
}Z\text{ is the set of}\\\text{all pairs }\left(  x,y\right)  \in\left[
n\right]  ^{2}\\\text{satisfying }x\perp y\text{ and }x+y>n\text{)}}}\dfrac
{1}{xy}\nonumber\\
&  =\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{xy}+\sum_{\left(
x,y\right)  \in Z}\ \ \dfrac{1}{xy}. \label{sol.ent.sum1xy-eng.1st.1}%
\end{align}


On the other hand, let $A$ be the set of all pairs $\left(  x,y\right)
\in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x<y$. Let $B$ be the set
of all pairs $\left(  x,y\right)  \in\left[  n\right]  ^{2}$ satisfying
$x\perp y$ and $x=y$. Let $C$ be the set of all pairs $\left(  x,y\right)
\in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x>y$.

Now, any pair $\left(  x,y\right)  \in\left[  n\right]  ^{2}$ satisfying
$x\perp y$ must satisfy exactly one of the three relations $x<y$ and $x=y$ and
$x>y$. Hence, we can split the sum $\sum_{\substack{\left(  x,y\right)
\in\left[  n\right]  ^{2};\\x\perp y}}\ \ \dfrac{1}{xy}$ as follows:%
\begin{align}
\sum_{\substack{\left(  x,y\right)  \in\left[  n\right]  ^{2};\\x\perp
y}}\ \ \dfrac{1}{xy}  &  =\underbrace{\sum_{\substack{\left(  x,y\right)
\in\left[  n\right]  ^{2};\\x\perp y;\\x<y}}}_{\substack{=\sum_{\left(
x,y\right)  \in A}\\\text{(since }A\text{ is the set of}\\\text{all pairs
}\left(  x,y\right)  \in\left[  n\right]  ^{2}\\\text{satisfying }x\perp
y\text{ and }x<y\text{)}}}\dfrac{1}{xy}+\underbrace{\sum_{\substack{\left(
x,y\right)  \in\left[  n\right]  ^{2};\\x\perp y;\\x=y}}}_{\substack{=\sum
_{\left(  x,y\right)  \in B}\\\text{(since }B\text{ is the set of}\\\text{all
pairs }\left(  x,y\right)  \in\left[  n\right]  ^{2}\\\text{satisfying }x\perp
y\text{ and }x=y\text{)}}}\dfrac{1}{xy}+\underbrace{\sum_{\substack{\left(
x,y\right)  \in\left[  n\right]  ^{2};\\x\perp y;\\x>y}}}_{\substack{=\sum
_{\left(  x,y\right)  \in C}\\\text{(since }C\text{ is the set of}\\\text{all
pairs }\left(  x,y\right)  \in\left[  n\right]  ^{2}\\\text{satisfying }x\perp
y\text{ and }x>y\text{)}}}\dfrac{1}{xy}\nonumber\\
&  =\sum_{\left(  x,y\right)  \in A}\ \ \dfrac{1}{xy}+\sum_{\left(
x,y\right)  \in B}\ \ \dfrac{1}{xy}+\sum_{\left(  x,y\right)  \in C}%
\ \ \dfrac{1}{xy}. \label{sol.ent.sum1xy-eng.1st.2}%
\end{align}


We shall now study the three sums on the right hand side of this equality. We
begin with the first one: We claim that
\begin{equation}
\sum_{\left(  x,y\right)  \in A}\ \ \dfrac{1}{xy}=\sum_{\left(  x,y\right)
\in W}\ \ \dfrac{1}{x\left(  x+y\right)  }.
\label{sol.ent.sum1xy-eng.1st.sumA}%
\end{equation}


[\textit{Proof of (\ref{sol.ent.sum1xy-eng.1st.sumA}):} We shall establish a
bijection between $A$ and $W$.

Indeed, if $\left(  u,v\right)  \in W$, then $\left(  u,u+v\right)  \in
A$\ \ \ \ \footnote{\textit{Proof.} Let $\left(  u,v\right)  \in W$. Thus,
$\left(  u,v\right)  $ is a pair $\left(  x,y\right)  \in\left[  n\right]
^{2}$ satisfying $x\perp y$ and $x+y\leq n$ (because $W$ is the set of all
such pairs). In other words, $\left(  u,v\right)  $ belongs to $\left[
n\right]  ^{2}$ and satisfies $u\perp v$ and $u+v\leq n$.
\par
We know that $\left(  u,v\right)  $ belongs to $\left[  n\right]  ^{2}$;
hence, $u\in\left[  n\right]  $ and $v\in\left[  n\right]  $. From
$u\in\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $, we obtain $1\leq
u\leq n$. From $v\in\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $, we
obtain $1\leq v\leq n$. Now, $1\leq v$, so that $v\geq1>0$ and therefore
$u+v>u$, so that $u<u+v$. From $u+v>u$, we obtain $u+v\geq u\geq1$ (since
$1\leq u$) and thus $1\leq u+v\leq n$. Hence, $u+v\in\left\{  1,2,\ldots
,n\right\}  =\left[  n\right]  $.
\par
We have $u\perp v$. In other words, the numbers $u$ and $v$ are coprime (by
Definition \ref{def.ent.coprime.perp}). In other words, $\gcd\left(
u,v\right)  =1$ (by the definition of \textquotedblleft
coprime\textquotedblright). But Proposition \ref{prop.ent.gcd.props1}
\textbf{(c)} (applied to $u$, $v$ and $1$ instead of $a$, $b$ and $u$) yields
$\gcd\left(  u,1u+v\right)  =\gcd\left(  u,v\right)  =1$. In other words,
$\gcd\left(  u,u+v\right)  =1$ (since $1u=u$). In other words, $u$ and $u+v$
are coprime (by the definition of \textquotedblleft coprime\textquotedblright%
). In other words, $u\perp u+v$.
\par
Now, $\left(  u,u+v\right)  \in\left[  n\right]  ^{2}$ (since $u\in\left[
n\right]  $ and $u+v\in\left[  n\right]  $) and $u\perp u+v$ and $u<u+v$. In
other words, $\left(  u,u+v\right)  $ is a pair $\left(  x,y\right)
\in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x<y$. In other words,
$\left(  u,u+v\right)  \in A$ (since $A$ is the set of all pairs $\left(
x,y\right)  \in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x<y$).
Qed.}. Hence, we can define a map%
\begin{align*}
f:W  &  \rightarrow A,\\
\left(  u,v\right)   &  \mapsto\left(  u,u+v\right)  .
\end{align*}
Consider this map $f$.

On the other hand, if $\left(  u,v\right)  \in A$, then $\left(  u,v-u\right)
\in W$\ \ \ \ \footnote{\textit{Proof.} Let $\left(  u,v\right)  \in A$. Thus,
$\left(  u,v\right)  $ is a pair $\left(  x,y\right)  \in\left[  n\right]
^{2}$ satisfying $x\perp y$ and $x<y$ (because $A$ is the set of all such
pairs). In other words, $\left(  u,v\right)  $ belongs to $\left[  n\right]
^{2}$ and satisfies $u\perp v$ and $u<v$.
\par
We know that $\left(  u,v\right)  $ belongs to $\left[  n\right]  ^{2}$;
hence, $u\in\left[  n\right]  $ and $v\in\left[  n\right]  $. From
$u\in\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $, we obtain $1\leq
u\leq n$. From $v\in\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $, we
obtain $1\leq v\leq n$. Now, $v-u>0$ (since $u<v$) and thus $v-u\geq1$ (since
$v-u$ is an integer). Also, $0<1\leq u$ and thus $u>0$; hence, $v-u<v\leq n$
and therefore $v-u\leq n$. From $v-u\geq1$ and $v-u\leq n$, we obtain
$v-u\in\left\{  1,2,\ldots,n\right\}  =\left[  n\right]  $.
\par
We have $u\perp v$. In other words, the numbers $u$ and $v$ are coprime (by
Definition \ref{def.ent.coprime.perp}). In other words, $\gcd\left(
u,v\right)  =1$ (by the definition of \textquotedblleft
coprime\textquotedblright). But Proposition \ref{prop.ent.gcd.props1}
\textbf{(c)} (applied to $u$, $v$ and $-1$ instead of $a$, $b$ and $u$) yields
$\gcd\left(  u,\left(  -1\right)  u+v\right)  =\gcd\left(  u,v\right)  =1$. In
other words, $\gcd\left(  u,v-u\right)  =1$ (since $\left(  -1\right)
u+v=v-u$). In other words, $u$ and $v-u$ are coprime (by the definition of
\textquotedblleft coprime\textquotedblright). In other words, $u\perp v-u$.
\par
Now, $\left(  u,v-u\right)  \in\left[  n\right]  ^{2}$ (since $u\in\left[
n\right]  $ and $v-u\in\left[  n\right]  $) and $u\perp v-u$ and $u+\left(
v-u\right)  \leq n$ (since $u+\left(  v-u\right)  =v\leq n$). In other words,
$\left(  u,v-u\right)  $ is a pair $\left(  x,y\right)  \in\left[  n\right]
^{2}$ satisfying $x\perp y$ and $x+y\leq n$. In other words, $\left(
u,v-u\right)  \in W$ (since $W$ is the set of all pairs $\left(  x,y\right)
\in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x+y\leq n$). Qed.}.
Hence, we can define a map%
\begin{align*}
g:A  &  \rightarrow W,\\
\left(  u,v\right)   &  \mapsto\left(  u,v-u\right)  .
\end{align*}
Consider this map $g$.

We have $f\circ g=\operatorname*{id}$\ \ \ \ \footnote{\textit{Proof.} Let
$p\in A$. Thus, $p$ is a pair $\left(  x,y\right)  \in\left[  n\right]  ^{2}$
satisfying $x\perp y$ and $x<y$ (because $A$ is the set of all such pairs).
Consider this pair $\left(  x,y\right)  $. Thus, $p=\left(  x,y\right)  $.
\par
Applying the map $g$ to both sides of this equality, we find $g\left(
p\right)  =g\left(  \left(  x,y\right)  \right)  =\left(  x,y-x\right)  $ (by
the definition of $g$). Applying the map $f$ to both sides of this equality,
we find
\begin{align*}
f\left(  g\left(  p\right)  \right)   &  =f\left(  \left(  x,y-x\right)
\right)  =\left(  x,\underbrace{x+\left(  y-x\right)  }_{=y}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }f\right) \\
&  =\left(  x,y\right)  =p.
\end{align*}
Thus, $\left(  f\circ g\right)  \left(  p\right)  =f\left(  g\left(  p\right)
\right)  =p=\operatorname*{id}\left(  p\right)  $.
\par
Forget that we fixed $p$. We thus have shown that $\left(  f\circ g\right)
\left(  p\right)  =\operatorname*{id}\left(  p\right)  $ for each $p\in A$. In
other words, $f\circ g=\operatorname*{id}$.} and $g\circ f=\operatorname*{id}%
$\ \ \ \ \footnote{\textit{Proof.} Let $p\in W$. Thus, $p$ is a pair $\left(
x,y\right)  \in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x+y\leq n$
(because $W$ is the set of all such pairs). Consider this pair $\left(
x,y\right)  $. Thus, $p=\left(  x,y\right)  $.
\par
Applying the map $f$ to both sides of this equality, we find $f\left(
p\right)  =f\left(  \left(  x,y\right)  \right)  =\left(  x,x+y\right)  $ (by
the definition of $f$). Applying the map $g$ to both sides of this equality,
we find
\begin{align*}
g\left(  f\left(  p\right)  \right)   &  =g\left(  \left(  x,x+y\right)
\right)  =\left(  x,\underbrace{\left(  x+y\right)  -x}_{=y}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }g\right) \\
&  =\left(  x,y\right)  =p.
\end{align*}
Thus, $\left(  g\circ f\right)  \left(  p\right)  =g\left(  f\left(  p\right)
\right)  =p=\operatorname*{id}\left(  p\right)  $.
\par
Forget that we fixed $p$. We thus have shown that $\left(  g\circ f\right)
\left(  p\right)  =\operatorname*{id}\left(  p\right)  $ for each $p\in W$. In
other words, $g\circ f=\operatorname*{id}$.}. Hence, the maps $f$ and $g$ are
mutually inverse, and thus are invertible. In other words, the maps $f$ and
$g$ are bijections.

In particular, the map $f$ is a bijection. In other words, the map%
\begin{align*}
W  &  \rightarrow A,\\
\left(  u,v\right)   &  \mapsto\left(  u,u+v\right)
\end{align*}
is a bijection (since this map is precisely the map $f$ (by the definition of
$f$)). Hence, we can substitute $\left(  u,u+v\right)  $ for $\left(
x,y\right)  $ in the sum $\sum_{\left(  x,y\right)  \in A}\ \ \dfrac{1}{xy}$.
We thus obtain
\[
\sum_{\left(  x,y\right)  \in A}\ \ \dfrac{1}{xy}=\sum_{\left(  u,v\right)
\in W}\ \ \dfrac{1}{u\left(  u+v\right)  }=\sum_{\left(  x,y\right)  \in
W}\ \ \dfrac{1}{x\left(  x+y\right)  }%
\]
(here, we have renamed the summation index $\left(  u,v\right)  $ as $\left(
x,y\right)  $). This proves (\ref{sol.ent.sum1xy-eng.1st.sumA}).]

Next, we claim that
\begin{equation}
\sum_{\left(  x,y\right)  \in C}\ \ \dfrac{1}{xy}=\sum_{\left(  x,y\right)
\in W}\ \ \dfrac{1}{y\left(  x+y\right)  }.
\label{sol.ent.sum1xy-eng.1st.sumC}%
\end{equation}


[\textit{Proof of (\ref{sol.ent.sum1xy-eng.1st.sumC}):} We shall establish a
bijection between $C$ and $W$.

Indeed, if $\left(  u,v\right)  \in W$, then $\left(  u+v,v\right)  \in
C$\ \ \ \ \footnote{\textit{Proof.} Let $\left(  u,v\right)  \in W$. Thus,
$\left(  u,v\right)  $ is a pair $\left(  x,y\right)  \in\left[  n\right]
^{2}$ satisfying $x\perp y$ and $x+y\leq n$ (because $W$ is the set of all
such pairs). In other words, $\left(  u,v\right)  $ belongs to $\left[
n\right]  ^{2}$ and satisfies $u\perp v$ and $u+v\leq n$.
\par
We know that $\left(  u,v\right)  $ belongs to $\left[  n\right]  ^{2}$;
hence, $u\in\left[  n\right]  $ and $v\in\left[  n\right]  $. From
$u\in\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $, we obtain $1\leq
u\leq n$. From $v\in\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $, we
obtain $1\leq v\leq n$. Now, $1\leq u$, so that $u\geq1>0$ and therefore
$u+v>v$. Hence, $u+v\geq v\geq1$ (since $1\leq v$) and thus $1\leq u+v\leq n$.
Hence, $u+v\in\left\{  1,2,\ldots,n\right\}  =\left[  n\right]  $.
\par
We have $u\perp v$. In other words, the numbers $u$ and $v$ are coprime (by
Definition \ref{def.ent.coprime.perp}). In other words, $\gcd\left(
u,v\right)  =1$ (by the definition of \textquotedblleft
coprime\textquotedblright). Proposition \ref{prop.ent.gcd.props1} \textbf{(b)}
(applied to $a=v$ and $b=u$) yields $\gcd\left(  v,u\right)  =\gcd\left(
u,v\right)  =1$. But Proposition \ref{prop.ent.gcd.props1} \textbf{(c)}
(applied to $v$, $u$ and $1$ instead of $a$, $b$ and $u$) yields $\gcd\left(
v,1v+u\right)  =\gcd\left(  v,u\right)  =1$. In other words, $\gcd\left(
v,u+v\right)  =1$ (since $1v+u=u+v$). Now, Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)} (applied to $a=u+v$ and $b=v$) yields
$\gcd\left(  u+v,v\right)  =\gcd\left(  v,u+v\right)  =1$. In other words,
$u+v$ and $v$ are coprime (by the definition of \textquotedblleft
coprime\textquotedblright). In other words, $u+v\perp v$.
\par
Now, $\left(  u+v,v\right)  \in\left[  n\right]  ^{2}$ (since $u+v\in\left[
n\right]  $ and $v\in\left[  n\right]  $) and $u+v\perp v$ and $u+v>v$. In
other words, $\left(  u+v,v\right)  $ is a pair $\left(  x,y\right)
\in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x>y$. In other words,
$\left(  u+v,v\right)  \in C$ (since $C$ is the set of all pairs $\left(
x,y\right)  \in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x>y$).
Qed.}. Hence, we can define a map%
\begin{align*}
f:W  &  \rightarrow C,\\
\left(  u,v\right)   &  \mapsto\left(  u+v,v\right)  .
\end{align*}
Consider this map $f$.

On the other hand, if $\left(  u,v\right)  \in C$, then $\left(  u-v,v\right)
\in W$\ \ \ \ \footnote{\textit{Proof.} Let $\left(  u,v\right)  \in C$. Thus,
$\left(  u,v\right)  $ is a pair $\left(  x,y\right)  \in\left[  n\right]
^{2}$ satisfying $x\perp y$ and $x>y$ (because $C$ is the set of all such
pairs). In other words, $\left(  u,v\right)  $ belongs to $\left[  n\right]
^{2}$ and satisfies $u\perp v$ and $u>v$.
\par
We know that $\left(  u,v\right)  $ belongs to $\left[  n\right]  ^{2}$;
hence, $u\in\left[  n\right]  $ and $v\in\left[  n\right]  $. From
$u\in\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $, we obtain $1\leq
u\leq n$. From $v\in\left[  n\right]  =\left\{  1,2,\ldots,n\right\}  $, we
obtain $1\leq v\leq n$. Now, $u-v>0$ (since $u>v$) and thus $u-v\geq1$ (since
$u-v$ is an integer). Also, $0<1\leq v$ and thus $v>0$; hence, $u-v<u\leq n$
and therefore $u-v\leq n$. From $u-v\geq1$ and $u-v\leq n$, we obtain
$u-v\in\left\{  1,2,\ldots,n\right\}  =\left[  n\right]  $.
\par
We have $u\perp v$. In other words, the numbers $u$ and $v$ are coprime (by
Definition \ref{def.ent.coprime.perp}). In other words, $\gcd\left(
u,v\right)  =1$ (by the definition of \textquotedblleft
coprime\textquotedblright). Proposition \ref{prop.ent.gcd.props1} \textbf{(b)}
(applied to $a=v$ and $b=u$) yields $\gcd\left(  v,u\right)  =\gcd\left(
u,v\right)  =1$. But Proposition \ref{prop.ent.gcd.props1} \textbf{(c)}
(applied to $v$, $u$ and $-1$ instead of $a$, $b$ and $u$) yields $\gcd\left(
v,\left(  -1\right)  v+u\right)  =\gcd\left(  v,u\right)  =1$. In other words,
$\gcd\left(  v,u-v\right)  =1$ (since $\left(  -1\right)  v+u=u-v$).
Furthermore, Proposition \ref{prop.ent.gcd.props1} \textbf{(b)} (applied to
$a=u-v$ and $b=v$) yields $\gcd\left(  u-v,v\right)  =\gcd\left(
v,u-v\right)  =1$. In other words, $u-v$ and $v$ are coprime (by the
definition of \textquotedblleft coprime\textquotedblright). In other words,
$u-v\perp v$.
\par
Now, $\left(  u-v,v\right)  \in\left[  n\right]  ^{2}$ (since $u-v\in\left[
n\right]  $ and $v\in\left[  n\right]  $) and $u-v\perp v$ and $\left(
u-v\right)  +v\leq n$ (since $\left(  u-v\right)  +v=u\leq n$). In other
words, $\left(  u-v,v\right)  $ is a pair $\left(  x,y\right)  \in\left[
n\right]  ^{2}$ satisfying $x\perp y$ and $x+y\leq n$. In other words,
$\left(  u-v,v\right)  \in W$ (since $W$ is the set of all pairs $\left(
x,y\right)  \in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x+y\leq n$).
Qed.}. Hence, we can define a map%
\begin{align*}
g:C  &  \rightarrow W,\\
\left(  u,v\right)   &  \mapsto\left(  u-v,v\right)  .
\end{align*}
Consider this map $g$.

We have $f\circ g=\operatorname*{id}$\ \ \ \ \footnote{\textit{Proof.} Let
$p\in C$. Thus, $p$ is a pair $\left(  x,y\right)  \in\left[  n\right]  ^{2}$
satisfying $x\perp y$ and $x>y$ (because $C$ is the set of all such pairs).
Consider this pair $\left(  x,y\right)  $. Thus, $p=\left(  x,y\right)  $.
\par
Applying the map $g$ to both sides of this equality, we find $g\left(
p\right)  =g\left(  \left(  x,y\right)  \right)  =\left(  x-y,y\right)  $ (by
the definition of $g$). Applying the map $f$ to both sides of this equality,
we find
\begin{align*}
f\left(  g\left(  p\right)  \right)   &  =f\left(  \left(  x-y,y\right)
\right)  =\left(  \underbrace{\left(  x-y\right)  +y}_{=x},y\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }f\right) \\
&  =\left(  x,y\right)  =p.
\end{align*}
Thus, $\left(  f\circ g\right)  \left(  p\right)  =f\left(  g\left(  p\right)
\right)  =p=\operatorname*{id}\left(  p\right)  $.
\par
Forget that we fixed $p$. We thus have shown that $\left(  f\circ g\right)
\left(  p\right)  =\operatorname*{id}\left(  p\right)  $ for each $p\in C$. In
other words, $f\circ g=\operatorname*{id}$.} and $g\circ f=\operatorname*{id}%
$\ \ \ \ \footnote{\textit{Proof.} Let $p\in W$. Thus, $p$ is a pair $\left(
x,y\right)  \in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x+y\leq n$
(because $W$ is the set of all such pairs). Consider this pair $\left(
x,y\right)  $. Thus, $p=\left(  x,y\right)  $.
\par
Applying the map $f$ to both sides of this equality, we find $f\left(
p\right)  =f\left(  \left(  x,y\right)  \right)  =\left(  x+y,y\right)  $ (by
the definition of $f$). Applying the map $g$ to both sides of this equality,
we find
\begin{align*}
g\left(  f\left(  p\right)  \right)   &  =g\left(  \left(  x+y,y\right)
\right)  =\left(  \underbrace{\left(  x+y\right)  -y}_{=x},y\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }g\right) \\
&  =\left(  x,y\right)  =p.
\end{align*}
Thus, $\left(  g\circ f\right)  \left(  p\right)  =g\left(  f\left(  p\right)
\right)  =p=\operatorname*{id}\left(  p\right)  $.
\par
Forget that we fixed $p$. We thus have shown that $\left(  g\circ f\right)
\left(  p\right)  =\operatorname*{id}\left(  p\right)  $ for each $p\in W$. In
other words, $g\circ f=\operatorname*{id}$.}. Hence, the maps $f$ and $g$ are
mutually inverse, and thus are invertible. In other words, the maps $f$ and
$g$ are bijections.

In particular, the map $f$ is a bijection. In other words, the map%
\begin{align*}
W  &  \rightarrow C,\\
\left(  u,v\right)   &  \mapsto\left(  u+v,v\right)
\end{align*}
is a bijection (since this map is precisely the map $f$ (by the definition of
$f$)). Hence, we can substitute $\left(  u+v,v\right)  $ for $\left(
x,y\right)  $ in the sum $\sum_{\left(  x,y\right)  \in C}\ \ \dfrac{1}{xy}$.
We thus obtain
\[
\sum_{\left(  x,y\right)  \in C}\ \ \dfrac{1}{xy}=\sum_{\left(  u,v\right)
\in W}\ \ \underbrace{\dfrac{1}{\left(  u+v\right)  v}}_{=\dfrac{1}{v\left(
u+v\right)  }}=\sum_{\left(  u,v\right)  \in W}\ \ \dfrac{1}{v\left(
u+v\right)  }=\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{y\left(
x+y\right)  }%
\]
(here, we have renamed the summation index $\left(  u,v\right)  $ as $\left(
x,y\right)  $). This proves (\ref{sol.ent.sum1xy-eng.1st.sumC}).]

Next, we claim that%
\begin{equation}
\sum_{\left(  x,y\right)  \in B}\ \ \dfrac{1}{xy}=1.
\label{sol.ent.sum1xy-eng.1st.sumB}%
\end{equation}


[\textit{Proof of (\ref{sol.ent.sum1xy-eng.1st.sumB}):} It is easy to see that
$\left\{  \left(  1,1\right)  \right\}  \subseteq B$%
\ \ \ \ \footnote{\textit{Proof.} We know that $n$ is a positive integer.
Thus, $1\in\left\{  1,2,\ldots,n\right\}  =\left[  n\right]  $. Hence,
$\left(  1,1\right)  \in\left[  n\right]  ^{2}$ (since $1\in\left[  n\right]
$ and $1\in\left[  n\right]  $) and $1\perp1$ (by Exercise
\ref{exe.ent.coprime.01} \textbf{(a)}, applied to $a=1$) and $1=1$. In other
words, $\left(  1,1\right)  $ is a pair $\left(  x,y\right)  \in\left[
n\right]  ^{2}$ satisfying $x\perp y$ and $x=y$. In other words, $\left(
1,1\right)  \in B$ (since $B$ is the set of all pairs $\left(  x,y\right)
\in\left[  n\right]  ^{2}$ satisfying $x\perp y$ and $x=y$). Hence, $\left\{
\left(  1,1\right)  \right\}  \subseteq B$.} and $B\subseteq\left\{  \left(
1,1\right)  \right\}  $\ \ \ \ \footnote{\textit{Proof.} Let $p\in B$. Thus,
$p$ is a pair $\left(  x,y\right)  \in\left[  n\right]  ^{2}$ satisfying
$x\perp y$ and $x=y$ (because $B$ is the set of all such pairs). Consider this
pair $\left(  x,y\right)  $. Thus, $p=\left(  x,y\right)  $. From $\left(
x,y\right)  \in\left[  n\right]  ^{2}$, we obtain $x\in\left[  n\right]  $ and
$y\in\left[  n\right]  $. Hence, $x\in\left[  n\right]  =\left\{
1,2,\ldots,n\right\}  $, so that $x$ is a positive integer. Now, we have
$y\mid y$. In other words, $x\mid y$ (since $x=y$). Hence, Proposition
\ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $a=x$ and $b=y$) yields
$\gcd\left(  x,y\right)  =\left\vert x\right\vert =x$ (since $x$ is positive).
However, we have $x\perp y$. In other words, $x$ is coprime to $y$ (by the
definition of the notation \textquotedblleft$x\perp y$\textquotedblright). In
other words, $\gcd\left(  x,y\right)  =1$ (by the definition of
\textquotedblleft coprime\textquotedblright). Comparing this with $\gcd\left(
x,y\right)  =x$, we obtain $x=1$. From $x=y$, we now obtain $y=x=1$. Combining
$x=1$ with $y=1$, we see that $\left(  x,y\right)  =\left(  1,1\right)  $.
Hence, $p=\left(  x,y\right)  =\left(  1,1\right)  \in\left\{  \left(
1,1\right)  \right\}  $.
\par
Forget that we fixed $p$. We thus have shown that $p\in\left\{  \left(
1,1\right)  \right\}  $ for each $p\in B$. In other words, $B\subseteq\left\{
\left(  1,1\right)  \right\}  $.}. Combining these two relations, we obtain
$B=\left\{  \left(  1,1\right)  \right\}  $. Thus,%
\[
\sum_{\left(  x,y\right)  \in B}\ \ \dfrac{1}{xy}=\sum_{\left(  x,y\right)
\in\left\{  \left(  1,1\right)  \right\}  }\ \ \dfrac{1}{xy}=\dfrac{1}%
{1\cdot1}=1.
\]
This proves (\ref{sol.ent.sum1xy-eng.1st.sumB}).]

Now, (\ref{sol.ent.sum1xy-eng.1st.2}) becomes%
\begin{align*}
\sum_{\substack{\left(  x,y\right)  \in\left[  n\right]  ^{2};\\x\perp
y}}\ \ \dfrac{1}{xy}  &  =\underbrace{\sum_{\left(  x,y\right)  \in
A}\ \ \dfrac{1}{xy}}_{\substack{=\sum_{\left(  x,y\right)  \in W}\ \ \dfrac
{1}{x\left(  x+y\right)  }\\\text{(by (\ref{sol.ent.sum1xy-eng.1st.sumA}))}%
}}+\underbrace{\sum_{\left(  x,y\right)  \in B}\ \ \dfrac{1}{xy}%
}_{\substack{=1\\\text{(by (\ref{sol.ent.sum1xy-eng.1st.sumB}))}%
}}+\underbrace{\sum_{\left(  x,y\right)  \in C}\ \ \dfrac{1}{xy}%
}_{\substack{=\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{y\left(
x+y\right)  }\\\text{(by (\ref{sol.ent.sum1xy-eng.1st.sumC}))}}}\\
&  =\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{x\left(  x+y\right)
}+1+\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{y\left(  x+y\right)  }\\
&  =\underbrace{\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{x\left(
x+y\right)  }+\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{y\left(
x+y\right)  }}_{=\sum_{\left(  x,y\right)  \in W}\left(  \dfrac{1}{x\left(
x+y\right)  }+\dfrac{1}{y\left(  x+y\right)  }\right)  }+1\\
&  =\sum_{\left(  x,y\right)  \in W}\underbrace{\left(  \dfrac{1}{x\left(
x+y\right)  }+\dfrac{1}{y\left(  x+y\right)  }\right)  }_{=\dfrac
{y+x}{xy\left(  x+y\right)  }=\dfrac{1}{xy}}+1=\sum_{\left(  x,y\right)  \in
W}\ \ \dfrac{1}{xy}+1.
\end{align*}
Comparing this with (\ref{sol.ent.sum1xy-eng.1st.1}), we obtain%
\[
\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{xy}+\sum_{\left(  x,y\right)
\in Z}\ \ \dfrac{1}{xy}=\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{xy}+1
\]
Subtracting $\sum_{\left(  x,y\right)  \in W}\ \ \dfrac{1}{xy}$ from both
sides of this equality, we obtain $\sum_{\left(  x,y\right)  \in Z}%
\ \ \dfrac{1}{xy}=1$. This solves Exercise \ref{exe.ent.sum1xy-eng}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.lcm.props1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.lcm.props1}.]The lowest common multiple of
any set of integers is a nonnegative integer (by Definition
\ref{def.ent.lcm.lcm}). Thus, in particular, $\operatorname{lcm}\left(
a,b\right)  $ and $\operatorname{lcm}\left(  b,a\right)  $ and
$\operatorname{lcm}\left(  -a,b\right)  $ are nonnegative integers.

\textbf{(a)} Proposition \ref{prop.ent.lcm.divides} \textbf{(c)} (applied to
$b$ and $a$ instead of $a$ and $b$) yields $b\mid\operatorname{lcm}\left(
b,a\right)  $ and $a\mid\operatorname{lcm}\left(  b,a\right)  $. Thus,
$a\mid\operatorname{lcm}\left(  b,a\right)  $ and $b\mid\operatorname{lcm}%
\left(  b,a\right)  $. Hence, Lemma \ref{lem.ent.lcm.uniprop} (applied to
$m=\operatorname{lcm}\left(  b,a\right)  $) yields $\operatorname{lcm}\left(
a,b\right)  \mid\operatorname{lcm}\left(  b,a\right)  $. The same argument
(applied to $b$ and $a$ instead of $a$ and $b$) yields $\operatorname{lcm}%
\left(  b,a\right)  \mid\operatorname{lcm}\left(  a,b\right)  $. Hence,
Exercise \ref{exe.ent.div.abba} (applied to $\operatorname{lcm}\left(
a,b\right)  $ and $\operatorname{lcm}\left(  b,a\right)  $ instead of $a$ and
$b$) yields $\left\vert \operatorname{lcm}\left(  a,b\right)  \right\vert
=\left\vert \operatorname{lcm}\left(  b,a\right)  \right\vert
=\operatorname{lcm}\left(  b,a\right)  $ (since $\operatorname{lcm}\left(
b,a\right)  $ is nonnegative). But $\operatorname{lcm}\left(  a,b\right)  $ is
nonnegative; thus, $\left\vert \operatorname{lcm}\left(  a,b\right)
\right\vert =\operatorname{lcm}\left(  a,b\right)  $. Hence,
$\operatorname{lcm}\left(  a,b\right)  =\left\vert \operatorname{lcm}\left(
a,b\right)  \right\vert =\operatorname{lcm}\left(  b,a\right)  $. This solves
Exercise \ref{exe.ent.lcm.props1} \textbf{(a)}.

\textbf{(b)} Proposition \ref{prop.ent.lcm.divides} \textbf{(c)} (applied to
$-a$ instead of $a$) yields $-a\mid\operatorname{lcm}\left(  -a,b\right)  $
and $b\mid\operatorname{lcm}\left(  -a,b\right)  $. But $a\mid-a$ (since
$-a=a\cdot\left(  -1\right)  $). Thus, $a\mid-a\mid\operatorname{lcm}\left(
-a,b\right)  $ and $b\mid\operatorname{lcm}\left(  -a,b\right)  $. Hence,
Lemma \ref{lem.ent.lcm.uniprop} (applied to $m=\operatorname{lcm}\left(
-a,b\right)  $) yields $\operatorname{lcm}\left(  a,b\right)  \mid
\operatorname{lcm}\left(  -a,b\right)  $. The same argument (applied to $-a$
instead of $a$) yields $\operatorname{lcm}\left(  -a,b\right)  \mid
\operatorname{lcm}\left(  -\left(  -a\right)  ,b\right)  $. In view of
$-\left(  -a\right)  =a$, this rewrites as $\operatorname{lcm}\left(
-a,b\right)  \mid\operatorname{lcm}\left(  a,b\right)  $. Hence, Exercise
\ref{exe.ent.div.abba} (applied to $\operatorname{lcm}\left(  a,b\right)  $
and $\operatorname{lcm}\left(  -a,b\right)  $ instead of $a$ and $b$) yields
$\left\vert \operatorname{lcm}\left(  a,b\right)  \right\vert =\left\vert
\operatorname{lcm}\left(  -a,b\right)  \right\vert =\operatorname{lcm}\left(
-a,b\right)  $ (since $\operatorname{lcm}\left(  -a,b\right)  $ is
nonnegative). But $\operatorname{lcm}\left(  a,b\right)  $ is nonnegative;
thus, $\left\vert \operatorname{lcm}\left(  a,b\right)  \right\vert
=\operatorname{lcm}\left(  a,b\right)  $. Hence, $\operatorname{lcm}\left(
a,b\right)  =\left\vert \operatorname{lcm}\left(  a,b\right)  \right\vert
=\operatorname{lcm}\left(  -a,b\right)  $. This solves Exercise
\ref{exe.ent.lcm.props1} \textbf{(b)}.

\textbf{(c)} Exercise \ref{exe.ent.lcm.props1} \textbf{(a)} (applied to $-b$
instead of $b$) yields $\operatorname{lcm}\left(  a,-b\right)
=\operatorname{lcm}\left(  -b,a\right)  =\operatorname{lcm}\left(  b,a\right)
$ (by Exercise \ref{exe.ent.lcm.props1} \textbf{(b)}, applied to $b$ and $a$
instead of $a$ and $b$). But Exercise \ref{exe.ent.lcm.props1} \textbf{(a)}
yields $\operatorname{lcm}\left(  a,b\right)  =\operatorname{lcm}\left(
b,a\right)  =\operatorname{lcm}\left(  a,-b\right)  $ (since
$\operatorname{lcm}\left(  a,-b\right)  =\operatorname{lcm}\left(  b,a\right)
$). This solves Exercise \ref{exe.ent.lcm.props1} \textbf{(c)}.

\textbf{(d)} Assume that $a\mid b$. Thus, $a\mid b$ and $b\mid b$. Hence,
Lemma \ref{lem.ent.lcm.uniprop} (applied to $m=b$) yields $\operatorname{lcm}%
\left(  a,b\right)  \mid b$. But Proposition \ref{prop.ent.lcm.divides}
\textbf{(c)} yields $a\mid\operatorname{lcm}\left(  a,b\right)  $ and
$b\mid\operatorname{lcm}\left(  a,b\right)  $. Hence, Exercise
\ref{exe.ent.div.abba} (applied to $b$ and $\operatorname{lcm}\left(
a,b\right)  $ instead of $a$ and $b$) yields $\left\vert b\right\vert
=\left\vert \operatorname{lcm}\left(  a,b\right)  \right\vert
=\operatorname{lcm}\left(  a,b\right)  $ (since $\operatorname{lcm}\left(
a,b\right)  $ is nonnegative). In other words, $\operatorname{lcm}\left(
a,b\right)  =\left\vert b\right\vert $. This solves Exercise
\ref{exe.ent.lcm.props1} \textbf{(d)}.

\textbf{(e)} If $s=0$, then Exercise \ref{exe.ent.lcm.props1} \textbf{(e)}
holds\footnote{\textit{Proof.} Assume that $s=0$. Thus, $\underbrace{s}%
_{=0}a=0$. Hence, the integers $sa,sb$ are not all nonzero. Hence,
$\operatorname{lcm}\left(  sa,sb\right)  =0$ (by Definition
\ref{def.ent.lcm.lcm}). Comparing this with $\left\vert \underbrace{s}%
_{=0}\right\vert \operatorname{lcm}\left(  a,b\right)  =\underbrace{\left\vert
0\right\vert }_{=0}\operatorname{lcm}\left(  a,b\right)  =0$, we obtain
$\operatorname{lcm}\left(  sa,sb\right)  =\left\vert s\right\vert
\operatorname{lcm}\left(  a,b\right)  $. Hence, Exercise
\ref{exe.ent.lcm.props1} \textbf{(e)} holds. Qed.}. Hence, for the rest of
this solution, we WLOG assume that $s\neq0$.

Recall that any lcm is a nonnegative integer. Thus, $\operatorname{lcm}\left(
sa,sb\right)  $ is a nonnegative integer.

Proposition \ref{prop.ent.lcm.divides} \textbf{(c)} (applied to $sa$ and $sb$
instead of $a$ and $b$) yields $sa\mid\operatorname{lcm}\left(  sa,sb\right)
$ and $sb\mid\operatorname{lcm}\left(  sa,sb\right)  $. Hence, $s\mid
sa\mid\operatorname{lcm}\left(  sa,sb\right)  $. In other words, there exists
some integer $d$ such that $\operatorname{lcm}\left(  sa,sb\right)  =sd$.
Consider this $d$.

Now, $as=sa\mid\operatorname{lcm}\left(  sa,sb\right)  =sd=ds$. But Exercise
\ref{exe.ent.div.acbc} (applied to $a$, $d$ and $s$ instead of $a$, $b$ and
$c$) yields that $a\mid d$ holds if and only if $as\mid ds$. Thus, we have
$a\mid d$ (since $as\mid ds$).

Also, $bs=sb\mid\operatorname{lcm}\left(  sa,sb\right)  =sd=ds$. But Exercise
\ref{exe.ent.div.acbc} (applied to $b$, $d$ and $s$ instead of $a$, $b$ and
$c$) yields that $b\mid d$ holds if and only if $bs\mid ds$. Thus, we have
$b\mid d$ (since $bs\mid ds$).

From $a\mid d$ and $b\mid d$, we obtain $\operatorname{lcm}\left(  a,b\right)
\mid d$ (by Lemma \ref{lem.ent.lcm.uniprop}, applied to $m=d$). Hence,
Proposition \ref{prop.ent.div.2} \textbf{(c)} (applied to $a_{1}=s$,
$a_{2}=\operatorname{lcm}\left(  a,b\right)  $, $b_{1}=s$ and $b_{2}=d$)
yields $s\operatorname{lcm}\left(  a,b\right)  \mid sd$ (since $s\mid s$). In
view of $\operatorname{lcm}\left(  sa,sb\right)  =sd$, this rewrites as
$s\operatorname{lcm}\left(  a,b\right)  \mid\operatorname{lcm}\left(
sa,sb\right)  $.

Proposition \ref{prop.ent.lcm.divides} \textbf{(c)} yields $a\mid
\operatorname{lcm}\left(  a,b\right)  $ and $b\mid\operatorname{lcm}\left(
a,b\right)  $. Hence, Proposition \ref{prop.ent.div.2} \textbf{(c)} (applied
to $a_{1}=s$, $a_{2}=a$, $b_{1}=s$ and $b_{2}=\operatorname{lcm}\left(
a,b\right)  $) yields $sa\mid s\operatorname{lcm}\left(  a,b\right)  $ (since
$s\mid s$ and $a\mid\operatorname{lcm}\left(  a,b\right)  $). Similarly, we
obtain $sb\mid s\operatorname{lcm}\left(  a,b\right)  $ (since $s\mid s$ and
$b\mid\operatorname{lcm}\left(  a,b\right)  $). Hence, Lemma
\ref{lem.ent.lcm.uniprop} (applied to $sa$, $sb$ and $s\operatorname{lcm}%
\left(  a,b\right)  $ instead of $a$, $b$ and $m$) yields that
$\operatorname{lcm}\left(  sa,sb\right)  \mid s\operatorname{lcm}\left(
a,b\right)  $.

Now, we know that $s\operatorname{lcm}\left(  a,b\right)  \mid
\operatorname{lcm}\left(  sa,sb\right)  $ and $\operatorname{lcm}\left(
sa,sb\right)  \mid s\operatorname{lcm}\left(  a,b\right)  $. Hence, Exercise
\ref{exe.ent.div.abba} (applied to $s\operatorname{lcm}\left(  a,b\right)  $
and $\operatorname{lcm}\left(  sa,sb\right)  $ instead of $a$ and $b$) yields
$\left\vert s\operatorname{lcm}\left(  a,b\right)  \right\vert =\left\vert
\operatorname{lcm}\left(  sa,sb\right)  \right\vert =\operatorname{lcm}\left(
sa,sb\right)  $ (since $\operatorname{lcm}\left(  sa,sb\right)  $ is
nonnegative). Hence,%
\begin{align*}
\operatorname{lcm}\left(  sa,sb\right)   &  =\left\vert s\operatorname{lcm}%
\left(  a,b\right)  \right\vert =\left\vert s\right\vert \cdot
\underbrace{\left\vert \operatorname{lcm}\left(  a,b\right)  \right\vert
}_{\substack{=\operatorname{lcm}\left(  a,b\right)  \\\text{(since
}\operatorname{lcm}\left(  a,b\right)  \\\text{is nonnegative)}}%
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.ent.div.abs(xy)})}\right) \\
&  =\left\vert s\right\vert \operatorname{lcm}\left(  a,b\right)  .
\end{align*}
This solves Exercise \ref{exe.ent.lcm.props1} \textbf{(e)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.lcm.lcmabc}}

\begin{fineprint}
\begin{proof}
[First solution to Exercise \ref{exe.ent.lcm.lcmabc}.]Let us prove a more
general fact:

\begin{statement}
\textit{Claim 1:} Let $x,y,z,N$ be four integers such that $ax=by=cz=N$. Then,
$\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  x,y,z\right)
=\left\vert N\right\vert $.
\end{statement}

Once we have proven Claim 1, we will immediately obtain Exercise
\ref{exe.ent.lcm.lcmabc} \textbf{(a)} by applying Claim 1 to $x=bc$, $y=ca$,
$z=ab$ and $N=abc$; and we will obtain Exercise \ref{exe.ent.lcm.lcmabc}
\textbf{(b)} in a similar way (see below for the details). Thus, let us focus
on proving Claim 1.

\textit{Proof of Claim 1:} If the integers $x,y,z$ are not all nonzero, then
Claim 1 holds\footnote{\textit{Proof.} Assume that the integers $x,y,z$ are
not all nonzero. In other words, $x=0$ or $y=0$ or $z=0$. We thus WLOG assume
that $x=0$ (since the proofs in the two cases $y=0$ and $z=0$ are analogous).
\par
The integers $x,y,z$ are not all nonzero. Hence, Definition
\ref{def.ent.lcm.lcm} yields that their lowest common multiple is $0$. In
other words, $\operatorname{lcm}\left(  x,y,z\right)  =0$.
\par
But $ax=N$, thus $N=a\underbrace{x}_{=0}=0$. Hence, $\left\vert N\right\vert
=\left\vert 0\right\vert =0$. Comparing this with $\gcd\left(  a,b,c\right)
\cdot\underbrace{\operatorname{lcm}\left(  x,y,z\right)  }_{=0}=0$, we obtain
$\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  x,y,z\right)
=\left\vert N\right\vert $. Hence, Claim 1 holds, qed.}. Thus, for the rest of
this proof, we WLOG assume that the integers $x,y,z$ are all nonzero. Hence,
$\operatorname{lcm}\left(  x,y,z\right)  $ is the smallest positive element of
the set $\operatorname*{Mul}\left(  x,y,z\right)  $ (by Definition
\ref{def.ent.lcm.lcm}). Thus, $\operatorname{lcm}\left(  x,y,z\right)  $ is a
positive integer.

If the integers $a,b,c$ are all zero, then Claim 1
holds\footnote{\textit{Proof.} Assume that the integers $a,b,c$ are all zero.
Hence, $\gcd\left(  a,b,c\right)  =0$ (by Definition \ref{def.ent.gcd.gcd}).
Also, $a=0$ (since $a,b,c$ are all zero).
\par
But $ax=N$, thus $N=\underbrace{a}_{=0}x=0$. Hence, $\left\vert N\right\vert
=\left\vert 0\right\vert =0$. Comparing this with $\underbrace{\gcd\left(
a,b,c\right)  }_{=0}\cdot\operatorname{lcm}\left(  x,y,z\right)  =0$, we
obtain $\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  x,y,z\right)
=\left\vert N\right\vert $. Hence, Claim 1 holds, qed.}. Hence, for the rest
of this proof, we WLOG assume that the integers $a,b,c$ are not all zero.
Hence, $\gcd\left(  a,b,c\right)  $ is a positive integer (by Definition
\ref{def.ent.gcd.gcd}). Denote this positive integer by $g$. Hence,
$g=\gcd\left(  a,b,c\right)  $.

Definition \ref{def.ent.gcd.gcd} also shows that $\gcd\left(  a,b,c\right)  $
is the largest element of the set $\operatorname*{Div}\left(  a,b,c\right)  $
(since $a,b,c$ are not all zero). Hence, $\gcd\left(  a,b,c\right)
\in\operatorname*{Div}\left(  a,b,c\right)  $. In other words, $g\in
\operatorname*{Div}\left(  a,b,c\right)  $ (since $g=\gcd\left(  a,b,c\right)
$). In other words, $g$ is a common divisor of $a,b,c$ (by the definition of
$\operatorname*{Div}\left(  a,b,c\right)  $). In other words, $g$ is an
integer satisfying $\left(  g\mid a\text{ and }g\mid b\text{ and }g\mid
c\right)  $. Thus, $g\mid a\mid ax=N$. In other words, there exists an integer
$h$ such that $N=gh$. Consider this $h$.

It is easy to see that $N\neq0$\ \ \ \ \footnote{\textit{Proof.} Assume the
contrary. Thus, $N=0$. But $x\neq0$ (since $x,y,z$ are nonzero). Hence, from
$ax=N=0$, we obtain $a=0$. Similarly, $b=0$ and $c=0$. Thus, the integers
$a,b,c$ are all zero. This contradicts the fact that the integers $a,b,c$ are
not all zero. This contradiction shows that our assumption was wrong, qed.}.
Now, $gh=N\neq0$ and thus $h\neq0$. Hence, $\left\vert h\right\vert $ is a
positive integer (since $h$ is an integer). Denote this positive integer by
$m$. Thus, $m=\left\vert h\right\vert $.

Also, set $N^{\prime}=\left\vert N\right\vert $. Thus, $N^{\prime}$ is an
integer satisfying%
\begin{align}
N^{\prime}  &  =\left\vert \underbrace{N}_{=gh}\right\vert =\left\vert
gh\right\vert =\underbrace{\left\vert g\right\vert }%
_{\substack{=g\\\text{(since }g\text{ is positive)}}}\cdot
\underbrace{\left\vert h\right\vert }_{=m}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.ent.div.abs(xy)})}\right) \nonumber\\
&  =gm. \label{sol.ent.lcm.lcmabc.c1.pf.3}%
\end{align}


Our next goal is to prove that $m=\operatorname{lcm}\left(  x,y,z\right)  $.
First, we shall prove that $m\in\operatorname*{Mul}\left(  x,y,z\right)  $.

Indeed, we have $h\neq0$. Hence, Exercise \ref{exe.ent.div.acbc} (applied to
$g$, $a$ and $h$ instead of $a$, $b$ and $c$) shows that $g\mid a$ holds if
and only if $gh\mid ah$. Hence, $gh\mid ah$ holds (since $g\mid a$ holds).
Now, $xa=ax=N=gh\mid ah=ha$. But $a\neq0$ (since $ax=N\neq0$). Thus, Exercise
\ref{exe.ent.div.acbc} (applied to $x$, $h$ and $a$ instead of $a$, $b$ and
$c$) shows that $x\mid h$ holds if and only if $xa\mid ha$. Hence, $x\mid h$
holds (since $xa\mid ha$ holds). But Exercise \ref{exe.ent.div.aabs}
\textbf{(a)} (applied to $h$ instead of $a$) yields $h\mid\left\vert
h\right\vert =m$. Thus, $x\mid h\mid m$. Similarly, $y\mid m$ and $z\mid m$.
Thus, we have $\left(  x\mid m\text{ and }y\mid m\text{ and }z\mid m\right)
$. In other words, $m$ is a common multiple of $x,y,z$. In other words,
$m\in\operatorname*{Mul}\left(  x,y,z\right)  $. So we know that $m$ is a
positive element of the set $\operatorname*{Mul}\left(  x,y,z\right)  $ (since
$m$ is positive).

We shall now show that $m$ is the smallest positive element of this set.
Indeed, let $w$ be any positive element of $\operatorname*{Mul}\left(
x,y,z\right)  $. We are going to prove that $w\geq m$.

In fact, $w\in\operatorname*{Mul}\left(  x,y,z\right)  $. In other words, $w$
is a common multiple of $x,y,z$. In other words, we have $\left(  x\mid
w\text{ and }y\mid w\text{ and }z\mid w\right)  $. Also, $w\neq0$ (since $w$
is positive).

We have $wa\neq0$ (since $w\neq0$ and $a\neq0$). Hence, the integers
$wa,wb,wc$ are not all zero. Thus, Definition \ref{def.ent.gcd.gcd} shows that
$\gcd\left(  wa,wb,wc\right)  $ is the largest element of the set
$\operatorname*{Div}\left(  wa,wb,wc\right)  $.

We have $a\neq0$. Hence, Exercise \ref{exe.ent.div.acbc} (applied to $x$, $w$
and $a$ instead of $a$, $b$ and $c$) shows that $x\mid w$ holds if and only if
$xa\mid wa$. Hence, $xa\mid wa$ holds (since $x\mid w$). Thus, $N=ax=xa\mid
wa$. But Exercise \ref{exe.ent.div.aabs} \textbf{(b)} (applied to $N$ instead
of $a$) yields $\left\vert N\right\vert \mid N$. In other words, $N^{\prime
}\mid N$ (since $N^{\prime}=\left\vert N\right\vert $). Hence, $N^{\prime}\mid
N\mid wa$. Similarly, $N^{\prime}\mid wb$ and $N^{\prime}\mid wc$. Thus,
$\left(  N^{\prime}\mid wa\text{ and }N^{\prime}\mid wb\text{ and }N^{\prime
}\mid wc\right)  $. In other words, $N^{\prime}$ is a common divisor of
$wa,wb,wc$. In other words, $N^{\prime}\in\operatorname*{Div}\left(
wa,wb,wc\right)  $. Hence, $N^{\prime}\leq\gcd\left(  wa,wb,wc\right)  $
(since $\gcd\left(  wa,wb,wc\right)  $ is the \textbf{largest} element of the
set $\operatorname*{Div}\left(  wa,wb,wc\right)  $). Now,
(\ref{sol.ent.lcm.lcmabc.c1.pf.3}) yields%
\begin{align*}
gm  &  =N^{\prime}\leq\gcd\left(  wa,wb,wc\right)  =\underbrace{\left\vert
w\right\vert }_{\substack{=w\\\text{(since }w\text{ is positive)}%
}}\underbrace{\gcd\left(  a,b,c\right)  }_{=g}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.ent.gcd.sa,sb,sc}
(applied to }s=w\text{)}\right) \\
&  =wg=gw.
\end{align*}
We can divide both sides of this inequality by $g$ (since $g$ is positive),
and thus obtain $m\leq w$. In other words, $w\geq m$.

Now, forget that we fixed $w$. We thus have proven that each positive element
$w$ of the set $\operatorname*{Mul}\left(  x,y,z\right)  $ satisfies $w\geq
m$. Hence, $m$ is the \textbf{smallest} positive element of the set
$\operatorname*{Mul}\left(  x,y,z\right)  $ (since we already know that $m$ is
a positive element of the set $\operatorname*{Mul}\left(  x,y,z\right)  $). In
other words, $m$ is $\operatorname{lcm}\left(  x,y,z\right)  $ (since
$\operatorname{lcm}\left(  x,y,z\right)  $ is the smallest positive element of
the set $\operatorname*{Mul}\left(  x,y,z\right)  $). In other words,
$m=\operatorname{lcm}\left(  x,y,z\right)  $. Hence,
(\ref{sol.ent.lcm.lcmabc.c1.pf.3}) becomes%
\[
N^{\prime}=\underbrace{g}_{=\gcd\left(  a,b,c\right)  }\underbrace{m}%
_{=\operatorname{lcm}\left(  x,y,z\right)  }=\gcd\left(  a,b,c\right)
\cdot\operatorname{lcm}\left(  x,y,z\right)  .
\]
Thus, $\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  x,y,z\right)
=N^{\prime}=\left\vert N\right\vert $. This proves Claim 1.

We can now solve the actual exercise:

\textbf{(a)} We have $a\left(  bc\right)  =b\left(  ca\right)  =c\left(
ab\right)  =abc$. Hence, Claim 1 (applied to $x=bc$, $y=ca$, $z=ab$ and
$N=abc$) yields $\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(
bc,ca,ab\right)  =\left\vert abc\right\vert $. This solves Exercise
\ref{exe.ent.lcm.lcmabc} \textbf{(a)}.

\textbf{(b)} We have $\left(  bc\right)  a=\left(  ca\right)  b=\left(
ab\right)  c=abc$. Hence, Claim 1 (applied to $bc$, $ca$, $ab$, $a$, $b$, $c$
and $abc$ instead of $a$, $b$, $c$, $x$, $y$, $z$ and $N$) yields $\gcd\left(
bc,ca,ab\right)  \cdot\operatorname{lcm}\left(  a,b,c\right)  =\left\vert
abc\right\vert $. Thus, $\operatorname{lcm}\left(  a,b,c\right)  \cdot
\gcd\left(  bc,ca,ab\right)  =\gcd\left(  bc,ca,ab\right)  \cdot
\operatorname{lcm}\left(  a,b,c\right)  =\left\vert abc\right\vert $. This
solves Exercise \ref{exe.ent.lcm.lcmabc} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.dist=cop}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.dist=cop}.]We have $p\neq q$ (since
$p$ and $q$ are distinct). Hence, $p\nmid q$\ \ \ \ \footnote{\textit{Proof.}
Assume the contrary. Thus, $p\mid q$. In other words, $p$ is a divisor of $q$.
\par
But $q$ is a prime. According to the definition of a prime, this means that
$q>1$ and that the only positive divisors of $q$ are $1$ and $q$.
\par
Also, $p$ is a prime; thus, $p>1$ (by the definition of a prime); hence,
$p>1>0$. Thus, $p$ is positive. So we know that $p$ is a positive divisor of
$q$. Hence, $p$ must be either $1$ or $q$ (since the only positive divisors of
$q$ are $1$ and $q$). Since $p$ cannot be $1$ (because $p>1$), we thus
conclude that $p$ must be $q$. In other words, $p=q$. This contradicts $p\neq
q$. This contradiction shows that our assumption was false, qed.}.

But Proposition \ref{prop.ent.prime.div-or-coprime} (applied to $a=q$) shows
that either $p\mid q$ or $p\perp q$. Since $p\mid q$ cannot hold (because we
have $p\nmid q$), we thus conclude that $p\perp q$. This solves Exercise
\ref{exe.ent.prime.dist=cop}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.pab-conv}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.pab-conv}.]The integer $p$ is
positive (since $p>1>0$). Thus, $\left\vert p\right\vert =p$.

Let $d$ be a positive divisor of $p$ other than $1$ and $p$. We shall derive a contradiction.

We know that $d$ is a divisor of $p$ \textbf{other than} $1$ and $p$. Hence,
$d\neq1$ and $d\neq p$.

But $d$ is a divisor of $p$. In other words, there exists an integer $c$ such
that $p=dc$. Consider this $c$.

The integer $d$ is positive, therefore nonzero. Hence, we can solve the
equality $p=dc$ for $c$; thus we find $c=p/d>0$ (since both $p$ and $d$ are
positive). Thus, the integer $c$ is positive; hence, $c\geq1$. Also, $d\geq1$
(since $d$ is a positive integer). Combining this with $d\neq1$, we obtain
$d>1$.

Since $c>0$, we can multiply the inequality $d>1$ by $c$. We thus find
$cd>c\cdot1=c$. Hence, $c<cd=dc=p$. Since $c$ is positive, we have $\left\vert
c\right\vert =c<p$. But $p$ is positive; thus, $\left\vert p\right\vert
=p>\left\vert c\right\vert $ (since $\left\vert c\right\vert <p$).

Since $d>0$, we can multiply the inequality $c\geq1$ by $d$. We thus find
$dc\geq d\cdot1=d$. Hence, $d\leq dc=p$. Combining this with $d\neq p$, we
obtain $d<p$. Since $d$ is positive, we have $\left\vert d\right\vert =d<p$.
But $p$ is positive; thus, $\left\vert p\right\vert =p>\left\vert d\right\vert
$ (since $\left\vert d\right\vert <p$).

We have $p\mid p=dc$. But let us recall that for every $a,b\in\mathbb{Z}$
satisfying $p\mid ab$, we must have $p\mid a$ or $p\mid b$. Applying this to
$a=d$ and $b=c$, we conclude that $p\mid d$ or $p\mid c$.

We have $d\neq0$ (since $d>0$). Hence, if we had $p\mid d$, then we would have
$\left\vert p\right\vert \leq\left\vert d\right\vert $ (by Proposition
\ref{prop.ent.div.1} \textbf{(b)}, applied to $a=p$ and $b=d$); but this would
contradict $\left\vert p\right\vert >\left\vert d\right\vert $. Hence, we
cannot have $p\mid d$.

We have $c\neq0$ (since $c>0$). Hence, if we had $p\mid c$, then we would have
$\left\vert p\right\vert \leq\left\vert c\right\vert $ (by Proposition
\ref{prop.ent.div.1} \textbf{(b)}, applied to $a=p$ and $b=c$); but this would
contradict $\left\vert p\right\vert >\left\vert c\right\vert $. Hence, we
cannot have $p\mid c$.

Thus, we have neither $p\mid d$ nor $p\mid c$. This contradicts the fact that
$p\mid d$ or $p\mid c$.

Now, forget that we have fixed $d$. We thus have found a contradiction for
each positive divisor $d$ of $p$ other than $1$ and $p$. Thus, there exists no
positive divisor $d$ of $p$ other than $1$ and $p$. In other words, each
positive divisor of $p$ is either $1$ or $p$. Thus, the only positive divisors
of $p$ are $1$ and $p$ (since $1$ and $p$ are indeed positive divisors of
$p$). In other words, $p$ is prime (by the definition of \textquotedblleft
prime\textquotedblright). This solves Exercise \ref{exe.ent.prime.pab-conv}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.coprime-to-pk}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.coprime-to-pk}.]$\Longrightarrow:$
Assume that $a\perp p^{k}$ holds. We must prove that $p\nmid a$.

Assume the contrary. Thus, $p\mid a$. But $k\geq1$ (since $k$ is a positive
integer), so that $1\leq k$. Hence, Exercise \ref{exe.ent.div.powers} (applied
to $p$, $1$ and $k$ instead of $n$, $a$ and $b$) yields $p^{1}\mid p^{k}$. In
other words, $p\mid p^{k}$ (since $p^{1}=p$). Now, Lemma
\ref{lem.ent.gcd.uniprop} (applied to $m=p$ and $b=p^{k}$) yields $p\mid
\gcd\left(  a,p^{k}\right)  $ (since $p\mid a$ and $p\mid p^{k}$). But from
$a\perp p^{k}$, we obtain $\gcd\left(  a,p^{k}\right)  =1$. Hence, $p\mid
\gcd\left(  a,p^{k}\right)  =1$. But $p$ is prime; hence, $p>1>0$, so that $p$
is nonnegative. Hence, Exercise \ref{exe.ent.div.g|1} (applied to $g=p$)
yields $p=1$ (since $p\mid1$). This contradicts $p>1$. This contradiction
shows that our assumption was false. Hence, $p\nmid a$ is proven. This
concludes the proof of the \textquotedblleft$\Longrightarrow$%
\textquotedblright\ direction of Exercise \ref{exe.ent.prime.coprime-to-pk}.

$\Longleftarrow:$ Assume that $p\nmid a$. We must prove that $a\perp p^{k}$.

Proposition \ref{prop.ent.prime.div-or-coprime} yields that either $p\mid a$
or $p\perp a$. Since $p\mid a$ does not hold (because $p\nmid a$), we thus
conclude that $p\perp a$. But Proposition \ref{prop.ent.coprime.perp-symm}
(applied to $b=p$) yields that $a\perp p$ if and only if $p\perp a$. Hence,
$a\perp p$ (since $p\perp a$). Thus, Exercise \ref{exe.ent.coprime.powers}
(applied to $b=p$, $n=1$ and $m=k$) yields $a^{1}\perp p^{k}$. In other words,
$a\perp p^{k}$. This concludes the proof of the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Exercise
\ref{exe.ent.prime.coprime-to-pk}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.vp-lem}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.vp-lem}.]This exercise can easily be
solved by induction on $k$; but here is a more artful proof:

Let $k\in\mathbb{N}$. We have $p\geq2$ (since $p$ is an integer and satisfies
$p>1$). Thus, $p-1\geq1$.

Recall the identity (\ref{pf.lem.ent.xd-yd.1}), which holds for every
$a,b\in\mathbb{Q}$. Let us apply this identity to $a=p$ and $b=1$. We thus
obtain%
\[
\left(  p-1\right)  \left(  p^{k-1}+p^{k-2}\cdot1+p^{k-3}\cdot1^{2}%
+\cdots+p\cdot1^{k-2}+1^{k-1}\right)  =p^{k}-\underbrace{1^{k}}_{=1}=p^{k}-1.
\]
Thus,%
\begin{align*}
p^{k}-1  &  =\left(  p-1\right)  \underbrace{\left(  p^{k-1}+p^{k-2}%
\cdot1+p^{k-3}\cdot1^{2}+\cdots+p\cdot1^{k-2}+1^{k-1}\right)  }_{=\sum
_{i=0}^{k-1}p^{i}1^{k-i}}\\
&  =\underbrace{\left(  p-1\right)  }_{\geq1}\sum_{i=0}^{k-1}p^{i}1^{k-i}%
\geq1\sum_{i=0}^{k-1}p^{i}1^{k-i}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }%
\sum_{i=0}^{k-1}p^{i}1^{k-i}\text{ is clearly }\geq0\right) \\
&  =\sum_{i=0}^{k-1}\underbrace{p^{i}1^{k-i}}_{\substack{=p^{i}\geq
1^{i}\\\text{(since }p\geq1\text{)}}}\geq\sum_{i=0}^{k-1}\underbrace{1^{i}%
}_{=1}=\sum_{i=0}^{k-1}1=k.
\end{align*}
Hence, $p^{k}\geq k+1>k$. This solves Exercise \ref{exe.ent.prime.vp-lem}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.vp-abs}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.vp-abs}.]If $n\geq0$, then we have
$\left\vert n\right\vert =n$ and thus $v_{p}\left(  \left\vert n\right\vert
\right)  =v_{p}\left(  n\right)  $. Hence, if $n\geq0$, then Exercise
\ref{exe.ent.prime.vp-abs} holds. Thus, for the rest of this solution, we WLOG
assume that $n<0$. Hence, $\left\vert n\right\vert =-n$.

We have $-1\mid p$ (since $p=\left(  -1\right)  \cdot\left(  -p\right)  $).
Thus, Proposition \ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $a=-1$
and $b=p$) yields $\gcd\left(  -1,p\right)  =\left\vert -1\right\vert =1$. In
other words, $-1\perp p$. Also, $-1=\left(  -1\right)  \cdot p^{0}$ (since
$p^{0}=1$). Thus, Lemma \ref{lem.ent.prime.vp-copr} \textbf{(b)} (applied to
$-1$, $0$ and $1$ instead of $n$, $i$ and $w$) yields $v_{p}\left(  -1\right)
=0$. Now, Theorem \ref{thm.ent.prime.vp-ring} \textbf{(a)} (applied to $a=-1$
and $b=n$) yields $v_{p}\left(  \left(  -1\right)  n\right)
=\underbrace{v_{p}\left(  -1\right)  }_{=0}+v_{p}\left(  n\right)
=v_{p}\left(  n\right)  $. In view of $\left(  -1\right)  n=-n=\left\vert
n\right\vert $, this rewrites as $v_{p}\left(  \left\vert n\right\vert
\right)  =v_{p}\left(  n\right)  $. This solves Exercise
\ref{exe.ent.prime.vp-abs}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.vp-pow}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.vp-pow}.]Corollary
\ref{cor.ent.prime.vp-ringk} (applied to $a_{i}=a$) yields%
\[
v_{p}\left(  \underbrace{aa\cdots a}_{k\text{ times}}\right)
=\underbrace{v_{p}\left(  a\right)  +v_{p}\left(  a\right)  +\cdots
+v_{p}\left(  a\right)  }_{k\text{ times}}=kv_{p}\left(  a\right)  .
\]
In view of $\underbrace{aa\cdots a}_{k\text{ times}}=a^{k}$, this rewrites as
$v_{p}\left(  a^{k}\right)  =kv_{p}\left(  a\right)  $. This solves Exercise
\ref{exe.ent.prime.vp-pow}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.p1a1puau}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.p1a1puau}.]For each $i\in\left\{
1,2,\ldots,u\right\}  $, the number $p_{i}^{a_{i}}$ is a well-defined positive
integer (since $p_{i}$ is a prime, and since $a_{i}$ is a nonnegative
integer). Thus, $p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}$ is a product
of positive integers, and therefore itself a positive integer.

Now, let $p$ be a prime. Note that $p_{1}^{a_{1}},p_{2}^{a_{2}},\ldots
,p_{u}^{a_{u}}$ are $u$ integers. Hence, Corollary
\ref{cor.ent.prime.vp-ringk} (applied to $u$ and $p_{j}^{a_{j}}$ instead of
$k$ and $a_{j}$) yields%
\begin{align}
v_{p}\left(  p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}\right)   &
=v_{p}\left(  p_{1}^{a_{1}}\right)  +v_{p}\left(  p_{2}^{a_{2}}\right)
+\cdots+v_{p}\left(  p_{u}^{a_{u}}\right) \nonumber\\
&  =\sum_{j=1}^{u}\underbrace{v_{p}\left(  p_{j}^{a_{j}}\right)
}_{\substack{=a_{j}v_{p}\left(  p_{j}\right)  \\\text{(by Exercise
\ref{exe.ent.prime.vp-pow},}\\\text{applied to }a=p_{j}\text{ and }%
k=a_{j}\text{)}}}=\underbrace{\sum_{j=1}^{u}}_{=\sum_{j\in\left\{
1,2,\ldots,u\right\}  }}a_{j}\underbrace{v_{p}\left(  p_{j}\right)
}_{\substack{=%
\begin{cases}
1, & \text{if }p_{j}=p;\\
0, & \text{if }p_{j}\neq p
\end{cases}
\\\text{(by Theorem \ref{thm.ent.prime.vp-ring} \textbf{(d)},}\\\text{applied
to }q=p_{j}\\\text{(since }p_{j}\text{ is prime))}}}\nonumber\\
&  =\sum_{j\in\left\{  1,2,\ldots,u\right\}  }a_{j}%
\begin{cases}
1, & \text{if }p_{j}=p;\\
0, & \text{if }p_{j}\neq p
\end{cases}
. \label{sol.ent.prime.p1a1puau.1}%
\end{align}


Now, forget that we fixed $p$. We thus have proven the equality
(\ref{sol.ent.prime.p1a1puau.1}) for each prime $p$.

\textbf{(a)} Let $i\in\left\{  1,2,\ldots,u\right\}  $. Then, $p_{i}$ is a
prime. Hence, (\ref{sol.ent.prime.p1a1puau.1}) (applied to $p=p_{i}$) yields%
\begin{align}
v_{p}\left(  p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}\right)   &
=\sum_{j\in\left\{  1,2,\ldots,u\right\}  }a_{j}%
\begin{cases}
1, & \text{if }p_{j}=p_{i};\\
0, & \text{if }p_{j}\neq p_{i}%
\end{cases}
\nonumber\\
&  =a_{i}%
\begin{cases}
1, & \text{if }p_{i}=p_{i};\\
0, & \text{if }p_{i}\neq p_{i}%
\end{cases}
+\sum_{\substack{j\in\left\{  1,2,\ldots,u\right\}  ;\\j\neq i}}a_{j}%
\begin{cases}
1, & \text{if }p_{j}=p_{i};\\
0, & \text{if }p_{j}\neq p_{i}%
\end{cases}
\label{sol.ent.prime.p1a1puau.a.1}%
\end{align}
(here, we have split off the addend for $j=i$ from the sum). But if
$j\in\left\{  1,2,\ldots,u\right\}  $ satisfies $j\neq i$, then it must
satisfy $p_{j}\neq p_{i}$ (since the primes $p_{1},p_{2},\ldots,p_{u}$ are
distinct) and therefore%
\begin{equation}%
\begin{cases}
1, & \text{if }p_{j}=p_{i};\\
0, & \text{if }p_{j}\neq p_{i}%
\end{cases}
=0. \label{sol.ent.prime.p1a1puau.a.2}%
\end{equation}
Hence, (\ref{sol.ent.prime.p1a1puau.a.1}) becomes%
\begin{align*}
v_{p}\left(  p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}\right)   &
=a_{i}\underbrace{%
\begin{cases}
1, & \text{if }p_{i}=p_{i};\\
0, & \text{if }p_{i}\neq p_{i}%
\end{cases}
}_{\substack{=1\\\text{(since }p_{i}=p_{i}\text{)}}}+\sum_{\substack{j\in
\left\{  1,2,\ldots,u\right\}  ;\\j\neq i}}a_{j}\underbrace{%
\begin{cases}
1, & \text{if }p_{j}=p_{i};\\
0, & \text{if }p_{j}\neq p_{i}%
\end{cases}
}_{\substack{=0\\\text{(by (\ref{sol.ent.prime.p1a1puau.a.2}))}}}\\
&  =a_{i}1+\underbrace{\sum_{\substack{j\in\left\{  1,2,\ldots,u\right\}
;\\j\neq i}}a_{j}0}_{=0}=a_{i}1=a_{i}.
\end{align*}
This solves Exercise \ref{exe.ent.prime.p1a1puau} \textbf{(a)}.

\textbf{(b)} Let $p$ be a prime satisfying $p\notin\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  $. Then, for each $j\in\left\{  1,2,\ldots,u\right\}
$, we have $p_{j}\neq p$ (since otherwise, we would have $p_{j}=p$ and
therefore $p=p_{j}\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  $, which would
contradict $p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  $) and therefore%
\begin{equation}%
\begin{cases}
1, & \text{if }p_{j}=p;\\
0, & \text{if }p_{j}\neq p
\end{cases}
=0. \label{sol.ent.prime.p1a1puau.b.2}%
\end{equation}
Hence, (\ref{sol.ent.prime.p1a1puau.1}) becomes%
\[
v_{p}\left(  p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}\right)
=\sum_{j\in\left\{  1,2,\ldots,u\right\}  }a_{j}\underbrace{%
\begin{cases}
1, & \text{if }p_{j}=p;\\
0, & \text{if }p_{j}\neq p
\end{cases}
}_{\substack{=0\\\text{(by (\ref{sol.ent.prime.p1a1puau.b.2}))}}}=\sum
_{j\in\left\{  1,2,\ldots,u\right\}  }a_{j}0=0.
\]
This solves Exercise \ref{exe.ent.prime.p1a1puau} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.vp=vp}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.vp=vp}.]Applying
(\ref{eq.exe.ent.prime.vp=vp.ass}) to $p=2$, we obtain $v_{2}\left(  n\right)
=v_{2}\left(  m\right)  $ (since $2$ is a prime).

If $n$ is nonzero, then $v_{p}\left(  n\right)  $ is a nonnegative integer for
every prime $p$ (by Definition \ref{def.ent.prime.vp} \textbf{(a)}). Applying
this to $p=2$, we conclude the following: If $n$ is nonzero, then
$v_{2}\left(  n\right)  $ is a nonnegative integer and thus satisfies
$v_{2}\left(  n\right)  \neq\infty$. Thus, we have shown that
\begin{equation}
\text{if }n\text{ is nonzero, then }v_{2}\left(  n\right)  \neq\infty.
\label{sol.ent.prime.vp=vp.1}%
\end{equation}
The same argument (applied to $m$ instead of $n$) shows that%
\begin{equation}
\text{if }m\text{ is nonzero, then }v_{2}\left(  m\right)  \neq\infty.
\label{sol.ent.prime.vp=vp.2}%
\end{equation}


We are in one of the following two cases:

\textit{Case 1:} We have $n=0$.

\textit{Case 2:} We have $n\neq0$.

Let us first consider Case 1. In this case, we have $n=0$. Thus, $v_{2}\left(
n\right)  =v_{2}\left(  0\right)  =\infty$ (by Definition
\ref{def.ent.prime.vp} \textbf{(b)}). Comparing this with $v_{2}\left(
n\right)  =v_{2}\left(  m\right)  $, we obtain $v_{2}\left(  m\right)
=\infty$. But if $m$ was nonzero, then we would have $v_{2}\left(  m\right)
\neq\infty$ (by (\ref{sol.ent.prime.vp=vp.2})), which would contradict
$v_{2}\left(  m\right)  =\infty$. Hence, $m$ cannot be nonzero. In other
words, $m$ must be $0$. Thus, $m=0$. Comparing this with $n=0$, we obtain
$n=m$. Hence, Exercise \ref{exe.ent.prime.vp=vp} is solved in Case 1.

Let us now consider Case 2. In this case, we have $n\neq0$. Thus, $n$ is
nonzero; hence, $v_{2}\left(  n\right)  \neq\infty$ (by
(\ref{sol.ent.prime.vp=vp.1})). If we had $m=0$, then we would have
$v_{2}\left(  n\right)  =v_{2}\left(  \underbrace{m}_{=0}\right)
=v_{2}\left(  0\right)  =\infty$ (by Definition \ref{def.ent.prime.vp}
\textbf{(b)}), which would contradict $v_{2}\left(  n\right)  \neq\infty$.
Thus, we cannot have $m=0$. Hence, $m$ is nonzero.

The integer $n$ is nonzero and nonnegative; thus, the integer $n$ is positive.
Thus, Corollary \ref{cor.ent.prime.can-fac} yields%
\begin{equation}
n=\prod_{p\text{ prime}}\underbrace{p^{v_{p}\left(  n\right)  }}%
_{\substack{=p^{v_{p}\left(  m\right)  }\\\text{(since
(\ref{eq.exe.ent.prime.vp=vp.ass})}\\\text{yields }v_{p}\left(  n\right)
=v_{p}\left(  m\right)  \text{)}}}=\prod_{p\text{ prime}}p^{v_{p}\left(
m\right)  }. \label{sol.ent.prime.vp=vp.5}%
\end{equation}


The integer $m$ is nonzero and nonnegative; thus, the integer $m$ is positive.
Hence, Corollary \ref{cor.ent.prime.can-fac} (applied to $m$ instead of $n$)
yields%
\[
m=\prod_{p\text{ prime}}p^{v_{p}\left(  m\right)  }.
\]
Comparing this with (\ref{sol.ent.prime.vp=vp.5}), we obtain $n=m$. Thus,
Exercise \ref{exe.ent.prime.vp=vp} is solved in Case 2.

We have now solved Exercise \ref{exe.ent.prime.vp=vp} in both of the Cases 1
and 2. Hence, Exercise \ref{exe.ent.prime.vp=vp} always holds.
\end{proof}
\end{fineprint}

\subsection{\label{sect.sols.exe.ent.lcm.lcmabc.2}Second solution to Exercise
\ref{exe.ent.lcm.lcmabc}}

\begin{fineprint}
\begin{proof}
[Second solution to Exercise \ref{exe.ent.lcm.lcmabc} (sketched).]WLOG assume
that $a,b,c$ are nonzero (since otherwise, the claim of Exercise
\ref{exe.ent.lcm.lcmabc} easily reduces to $0=0$). Then, $abc$ is nonzero as
well. Hence, Corollary \ref{cor.ent.prime.can-facZ} yields%
\[
\left\vert abc\right\vert =\prod_{p\text{ prime}}p^{v_{p}\left(  abc\right)
}.
\]
We have%
\begin{align}
&  \underbrace{\gcd\left(  a,b,c\right)  }_{\substack{=\prod\limits_{p\text{
prime}}p^{\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)
,v_{p}\left(  c\right)  \right\}  }\\\text{(by Proposition
\ref{prop.ent.prime.gcd-k})}}}\cdot\underbrace{\operatorname{lcm}\left(
bc,ca,ab\right)  }_{\substack{=\prod\limits_{p\text{ prime}}p^{\max\left\{
v_{p}\left(  bc\right)  ,v_{p}\left(  ca\right)  ,v_{p}\left(  ab\right)
\right\}  }\\\text{(by Proposition \ref{prop.ent.prime.gcd-k})}}}\nonumber\\
&  =\left(  \prod\limits_{p\text{ prime}}p^{\min\left\{  v_{p}\left(
a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(  c\right)  \right\}  }\right)
\cdot\left(  \prod\limits_{p\text{ prime}}p^{\max\left\{  v_{p}\left(
bc\right)  ,v_{p}\left(  ca\right)  ,v_{p}\left(  ab\right)  \right\}
}\right) \nonumber\\
&  =\prod\limits_{p\text{ prime}}\underbrace{\left(  p^{\min\left\{
v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(  c\right)
\right\}  }p^{\max\left\{  v_{p}\left(  bc\right)  ,v_{p}\left(  ca\right)
,v_{p}\left(  ab\right)  \right\}  }\right)  }_{=p^{\min\left\{  v_{p}\left(
a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(  c\right)  \right\}
+\max\left\{  v_{p}\left(  bc\right)  ,v_{p}\left(  ca\right)  ,v_{p}\left(
ab\right)  \right\}  }}\nonumber\\
&  =\prod\limits_{p\text{ prime}}p^{\min\left\{  v_{p}\left(  a\right)
,v_{p}\left(  b\right)  ,v_{p}\left(  c\right)  \right\}  +\max\left\{
v_{p}\left(  bc\right)  ,v_{p}\left(  ca\right)  ,v_{p}\left(  ab\right)
\right\}  }. \label{sol.ent.lcm.lcmabc.2nd.2}%
\end{align}


Let us now fix a prime $p$, and try to simplify \newline$\min\left\{
v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(  c\right)
\right\}  +\max\left\{  v_{p}\left(  bc\right)  ,v_{p}\left(  ca\right)
,v_{p}\left(  ab\right)  \right\}  $. Indeed, set $u=v_{p}\left(  abc\right)
$. Note that $u\in\mathbb{N}$ (since $abc$ is nonzero).

Theorem \ref{thm.ent.prime.vp-ring} \textbf{(a)} (applied to $ca$ and $b$
instead of $a$ and $b$) yields $v_{p}\left(  cab\right)  =v_{p}\left(
ca\right)  +v_{p}\left(  b\right)  $. Comparing this with $v_{p}\left(
\underbrace{cab}_{=abc}\right)  =v_{p}\left(  abc\right)  =u$, we obtain
$u=v_{p}\left(  ca\right)  +v_{p}\left(  b\right)  $. Subtracting
$v_{p}\left(  b\right)  $ from this equality\footnote{This is allowed, since
$v_{p}\left(  b\right)  \in\mathbb{N}$ (because $b$ is nonzero).}, we obtain
$u-v_{p}\left(  b\right)  =v_{p}\left(  ca\right)  $. Thus, $v_{p}\left(
ca\right)  =u-v_{p}\left(  b\right)  $. Similarly, $v_{p}\left(  ab\right)
=u-v_{p}\left(  c\right)  $ and $v_{p}\left(  bc\right)  =u-v_{p}\left(
a\right)  $. Now,%
\begin{align}
&  \min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(
c\right)  \right\}  +\max\left\{  \underbrace{v_{p}\left(  bc\right)
}_{=u-v_{p}\left(  a\right)  },\underbrace{v_{p}\left(  ca\right)  }%
_{=u-v_{p}\left(  b\right)  },\underbrace{v_{p}\left(  ab\right)  }%
_{=u-v_{p}\left(  c\right)  }\right\} \nonumber\\
&  =\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(
c\right)  \right\}  +\underbrace{\max\left\{  u-v_{p}\left(  a\right)
,u-v_{p}\left(  b\right)  ,u-v_{p}\left(  c\right)  \right\}  }%
_{\substack{=u-\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)
,v_{p}\left(  c\right)  \right\}  \\\text{(since any three reals
}x,y,z\\\text{satisfy }\max\left\{  u-x,u-y,u-z\right\}  =u-\min\left\{
x,y,z\right\}  \text{)}}}\nonumber\\
&  =\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(
c\right)  \right\}  +\left(  u-\min\left\{  v_{p}\left(  a\right)
,v_{p}\left(  b\right)  ,v_{p}\left(  c\right)  \right\}  \right) \nonumber\\
&  =u=v_{p}\left(  abc\right)  . \label{sol.ent.lcm.lcmabc.2nd.4}%
\end{align}


Now, forget that we fixed $p$. We thus have proven
(\ref{sol.ent.lcm.lcmabc.2nd.4}) for each prime $p$. Thus,
(\ref{sol.ent.lcm.lcmabc.2nd.2}) becomes%
\begin{align*}
&  \gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  bc,ca,ab\right) \\
&  =\prod\limits_{p\text{ prime}}\underbrace{p^{\min\left\{  v_{p}\left(
a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(  c\right)  \right\}
+\max\left\{  v_{p}\left(  bc\right)  ,v_{p}\left(  ca\right)  ,v_{p}\left(
ab\right)  \right\}  }}_{\substack{=p^{v_{p}\left(  abc\right)  }\\\text{(by
(\ref{sol.ent.lcm.lcmabc.2nd.4}))}}}=\prod_{p\text{ prime}}p^{v_{p}\left(
abc\right)  }=\left\vert abc\right\vert .
\end{align*}
This solves Exercise \ref{exe.ent.lcm.lcmabc} \textbf{(a)} again. Similarly we
can re-solve Exercise \ref{exe.ent.lcm.lcmabc} \textbf{(b)}.
\end{proof}

\begin{remark}
Similarly, we could show that any four integers $a,b,c,d$ satisfy
\begin{align*}
\gcd\left(  a,b,c,d\right)  \cdot\operatorname{lcm}\left(
bcd,cda,dab,abc\right)   &  =\left\vert abcd\right\vert
\ \ \ \ \ \ \ \ \ \ \text{and}\\
\operatorname{lcm}\left(  a,b,c,d\right)  \cdot\gcd\left(
bcd,cda,dab,abc\right)   &  =\left\vert abcd\right\vert .
\end{align*}
Indeed, the last equality holds since each prime $p$ satisfies%
\begin{align*}
&  \min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(
c\right)  ,v_{p}\left(  d\right)  \right\} \\
&  \ \ \ \ \ \ \ \ \ \ +\max\left\{  \underbrace{v_{p}\left(  bcd\right)
}_{=v_{p}\left(  abcd\right)  -v_{p}\left(  a\right)  },\underbrace{v_{p}%
\left(  cda\right)  }_{=v_{p}\left(  abcd\right)  -v_{p}\left(  b\right)
},\underbrace{v_{p}\left(  dab\right)  }_{=v_{p}\left(  abcd\right)
-v_{p}\left(  c\right)  },\underbrace{v_{p}\left(  abc\right)  }%
_{=v_{p}\left(  abcd\right)  -v_{p}\left(  d\right)  }\right\} \\
&  =\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(
c\right)  ,v_{p}\left(  d\right)  \right\} \\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\max\left\{  v_{p}\left(  abcd\right)
-v_{p}\left(  a\right)  ,v_{p}\left(  abcd\right)  -v_{p}\left(  b\right)
,v_{p}\left(  abcd\right)  -v_{p}\left(  c\right)  ,v_{p}\left(  abcd\right)
-v_{p}\left(  d\right)  \right\}  }_{=v_{p}\left(  abcd\right)  -\min\left\{
v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(  c\right)
,v_{p}\left(  d\right)  \right\}  }\\
&  =\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(
c\right)  ,v_{p}\left(  d\right)  \right\}  +\left(  v_{p}\left(  abcd\right)
-\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  ,v_{p}\left(
c\right)  ,v_{p}\left(  d\right)  \right\}  \right) \\
&  =v_{p}\left(  abcd\right)
\end{align*}
(assuming that $a,b,c,d$ are nonzero). Similarly, the first equality holds.
You can likewise prove generalizations to $k$ integers.\footnotemark
\end{remark}

\footnotetext{That said, it is probably better (and easier) to generalize
Claim 1 from the first solution of Exercise \ref{exe.ent.lcm.lcmabc} to $k$
integers:
\par
\begin{statement}
\textit{Claim 2:} Let $k>0$. Let $N$ be an integer. Let $a_{1},a_{2}%
,\ldots,a_{k}$ be $k$ integers, and let $x_{1},x_{2},\ldots,x_{k}$ be $k$
integers such that $a_{1}x_{1}=a_{2}x_{2}=\cdots=a_{k}x_{k}=N$. Then,
$\gcd\left(  a_{1},a_{2},\ldots,a_{k}\right)  \cdot\operatorname{lcm}\left(
x_{1},x_{2},\ldots,x_{k}\right)  =\left\vert N\right\vert $.
\end{statement}
\par
This Claim 2 can be proven either by generalizing the proof of Claim 1 from
the first solution of Exercise \ref{exe.ent.lcm.lcmabc}, or (again) using
Proposition \ref{prop.ent.prime.gcd}.}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.modpvp}}

\begin{fineprint}
\begin{proof}
[First solution to Exercise \ref{exe.ent.prime.modpvp}.]We must prove that
$a\equiv b\operatorname{mod}n$. If $a=b$, then this is true (because if $a=b$,
then $a=b\equiv b\operatorname{mod}n$). Thus, for the rest of this proof, we
WLOG assume that we don't have $a=b$. Hence, $a\neq b$, so that $a-b\neq0$.
Thus, $a-b$ is a nonzero integer. Hence, $v_{p}\left(  a-b\right)
\in\mathbb{N}$ for every prime $p$.

Let $p$ be any prime. Then, (\ref{eq.exe.ent.prime.modpvp.ass}) yields
$a\equiv b\operatorname{mod}p^{v_{p}\left(  n\right)  }$. In other words,
$p^{v_{p}\left(  n\right)  }\mid a-b$. But Lemma \ref{lem.ent.prime.vp-def}
(applied to $v_{p}\left(  n\right)  $ and $a-b$ instead of $i$ and $n$) yields
that $p^{v_{p}\left(  n\right)  }\mid a-b$ if and only if $v_{p}\left(
a-b\right)  \geq v_{p}\left(  n\right)  $. Hence, we have $v_{p}\left(
a-b\right)  \geq v_{p}\left(  n\right)  $ (since $p^{v_{p}\left(  n\right)
}\mid a-b$). In other words, $v_{p}\left(  n\right)  \leq v_{p}\left(
a-b\right)  $.

Now, forget that we fixed $p$. We thus have proven that each prime $p$
satisfies $v_{p}\left(  n\right)  \leq v_{p}\left(  a-b\right)  $. But
Proposition \ref{prop.ent.prime.n|m} (applied to $a-b$ instead of $m$) shows
that $n\mid a-b$ if and only if each prime $p$ satisfies $v_{p}\left(
n\right)  \leq v_{p}\left(  a-b\right)  $. Hence, $n\mid a-b$ (since each
prime $p$ satisfies $v_{p}\left(  n\right)  \leq v_{p}\left(  a-b\right)  $).
In other words, $a\equiv b\operatorname{mod}n$. This solves Exercise
\ref{exe.ent.prime.modpvp}.
\end{proof}

\begin{proof}
[Second solution to Exercise \ref{exe.ent.prime.modpvp}.]Define an integer $c$
by $c=a-b$.

We shall show that%
\begin{equation}
d\mid c\text{ for every positive divisor }d\text{ of }n.
\label{sol.ent.prime.modpvp.2nd.goal}%
\end{equation}


[\textit{Proof of (\ref{sol.ent.prime.modpvp.2nd.goal}):} We shall prove
(\ref{sol.ent.prime.modpvp.2nd.goal}) by strong induction on $d$:

Let $e$ be a positive divisor of $n$. Assume that
(\ref{sol.ent.prime.modpvp.2nd.goal}) holds for all positive divisors $d$ of
$n$ satisfying $d<e$. We must prove that (\ref{sol.ent.prime.modpvp.2nd.goal})
holds for $d=e$. In other words, we must prove that $e\mid c$.

We have assumed that (\ref{sol.ent.prime.modpvp.2nd.goal}) holds for all
positive divisors $d$ of $n$ satisfying $d<e$. In other words, if $d$ is a
positive divisor of $n$ satisfying $d<e$, then%
\begin{equation}
d\mid c. \label{sol.ent.prime.modpvp.2nd.goal.pf.IH}%
\end{equation}


Note that the integer $e$ is nonzero (since $e$ is positive); thus,
$v_{p}\left(  e\right)  \in\mathbb{N}$. Also, $v_{p}\left(  n\right)
\in\mathbb{N}$ (since $n$ is nonzero). We know that $e\mid n$ (since $e$ is a
divisor of $n$). But Proposition \ref{prop.ent.prime.n|m} (applied to $e$ and
$n$ instead of $n$ and $m$) shows that $e\mid n$ if and only if each prime $p$
satisfies $v_{p}\left(  e\right)  \leq v_{p}\left(  n\right)  $. Hence,%
\begin{equation}
\text{each prime }p\text{ satisfies }v_{p}\left(  e\right)  \leq v_{p}\left(
n\right)  \label{sol.ent.prime.modpvp.2nd.goal.pf.vpe}%
\end{equation}
(since $e\mid n$).

We must prove that $e\mid c$. If $e=1$, then this follows from the (obvious)
fact that $1\mid c$. Thus, for the rest of this proof, we WLOG assume that
$e\neq1$. Hence, $e>1$ (since $e$ is a positive integer). Thus, Proposition
\ref{prop.ent.prime.ex-pri-div} (applied to $e$ instead of $n$) shows that
there exists at least one prime $p$ such that $p\mid e$. Consider this $p$.
Theorem \ref{lem.ent.prime.vp-copr} \textbf{(a)} (applied to $e$ instead of
$n$) shows that there exists a nonzero integer $u$ such that $u\perp p$ and
$e=up^{v_{p}\left(  e\right)  }$. Consider this $u$. From $e=up^{v_{p}\left(
e\right)  }$, we obtain $u=e/p^{v_{p}\left(  e\right)  }$; therefore, $u$ is
positive (since $e$ and $p^{v_{p}\left(  e\right)  }$ are positive).

Lemma \ref{lem.ent.prime.vp-def} (applied to $1$ and $e$ instead of $i$ and
$n$) shows that $p^{1}\mid e$ if and only if $v_{p}\left(  e\right)  \geq1$.
Hence, $v_{p}\left(  e\right)  \geq1$ (since $p^{1}=p\mid e$). Hence,
$p^{v_{p}\left(  e\right)  }\geq p^{1}=p>1$. Now, $e=u\underbrace{p^{v_{p}%
\left(  e\right)  }}_{>1}>u$ (since $u$ is positive). Thus, $u<e$.
Furthermore, $p^{v_{p}\left(  e\right)  }$ is an integer; hence, the equality
$e=up^{v_{p}\left(  e\right)  }$ yields that $u\mid e$. Thus, $u\mid e\mid n$.
Hence, $u$ is a divisor of $n$. Thus, $u$ is a positive divisor of $n$ (since
$u$ is positive). Since $u<e$, we can thus apply
(\ref{sol.ent.prime.modpvp.2nd.goal.pf.IH}) to $d=u$. We thus obtain $u\mid c$.

On the other hand, (\ref{eq.exe.ent.prime.modpvp.ass}) yields $a\equiv
b\operatorname{mod}p^{v_{p}\left(  n\right)  }$. In other words,
$p^{v_{p}\left(  n\right)  }\mid a-b$. This rewrites as $p^{v_{p}\left(
n\right)  }\mid c$ (since $c=a-b$). But $v_{p}\left(  e\right)  \leq
v_{p}\left(  n\right)  $ (by (\ref{sol.ent.prime.modpvp.2nd.goal.pf.vpe})).
Hence, Exercise \ref{exe.ent.div.powers} (applied to $p$, $v_{p}\left(
e\right)  $ and $v_{p}\left(  n\right)  $ instead of $n$, $a$ and $b$) yields
$p^{v_{p}\left(  e\right)  }\mid p^{v_{p}\left(  n\right)  }\mid c$.

Recall that $u\perp p$. Thus, Exercise \ref{exe.ent.coprime.powers} (applied
to $u$, $p$, $1$ and $v_{p}\left(  e\right)  $ instead of $a$, $b$, $n$ and
$m$) yields $u^{1}\perp p^{v_{p}\left(  e\right)  }$. In view of $u^{1}=u$,
this rewrites as $u\perp p^{v_{p}\left(  e\right)  }$.

Now we know that $u\in\mathbb{Z}$ and $p^{v_{p}\left(  e\right)  }%
\in\mathbb{Z}$ and $c\in\mathbb{Z}$ and $u\mid c$ and $p^{v_{p}\left(
e\right)  }\mid c$ and $u\perp p^{v_{p}\left(  e\right)  }$. Hence, Theorem
\ref{thm.ent.coprime.combine} (applied to $u$ and $p^{v_{p}\left(  e\right)
}$ instead of $a$ and $b$) yields $up^{v_{p}\left(  e\right)  }\mid c$. In
view of $e=up^{v_{p}\left(  e\right)  }$, this rewrites as $e\mid c$. In other
words, (\ref{sol.ent.prime.modpvp.2nd.goal}) holds for $d=e$. This completes
the induction step. Hence, (\ref{sol.ent.prime.modpvp.2nd.goal}) is proven by
strong induction.]

Let $n^{\prime}=\left\vert n\right\vert $. Then, $n^{\prime}=\left\vert
n\right\vert >0$ (since $n$ is nonzero). Moreover, Exercise
\ref{exe.ent.div.aabs} \textbf{(b)} (applied to $n$ instead of $a$) yields
$\left\vert n\right\vert \mid n$. Since $n^{\prime}=\left\vert n\right\vert $,
this rewrites as $n^{\prime}\mid n$. Hence, $n^{\prime}$ is a divisor of $n$.
Since $n^{\prime}$ is positive, we thus conclude that $n^{\prime}$ is a
positive divisor of $n$. Hence, (\ref{sol.ent.prime.modpvp.2nd.goal}) (applied
to $d=n^{\prime}$) yields $n^{\prime}\mid c$. But Exercise
\ref{exe.ent.div.aabs} \textbf{(a)} (applied to $n$ instead of $a$) yields
$n\mid\left\vert n\right\vert $. Since $n^{\prime}=\left\vert n\right\vert $,
this rewrites as $n\mid n^{\prime}$. Hence, $n\mid n^{\prime}\mid c=a-b$. In
other words, $a\equiv b\operatorname{mod}n$. This solves Exercise
\ref{exe.ent.prime.modpvp} again.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.gcd.1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.gcd.1}.]\textbf{(a)} Forget that we
fixed $p$. We thus must prove that
\begin{equation}
v_{p}\left(  \gcd\left(  n,m\right)  \right)  =\min\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  \ \ \ \ \ \ \ \ \ \ \text{for each
prime }p\text{.} \label{sol.ent.prime.gcd.1.a.goal}%
\end{equation}


We are in one of the following two cases:

\textit{Case 1:} The integers $n$ and $m$ are both nonzero.

\textit{Case 2:} The integers $n$ and $m$ are not both nonzero.

Let us first consider Case 1. In this case, the integers $n$ and $m$ are both
nonzero. Thus, (\ref{eq.prop.ent.prime.gcd.gcd}) yields%
\[
\gcd\left(  n,m\right)  =\prod_{p\text{ prime}}p^{\min\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  }.
\]
In particular, the product $\prod_{p\text{ prime}}p^{\min\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  }$ is well-defined. In other words:

\begin{itemize}
\item The number $\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  $ is a nonnegative integer for each prime $p$;

\item all but finitely many primes $p$ satisfy $\min\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  =0$.
\end{itemize}

(Both of these facts were proven during our proof of Proposition
\ref{prop.ent.prime.gcd}.)

Hence, Corollary \ref{cor.ent.prime.vp-of-can} (applied to $\gcd\left(
n,m\right)  $ and $\min\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  $ instead of $n$ and $b_{p}$) shows that%
\[
v_{q}\left(  \gcd\left(  n,m\right)  \right)  =\min\left\{  v_{q}\left(
n\right)  ,v_{q}\left(  m\right)  \right\}  \ \ \ \ \ \ \ \ \ \ \text{for each
prime }q.
\]
Renaming $q$ as $p$ in this statement, we obtain%
\[
v_{p}\left(  \gcd\left(  n,m\right)  \right)  =\min\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  \ \ \ \ \ \ \ \ \ \ \text{for each
prime }p\text{.}%
\]
Thus, (\ref{sol.ent.prime.gcd.1.a.goal}) is proven in Case 1.

Now, let us consider Case 2. In this case, the integers $n$ and $m$ are not
both nonzero. In other words, we have $n=0$ or $m=0$. Thus, we can WLOG assume
that $m=0$ (because in the case $n=0$, we can swap $n$ with $m$ without
changing the meaning of our claim, since $n$ and $m$ play symmetric
roles\footnote{Here we are using the fact that $\gcd\left(  n,m\right)
=\gcd\left(  m,n\right)  $ (which follows from Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)}).}). Assume this.

Fix a prime $p$. Now, $\gcd\left(  n,\underbrace{m}_{=0}\right)  =\gcd\left(
n,0\right)  =\left\vert n\right\vert $ (since Proposition
\ref{prop.ent.gcd.props1} \textbf{(a)} (applied to $a=n$) yields $\gcd\left(
n,0\right)  =\gcd\left(  n\right)  =\left\vert n\right\vert $). Hence,%
\[
v_{p}\left(  \gcd\left(  n,m\right)  \right)  =v_{p}\left(  \left\vert
n\right\vert \right)  =v_{p}\left(  n\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Exercise \ref{exe.ent.prime.vp-abs}}\right)  .
\]
On the other hand, from $m=0$, we obtain $v_{p}\left(  m\right)  =v_{p}\left(
0\right)  =\infty$ (by Definition \ref{def.ent.prime.vp} \textbf{(b)}). Thus,%
\[
\min\left\{  v_{p}\left(  n\right)  ,\underbrace{v_{p}\left(  m\right)
}_{=\infty}\right\}  =\min\left\{  v_{p}\left(  n\right)  ,\infty\right\}
=v_{p}\left(  n\right)
\]
(by our rules for the symbol $\infty$). Comparing this with $v_{p}\left(
\gcd\left(  n,m\right)  \right)  =v_{p}\left(  n\right)  $, we obtain
$v_{p}\left(  \gcd\left(  n,m\right)  \right)  =\min\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  $.

Now, forget that we fixed $p$. We thus have proven that $v_{p}\left(
\gcd\left(  n,m\right)  \right)  =\min\left\{  v_{p}\left(  n\right)
,v_{p}\left(  m\right)  \right\}  $ for each prime $p$. Thus,
(\ref{sol.ent.prime.gcd.1.a.goal}) is proven in Case 2.

We have now proven (\ref{sol.ent.prime.gcd.1.a.goal}) in each of the two Cases
1 and 2. Thus, (\ref{sol.ent.prime.gcd.1.a.goal}) always holds. This solves
Exercise \ref{exe.ent.prime.gcd.1} \textbf{(a)}.

\textbf{(b)} Forget that we fixed $p$. We thus must prove that
\begin{equation}
v_{p}\left(  \operatorname{lcm}\left(  n,m\right)  \right)  =\max\left\{
v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}
\ \ \ \ \ \ \ \ \ \ \text{for each prime }p\text{.}
\label{sol.ent.prime.gcd.1.b.goal}%
\end{equation}


We are in one of the following two cases:

\textit{Case 1:} The integers $n$ and $m$ are both nonzero.

\textit{Case 2:} The integers $n$ and $m$ are not both nonzero.

Let us first consider Case 1. In this case, the integers $n$ and $m$ are both
nonzero. Thus, (\ref{eq.prop.ent.prime.gcd.lcm}) yields%
\[
\operatorname{lcm}\left(  n,m\right)  =\prod_{p\text{ prime}}p^{\max\left\{
v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  }.
\]
In particular, the product $\prod_{p\text{ prime}}p^{\max\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  }$ is well-defined. In other words:

\begin{itemize}
\item The number $\max\left\{  v_{p}\left(  n\right)  ,v_{p}\left(  m\right)
\right\}  $ is a nonnegative integer for each prime $p$;

\item all but finitely many primes $p$ satisfy $\max\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  =0$.
\end{itemize}

(Both of these facts were proven during our proof of Proposition
\ref{prop.ent.prime.gcd}.)

Hence, Corollary \ref{cor.ent.prime.vp-of-can} (applied to $\operatorname{lcm}%
\left(  n,m\right)  $ and $\max\left\{  v_{p}\left(  n\right)  ,v_{p}\left(
m\right)  \right\}  $ instead of $n$ and $b_{p}$) shows that%
\[
v_{q}\left(  \operatorname{lcm}\left(  n,m\right)  \right)  =\max\left\{
v_{q}\left(  n\right)  ,v_{q}\left(  m\right)  \right\}
\ \ \ \ \ \ \ \ \ \ \text{for each prime }q.
\]
Renaming $q$ as $p$ in this statement, we obtain%
\[
v_{p}\left(  \operatorname{lcm}\left(  n,m\right)  \right)  =\max\left\{
v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}
\ \ \ \ \ \ \ \ \ \ \text{for each prime }p\text{.}%
\]
Thus, (\ref{sol.ent.prime.gcd.1.b.goal}) is proven in Case 1.

Now, let us consider Case 2. In this case, the integers $n$ and $m$ are not
both nonzero. In other words, we have $n=0$ or $m=0$. Thus, we can WLOG assume
that $m=0$ (because in the case $n=0$, we can swap $n$ with $m$ without
changing the meaning of our claim, since $n$ and $m$ play symmetric
roles\footnote{Here we are using the fact that $\operatorname{lcm}\left(
n,m\right)  =\operatorname{lcm}\left(  m,n\right)  $ (which follows from
Exercise \ref{exe.ent.lcm.props1} \textbf{(a)}).}). Assume this.

Fix a prime $p$. The numbers $n,m$ are not all nonzero (since $m=0$). Hence,
$\operatorname{lcm}\left(  n,m\right)  =0$ (by the definition of
$\operatorname{lcm}\left(  n,m\right)  $). Thus,%
\[
v_{p}\left(  \operatorname{lcm}\left(  n,m\right)  \right)  =v_{p}\left(
0\right)  =\infty\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition
\ref{def.ent.prime.vp} \textbf{(b)}}\right)  .
\]
On the other hand, from $m=0$, we obtain $v_{p}\left(  m\right)  =v_{p}\left(
0\right)  =\infty$ (by Definition \ref{def.ent.prime.vp} \textbf{(b)}). Thus,%
\[
\max\left\{  v_{p}\left(  n\right)  ,\underbrace{v_{p}\left(  m\right)
}_{=\infty}\right\}  =\max\left\{  v_{p}\left(  n\right)  ,\infty\right\}
=\infty
\]
(by our rules for the symbol $\infty$). Comparing this with $v_{p}\left(
\operatorname{lcm}\left(  n,m\right)  \right)  =\infty$, we obtain
$v_{p}\left(  \operatorname{lcm}\left(  n,m\right)  \right)  =\max\left\{
v_{p}\left(  n\right)  ,v_{p}\left(  m\right)  \right\}  $.

Now, forget that we fixed $p$. We thus have proven that $v_{p}\left(
\operatorname{lcm}\left(  n,m\right)  \right)  =\max\left\{  v_{p}\left(
n\right)  ,v_{p}\left(  m\right)  \right\}  $ for each prime $p$. Thus,
(\ref{sol.ent.prime.gcd.1.b.goal}) is proven in Case 2.

We have now proven (\ref{sol.ent.prime.gcd.1.b.goal}) in each of the two Cases
1 and 2. Thus, (\ref{sol.ent.prime.gcd.1.b.goal}) always holds. This solves
Exercise \ref{exe.ent.prime.gcd.1} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.gcd.distrib}}

\begin{fineprint}
We shall solve Exercise \ref{exe.ent.prime.gcd.distrib} in two different ways.
The first solution uses $p$-valuations (and Exercise \ref{exe.ent.prime.gcd.1}
in particular) to reduce the claim of the exercise to a simple identity
between minima and maxima of sets of numbers. This solution (just as our
Second proof of Theorem \ref{thm.ent.lcm.gcd*lcm} above) illustrates how
properties of gcds and lcms of integers can be proven in a straightforward way
using $p$-valuations. The second solution (due to Bill Dubuque), in contrast,
completely avoids the use of prime numbers.

\begin{proof}
[First solution to Exercise \ref{exe.ent.prime.gcd.distrib}.]\textbf{(a)} Let
us first show an auxiliary claim:

\begin{statement}
\textit{Claim 1:} Let $i,j,k\in\mathbb{N}\cup\left\{  \infty\right\}  $ be
arbitrary. Then,%
\[
\min\left\{  i,\max\left\{  j,k\right\}  \right\}  =\max\left\{  \min\left\{
i,j\right\}  ,\min\left\{  i,k\right\}  \right\}  .
\]

\end{statement}

[\textit{Proof of Claim 1:} We have $j\leq k$ or $j\geq k$. Since $j$ and $k$
play symmetric roles in Claim 1, we can always swap $j$ and $k$; thus, we can
WLOG assume that $j\leq k$. Assume this. From $j\leq k$, we obtain
$\max\left\{  j,k\right\}  =k$. Moreover, any element of a set must be $\geq$
to the minimum of this set; hence, $i\geq\min\left\{  i,j\right\}  $ and
$j\geq\min\left\{  i,j\right\}  $. The minimum $\min\left\{  i,k\right\}  $
must be one of the two elements $i$ and $k$ (since the minimum of a set must
always be an element of this set); but both of these elements $i$ and $k$ are
$\geq\min\left\{  i,j\right\}  $ (because $i\geq\min\left\{  i,j\right\}  $
and $k\geq j\geq\min\left\{  i,j\right\}  $). Hence, $\min\left\{
i,k\right\}  $ must be $\geq\min\left\{  i,j\right\}  $. Hence, $\max\left\{
\min\left\{  i,j\right\}  ,\min\left\{  i,k\right\}  \right\}  =\min\left\{
i,k\right\}  $. Comparing this with $\min\left\{  i,\underbrace{\max\left\{
j,k\right\}  }_{=k}\right\}  =\min\left\{  i,k\right\}  $, we obtain
$\min\left\{  i,\max\left\{  j,k\right\}  \right\}  =\max\left\{  \min\left\{
i,j\right\}  ,\min\left\{  i,k\right\}  \right\}  $. This proves Claim 1.]

Now, fix a prime $p$. Then, Exercise \ref{exe.ent.prime.gcd.1} \textbf{(a)}
(applied to $n=a$ and $m=\operatorname{lcm}\left(  b,c\right)  $) yields%
\begin{align}
v_{p}\left(  \gcd\left(  a,\operatorname{lcm}\left(  b,c\right)  \right)
\right)   &  =\min\left\{  v_{p}\left(  a\right)  ,\underbrace{v_{p}\left(
\operatorname{lcm}\left(  b,c\right)  \right)  }_{\substack{=\max\left\{
v_{p}\left(  b\right)  ,v_{p}\left(  c\right)  \right\}  \\\text{(by Exercise
\ref{exe.ent.prime.gcd.1} \textbf{(b)},}\\\text{applied to }n=b\text{ and
}m=c\text{)}}}\right\} \nonumber\\
&  =\min\left\{  v_{p}\left(  a\right)  ,\max\left\{  v_{p}\left(  b\right)
,v_{p}\left(  c\right)  \right\}  \right\} \nonumber\\
&  =\max\left\{  \min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)
\right\}  ,\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  c\right)
\right\}  \right\}  \label{sol.ent.prime.gcd.distrib.1st.a.1}%
\end{align}
(by Claim 1, applied to $i=v_{p}\left(  a\right)  $, $j=v_{p}\left(  b\right)
$ and $k=v_{p}\left(  c\right)  $). On the other hand, Exercise
\ref{exe.ent.prime.gcd.1} \textbf{(b)} (applied to $n=\gcd\left(  a,b\right)
$ and $m=\gcd\left(  a,c\right)  $) yields%
\begin{align*}
v_{p}\left(  \operatorname{lcm}\left(  \gcd\left(  a,b\right)  ,\gcd\left(
a,c\right)  \right)  \right)   &  =\max\left\{  \underbrace{v_{p}\left(
\gcd\left(  a,b\right)  \right)  }_{\substack{=\min\left\{  v_{p}\left(
a\right)  ,v_{p}\left(  b\right)  \right\}  \\\text{(by Exercise
\ref{exe.ent.prime.gcd.1} \textbf{(a)},}\\\text{applied to }n=a\text{ and
}m=b\text{)}}},\underbrace{v_{p}\left(  \gcd\left(  a,c\right)  \right)
}_{\substack{=\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  c\right)
\right\}  \\\text{(by Exercise \ref{exe.ent.prime.gcd.1} \textbf{(a)}%
,}\\\text{applied to }n=a\text{ and }m=c\text{)}}}\right\} \\
&  =\max\left\{  \min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)
\right\}  ,\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  c\right)
\right\}  \right\}  .
\end{align*}
Comparing this with (\ref{sol.ent.prime.gcd.distrib.1st.a.1}), we obtain%
\[
v_{p}\left(  \gcd\left(  a,\operatorname{lcm}\left(  b,c\right)  \right)
\right)  =v_{p}\left(  \operatorname{lcm}\left(  \gcd\left(  a,b\right)
,\gcd\left(  a,c\right)  \right)  \right)  .
\]


Now, forget that we fixed $p$. We thus have proven that
\[
v_{p}\left(  \gcd\left(  a,\operatorname{lcm}\left(  b,c\right)  \right)
\right)  =v_{p}\left(  \operatorname{lcm}\left(  \gcd\left(  a,b\right)
,\gcd\left(  a,c\right)  \right)  \right)  \ \ \ \ \ \ \ \ \ \ \text{for every
prime }p\text{.}%
\]
Thus, Exercise \ref{exe.ent.prime.vp=vp} (applied to $n=\gcd\left(
a,\operatorname{lcm}\left(  b,c\right)  \right)  $ and $m=\operatorname{lcm}%
\left(  \gcd\left(  a,b\right)  ,\gcd\left(  a,c\right)  \right)  $) yields
that $\gcd\left(  a,\operatorname{lcm}\left(  b,c\right)  \right)
=\operatorname{lcm}\left(  \gcd\left(  a,b\right)  ,\gcd\left(  a,c\right)
\right)  $ (since $\gcd\left(  a,\operatorname{lcm}\left(  b,c\right)
\right)  $ and \newline$\operatorname{lcm}\left(  \gcd\left(  a,b\right)
,\gcd\left(  a,c\right)  \right)  $ are nonnegative integers\footnote{because
any gcd and any lcm is a nonnegative integer}). This solves Exercise
\ref{exe.ent.prime.gcd.distrib} \textbf{(a)}.

\textbf{(b)} Exercise \ref{exe.ent.prime.gcd.distrib} \textbf{(b)} can be
solved in the same way as we solved Exercise \ref{exe.ent.prime.gcd.distrib}
\textbf{(a)} above, after making the obvious changes (i.e., all minima should
be replaced by maxima and vice versa; all inequalities in the proof of Claim 1
need to be flipped; all gcds should be replaced by lcms and vice versa). For
example, instead of Claim 1, we now need the following claim (with an
analogous proof):

\begin{statement}
\textit{Claim 2:} Let $i,j,k\in\mathbb{N}\cup\left\{  \infty\right\}  $ be
arbitrary. Then,%
\[
\max\left\{  i,\min\left\{  j,k\right\}  \right\}  =\min\left\{  \max\left\{
i,j\right\}  ,\max\left\{  i,k\right\}  \right\}  .
\]

\end{statement}
\end{proof}

\begin{proof}
[Second solution to Exercise \ref{exe.ent.prime.gcd.distrib}.]\textbf{(a)} We
are in one of the following two cases:

\textit{Case 1:} The two integers $b,c$ are all $0$.

\textit{Case 2:} The two integers $b,c$ are not all $0$.

Let us first consider Case 1. In this case, the two integers $b,c$ are all
$0$. In other words, $b=0$ and $c=0$. Clearly, $\left\vert a\right\vert
\mid\left\vert a\right\vert $. Thus, Exercise \ref{exe.ent.lcm.props1}
\textbf{(e)} (applied to $\left\vert a\right\vert $ and $\left\vert
a\right\vert $ instead of $a$ and $b$) yields $\operatorname{lcm}\left(
\left\vert a\right\vert ,\left\vert a\right\vert \right)  =\left\vert
\left\vert a\right\vert \right\vert =\left\vert a\right\vert $ (since
$\left\vert a\right\vert \geq0$).

Proposition \ref{prop.ent.gcd.props1} \textbf{(a)} yields $\gcd\left(
a,0\right)  =\gcd\left(  a\right)  =\left\vert a\right\vert $. Now,%
\[
\operatorname{lcm}\left(  \gcd\left(  a,\underbrace{b}_{=0}\right)
,\gcd\left(  a,\underbrace{c}_{=0}\right)  \right)  =\operatorname{lcm}\left(
\underbrace{\gcd\left(  a,0\right)  }_{=\left\vert a\right\vert }%
,\underbrace{\gcd\left(  a,0\right)  }_{=\left\vert a\right\vert }\right)
=\operatorname{lcm}\left(  \left\vert a\right\vert ,\left\vert a\right\vert
\right)  =\left\vert a\right\vert .
\]


On the other hand, $\operatorname{lcm}\left(  \underbrace{b}_{=0}%
,\underbrace{c}_{=0}\right)  =\operatorname{lcm}\left(  0,0\right)  =0$ (by
Definition \ref{def.ent.lcm.lcm}, because the integers $0,0$ are not all
nonzero). Hence,
\[
\gcd\left(  a,\underbrace{\operatorname{lcm}\left(  b,c\right)  }_{=0}\right)
=\gcd\left(  a,0\right)  =\left\vert a\right\vert .
\]
Comparing this with $\operatorname{lcm}\left(  \gcd\left(  a,b\right)
,\gcd\left(  a,c\right)  \right)  =\left\vert a\right\vert $, we find
\newline$\gcd\left(  a,\operatorname{lcm}\left(  b,c\right)  \right)
=\operatorname{lcm}\left(  \gcd\left(  a,b\right)  ,\gcd\left(  a,c\right)
\right)  $. Thus, Exercise \ref{exe.ent.prime.gcd.distrib} \textbf{(a)} is
solved in Case 1.

Let us now consider Case 2. In this case, the two integers $b,c$ are not all
$0$. Thus, $\gcd\left(  b,c\right)  $ is a positive integer (by Definition
\ref{def.ent.gcd.gcd}). Hence, $\gcd\left(  b,c\right)  >0$, so that
$\gcd\left(  b,c\right)  \neq0$.

Theorem \ref{thm.ent.gcd.sa,sb} (applied to $a$, $b$ and $c$ instead of $s$,
$a$ and $b$) yields $\gcd\left(  ab,ac\right)  =\left\vert a\right\vert
\gcd\left(  b,c\right)  $. But (\ref{eq.ent.div.abs(xy)}) (applied to $x=a$
and $y=\gcd\left(  b,c\right)  $) yields $\left\vert a\gcd\left(  b,c\right)
\right\vert =\left\vert a\right\vert \cdot\underbrace{\left\vert \gcd\left(
b,c\right)  \right\vert }_{\substack{=\gcd\left(  b,c\right)  \\\text{(since
}\gcd\left(  b,c\right)  >0\text{)}}}=\left\vert a\right\vert \gcd\left(
b,c\right)  $. Comparing this with $\gcd\left(  ab,ac\right)  =\left\vert
a\right\vert \gcd\left(  b,c\right)  $, we obtain%
\begin{equation}
\left\vert a\gcd\left(  b,c\right)  \right\vert =\gcd\left(
ab,\underbrace{ac}_{=ca}\right)  =\gcd\left(  ab,ca\right)  .
\label{sol.ent.prime.gcd.distrib.2nd.a.2}%
\end{equation}


On the other hand, Theorem \ref{thm.ent.lcm.gcd*lcm} (applied to $b$ and $c$
instead of $a$ and $b$) yields $\gcd\left(  b,c\right)  \cdot
\operatorname{lcm}\left(  b,c\right)  =\left\vert bc\right\vert $.

Now, Theorem \ref{thm.ent.gcd.sa,sb} (applied to $\gcd\left(  b,c\right)  $,
$a$ and $\operatorname{lcm}\left(  b,c\right)  $ instead of $s$, $a$ and $b$)
yields%
\begin{align*}
\gcd\left(  \gcd\left(  b,c\right)  a,\gcd\left(  b,c\right)
\operatorname{lcm}\left(  b,c\right)  \right)   &  =\underbrace{\left\vert
\gcd\left(  b,c\right)  \right\vert }_{\substack{=\gcd\left(  b,c\right)
\\\text{(since }\gcd\left(  b,c\right)  >0\text{)}}}\gcd\left(
a,\operatorname{lcm}\left(  b,c\right)  \right) \\
&  =\gcd\left(  b,c\right)  \gcd\left(  a,\operatorname{lcm}\left(
b,c\right)  \right)  .
\end{align*}
Hence,%
\begin{align}
&  \gcd\left(  b,c\right)  \gcd\left(  a,\operatorname{lcm}\left(  b,c\right)
\right) \nonumber\\
&  =\gcd\left(  \underbrace{\gcd\left(  b,c\right)  a}_{=a\gcd\left(
b,c\right)  },\underbrace{\gcd\left(  b,c\right)  \operatorname{lcm}\left(
b,c\right)  }_{=\gcd\left(  b,c\right)  \cdot\operatorname{lcm}\left(
b,c\right)  =\left\vert bc\right\vert }\right) \nonumber\\
&  =\gcd\left(  a\gcd\left(  b,c\right)  ,\left\vert bc\right\vert \right)
=\gcd\left(  a\gcd\left(  b,c\right)  ,bc\right)
\label{sol.ent.prime.gcd.distrib.2nd.a.4}%
\end{align}
(by Exercise \ref{exe.ent.gcd.abs} \textbf{(a)}, applied to $a\gcd\left(
b,c\right)  $ and $bc$ instead of $a$ and $b$).

On the other hand, Exercise \ref{exe.ent.gcd.abs} \textbf{(b)} (applied to
$a\gcd\left(  b,c\right)  $ and $bc$ instead of $a$ and $b$) yields%
\[
\gcd\left(  \left\vert a\gcd\left(  b,c\right)  \right\vert ,bc\right)
=\gcd\left(  a\gcd\left(  b,c\right)  ,bc\right)  .
\]
Comparing this with (\ref{sol.ent.prime.gcd.distrib.2nd.a.4}), we obtain%
\[
\gcd\left(  b,c\right)  \gcd\left(  a,\operatorname{lcm}\left(  b,c\right)
\right)  =\gcd\left(  \underbrace{\left\vert a\gcd\left(  b,c\right)
\right\vert }_{\substack{=\gcd\left(  ab,ca\right)  \\\text{(by
(\ref{sol.ent.prime.gcd.distrib.2nd.a.2}))}}},bc\right)  =\gcd\left(
\gcd\left(  ab,ca\right)  ,bc\right)  .
\]


On the other hand, Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} (applied
to $3$ and $\left(  ab,ca,bc\right)  $ instead of $k$ and $\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $) yields%
\[
\gcd\left(  ab,ca,bc\right)  =\gcd\left(  \gcd\left(  ab,ca\right)
,bc\right)  .
\]
Comparing these two equalities, we obtain%
\begin{equation}
\gcd\left(  b,c\right)  \gcd\left(  a,\operatorname{lcm}\left(  b,c\right)
\right)  =\gcd\left(  ab,ca,bc\right)  .
\label{sol.ent.prime.gcd.distrib.2nd.a.7}%
\end{equation}


But $\left\{  bc,ca,ab\right\}  =\left\{  ab,ca,bc\right\}  $. Thus, Exercise
\ref{exe.ent.Div.set} (applied to $3$, $\left(  bc,ca,ab\right)  $, $3$ and
$\left(  ab,ca,bc\right)  $ instead of $k$, $\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $, $\ell$ and $\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $)
yields $\gcd\left(  bc,ca,ab\right)  =\gcd\left(  ab,ca,bc\right)  $.
Comparing this with (\ref{sol.ent.prime.gcd.distrib.2nd.a.7}), we obtain%
\[
\gcd\left(  b,c\right)  \gcd\left(  a,\operatorname{lcm}\left(  b,c\right)
\right)  =\gcd\left(  bc,ca,ab\right)  .
\]
We can divide both sides of this equality by $\gcd\left(  b,c\right)  $ (since
$\gcd\left(  b,c\right)  \neq0$); thus we obtain%
\begin{equation}
\gcd\left(  a,\operatorname{lcm}\left(  b,c\right)  \right)  =\dfrac
{\gcd\left(  bc,ca,ab\right)  }{\gcd\left(  b,c\right)  }.
\label{sol.ent.prime.gcd.distrib.2nd.a.8}%
\end{equation}


On the other hand, the three integers $a,b,c$ are not all $0$ (since the two
integers $b,c$ are not all $0$). Thus, $\gcd\left(  a,b,c\right)  $ is a
positive integer (by Definition \ref{def.ent.gcd.gcd}). Hence, $\gcd\left(
a,b,c\right)  >0$, so that $\gcd\left(  a,b,c\right)  \neq0$. From
$\gcd\left(  a,b,c\right)  \neq0$ and $\gcd\left(  b,c\right)  \neq0$, we
obtain $\gcd\left(  a,b,c\right)  \cdot\gcd\left(  b,c\right)  \neq0$.

Recall that a gcd of a finite list of integers is always nonnegative. Hence,
the two numbers $\gcd\left(  a,b\right)  $ and $\gcd\left(  a,c\right)  $ are
nonnegative. Thus, their product $\gcd\left(  a,b\right)  \gcd\left(
a,c\right)  $ is nonnegative as well.

Now, Theorem \ref{thm.ent.lcm.gcd*lcm} (applied to $\gcd\left(  a,b\right)  $
and $\gcd\left(  a,c\right)  $ instead of $a$ and $b$) yields%
\begin{align}
&  \gcd\left(  \gcd\left(  a,b\right)  ,\gcd\left(  a,c\right)  \right)
\cdot\operatorname{lcm}\left(  \gcd\left(  a,b\right)  ,\gcd\left(
a,c\right)  \right) \nonumber\\
&  =\left\vert \gcd\left(  a,b\right)  \gcd\left(  a,c\right)  \right\vert
=\gcd\left(  a,b\right)  \underbrace{\gcd\left(  a,c\right)  }%
_{\substack{=\gcd\left(  c,a\right)  \\\text{(by Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)},}\\\text{applied to }c\text{ instead of
}b\text{)}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\gcd\left(  a,b\right)
\gcd\left(  a,c\right)  \text{ is nonnegative}\right) \nonumber\\
&  =\gcd\left(  a,b\right)  \cdot\gcd\left(  c,a\right)  =\gcd\left(
c,a\right)  \cdot\gcd\left(  a,b\right)  .
\label{sol.ent.prime.gcd.distrib.2nd.a.11}%
\end{align}


But $\left\{  a,b,a,c\right\}  =\left\{  a,b,c\right\}  $. Hence, Exercise
\ref{exe.ent.Div.set} (applied to $4$, $\left(  a,b,a,c\right)  $, $3$ and
$\left(  a,b,c\right)  $ instead of $k$, $\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $, $\ell$ and $\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $)
yields
\[
\gcd\left(  a,b,a,c\right)  =\gcd\left(  a,b,c\right)  .
\]
But Theorem \ref{thm.ent.gcd.split} (applied to $2$, $\left(  a,b\right)  $,
$2$ and $\left(  a,c\right)  $ instead of $k$, $\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $, $\ell$ and $\left(  c_{1},c_{2},\ldots,c_{\ell
}\right)  $) yields%
\[
\gcd\left(  a,b,a,c\right)  =\gcd\left(  \gcd\left(  a,b\right)  ,\gcd\left(
a,c\right)  \right)  .
\]
Comparing these two equalities, we obtain%
\[
\gcd\left(  \gcd\left(  a,b\right)  ,\gcd\left(  a,c\right)  \right)
=\gcd\left(  a,b,c\right)  .
\]
Now, (\ref{sol.ent.prime.gcd.distrib.2nd.a.11}) yields%
\begin{align*}
\gcd\left(  c,a\right)  \cdot\gcd\left(  a,b\right)   &  =\underbrace{\gcd
\left(  \gcd\left(  a,b\right)  ,\gcd\left(  a,c\right)  \right)  }%
_{=\gcd\left(  a,b,c\right)  }\cdot\operatorname{lcm}\left(  \gcd\left(
a,b\right)  ,\gcd\left(  a,c\right)  \right) \\
&  =\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  \gcd\left(
a,b\right)  ,\gcd\left(  a,c\right)  \right)  .
\end{align*}
Dividing both sides of this equality by $\gcd\left(  a,b,c\right)  $ (we can
do this, since $\gcd\left(  a,b,c\right)  \neq0$), we obtain%
\begin{equation}
\dfrac{\gcd\left(  c,a\right)  \cdot\gcd\left(  a,b\right)  }{\gcd\left(
a,b,c\right)  }=\operatorname{lcm}\left(  \gcd\left(  a,b\right)  ,\gcd\left(
a,c\right)  \right)  . \label{sol.ent.prime.gcd.distrib.2nd.a.14}%
\end{equation}


However, Exercise \ref{exe.ent.coprime.gcd-distrib1} yields
\[
\gcd\left(  b,c\right)  \cdot\gcd\left(  c,a\right)  \cdot\gcd\left(
a,b\right)  =\gcd\left(  a,b,c\right)  \cdot\gcd\left(  bc,ca,ab\right)  .
\]
We can divide both sides of this equality by $\gcd\left(  a,b,c\right)
\cdot\gcd\left(  b,c\right)  $ (since $\gcd\left(  a,b,c\right)  \cdot
\gcd\left(  b,c\right)  \neq0$); we thus obtain%
\[
\dfrac{\gcd\left(  c,a\right)  \cdot\gcd\left(  a,b\right)  }{\gcd\left(
a,b,c\right)  }=\dfrac{\gcd\left(  bc,ca,ab\right)  }{\gcd\left(  b,c\right)
}.
\]
Comparing this with (\ref{sol.ent.prime.gcd.distrib.2nd.a.14}), we find%
\[
\operatorname{lcm}\left(  \gcd\left(  a,b\right)  ,\gcd\left(  a,c\right)
\right)  =\dfrac{\gcd\left(  bc,ca,ab\right)  }{\gcd\left(  b,c\right)  }%
=\gcd\left(  a,\operatorname{lcm}\left(  b,c\right)  \right)
\]
(by (\ref{sol.ent.prime.gcd.distrib.2nd.a.8})). Thus, Exercise
\ref{exe.ent.prime.gcd.distrib} \textbf{(a)} is solved in Case 2.

We have now solved Exercise \ref{exe.ent.prime.gcd.distrib} \textbf{(a)} in
each of the two Cases 1 and 2. Thus, Exercise \ref{exe.ent.prime.gcd.distrib}
\textbf{(a)} is solved in all cases.

[\textit{Remark:} The above solution to Exercise
\ref{exe.ent.prime.gcd.distrib} \textbf{(a)} is (an expanded version of) Bill
Dubuque's post \url{https://math.stackexchange.com/a/147992/}. Note that
Dubuque uses the notations $\left(  x_{1},x_{2},\ldots,x_{k}\right)  $ and
$\left[  x_{1},x_{2},\ldots,x_{k}\right]  $ for what we call $\gcd\left(
x_{1},x_{2},\ldots,x_{k}\right)  $ and $\operatorname{lcm}\left(  x_{1}%
,x_{2},\ldots,x_{k}\right)  $.]

\textbf{(b)} We are in one of the following two cases:

\textit{Case 1:} We have $a=0$.

\textit{Case 2:} We have $a\neq0$.

Let us first consider Case 1. In this case, we have $a=0$. Thus, the two
integers $a,\gcd\left(  b,c\right)  $ are not all nonzero. Hence, Definition
\ref{def.ent.lcm.lcm} yields $\operatorname{lcm}\left(  a,\gcd\left(
b,c\right)  \right)  =0$. Also, the two integers $a,b$ are not all nonzero
(since $a=0$). Hence, $\operatorname{lcm}\left(  a,b\right)  =0$ (again by
Definition \ref{def.ent.lcm.lcm}). Similarly, $\operatorname{lcm}\left(
a,c\right)  =0$. Now,
\[
\gcd\left(  \underbrace{\operatorname{lcm}\left(  a,b\right)  }_{=0}%
,\underbrace{\operatorname{lcm}\left(  a,c\right)  }_{=0}\right)  =\gcd\left(
0,0\right)  =0
\]
(by Definition \ref{def.ent.gcd.gcd}, since all of the integers $0,0$ are
$0$). Comparing this with $\operatorname{lcm}\left(  a,\gcd\left(  b,c\right)
\right)  =0$, we obtain $\operatorname{lcm}\left(  a,\gcd\left(  b,c\right)
\right)  =\gcd\left(  \operatorname{lcm}\left(  a,b\right)
,\operatorname{lcm}\left(  a,c\right)  \right)  $. Thus, Exercise
\ref{exe.ent.prime.gcd.distrib} \textbf{(b)} is solved in Case 1.

Let us now consider Case 2. In this case, we have $a\neq0$. Hence, the two
integers $a,b$ are not all $0$. Thus, $\gcd\left(  a,b\right)  $ is a positive
integer (by Definition \ref{def.ent.gcd.gcd}). Similarly, $\gcd\left(
a,c\right)  $ is a positive integer. Also, the three integers $a,b,c$ are not
all $0$ (since $a\neq0$). Thus, $\gcd\left(  a,b,c\right)  $ is a positive
integer (by Definition \ref{def.ent.gcd.gcd}). Hence, $\gcd\left(
a,b,c\right)  \neq0$.

The numbers $\gcd\left(  a,b\right)  $ and $\gcd\left(  a,c\right)  $ are
positive integers. Hence, their product $\gcd\left(  a,b\right)  \cdot
\gcd\left(  a,c\right)  $ is a positive integer as well. Let us denote this
positive integer by $g$. Thus,%
\begin{align}
g  &  =\gcd\left(  a,b\right)  \cdot\underbrace{\gcd\left(  a,c\right)
}_{\substack{=\gcd\left(  c,a\right)  \\\text{(by Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)},}\\\text{applied to }c\text{ instead of
}b\text{)}}}=\gcd\left(  a,b\right)  \cdot\gcd\left(  c,a\right) \nonumber\\
&  =\gcd\left(  c,a\right)  \cdot\gcd\left(  a,b\right)  .
\label{sol.ent.prime.gcd.distrib.2nd.b.g=2}%
\end{align}
Also, $g\neq0$ (since $g$ is positive).

Theorem \ref{thm.ent.lcm.gcd*lcm} yields $\gcd\left(  a,b\right)
\cdot\operatorname{lcm}\left(  a,b\right)  =\left\vert ab\right\vert $. Also,
Theorem \ref{thm.ent.lcm.gcd*lcm} (applied to $c$ instead of $b$) yields
$\gcd\left(  a,c\right)  \cdot\operatorname{lcm}\left(  a,c\right)
=\left\vert ac\right\vert $.

Theorem \ref{thm.ent.gcd.sa,sb} (applied to $g$, $\operatorname{lcm}\left(
a,b\right)  $ and $\operatorname{lcm}\left(  a,c\right)  $ instead of $s$, $a$
and $b$) yields%
\begin{align*}
\gcd\left(  g\operatorname{lcm}\left(  a,b\right)  ,g\operatorname{lcm}\left(
a,c\right)  \right)   &  =\underbrace{\left\vert g\right\vert }%
_{\substack{=g\\\text{(since }g\text{ is positive)}}}\gcd\left(
\operatorname{lcm}\left(  a,b\right)  ,\operatorname{lcm}\left(  a,c\right)
\right) \\
&  =g\gcd\left(  \operatorname{lcm}\left(  a,b\right)  ,\operatorname{lcm}%
\left(  a,c\right)  \right)  .
\end{align*}
Hence,%
\begin{align}
&  g\gcd\left(  \operatorname{lcm}\left(  a,b\right)  ,\operatorname{lcm}%
\left(  a,c\right)  \right) \nonumber\\
&  =\gcd\left(  \underbrace{g}_{=\gcd\left(  c,a\right)  \cdot\gcd\left(
a,b\right)  }\operatorname{lcm}\left(  a,b\right)  ,\underbrace{g}%
_{=\gcd\left(  a,b\right)  \cdot\gcd\left(  a,c\right)  }\operatorname{lcm}%
\left(  a,c\right)  \right) \nonumber\\
&  =\gcd\left(  \gcd\left(  c,a\right)  \cdot\underbrace{\gcd\left(
a,b\right)  \cdot\operatorname{lcm}\left(  a,b\right)  }_{=\left\vert
ab\right\vert },\gcd\left(  a,b\right)  \cdot\underbrace{\gcd\left(
a,c\right)  \cdot\operatorname{lcm}\left(  a,c\right)  }_{=\left\vert
ac\right\vert }\right) \nonumber\\
&  =\gcd\left(  \gcd\left(  c,a\right)  \cdot\left\vert ab\right\vert
,\gcd\left(  a,b\right)  \cdot\left\vert ac\right\vert \right)  .
\label{sol.ent.prime.gcd.distrib.2nd.b.4}%
\end{align}


On the other hand, Theorem \ref{thm.ent.gcd.sa,sb} (applied to $ab$, $c$ and
$a$ instead of $s$, $a$ and $b$) yields
\begin{equation}
\gcd\left(  abc,aba\right)  =\left\vert ab\right\vert \gcd\left(  c,a\right)
=\gcd\left(  c,a\right)  \cdot\left\vert ab\right\vert .
\label{sol.ent.prime.gcd.distrib.2nd.b.5a}%
\end{equation}
Also, Theorem \ref{thm.ent.gcd.sa,sb} (applied to $ac$, $a$ and $b$ instead of
$s$, $a$ and $b$) yields
\begin{equation}
\gcd\left(  aca,acb\right)  =\left\vert ac\right\vert \gcd\left(  a,b\right)
=\gcd\left(  a,b\right)  \cdot\left\vert ac\right\vert .
\label{sol.ent.prime.gcd.distrib.2nd.b.5b}%
\end{equation}


Also, $\left\{  abc,\underbrace{aba}_{=aab},aca,\underbrace{acb}%
_{=abc}\right\}  =\left\{  abc,aab,aca,abc\right\}  =\left\{
abc,aca,aab\right\}  $. Hence, Exercise \ref{exe.ent.Div.set} (applied to $4$,
$\left(  abc,aba,aca,acb\right)  $, $3$ and $\left(  abc,aca,aab\right)  $
instead of $k$, $\left(  b_{1},b_{2},\ldots,b_{k}\right)  $, $\ell$ and
$\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $) yields
\[
\gcd\left(  abc,aba,aca,acb\right)  =\gcd\left(  abc,aca,aab\right)
=\left\vert a\right\vert \gcd\left(  bc,ca,ab\right)
\]
(by Exercise \ref{exe.ent.gcd.sak}, applied to $a$, $3$ and $\left(
bc,ca,ab\right)  $ instead of $s$, $k$ and $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  $). Hence,%
\begin{align*}
\left\vert a\right\vert \gcd\left(  bc,ca,ab\right)   &  =\gcd\left(
abc,aba,aca,acb\right)  =\gcd\left(  \underbrace{\gcd\left(  abc,aba\right)
}_{\substack{=\gcd\left(  c,a\right)  \cdot\left\vert ab\right\vert
\\\text{(by (\ref{sol.ent.prime.gcd.distrib.2nd.b.5a}))}}},\underbrace{\gcd
\left(  aca,acb\right)  }_{\substack{=\gcd\left(  a,b\right)  \cdot\left\vert
ac\right\vert \\\text{(by (\ref{sol.ent.prime.gcd.distrib.2nd.b.5b}))}%
}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.ent.gcd.split}, applied to }2\text{, }\left(
abc,aba\right)  \text{, }2\text{ and }\left(  aca,acb\right) \\
\text{instead of }k\text{, }\left(  b_{1},b_{2},\ldots,b_{k}\right)  \text{,
}\ell\text{ and }\left(  c_{1},c_{2},\ldots,c_{\ell}\right)
\end{array}
\right) \\
&  =\gcd\left(  \gcd\left(  c,a\right)  \cdot\left\vert ab\right\vert
,\gcd\left(  a,b\right)  \cdot\left\vert ac\right\vert \right)  =g\gcd\left(
\operatorname{lcm}\left(  a,b\right)  ,\operatorname{lcm}\left(  a,c\right)
\right)
\end{align*}
(by (\ref{sol.ent.prime.gcd.distrib.2nd.b.4})). We can divide both sides of
this equality by $g$ (since $g\neq0$); thus we obtain%
\begin{equation}
\dfrac{\left\vert a\right\vert \gcd\left(  bc,ca,ab\right)  }{g}=\gcd\left(
\operatorname{lcm}\left(  a,b\right)  ,\operatorname{lcm}\left(  a,c\right)
\right)  . \label{sol.ent.prime.gcd.distrib.2nd.b.7}%
\end{equation}


Proposition \ref{prop.ent.gcd.props1} \textbf{(b)} (applied to $\gcd\left(
b,c\right)  $ instead of $b$) yields \newline$\gcd\left(  a,\gcd\left(
b,c\right)  \right)  =\gcd\left(  \gcd\left(  b,c\right)  ,a\right)  $. But
Theorem \ref{thm.ent.gcd.uniprop-mul} \textbf{(d)} (applied to $3$ and
$\left(  b,c,a\right)  $ instead of $k$ and $\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $) yields $\gcd\left(  b,c,a\right)  =\gcd\left(  \gcd\left(
b,c\right)  ,a\right)  $. Comparing these two equalities, we obtain
\begin{equation}
\gcd\left(  a,\gcd\left(  b,c\right)  \right)  =\gcd\left(  b,c,a\right)  .
\label{sol.ent.prime.gcd.distrib.2nd.b.8}%
\end{equation}


But $\left\{  b,c,a\right\}  =\left\{  a,b,c\right\}  $. Thus, Exercise
\ref{exe.ent.Div.set} (applied to $3$, $\left(  b,c,a\right)  $, $3$ and
$\left(  a,b,c\right)  $ instead of $k$, $\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $, $\ell$ and $\left(  c_{1},c_{2},\ldots,c_{\ell}\right)  $)
yields $\gcd\left(  b,c,a\right)  =\gcd\left(  a,b,c\right)  $. Thus,
(\ref{sol.ent.prime.gcd.distrib.2nd.b.8}) becomes%
\begin{equation}
\gcd\left(  a,\gcd\left(  b,c\right)  \right)  =\gcd\left(  b,c,a\right)
=\gcd\left(  a,b,c\right)  . \label{sol.ent.prime.gcd.distrib.2nd.b.9}%
\end{equation}


The gcd of any list of integers is a nonnegative integer. Thus, $\gcd\left(
b,c\right)  $ is a nonnegative integer. Now, Theorem \ref{thm.ent.lcm.gcd*lcm}
(applied to $\gcd\left(  b,c\right)  $ instead of $b$) yields
\begin{align*}
&  \gcd\left(  a,\gcd\left(  b,c\right)  \right)  \cdot\operatorname{lcm}%
\left(  a,\gcd\left(  b,c\right)  \right) \\
&  =\left\vert a\gcd\left(  b,c\right)  \right\vert =\left\vert a\right\vert
\cdot\underbrace{\left\vert \gcd\left(  b,c\right)  \right\vert }%
_{\substack{=\gcd\left(  b,c\right)  \\\text{(since }\gcd\left(  b,c\right)
\\\text{is nonnegative)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.ent.div.abs(xy)}), applied to }x=a\text{ and }y=\gcd\left(
b,c\right)  \right) \\
&  =\left\vert a\right\vert \gcd\left(  b,c\right)  .
\end{align*}
In view of (\ref{sol.ent.prime.gcd.distrib.2nd.b.9}), this rewrites as%
\begin{equation}
\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  a,\gcd\left(
b,c\right)  \right)  =\left\vert a\right\vert \gcd\left(  b,c\right)  .
\label{sol.ent.prime.gcd.distrib.2nd.b.11}%
\end{equation}
Multiplying both sides of this equality by $g$, we obtain%
\begin{align*}
\gcd\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  a,\gcd\left(
b,c\right)  \right)  \cdot g  &  =\left\vert a\right\vert \gcd\left(
b,c\right)  \cdot\underbrace{g}_{\substack{=\gcd\left(  c,a\right)  \cdot
\gcd\left(  a,b\right)  \\\text{(by (\ref{sol.ent.prime.gcd.distrib.2nd.b.g=2}%
))}}}\\
&  =\left\vert a\right\vert \underbrace{\gcd\left(  b,c\right)  \cdot
\gcd\left(  c,a\right)  \cdot\gcd\left(  a,b\right)  }_{\substack{=\gcd\left(
a,b,c\right)  \cdot\gcd\left(  bc,ca,ab\right)  \\\text{(by Exercise
\ref{exe.ent.coprime.gcd-distrib1})}}}\\
&  =\left\vert a\right\vert \gcd\left(  a,b,c\right)  \cdot\gcd\left(
bc,ca,ab\right) \\
&  =\gcd\left(  a,b,c\right)  \cdot\left\vert a\right\vert \gcd\left(
bc,ca,ab\right)  .
\end{align*}
We can divide both sides of this equality by $\gcd\left(  a,b,c\right)  $
(since $\gcd\left(  a,b,c\right)  \neq0$); we thus obtain%
\[
\operatorname{lcm}\left(  a,\gcd\left(  b,c\right)  \right)  \cdot
g=\left\vert a\right\vert \gcd\left(  bc,ca,ab\right)  .
\]
We can divide both sides of this equality by $g$ (since $g\neq0$); thus we
find%
\[
\operatorname{lcm}\left(  a,\gcd\left(  b,c\right)  \right)  =\dfrac
{\left\vert a\right\vert \gcd\left(  bc,ca,ab\right)  }{g}=\gcd\left(
\operatorname{lcm}\left(  a,b\right)  ,\operatorname{lcm}\left(  a,c\right)
\right)
\]
(by (\ref{sol.ent.prime.gcd.distrib.2nd.b.7})). Thus, Exercise
\ref{exe.ent.prime.gcd.distrib} \textbf{(b)} is solved in Case 2.

We have now solved Exercise \ref{exe.ent.prime.gcd.distrib} \textbf{(b)} in
each of the two Cases 1 and 2. Thus, Exercise \ref{exe.ent.prime.gcd.distrib}
\textbf{(b)} is solved in all cases.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.aa-1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.aa-1}.]We have $a^{2}\equiv
1\operatorname{mod}p$. In other words, $p\mid a^{2}-1=\left(  a-1\right)
\left(  a+1\right)  $. Hence, Theorem \ref{thm.ent.prime.pab} (applied to
$a-1$ and $a+1$ instead of $a$ and $b$) yields that $p\mid a-1$ or $p\mid
a+1$. In view of the logical equivalences%
\[
\left(  p\mid a-1\right)  \ \Longleftrightarrow\ \left(  a\equiv
1\operatorname{mod}p\right)
\]
and%
\[
\left(  p\mid\underbrace{a+1}_{=a-\left(  -1\right)  }\right)
\ \Longleftrightarrow\ \left(  p\mid a-\left(  -1\right)  \right)
\ \Longleftrightarrow\ \left(  a\equiv-1\operatorname{mod}p\right)  ,
\]
this rewrites as follows: $a\equiv1\operatorname{mod}p$ or $a\equiv
-1\operatorname{mod}p$. This solves Exercise \ref{exe.ent.prime.aa-1}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.prime.pkdivs}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.prime.pkdivs}.]The number $p$ is a prime,
and thus is a positive integer. Hence, $p^{k}$ is a positive integer as well
(since $k\in\mathbb{N}$).

For each $i\in\left\{  0,1,\ldots,k\right\}  $, the integer $p^{i}$ is a
nonnegative divisor of $p^{k}$\ \ \ \ \footnote{\textit{Proof.} Let
$i\in\left\{  0,1,\ldots,k\right\}  $. We must show that the integer $p^{i}$
is a nonnegative divisor of $p^{k}$.
\par
The number $p$ is a positive integer. Thus, $p^{i}$ is a positive integer
(since $i\in\left\{  0,1,\ldots,k\right\}  \subseteq\mathbb{N}$). Hence,
$p^{i}$ is a nonnegative integer. Furthermore, $i\leq k$ (since $i\in\left\{
0,1,\ldots,k\right\}  $). Hence, Exercise \ref{exe.ent.div.powers} (applied to
$n=p$, $a=i$ and $b=k$) yields $p^{i}\mid p^{k}$. Thus, $p^{i}$ is a divisor
of $p^{k}$. Hence, $p^{i}$ is a nonnegative divisor of $p^{k}$ (since $p^{i}$
is nonnegative). Qed.}. In other words, the integers $p^{0},p^{1},\ldots
,p^{k}$ are nonnegative divisors of $p^{k}$. In other words, we have%
\begin{equation}
\left\{  p^{0},p^{1},\ldots,p^{k}\right\}  \subseteq\left\{  \text{the
nonnegative divisors of }p^{k}\right\}  .
\label{sol.ent.prime.pkdivs.easyhalf}%
\end{equation}


Now we shall show that $\left\{  \text{the nonnegative divisors of }%
p^{k}\right\}  \subseteq\left\{  p^{0},p^{1},\ldots,p^{k}\right\}  $.

Indeed, let $d\in\left\{  \text{the nonnegative divisors of }p^{k}\right\}  $.
Thus, $d$ is a nonnegative divisor of $p^{k}$. Hence, in particular, $d$ is a
divisor of $p^{k}$; thus, $d\mid p^{k}$. In other words, there exists an
integer $c$ such that $p^{k}=dc$. Consider this $c$. If we had $d=0$, then we
would have $p^{k}=\underbrace{d}_{=0}c=0c=0$, which would contradict the fact
that $p^{k}$ is positive. Hence, we cannot have $d=0$. Thus, we have $d\neq0$.
Hence, $d$ is nonzero. Therefore, Lemma \ref{lem.ent.prime.vp-copr}
\textbf{(a)} (applied to $n=d$) shows that there exists a nonzero integer $u$
such that $u\perp p$ and $d=up^{v_{p}\left(  d\right)  }$. Consider this $u$.
From $d=up^{v_{p}\left(  d\right)  }$, we obtain $u=d/p^{v_{p}\left(
d\right)  }$, and thus $u$ is nonnegative (since $d$ is nonnegative and $p$ is positive).

Let $i=v_{p}\left(  d\right)  $. Then, $i=v_{p}\left(  d\right)  \in
\mathbb{N}$ (since $d$ is nonzero). Moreover, from $i=v_{p}\left(  d\right)
$, we obtain $up^{i}=up^{v_{p}\left(  d\right)  }=d$ (since $d=up^{v_{p}%
\left(  d\right)  }$). Moreover, $u$ is an integer; thus,
\[
p^{i}\mid up^{i}=d\mid p^{k}.
\]
But Lemma \ref{lem.ent.prime.vp-def} (applied to $n=p^{k}$) yields that
$p^{i}\mid p^{k}$ if and only if $v_{p}\left(  p^{k}\right)  \geq i$. Hence,
$v_{p}\left(  p^{k}\right)  \geq i$ (since $p^{i}\mid p^{k}$).

However, Theorem \ref{thm.ent.prime.vp-ring} \textbf{(d)} (applied to $q=p$)
yields $v_{p}\left(  p\right)  =%
\begin{cases}
1, & \text{if }p=p;\\
0, & \text{if }p\neq p
\end{cases}
=1$ (since $p=p$). But Exercise \ref{exe.ent.prime.vp-pow} (applied to $a=p$)
yields $v_{p}\left(  p^{k}\right)  =k\underbrace{v_{p}\left(  p\right)  }%
_{=1}=k\cdot1=k$. Hence, $k=v_{p}\left(  p^{k}\right)  \geq i$, so that $i\leq
k$ and thus $i\in\left\{  0,1,\ldots,k\right\}  $ (since $i\in\mathbb{N}$).

We have $u\perp p$. Thus, Exercise \ref{exe.ent.coprime.powers} (applied to
$a=u$, $b=p$, $n=1$ and $m=k$) yields $u^{1}\perp p^{k}$. In other words,
$u\perp p^{k}$ (since $u^{1}=u$). In other words, $\gcd\left(  u,p^{k}\right)
=1$ (by the definition of coprimality).

But $u\mid up^{i}\mid p^{k}$ (as we have shown above). Hence, Proposition
\ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $a=u$ and $b=p^{k}$) yields
$\gcd\left(  u,p^{k}\right)  =\left\vert u\right\vert =u$ (since $u$ is
nonnegative). Thus, $u=\gcd\left(  u,p^{k}\right)  =1$. Therefore, from
$up^{i}=d$, we obtain $d=\underbrace{u}_{=1}p^{i}=p^{i}\in\left\{  p^{0}%
,p^{1},\ldots,p^{k}\right\}  $ (since $i\in\left\{  0,1,\ldots,k\right\}  $).

Now, forget that we fixed $d$. We thus have shown that $d\in\left\{
p^{0},p^{1},\ldots,p^{k}\right\}  $ for each $d\in\left\{  \text{the
nonnegative divisors of }p^{k}\right\}  $. In other words,%
\[
\left\{  \text{the nonnegative divisors of }p^{k}\right\}  \subseteq\left\{
p^{0},p^{1},\ldots,p^{k}\right\}  .
\]
Combining this with (\ref{sol.ent.prime.pkdivs.easyhalf}), we obtain%
\[
\left\{  \text{the nonnegative divisors of }p^{k}\right\}  =\left\{
p^{0},p^{1},\ldots,p^{k}\right\}  .
\]
In other words, the nonnegative divisors of $p^{k}$ are $p^{0},p^{1}%
,\ldots,p^{k}$. This solves Exercise \ref{exe.ent.prime.pkdivs}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.phi.pk}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.phi.pk}.]Let $M$ be the set $\left\{
1p,2p,\ldots,p^{k-1}p\right\}  =\left\{  cp\ \mid\ c\in\left\{  1,2,\ldots
,p^{k-1}\right\}  \right\}  $. This set $M$ has $p^{k-1}$ elements (since the
$p^{k-1}$ numbers $1p,2p,\ldots,p^{k-1}p$ are all distinct). In other words,
$\left\vert M\right\vert =p^{k-1}$. Also, $M\subseteq\left\{  1,2,\ldots
,p^{k}\right\}  $\ \ \ \ \footnote{\textit{Proof.} Let $m\in M$. Thus, $m\in
M=\left\{  1p,2p,\ldots,p^{k-1}p\right\}  $; in other words, $m=cp$ for some
$c\in\left\{  1,2,\ldots,p^{k-1}\right\}  $. Consider this $c$. From
$c\in\left\{  1,2,\ldots,p^{k-1}\right\}  $, we obtain $c\leq p^{k-1}$. We can
multiply this inequality by $p$ (since $p>0$) and thus obtain $cp\leq
p^{k-1}p=p^{k}$. Also, $cp$ is a positive integer (since $c$ and $p$ are
positive integers). Thus, $cp$ is a positive integer and $\leq p^{k}$. In
other words, $cp\in\left\{  1,2,\ldots,p^{k}\right\}  $. Thus, $m=cp\in
\left\{  1,2,\ldots,p^{k}\right\}  $.
\par
Now, forget that we fixed $m$. We thus have shown that $m\in\left\{
1,2,\ldots,p^{k}\right\}  $ for each $m\in M$. In other words, $M\subseteq
\left\{  1,2,\ldots,p^{k}\right\}  $.}. Hence,%
\begin{equation}
\left\vert \left\{  1,2,\ldots,p^{k}\right\}  \setminus M\right\vert
=\underbrace{\left\vert \left\{  1,2,\ldots,p^{k}\right\}  \right\vert
}_{=p^{k}}-\underbrace{\left\vert M\right\vert }_{=p^{k-1}}=p^{k}-p^{k-1}.
\label{sol.ent.phi.pk.0}%
\end{equation}


Next, we claim that%
\begin{equation}
\left\{  i\in\left\{  1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}
\subseteq\left\{  1,2,\ldots,p^{k}\right\}  \setminus M.
\label{sol.ent.phi.pk.1}%
\end{equation}


[\textit{Proof of (\ref{sol.ent.phi.pk.1}):} Let $a\in\left\{  i\in\left\{
1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}  $. In other words, $a$
is an element of $\left\{  1,2,\ldots,p^{k}\right\}  $ and satisfies $a\perp
p^{k}$.

Exercise \ref{exe.ent.prime.coprime-to-pk} shows that $a\perp p^{k}$ holds if
and only if $p\nmid a$. Hence, $p\nmid a$ (since $a\perp p^{k}$), and
therefore $a\notin M$\ \ \ \ \footnote{\textit{Proof.} Assume the contrary.
Thus, $a\in M=\left\{  1p,2p,\ldots,p^{k-1}p\right\}  $. In other words,
$a=cp$ for some $c\in\left\{  1,2,\ldots,p^{k-1}\right\}  $. Consider this
$c$. Clearly, $c$ is an integer; thus, from $a=cp=pc$, we obtain $p\mid a$.
But this contradicts $p\nmid a$. This contradiction shows that our assumption
was false, qed.}. Combining $a\in\left\{  1,2,\ldots,p^{k}\right\}  $ with
$a\notin M$, we obtain $a\in\left\{  1,2,\ldots,p^{k}\right\}  \setminus M$.

Now, forget that we fixed $a$. Thus, we have shown that $a\in\left\{
1,2,\ldots,p^{k}\right\}  \setminus M$ for each $a\in\left\{  i\in\left\{
1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}  $. In other words,
$\left\{  i\in\left\{  1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}
\subseteq\left\{  1,2,\ldots,p^{k}\right\}  \setminus M$. This proves
(\ref{sol.ent.phi.pk.1}).]

Furthermore, we have%
\begin{equation}
\left\{  1,2,\ldots,p^{k}\right\}  \setminus M\subseteq\left\{  i\in\left\{
1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}  .
\label{sol.ent.phi.pk.2}%
\end{equation}


[\textit{Proof of (\ref{sol.ent.phi.pk.2}):} Let $a\in\left\{  1,2,\ldots
,p^{k}\right\}  \setminus M$. In other words, $a\in\left\{  1,2,\ldots
,p^{k}\right\}  $ and $a\notin M$.

We have $p\nmid a$\ \ \ \ \footnote{\textit{Proof.} Assume the contrary. Thus,
$p\mid a$. In other words, $a=pc$ for some integer $c$. Consider this $c$. We
have $a=pc$, thus $c=a/p$ (since $p$ is nonzero). Also, $c=a/p>0$ (since $a$
and $p$ are positive). Hence, $c$ is a positive integer. Furthermore, from
$a\in\left\{  1,2,\ldots,p^{k}\right\}  $, we obtain $a\leq p^{k}$ and thus
$a/p\leq p^{k}/p=p^{k-1}$, so that $c=a/p\leq p^{k-1}$. Thus, $c\in\left\{
1,2,\ldots,p^{k-1}\right\}  $ (since $c$ is a positive integer) and therefore
$cp\in\left\{  1p,2p,\ldots,p^{k-1}p\right\}  =M$ (by the definition of $M$).
Now, $a=pc=cp\in M$; but this contradicts $a\notin M$. This contradiction
shows that our assumption was false, qed.}. But Exercise
\ref{exe.ent.prime.coprime-to-pk} shows that $a\perp p^{k}$ holds if and only
if $p\nmid a$. Hence, $a\perp p^{k}$ (since $p\nmid a$). Now, we know that $a$
is an $i\in\left\{  1,2,\ldots,p^{k}\right\}  $ satisfying $i\perp p^{k}$
(since $a\in\left\{  1,2,\ldots,p^{k}\right\}  $ and $a\perp p^{k}$). In other
words, $a\in\left\{  i\in\left\{  1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp
p^{k}\right\}  $.

Now, forget that we fixed $a$. Thus, we have shown that $a\in\left\{
i\in\left\{  1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}  $ for
each $a\in\left\{  1,2,\ldots,p^{k}\right\}  \setminus M$. In other words,
$\left\{  1,2,\ldots,p^{k}\right\}  \setminus M\subseteq\left\{  i\in\left\{
1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}  $. This proves
(\ref{sol.ent.phi.pk.2}).]

Combining (\ref{sol.ent.phi.pk.1}) with (\ref{sol.ent.phi.pk.2}), we obtain%
\[
\left\{  i\in\left\{  1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}
=\left\{  1,2,\ldots,p^{k}\right\}  \setminus M.
\]


Now, (\ref{eq.def.ent.phi.phi.1}) (applied to $n=p^{k}$) yields%
\begin{align*}
\phi\left(  p^{k}\right)   &  =\left\vert \underbrace{\left\{  i\in\left\{
1,2,\ldots,p^{k}\right\}  \ \mid\ i\perp p^{k}\right\}  }_{=\left\{
1,2,\ldots,p^{k}\right\}  \setminus M}\right\vert =\left\vert \left\{
1,2,\ldots,p^{k}\right\}  \setminus M\right\vert \\
&  =\underbrace{p^{k}}_{=pp^{k-1}}-p^{k-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.ent.phi.pk.0})}\right) \\
&  =pp^{k-1}-p^{k-1}=\left(  p-1\right)  p^{k-1}.
\end{align*}
This solves Exercise \ref{exe.ent.phi.pk}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.phi.d-phid}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.phi.d-phid}.]\textbf{(a)} If $I$ is any
set, and if we are given a statement $\mathcal{A}\left(  i\right)  $ for each
$i\in I$, then%
\begin{equation}
\left\{  i\in I\ \mid\ \text{we don't have }\mathcal{A}\left(  i\right)
\right\}  =I\setminus\left\{  i\in I\ \mid\ \mathcal{A}\left(  i\right)
\right\}  . \label{sol.ent.phi.d-phid.set-comp}%
\end{equation}
(This is one of the basic rules of sets and logic.)

Now,%
\begin{align*}
&  \left\vert \underbrace{\left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ \text{we don't have }i\perp n\right\}  }_{\substack{=\left\{
1,2,\ldots,n\right\}  \setminus\left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ i\perp n\right\}  \\\text{(by (\ref{sol.ent.phi.d-phid.set-comp}),
applied to }I=\left\{  1,2,\ldots,n\right\}  \text{ and }\mathcal{A}\left(
i\right)  =\left(  i\perp n\right)  \text{)}}}\right\vert \\
&  =\left\vert \left\{  1,2,\ldots,n\right\}  \setminus\left\{  i\in\left\{
1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}  \right\vert \\
&  =\underbrace{\left\vert \left\{  1,2,\ldots,n\right\}  \right\vert }%
_{=n}-\underbrace{\left\vert \left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ i\perp n\right\}  \right\vert }_{\substack{=\phi\left(  n\right)
\\\text{(by (\ref{eq.def.ent.phi.phi.1}))}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\{  i\in\left\{
1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}  \subseteq\left\{
1,2,\ldots,n\right\}  \right) \\
&  =n-\phi\left(  n\right)  .
\end{align*}
This solves Exercise \ref{exe.ent.phi.d-phid} \textbf{(a)}.

\textbf{(b)} Exercise \ref{exe.ent.phi.d-phid} \textbf{(a)} yields%
\[
n-\phi\left(  n\right)  =\left\vert \left\{  i\in\left\{  1,2,\ldots
,n\right\}  \ \mid\ \text{we don't have }i\perp n\right\}  \right\vert \geq0
\]
(since $\left\vert X\right\vert \geq0$ for any finite set $X$). This solves
Exercise \ref{exe.ent.phi.d-phid} \textbf{(b)}.

\textbf{(c)} We have $d\mid n$ and $n\neq0$ (since $n$ is positive). Thus,
Proposition \ref{prop.ent.div.1} \textbf{(a)} (applied to $a=d$ and $b=n$)
yields $\left\vert d\right\vert \leq\left\vert n\right\vert =n$ (since $n$ is
positive). But $\left\vert d\right\vert =d$ (since $d$ is positive). Hence,
$d=\left\vert d\right\vert \leq n$.

It is easy to see that%
\begin{align}
&  \left\{  i\in\left\{  1,2,\ldots,d\right\}  \ \mid\ \text{we don't have
}i\perp d\right\} \nonumber\\
&  \subseteq\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \text{we don't
have }i\perp n\right\}  . \label{sol.ent.phi.d-phid.b.subset}%
\end{align}


[\textit{Proof of (\ref{sol.ent.phi.d-phid.b.subset}):} Let $j\in\left\{
i\in\left\{  1,2,\ldots,d\right\}  \ \mid\ \text{we don't have }i\perp
d\right\}  $. Thus, $j$ is an $i\in\left\{  1,2,\ldots,d\right\}  $ such that
we don't have $i\perp d$. In other words, $j$ is an element of $\left\{
1,2,\ldots,d\right\}  $ and has the property that we don't have $j\perp d$.

Now, recall that $j$ is an element of $\left\{  1,2,\ldots,d\right\}  $.
Hence, $j\in\left\{  1,2,\ldots,d\right\}  \subseteq\left\{  1,2,\ldots
,n\right\}  $ (since $d\leq n$). In other words, $j$ is an element of
$\left\{  1,2,\ldots,n\right\}  $.

Also, we don't have $j\perp d$. Hence, we don't have $j\perp n$%
\ \ \ \ \footnote{\textit{Proof:} Assume the contrary. Thus, $j\perp n$. In
other words, $\gcd\left(  j,n\right)  =1$. But $j\mid j$ and $d\mid n$. Hence,
Exercise \ref{exe.ent.gcd.div} (applied to $j$, $d$, $j$ and $n$ instead of
$a_{1}$, $a_{2}$, $b_{1}$ and $b_{2}$) yields $\gcd\left(  j,d\right)
\mid\gcd\left(  j,n\right)  =1$. But $\gcd\left(  j,d\right)  $ is a
nonnegative integer (since the gcd of any list of integers is a nonnegative
integer). Hence, Exercise \ref{exe.ent.div.g|1} (applied to $g=\gcd\left(
j,d\right)  $) yields $\gcd\left(  j,d\right)  =1$ (since $\gcd\left(
j,d\right)  \mid1$). In other words, $j\perp d$. This contradicts the fact
that we don't have $j\perp d$. This contradiction shows that our assumption
was wrong, qed.}. Now, we know that $j$ is an element of $\left\{
1,2,\ldots,n\right\}  $ and has the property that we don't have $j\perp n$. In
other words, $j$ is an $i\in\left\{  1,2,\ldots,n\right\}  $ such that we
don't have $i\perp n$. In other words, $j\in\left\{  i\in\left\{
1,2,\ldots,n\right\}  \ \mid\ \text{we don't have }i\perp n\right\}  $.

Now, forget that we fixed $j$. We thus have proven that \newline$j\in\left\{
i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \text{we don't have }i\perp
n\right\}  $ for each \newline$j\in\left\{  i\in\left\{  1,2,\ldots,d\right\}
\ \mid\ \text{we don't have }i\perp d\right\}  $. In other words,
\begin{equation}
\left\{  i\in\left\{  1,2,\ldots,d\right\}  \ \mid\ \text{we don't have
}i\perp d\right\}  \subseteq\left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ \text{we don't have }i\perp n\right\}  .\nonumber
\end{equation}
This proves (\ref{sol.ent.phi.d-phid.b.subset}).]

Now, Exercise \ref{exe.ent.phi.d-phid} \textbf{(a)} (applied to $d$ instead of
$n$) yields%
\begin{align*}
d-\phi\left(  d\right)   &  =\left\vert \underbrace{\left\{  i\in\left\{
1,2,\ldots,d\right\}  \ \mid\ \text{we don't have }i\perp d\right\}
}_{\substack{\subseteq\left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ \text{we don't have }i\perp n\right\}  \\\text{(by
(\ref{sol.ent.phi.d-phid.b.subset}))}}}\right\vert \\
&  \leq\left\vert \left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \text{we
don't have }i\perp n\right\}  \right\vert =n-\phi\left(  n\right)
\end{align*}
(by Exercise \ref{exe.ent.phi.d-phid} \textbf{(a)}). Thus, Exercise
\ref{exe.ent.phi.d-phid} \textbf{(c)} is solved.

\textbf{(d)} In our solution to Exercise \ref{exe.ent.phi.d-phid} \textbf{(c)}
above, we have shown that $d\leq n$. Combining this with $d\neq n$, we obtain
$d<n$. Thus, $n>d$. Also, $d\geq1$ (since $d$ is a positive integer). Hence,
$n>d\geq1$.

Define two finite sets%
\begin{align*}
D  &  =\left\{  i\in\left\{  1,2,\ldots,d\right\}  \ \mid\ \text{we don't have
}i\perp d\right\}  \ \ \ \ \ \ \ \ \ \ \text{and}\\
N  &  =\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \text{we don't have
}i\perp n\right\}  .
\end{align*}


In our solution to Exercise \ref{exe.ent.phi.d-phid} \textbf{(c)} above, we
have proven (\ref{sol.ent.phi.d-phid.b.subset}). Thus,%
\begin{align*}
D  &  =\left\{  i\in\left\{  1,2,\ldots,d\right\}  \ \mid\ \text{we don't have
}i\perp d\right\} \\
&  \subseteq\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \text{we don't
have }i\perp n\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.ent.phi.d-phid.b.subset})}\right) \\
&  =N.
\end{align*}


Now, we have $n\in N$.

[\textit{Proof:} We have $n\in\left\{  1,2,\ldots,n\right\}  $ (since $n\geq
1$), but we don't have $n\perp n$\ \ \ \ \footnote{\textit{Proof.} Assume the
contrary. Thus, $n\perp n$. In other words, $\gcd\left(  n,n\right)  =1$. But
Proposition \ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $a=n$ and
$b=n$) yields $\gcd\left(  n,n\right)  =\left\vert n\right\vert $ (since
$n\mid n$). Hence, $\gcd\left(  n,n\right)  =\left\vert n\right\vert =n$
(since $n>1>0$). Therefore, $n=\gcd\left(  n,n\right)  =1$. This contradicts
$n>1$. This contradiction shows that our assumption was wrong, qed.}. Thus,
$n$ is an element of $\left\{  1,2,\ldots,n\right\}  $ such that we don't have
$n\perp n$. In other words, $n$ is an $i\in\left\{  1,2,\ldots,n\right\}  $
such that we don't have $i\perp n$. Hence,%
\[
n\in\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \text{we don't have
}i\perp n\right\}  .
\]
This rewrites as $n\in N$ (since $N=\left\{  i\in\left\{  1,2,\ldots
,n\right\}  \ \mid\ \text{we don't have }i\perp n\right\}  $). Qed.]

Now, we claim that $D\neq N$.

[\textit{Proof:} Assume the contrary. Thus, $D=N$. Hence, $N=D$. Now,%
\[
n\in N=D=\left\{  i\in\left\{  1,2,\ldots,d\right\}  \ \mid\ \text{we don't
have }i\perp d\right\}  \subseteq\left\{  1,2,\ldots,d\right\}  ,
\]
so that $n\leq d$. This contradicts $d<n$. This contradiction shows that our
assumption was false. Hence, $D\neq N$ is proven.]

Now, $D$ is a subset of $N$ (since $D\subseteq N$), and hence is a proper
subset of $N$ (since $D\neq N$). Hence, $\left\vert D\right\vert <\left\vert
N\right\vert $ (because if $X$ is a proper subset of a finite set $Y$, then
$\left\vert X\right\vert <\left\vert Y\right\vert $). But Exercise
\ref{exe.ent.phi.d-phid} \textbf{(a)} (applied to $d$ instead of $n$) yields%
\begin{align*}
d-\phi\left(  d\right)   &  =\left\vert \underbrace{\left\{  i\in\left\{
1,2,\ldots,d\right\}  \ \mid\ \text{we don't have }i\perp d\right\}  }%
_{=D}\right\vert =\left\vert D\right\vert \\
&  <\left\vert \underbrace{N}_{=\left\{  i\in\left\{  1,2,\ldots,n\right\}
\ \mid\ \text{we don't have }i\perp n\right\}  }\right\vert \\
&  =\left\vert \left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ \text{we
don't have }i\perp n\right\}  \right\vert =n-\phi\left(  n\right)
\end{align*}
(by Exercise \ref{exe.ent.phi.d-phid} \textbf{(a)}). Thus, Exercise
\ref{exe.ent.phi.d-phid} \textbf{(d)} is solved.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.phi.even}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.phi.even}.]The following solution is mostly
a calque of the proof of Proposition \ref{prop.ent.phi.ghosts} we gave above,
but using subtraction instead of division and using the relation
\textquotedblleft coprime\textquotedblright\ instead of \textquotedblleft
divides\textquotedblright.

Clearly, $n$ is a positive integer (since $n>2$), so that $\phi\left(
n\right)  $ is well-defined.

Let $C=\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}
$. An element $c$ of $C$ is said to be

\begin{itemize}
\item \textit{small} if $c<n-c$;

\item \textit{medium} if $c=n-c$;

\item \textit{large} if $c>n-c$.
\end{itemize}

Now, it is easy to see that the set $C$ has no medium
elements\footnote{\textit{Proof.} Let $c$ be a medium element of $C$. We shall
derive a contradiction.
\par
We have $c\in C=\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp
n\right\}  $. In other words, $c$ is an element of $\left\{  1,2,\ldots
,n\right\}  $ and satisfies $c\perp n$. Clearly, the integer $c$ is positive
(since $c\in\left\{  1,2,\ldots,n\right\}  $) and we have $\gcd\left(
c,n\right)  =1$ (since $c\perp n$).
\par
Furthermore, $c$ is medium; in other words, $c=n-c$. Thus, $2c=n$, so that
$n=2c=c\cdot2$. Hence, $c\mid n$. Thus, Proposition \ref{prop.ent.gcd.props1}
\textbf{(i)} (applied to $a=c$ and $b=n$) yields $\gcd\left(  c,n\right)
=\left\vert c\right\vert =c$ (since $c$ is positive). But from $2c=n$, we also
obtain $c=n/2>2/2$ (since $n>2$). Thus, $\gcd\left(  c,n\right)  =c>2/2=1$.
This contradicts $\gcd\left(  c,n\right)  =1$.
\par
Forget that we fixed $c$. We thus have obtained a contradiction for each
medium element $c$ of $C$. Thus, there are no such elements. In other words,
the set $C$ has no medium elements.}. In other words,%
\[
\left\vert \left\{  \text{medium elements of }C\right\}  \right\vert =0.
\]


Furthermore, if $c\in C$, then $n-c\in C$\ \ \ \ \footnote{\textit{Proof.} Let
$c\in C$.
\par
We have $c\in C=\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp
n\right\}  $. In other words, $c$ is an element of $\left\{  1,2,\ldots
,n\right\}  $ and satisfies $c\perp n$. From $c\perp n$, we obtain $n\perp c$
(by Proposition \ref{prop.ent.coprime.perp-symm}) and thus $\gcd\left(
n,c\right)  =1$.
\par
But $n\mid n$. Hence, Proposition \ref{prop.ent.gcd.props1} \textbf{(i)}
(applied to $a=n$ and $b=n$) yields $\gcd\left(  n,n\right)  =\left\vert
n\right\vert =n$ (since $n$ is positive). Thus, $\gcd\left(  n,n\right)
=n>2>1$, so that $\gcd\left(  n,n\right)  \neq1=\gcd\left(  n,c\right)  $ and
therefore $n\neq c$. In other words, $c\neq n$.
\par
Combining $c\in\left\{  1,2,\ldots,n\right\}  $ with $c\neq n$, we find
$c\in\left\{  1,2,\ldots,n\right\}  \setminus\left\{  n\right\}  =\left\{
1,2,\ldots,n-1\right\}  $. Hence, $n-c\in\left\{  1,2,\ldots,n-1\right\}
\subseteq\left\{  1,2,\ldots,n\right\}  $.
\par
We have $\underbrace{n}_{\equiv0\operatorname{mod}n}-c\equiv
-c\operatorname{mod}n$. Hence, Proposition \ref{prop.ent.gcd.props1}
\textbf{(d)} (applied to $n$, $n-c$ and $-c$ instead of $a$, $b$ and $c$)
yields
\begin{align*}
\gcd\left(  n,n-c\right)   &  =\gcd\left(  n,-c\right) \\
&  =\gcd\left(  n,c\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.ent.gcd.props1} \textbf{(h)} (applied to }a=n\text{ and }%
b=c\text{)}\right) \\
&  =1.
\end{align*}
In other words, $n\perp n-c$. In other words, $n-c\perp n$ (by Proposition
\ref{prop.ent.coprime.perp-symm}).
\par
Combining this with $n-c\in\left\{  1,2,\ldots,n\right\}  $, we conclude that
$n-c$ is an $i\in\left\{  1,2,\ldots,n\right\}  $ satisfying $i\perp n$. In
other words, $n-c\in\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp
n\right\}  =C$. Qed.}. This allows us to define a map%
\begin{align*}
F:C  &  \rightarrow C,\\
c  &  \mapsto n-c.
\end{align*}
This map $F$ has the property that $F\circ F=\operatorname*{id}$, because each
$c\in C$ satisfies%
\begin{align*}
\left(  F\circ F\right)  \left(  c\right)   &  =F\left(  \underbrace{F\left(
c\right)  }_{\substack{=n-c\\\text{(by the definition of }F\text{)}}}\right)
=F\left(  n-c\right) \\
&  =n-\left(  n-c\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition
of }F\right) \\
&  =c=\operatorname*{id}\left(  c\right)  .
\end{align*}
Hence, the map $F$ is inverse to itself. Thus, the map $F$ is invertible,
i.e., is a bijection.

It is easy to see that if $c$ is a small element of $C$, then $F\left(
c\right)  $ is a large element of $C$\ \ \ \ \footnote{\textit{Proof.} Let $c$
be a small element of $C$. Thus, $c<n-c$. Hence, $n-c>c=n-\left(  n-c\right)
$. In view of $F\left(  c\right)  =n-c$, this rewrites as $F\left(  c\right)
>n-F\left(  c\right)  $. In other words, $F\left(  c\right)  $ is a large
element of $C$ (by the definition of \textquotedblleft large\textquotedblright%
). Qed.}. Hence, the map%
\begin{align*}
F^{+}:\left\{  \text{small elements of }C\right\}   &  \rightarrow\left\{
\text{large elements of }C\right\}  ,\\
c  &  \mapsto F\left(  c\right)
\end{align*}
is well-defined. Similarly, the map%
\begin{align*}
F^{-}:\left\{  \text{large elements of }C\right\}   &  \rightarrow\left\{
\text{small elements of }C\right\}  ,\\
c  &  \mapsto F\left(  c\right)
\end{align*}
is well-defined. These two maps $F^{+}$ and $F^{-}$ are both restrictions of
the map $F$, and thus are mutually inverse (since the map $F$ is inverse to
itself). Hence, the map $F^{+}$ is invertible, i.e., is a bijection. Thus, we
have found a bijection from $\left\{  \text{small elements of }C\right\}  $ to
$\left\{  \text{large elements of }C\right\}  $ (namely, $F^{+}$). Therefore,%
\[
\left\vert \left\{  \text{small elements of }C\right\}  \right\vert
=\left\vert \left\{  \text{large elements of }C\right\}  \right\vert .
\]


Now, (\ref{eq.def.ent.phi.phi.1}) yields%
\begin{align*}
\phi\left(  n\right)   &  =\left\vert \underbrace{\left\{  i\in\left\{
1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}  }_{=C}\right\vert =\left\vert
C\right\vert \\
&  =\underbrace{\left\vert \left\{  \text{small elements of }C\right\}
\right\vert }_{=\left\vert \left\{  \text{large elements of }C\right\}
\right\vert }+\underbrace{\left\vert \left\{  \text{medium elements of
}C\right\}  \right\vert }_{=0}+\left\vert \left\{  \text{large elements of
}C\right\}  \right\vert \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each element of }C\text{ is either small or medium or large}\\
\text{(and there is no overlap between these three classes of elements)}%
\end{array}
\right) \\
&  =\left\vert \left\{  \text{large elements of }C\right\}  \right\vert
+\left\vert \left\{  \text{large elements of }C\right\}  \right\vert \\
&  =2\cdot\left\vert \left\{  \text{large elements of }C\right\}  \right\vert
.
\end{align*}
Thus, $2\mid\phi\left(  n\right)  $ (since $\left\vert \left\{  \text{large
elements of }C\right\}  \right\vert $ is an integer). In other words,
$\phi\left(  n\right)  $ is even. This solves Exercise \ref{exe.ent.phi.even}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.phi.gauss}}

\begin{fineprint}
Our below solution to Exercise \ref{exe.ent.phi.gauss} imitates the proof of
Proposition \ref{prop.ent.1+2+...+n}.

\begin{proof}
[Solution to Exercise \ref{exe.ent.phi.gauss}.]We do not have $n\perp
n$\ \ \ \ \footnote{\textit{Proof.} Assume the contrary. Thus, $n\perp n$. In
other words, $\gcd\left(  n,n\right)  =1$. But Proposition
\ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $a=n$ and $b=n$) yields
$\gcd\left(  n,n\right)  =\left\vert n\right\vert $ (since $n\mid n$). Hence,
$\gcd\left(  n,n\right)  =\left\vert n\right\vert =n$ (since $n>1>0$).
Therefore, $n=\gcd\left(  n,n\right)  =1$. This contradicts $n>1$. This
contradiction shows that our assumption was wrong, qed.}. Hence,%
\begin{equation}
\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}
=\left\{  i\in\left\{  1,2,\ldots,n-1\right\}  \ \mid\ i\perp n\right\}
\label{sol.ent.phi.gauss.1}%
\end{equation}
\footnote{\textit{Proof of (\ref{sol.ent.phi.gauss.1}):} Let $j\in\left\{
i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}  $. Thus, $j$ is
an element $i$ of $\left\{  1,2,\ldots,n\right\}  $ satisfying $i\perp n$. In
other words, $j$ is an element of $\left\{  1,2,\ldots,n\right\}  $ and
satisfies $j\perp n$. We have $j\perp n$. If we had $j=n$, then this would
rewrite as $n\perp n$, which would contradict the fact that we do not have
$n\perp n$. Thus, we cannot have $j=n$. In other words, we have $j\neq n$.
Combining $j\in\left\{  1,2,\ldots,n\right\}  $ with $j\neq n$, we obtain
$j\in\left\{  1,2,\ldots,n\right\}  \setminus\left\{  n\right\}  =\left\{
1,2,\ldots,n-1\right\}  $. Hence, $j$ is an element of $\left\{
1,2,\ldots,n-1\right\}  $ and satisfies $j\perp n$. In other words, $j$ is an
element $i$ of $\left\{  1,2,\ldots,n-1\right\}  $ satisfying $i\perp n$. In
other words, $j\in\left\{  i\in\left\{  1,2,\ldots,n-1\right\}  \ \mid\ i\perp
n\right\}  $.
\par
Now, forget that we fixed $j$. We thus have proven that $j\in\left\{
i\in\left\{  1,2,\ldots,n-1\right\}  \ \mid\ i\perp n\right\}  $ for each
$j\in\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}  $.
In other words,%
\[
\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}
\subseteq\left\{  i\in\left\{  1,2,\ldots,n-1\right\}  \ \mid\ i\perp
n\right\}  .
\]
Combining this with%
\[
\left\{  i\in\underbrace{\left\{  1,2,\ldots,n-1\right\}  }_{\subseteq\left\{
1,2,\ldots,n\right\}  }\ \mid\ i\perp n\right\}  \subseteq\left\{
i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp n\right\}  ,
\]
we obtain $\left\{  i\in\left\{  1,2,\ldots,n\right\}  \ \mid\ i\perp
n\right\}  =\left\{  i\in\left\{  1,2,\ldots,n-1\right\}  \ \mid\ i\perp
n\right\}  $. This proves (\ref{sol.ent.phi.gauss.1}).}. Now,
(\ref{eq.def.ent.phi.phi.1}) yields%
\begin{align}
\phi\left(  n\right)   &  =\left\vert \left\{  i\in\left\{  1,2,\ldots
,n\right\}  \ \mid\ i\perp n\right\}  \right\vert \nonumber\\
&  =\left\vert \left\{  i\in\left\{  1,2,\ldots,n-1\right\}  \ \mid\ i\perp
n\right\}  \right\vert \label{sol.ent.phi.gauss.phin=}%
\end{align}
(by (\ref{sol.ent.phi.gauss.1})).

On the other hand, for each $k\in\mathbb{Z}$, we have the logical equivalence%
\begin{equation}
\left(  n-k\perp n\right)  \ \Longleftrightarrow\ \left(  k\perp n\right)
\label{sol.ent.phi.gauss.2}%
\end{equation}
(because Exercise \ref{exe.ent.coprime.b-a} (applied to $a=k$ and $b=n$) shows
that $n-k\perp n$ holds if and only if $k\perp n$). Now,
\begin{align*}
2\cdot\sum_{\substack{i\in\left\{  1,2,\ldots,n\right\}  ;\\i\perp n}}i  &
=2\cdot\underbrace{\sum_{\substack{k\in\left\{  1,2,\ldots,n\right\}
;\\k\perp n}}}_{\substack{=\sum_{k\in\left\{  i\in\left\{  1,2,\ldots
,n\right\}  \ \mid\ i\perp n\right\}  }\\=\sum_{k\in\left\{  i\in\left\{
1,2,\ldots,n-1\right\}  \ \mid\ i\perp n\right\}  }\\\text{(by
(\ref{sol.ent.phi.gauss.1}))}}}k\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have renamed the}\\
\text{summation index }i\text{ as }k
\end{array}
\right) \\
&  =2\cdot\underbrace{\sum_{k\in\left\{  i\in\left\{  1,2,\ldots,n-1\right\}
\ \mid\ i\perp n\right\}  }}_{=\sum_{\substack{k\in\left\{  1,2,\ldots
,n-1\right\}  ;\\k\perp n}}}k=2\cdot\sum_{\substack{k\in\left\{
1,2,\ldots,n-1\right\}  ;\\k\perp n}}k\\
&  =\sum_{\substack{k\in\left\{  1,2,\ldots,n-1\right\}  ;\\k\perp n}%
}k+\sum_{\substack{k\in\left\{  1,2,\ldots,n-1\right\}  ;\\k\perp n}}k\\
&  =\sum_{\substack{k\in\left\{  1,2,\ldots,n-1\right\}  ;\\k\perp
n}}k+\underbrace{\sum_{\substack{k\in\left\{  1,2,\ldots,n-1\right\}
;\\n-k\perp n}}}_{\substack{=\sum_{\substack{k\in\left\{  1,2,\ldots
,n-1\right\}  ;\\k\perp n}}\\\text{(by the equivalence
(\ref{sol.ent.phi.gauss.2}))}}}\left(  n-k\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }n-k\text{ for
}k\text{ in the second sum}\right) \\
&  =\sum_{\substack{k\in\left\{  1,2,\ldots,n-1\right\}  ;\\k\perp n}%
}k+\sum_{\substack{k\in\left\{  1,2,\ldots,n-1\right\}  ;\\k\perp n}}\left(
n-k\right)  =\sum_{\substack{k\in\left\{  1,2,\ldots,n-1\right\}  ;\\k\perp
n}}\underbrace{\left(  k+\left(  n-k\right)  \right)  }_{=n}\\
&  =\sum_{\substack{k\in\left\{  1,2,\ldots,n-1\right\}  ;\\k\perp n}%
}n=\sum_{\substack{i\in\left\{  1,2,\ldots,n-1\right\}  ;\\i\perp
n}}n\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have renamed the}\\
\text{summation index }k\text{ as }i
\end{array}
\right) \\
&  =\underbrace{\left\vert \left\{  i\in\left\{  1,2,\ldots,n-1\right\}
\ \mid\ i\perp n\right\}  \right\vert }_{\substack{=\phi\left(  n\right)
\\\text{(by (\ref{sol.ent.phi.gauss.phin=}))}}}\cdot n=\phi\left(  n\right)
\cdot n=n\phi\left(  n\right)  .
\end{align*}
Dividing this equality by $2$, we obtain%
\[
\sum_{\substack{i\in\left\{  1,2,\ldots,n\right\}  ;\\i\perp n}}i=n\phi\left(
n\right)  /2.
\]
This solves Exercise \ref{exe.ent.phi.gauss}.

[\textit{Remark:} Alternatively, instead of doubling the sum we wanted to
compute, we could have paired its addends up with each other: every $i$ gets
paired with the respective $n-i$. But this is slightly messy, since $\dfrac
{n}{2}$ can happen to be a term of the sum (this happens when $n=2$), which
necessitates a separate argument.]
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.fermat.uv}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.fermat.uv}.]From $u\equiv
v\operatorname{mod}p-1$, we obtain $v\equiv u\operatorname{mod}p-1$. Likewise,
the congruence $a^{u}\equiv a^{v}\operatorname{mod}p$, which we need to prove,
is clearly equivalent to $a^{v}\equiv a^{u}\operatorname{mod}p$. Hence, the
numbers $u$ and $v$ play symmetric roles in Exercise \ref{exe.ent.fermat.uv}.
Thus, we can WLOG assume that $u\leq v$ (since otherwise, we can simply swap
$u$ with $v$). Assume this.

We have $v\equiv u\operatorname{mod}p-1$. In other words, $p-1\mid v-u$. Thus,
there exists an integer $c$ such that $v-u=\left(  p-1\right)  c$. Consider
this $c$. Thus, $\left(  p-1\right)  c=v-\underbrace{u}_{\leq v}\geq v-v=0$.
But $p>1$ (since $p$ is a prime), thus $p-1>0$. Hence, we can divide the
inequality $\left(  p-1\right)  c\geq0$ by $p-1$, and obtain $c\geq0$. Hence,
$c\in\mathbb{N}$.

Now, Theorem \ref{thm.ent.fermat} \textbf{(a)} yields $a^{p-1}\equiv
1\operatorname{mod}p$. We can take this congruence to the $c$-th power (since
$c\in\mathbb{N}$), and obtain $\left(  a^{p-1}\right)  ^{c}\equiv
1^{c}=1\operatorname{mod}p$. But $\left(  a^{p-1}\right)  ^{c}=a^{\left(
p-1\right)  c}=a^{v-u}$ (since $\left(  p-1\right)  c=v-u$). Hence,
$a^{v-u}=\left(  a^{p-1}\right)  ^{c}\equiv1\operatorname{mod}p$. Multiplying
this congruence by the obvious congruence $a^{u}\equiv a^{u}\operatorname{mod}%
p$, we obtain $a^{v-u}a^{u}\equiv1a^{u}=a^{u}\operatorname{mod}p$. Hence,
$a^{u}\equiv a^{v-u}a^{u}=a^{\left(  v-u\right)  +u}=a^{v}\operatorname{mod}%
p$. This solves Exercise \ref{exe.ent.fermat.uv}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.wilson.gauss}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.wilson.gauss}.]Theorem \ref{thm.ent.wilson}
yields
\[
\left(  p-1\right)  !\equiv-1\equiv p-1\operatorname{mod}p
\]
(since $p-1\equiv-1\operatorname{mod}p$). In other words, $p\mid\left(
p-1\right)  !-\left(  p-1\right)  $.

On the other hand, $p>1$ (since $p$ is a prime). Now, the definition of
$\left(  p-1\right)  !$ yields%
\[
\left(  p-1\right)  !=1\cdot2\cdot\cdots\cdot\left(  p-1\right)  =\left(
1\cdot2\cdot\cdots\cdot\left(  p-2\right)  \right)  \cdot\left(  p-1\right)
.
\]
Subtracting $p-1$ from both sides of this equality, we obtain%
\begin{align*}
\left(  p-1\right)  !-\left(  p-1\right)   &  =\left(  1\cdot2\cdot\cdots
\cdot\left(  p-2\right)  \right)  \cdot\left(  p-1\right)  -\left(  p-1\right)
\\
&  =\left(  1\cdot2\cdot\cdots\cdot\left(  p-2\right)  -1\right)  \cdot\left(
p-1\right) \\
&  =\left(  p-1\right)  \cdot\left(  1\cdot2\cdot\cdots\cdot\left(
p-2\right)  -1\right)  .
\end{align*}
Hence, $p-1\mid\left(  p-1\right)  !-\left(  p-1\right)  $ (since
$1\cdot2\cdot\cdots\cdot\left(  p-2\right)  -1$ is an integer).

Now, it is easy to see that $p-1\perp p$\ \ \ \ \footnote{\textit{Proof.}
Proposition \ref{prop.ent.gcd.props1} \textbf{(c)} (applied to $a=p-1$, $b=1$
and $u=1$) yields $\gcd\left(  p-1,1\left(  p-1\right)  +1\right)
=\gcd\left(  p-1,1\right)  $. But Proposition \ref{prop.ent.gcd.props1}
\textbf{(f)} (applied to $a=p-1$ and $b=1$) yields $\gcd\left(  p-1,1\right)
\mid p-1$ and $\gcd\left(  p-1,1\right)  \mid1$. Since $\gcd\left(
p-1,1\right)  $ is a nonnegative integer satisfying $\gcd\left(  p-1,1\right)
\mid1$, we obtain $\gcd\left(  p-1,1\right)  =1$ (by Exercise
\ref{exe.ent.div.g|1}, applied to $g=\gcd\left(  p-1,1\right)  $). Hence,
\[
\gcd\left(  p-1,\underbrace{p}_{=1\left(  p-1\right)  +1}\right)  =\gcd\left(
p-1,1\left(  p-1\right)  +1\right)  =\gcd\left(  p-1,1\right)  =1.
\]
In other words, $p-1\perp p$.}. Furthermore, recall that $p-1\mid\left(
p-1\right)  !-\left(  p-1\right)  $ and $p\mid\left(  p-1\right)  !-\left(
p-1\right)  $. Hence, Theorem \ref{thm.ent.coprime.combine} (applied to
$a=p-1$, $b=p$ and $c=\left(  p-1\right)  !-\left(  p-1\right)  $) yields%
\begin{equation}
\left(  p-1\right)  p\mid\left(  p-1\right)  !-\left(  p-1\right)  .
\label{sol.ent.wilson.gauss.at}%
\end{equation}


But Proposition \ref{prop.ent.1+2+...+n} (applied to $n=p-1$) yields%
\[
1+2+\cdots+\left(  p-1\right)  =\dfrac{\left(  p-1\right)  \left(  \left(
p-1\right)  +1\right)  }{2}=\dfrac{\left(  p-1\right)  p}{2}.
\]
Hence, $\left(  p-1\right)  p=\left(  1+2+\cdots+\left(  p-1\right)  \right)
\cdot2$, so that
\[
1+2+\cdots+\left(  p-1\right)  \mid\left(  p-1\right)  p\mid\left(
p-1\right)  !-\left(  p-1\right)
\]
(by (\ref{sol.ent.wilson.gauss.at})). In other words, $\left(  p-1\right)
!\equiv p-1\operatorname{mod}1+2+\cdots+\left(  p-1\right)  $. This solves
Exercise \ref{exe.ent.wilson.gauss}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.wilson.-1qr}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.wilson.-1qr}.]From $p=2k+1$, we obtain
$p-1=2k$. But Theorem \ref{thm.ent.wilson} yields $\left(  p-1\right)
!\equiv-1\operatorname{mod}p$. In view of $p-1=2k$, this rewrites as $\left(
2k\right)  !\equiv-1\operatorname{mod}p$.

But the definition of $\left(  2k\right)  !$ yields%
\begin{equation}
\left(  2k\right)  !=1\cdot2\cdot\cdots\cdot\left(  2k\right)  =\prod
_{j=1}^{2k}j=\left(  \prod_{j=1}^{k}j\right)  \cdot\left(  \prod_{j=k+1}%
^{2k}j\right)  \label{sol.ent.wilson.-1qr.1}%
\end{equation}
(here, we have split the product at $j=k$, because $0\leq k\leq2k$). But
$\prod_{j=1}^{k}j=1\cdot2\cdot\cdots\cdot k=k!$ (by the definition of $k!$).
Furthermore
\begin{align*}
\prod_{j=k+1}^{2k}j  &  =\prod_{j=p-2k}^{p-\left(  k+1\right)  }\left(
p-j\right)  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }p-j\\
\text{for }j\text{ in the product}%
\end{array}
\right) \\
&  =\prod_{j=1}^{k}\underbrace{\left(  p-j\right)  }_{\equiv
-j\operatorname{mod}p}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }\underbrace{p}_{=2k+1}-2k=\left(  2k+1\right)  -2k=1\\
\text{and }\underbrace{p}_{=2k+1}-\left(  k+1\right)  =\left(  2k+1\right)
-\left(  k+1\right)  =k
\end{array}
\right) \\
&  \equiv\prod_{j=1}^{k}\left(  -j\right)  \operatorname{mod}p.
\end{align*}
(Here, the last congruence sign is a consequence of
(\ref{eq.exe.ent.mod.k-sum.b})\footnote{In more detail: We have $p-s\equiv
-s\operatorname{mod}p$ for each $s\in\left\{  1,2,\ldots,k\right\}  $. Hence,
(\ref{eq.exe.ent.mod.k-sum.b}) (applied to $n=p$, $S=\left\{  1,2,\ldots
,k\right\}  $, $a_{s}=p-s$ and $b_{s}=-s$) yields $\prod_{s\in\left\{
1,2,\ldots,k\right\}  }\left(  p-s\right)  \equiv\prod_{s\in\left\{
1,2,\ldots,k\right\}  }\left(  -s\right)  \operatorname{mod}p$. If we rename
the index $s$ (of the product sign \textquotedblleft$\prod_{s\in\left\{
1,2,\ldots,k\right\}  }$\textquotedblright) as $j$ on both sides of this
congruence, then we obtain $\prod_{j\in\left\{  1,2,\ldots,k\right\}  }\left(
p-j\right)  \equiv\prod_{j\in\left\{  1,2,\ldots,k\right\}  }\left(
-j\right)  \operatorname{mod}p$. This rewrites as $\prod_{j=1}^{k}\left(
p-j\right)  \equiv\prod_{j=1}^{k}\left(  -j\right)  \operatorname{mod}p$
(since the product sign $\prod_{j\in\left\{  1,2,\ldots,k\right\}  }$ is
equivalent to the product sign $\prod_{j=1}^{k}$).}.) Thus,%
\[
\prod_{j=k+1}^{2k}j\equiv\prod_{j=1}^{k}\left(  -j\right)  =\left(  -1\right)
^{k}\underbrace{\prod_{j=1}^{k}j}_{=k!}=\left(  -1\right)  ^{k}\cdot
k!\operatorname{mod}p.
\]
Hence, (\ref{sol.ent.wilson.-1qr.1}) becomes%
\[
\left(  2k\right)  !=\underbrace{\left(  \prod_{j=1}^{k}j\right)  }_{=k!}%
\cdot\underbrace{\left(  \prod_{j=k+1}^{2k}j\right)  }_{\equiv\left(
-1\right)  ^{k}\cdot k!\operatorname{mod}p}\equiv k!\cdot\left(  -1\right)
^{k}\cdot k!=k!^{2}\cdot\left(  -1\right)  ^{k}\operatorname{mod}p.
\]
Therefore,%
\[
k!^{2}\cdot\left(  -1\right)  ^{k}\equiv\left(  2k\right)  !\equiv
-1\operatorname{mod}p.
\]
Multiplying this congruence by the obvious congruence $\left(  -1\right)
^{k}\equiv\left(  -1\right)  ^{k}\operatorname{mod}p$, we find%
\[
k!^{2}\cdot\left(  -1\right)  ^{k}\cdot\left(  -1\right)  ^{k}\equiv\left(
-1\right)  \cdot\left(  -1\right)  ^{k}=-\left(  -1\right)  ^{k}%
\operatorname{mod}p.
\]
In view of%
\[
k!^{2}\cdot\underbrace{\left(  -1\right)  ^{k}\cdot\left(  -1\right)  ^{k}%
}_{\substack{=\left(  -1\right)  ^{k+k}=1\\\text{(since }k+k=2k\text{ is
even)}}}=k!^{2},
\]
this rewrites as $k!^{2}\equiv-\left(  -1\right)  ^{k}\operatorname{mod}p$.
This solves Exercise \ref{exe.ent.wilson.-1qr}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.phi.multk.1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.phi.multk.1}.]We assumed that the integers
$n_{1},n_{2},\ldots,n_{k}$ are mutually coprime. In other words, we have%
\begin{equation}
n_{i}\perp n_{j}\text{ for all }i,j\in\left\{  1,2,\ldots,k\right\}  \text{
satisfying }i\neq j. \label{pf.cor.ent.phi.multk.1.copr}%
\end{equation}


We claim that%
\begin{equation}
\phi\left(  n_{1}n_{2}\cdots n_{i}\right)  =\phi\left(  n_{1}\right)
\cdot\phi\left(  n_{2}\right)  \cdot\cdots\cdot\phi\left(  n_{i}\right)
\label{pf.cor.ent.phi.multk.1.goal}%
\end{equation}
for each $i\in\left\{  0,1,\ldots,k\right\}  $.

[\textit{Proof of (\ref{pf.cor.ent.phi.multk.1.goal}):} We shall prove
(\ref{pf.cor.ent.phi.multk.1.goal}) by induction on $i$:

\textit{Induction base:} It is easy to see that $\phi\left(  1\right)
=1$\ \ \ \ \footnote{\textit{Proof.} We have $1\mid1$. Hence, Proposition
\ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $1$ and $1$ instead of $a$
and $b$) yields $\gcd\left(  1,1\right)  =\left\vert 1\right\vert =1$. Hence,
$1\perp1$. Thus, $1$ is an $i\in\left\{  1,2,\ldots,1\right\}  $ satisfying
$i\perp1$. In other words, $1$ is an element of the set $\left\{  i\in\left\{
1,2,\ldots,1\right\}  \ \mid\ i\perp1\right\}  $. Since $1$ is the
\textbf{only} element of this set (because every element of $\left\{
i\in\left\{  1,2,\ldots,1\right\}  \ \mid\ i\perp1\right\}  $ must belong to
the set $\left\{  1,2,\ldots,1\right\}  =\left\{  1\right\}  $ and thus must
equal to $1$), we can thus conclude that $\left\{  i\in\left\{  1,2,\ldots
,1\right\}  \ \mid\ i\perp1\right\}  =\left\{  1\right\}  $.
\par
But the equality (\ref{eq.def.ent.phi.phi.1}) (applied to $n=1$) yields%
\[
\phi\left(  1\right)  =\left\vert \underbrace{\left\{  i\in\left\{
1,2,\ldots,1\right\}  \ \mid\ i\perp1\right\}  }_{=\left\{  1\right\}
}\right\vert =\left\vert \left\{  1\right\}  \right\vert =1.
\]
}. But applying the map $\phi$ to the equality $n_{1}n_{2}\cdots n_{0}=\left(
\text{empty product}\right)  =1$, we obtain
\[
\phi\left(  n_{1}n_{2}\cdots n_{0}\right)  =\phi\left(  1\right)  =1.
\]
Comparing this with $\phi\left(  n_{1}\right)  \cdot\phi\left(  n_{2}\right)
\cdot\cdots\cdot\phi\left(  n_{0}\right)  =\left(  \text{empty product}%
\right)  =1$, we obtain $\phi\left(  n_{1}n_{2}\cdots n_{0}\right)
=\phi\left(  n_{1}\right)  \cdot\phi\left(  n_{2}\right)  \cdot\cdots\cdot
\phi\left(  n_{0}\right)  $. In other words,
(\ref{pf.cor.ent.phi.multk.1.goal}) holds for $i=0$. This completes the
induction base.

\textit{Induction step:} Let $j\in\left\{  0,1,\ldots,k\right\}  $ be
positive. Assume that (\ref{pf.cor.ent.phi.multk.1.goal}) holds for $i=j-1$.
We must prove that (\ref{pf.cor.ent.phi.multk.1.goal}) holds for $i=j$.

For each $i\in\left\{  1,2,\ldots,j-1\right\}  $, we have $i\leq j-1<j$ and
thus $i\neq j$ and therefore $n_{i}\perp n_{j}$ (by
(\ref{pf.cor.ent.phi.multk.1.copr})). Hence, Exercise
\ref{exe.ent.coprime.ab-to-ck} (applied to $j-1$, $n_{j}$ and $\left(
n_{1},n_{2},\ldots,n_{j-1}\right)  $ instead of $k$, $c$ and $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $) yields $n_{1}n_{2}\cdots n_{j-1}\perp
n_{j}$. In other words, the two positive integers $n_{1}n_{2}\cdots n_{j-1}$
and $n_{j}$ are coprime. Therefore, Theorem \ref{thm.ent.phi.mult} yields%
\[
\phi\left(  \left(  n_{1}n_{2}\cdots n_{j-1}\right)  n_{j}\right)
=\phi\left(  n_{1}n_{2}\cdots n_{j-1}\right)  \cdot\phi\left(  n_{j}\right)
.
\]


But we have assumed that (\ref{pf.cor.ent.phi.multk.1.goal}) holds for
$i=j-1$. In other words, we have%
\begin{equation}
\phi\left(  n_{1}n_{2}\cdots n_{j-1}\right)  =\phi\left(  n_{1}\right)
\cdot\phi\left(  n_{2}\right)  \cdot\cdots\cdot\phi\left(  n_{j-1}\right)  .
\label{pf.cor.ent.phi.multk.1.goal.pf.IH}%
\end{equation}
Now,%
\begin{align*}
\phi\left(  \underbrace{n_{1}n_{2}\cdots n_{j}}_{=\left(  n_{1}n_{2}\cdots
n_{j-1}\right)  n_{j}}\right)   &  =\phi\left(  \left(  n_{1}n_{2}\cdots
n_{j-1}\right)  n_{j}\right)  =\underbrace{\phi\left(  n_{1}n_{2}\cdots
n_{j-1}\right)  }_{=\phi\left(  n_{1}\right)  \cdot\phi\left(  n_{2}\right)
\cdot\cdots\cdot\phi\left(  n_{j-1}\right)  }\cdot\phi\left(  n_{j}\right) \\
&  =\left(  \phi\left(  n_{1}\right)  \cdot\phi\left(  n_{2}\right)
\cdot\cdots\cdot\phi\left(  n_{j-1}\right)  \right)  \cdot\phi\left(
n_{j}\right) \\
&  =\phi\left(  n_{1}\right)  \cdot\phi\left(  n_{2}\right)  \cdot\cdots
\cdot\phi\left(  n_{j}\right)  .
\end{align*}
In other words, (\ref{pf.cor.ent.phi.multk.1.goal}) holds for $i=j$. This
completes the induction step. Hence, the induction proof of
(\ref{pf.cor.ent.phi.multk.1.goal}) is complete.]

Now, (\ref{pf.cor.ent.phi.multk.1.goal}) (applied to $i=k$) yields
$\phi\left(  n_{1}n_{2}\cdots n_{k}\right)  =\phi\left(  n_{1}\right)
\cdot\phi\left(  n_{2}\right)  \cdot\cdots\cdot\phi\left(  n_{k}\right)  $.
This solves Exercise \ref{exe.ent.phi.multk.1}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.phi.multk.2}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.phi.multk.2}.]Exercise
\ref{exe.ent.phi.multk.1} and Exercise \ref{exe.ent.phi.multk.2} say the same
thing: They say that applying the function $\phi$ to a product of finitely
many mutually coprime positive integers yields the same result as applying
$\phi$ to each of these integers separately and then taking the product. The
difference between these two exercises is merely how the product is indexed.
Thus, deriving Exercise \ref{exe.ent.phi.multk.2} from Exercise
\ref{exe.ent.phi.multk.1} is merely a matter of bookkeeping (and this is
pretty much the same sort of bookkeeping that we used to derive Exercise
\ref{exe.ent.coprime.ab-to-cI} from Exercise \ref{exe.ent.coprime.ab-to-ck}
above). Let us do this bookkeeping:

The set $I$ is finite; thus, we can define some $k\in\mathbb{N}$ by
$k=\left\vert I\right\vert $. Consider this $k$. There exists a bijection
$f:\left\{  1,2,\ldots,k\right\}  \rightarrow I$ (since $k=\left\vert
I\right\vert $). Pick such an $f$. Thus, $f\left(  1\right)  ,f\left(
2\right)  ,\ldots,f\left(  k\right)  $ are the $k$ elements of $I$; hence,
$n_{f\left(  1\right)  },n_{f\left(  2\right)  },\ldots,n_{f\left(  k\right)
}$ are $k$ positive integers. Moreover, these $k$ integers $n_{f\left(
1\right)  },n_{f\left(  2\right)  },\ldots,n_{f\left(  k\right)  }$ are
mutually coprime\footnote{\textit{Proof.} Let $x$ and $y$ be two distinct
elements of $\left\{  1,2,\ldots,k\right\}  $. We claim that $n_{f\left(
x\right)  }\perp n_{f\left(  y\right)  }$.
\par
Indeed, the map $f$ is a bijection, and thus is injective. But $x$ and $y$ are
distinct; thus, $x\neq y$. Therefore, $f\left(  x\right)  \neq f\left(
y\right)  $ (since $f$ is injective). Hence, $f\left(  x\right)  $ and
$f\left(  y\right)  $ are two distinct elements of $I$. Thus,
(\ref{eq.exe.ent.phi.multk.2.ass}) (applied to $i=f\left(  x\right)  $ and
$j=f\left(  y\right)  $) yields $n_{f\left(  x\right)  }\perp n_{f\left(
y\right)  }$.
\par
Now, forget that we fixed $x$ and $y$. We thus have proven that every two
distinct elements $x$ and $y$ of $\left\{  1,2,\ldots,k\right\}  $ satisfy
$n_{f\left(  x\right)  }\perp n_{f\left(  y\right)  }$. In other words, the
$k$ integers $n_{f\left(  1\right)  },n_{f\left(  2\right)  },\ldots
,n_{f\left(  k\right)  }$ are mutually coprime.}. Hence, Exercise
\ref{exe.ent.phi.multk.1} (applied to $n_{f\left(  i\right)  }$ instead of
$n_{i}$) yields $\phi\left(  n_{f\left(  1\right)  }n_{f\left(  2\right)
}\cdots n_{f\left(  k\right)  }\right)  =\phi\left(  n_{f\left(  1\right)
}\right)  \cdot\phi\left(  n_{f\left(  2\right)  }\right)  \cdot\cdots
\cdot\phi\left(  n_{f\left(  k\right)  }\right)  $.

The map $f:\left\{  1,2,\ldots,k\right\}  \rightarrow I$ is a bijection.
Hence, we can substitute $f\left(  j\right)  $ for $i$ in the product
$\prod_{i\in I}n_{i}$. We thus find%
\[
\prod_{i\in I}n_{i}=\prod_{j\in\left\{  1,2,\ldots,k\right\}  }n_{f\left(
j\right)  }=\prod_{j=1}^{k}n_{f\left(  j\right)  }=n_{f\left(  1\right)
}n_{f\left(  2\right)  }\cdots n_{f\left(  k\right)  }.
\]
Applying the map $\phi$ to both sides of this equality, we obtain%
\begin{align*}
\phi\left(  \prod_{i\in I}n_{i}\right)   &  =\phi\left(  n_{f\left(  1\right)
}n_{f\left(  2\right)  }\cdots n_{f\left(  k\right)  }\right)  =\phi\left(
n_{f\left(  1\right)  }\right)  \cdot\phi\left(  n_{f\left(  2\right)
}\right)  \cdot\cdots\cdot\phi\left(  n_{f\left(  k\right)  }\right) \\
&  =\prod_{j=1}^{k}\phi\left(  n_{f\left(  j\right)  }\right)  =\prod
_{j\in\left\{  1,2,\ldots,k\right\}  }\phi\left(  n_{f\left(  j\right)
}\right)  =\prod_{i\in I}\phi\left(  n_{i}\right)
\end{align*}
(here, we have substituted $i$ for $f\left(  j\right)  $ in the product, since
the map $f:\left\{  1,2,\ldots,k\right\}  \rightarrow I$ is a bijection). This
solves Exercise \ref{exe.ent.phi.multk.2}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.euler.non-coprime}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.euler.non-coprime}.]The integer $n$ is
positive and thus nonzero. Hence, $v_{p}\left(  n\right)  \in\mathbb{N}$ for
each prime $p$.

We shall next prove that%
\begin{equation}
a^{n}\equiv a^{n-\phi\left(  n\right)  }\operatorname{mod}p^{v_{p}\left(
n\right)  }\ \ \ \ \ \ \ \ \ \ \text{for every prime }p.
\label{sol.ent.euler.non-coprime.goal}%
\end{equation}
Once this congruence is proven, the claim of Exercise
\ref{exe.ent.euler.non-coprime} will easily follow using Exercise
\ref{exe.ent.prime.modpvp}.

[\textit{Proof of (\ref{sol.ent.euler.non-coprime.goal}):} Let $p$ be a prime.
Then, $p>1$. Hence, $p\neq1$, and the integer $p$ is positive. Also, Lemma
\ref{lem.ent.prime.vp-copr} \textbf{(a)} shows that there exists a nonzero
integer $u$ such that $u\perp p$ and $n=up^{v_{p}\left(  n\right)  }$.
Consider this $u$.

We have $v_{p}\left(  n\right)  \in\mathbb{N}$ (since $n$ is nonzero). Thus,
we can define $r\in\mathbb{N}$ by $r=v_{p}\left(  n\right)  $. Consider this
$r$. Note that $p^{r}$ is nonzero (since $p$ is positive and thus nonzero).

We have $n=up^{v_{p}\left(  n\right)  }=up^{r}$ (since $v_{p}\left(  n\right)
=r$). Solving this equation for $u$, we obtain $u=n/p^{r}$ (since $p^{r}$ is
nonzero). Thus, $u$ is positive (since both $n$ and $p$ are positive).

Now, we claim that
\begin{equation}
up^{i}-\phi\left(  up^{i}\right)  \geq i\ \ \ \ \ \ \ \ \ \ \text{for each
}i\in\mathbb{N}. \label{sol.ent.euler.non-coprime.ineq.pf.1}%
\end{equation}


Let us give three proofs of this inequality:

\begin{itemize}
\item {}[\textit{First proof of (\ref{sol.ent.euler.non-coprime.ineq.pf.1}):}
We shall prove (\ref{sol.ent.euler.non-coprime.ineq.pf.1}) by induction on $i$:

\textit{Induction base:} Exercise \ref{exe.ent.phi.d-phid} \textbf{(b)}
(applied to $u$ instead of $n$) yields $u-\phi\left(  u\right)  \geq0$. Now,
$u\underbrace{p^{0}}_{=1}-\phi\left(  u\underbrace{p^{0}}_{=1}\right)
=u-\phi\left(  u\right)  \geq0$. In other words,
(\ref{sol.ent.euler.non-coprime.ineq.pf.1}) holds for $i=0$. This completes
the induction base.

\textit{Induction step:} Let $j$ be a positive integer. Assume that
(\ref{sol.ent.euler.non-coprime.ineq.pf.1}) holds for $i=j-1$. We must prove
that (\ref{sol.ent.euler.non-coprime.ineq.pf.1}) holds for $i=j$.

We have assumed that (\ref{sol.ent.euler.non-coprime.ineq.pf.1}) holds for
$i=j-1$. In other words, we have $up^{j-1}-\phi\left(  up^{j-1}\right)  \geq
j-1$.

We have $j-1\in\mathbb{N}$ (since $j$ is a positive integer); hence, $p^{j-1}$
is an integer. Thus, $up^{j-1}$ is an integer. Clearly, $up^{j-1}\mid up^{j}$
(since $up^{j}=up^{j-1}p$); thus, $up^{j-1}$ is a divisor of $up^{j}$. Also,
$up^{j-1}$ is positive\footnote{since $u$ and $p$ are positive} and satisfies
$up^{j-1}\neq up^{j}$ (since $\dfrac{up^{j}}{up^{j-1}}=p\neq1$). Hence,
Exercise \ref{exe.ent.phi.d-phid} \textbf{(d)} (applied to $up^{j-1}$ and
$up^{j}$ instead of $d$ and $n$) yields $up^{j-1}-\phi\left(  up^{j-1}\right)
<up^{j}-\phi\left(  up^{j}\right)  $. Hence,
\[
up^{j}-\phi\left(  up^{j}\right)  >up^{j-1}-\phi\left(  up^{j-1}\right)  \geq
j-1.
\]
Since $up^{j}-\phi\left(  up^{j}\right)  $ and $j-1$ are integers, this leads
to%
\[
up^{j}-\phi\left(  up^{j}\right)  \geq\left(  j-1\right)  +1=j.
\]
In other words, (\ref{sol.ent.euler.non-coprime.ineq.pf.1}) holds for $i=j$.
This completes the induction step. Hence,
(\ref{sol.ent.euler.non-coprime.ineq.pf.1}) is proven by induction.]

\item {}[\textit{Second proof of (\ref{sol.ent.euler.non-coprime.ineq.pf.1})
(sketched):} Let $j\in\mathbb{N}$. We shall show that $up^{j}-\phi\left(
up^{j}\right)  \geq j$.

Recall that $u$ is a positive integer. Hence, $u\geq1$ and thus
$\underbrace{u}_{\geq1}p^{j}\geq p^{j}$ (since $p^{j}$ is a positive integer);
in other words, $p^{j}\leq up^{j}$. Also, from $p>1$, we obtain $p^{1}%
<p^{2}<\cdots<p^{j}$. Hence, the $j$ integers $p^{1},p^{2},\ldots,p^{j}$ are distinct.

On the other hand, it is easy to see that%
\[
\left\{  p^{1},p^{2},\ldots,p^{j}\right\}  \subseteq\left\{  i\in\left\{
1,2,\ldots,up^{j}\right\}  \ \mid\ \text{we don't have }i\perp up^{j}\right\}
\]
\footnote{\textit{Proof.} Let $s\in\left\{  1,2,\ldots,j\right\}  $. Thus,
$s\geq1$ and $s\leq j$. From $s\geq1$, we conclude that $p^{s}$ is a positive
integer. Moreover, from $s\geq1$, we obtain $p^{s}\geq p^{1}$ (since $p>1$),
thus $p^{s}\geq p^{1}=p>1$. From $s\leq j$, we obtain $p^{s}\leq p^{j}$ (since
$p>1$) and thus $p^{s}\leq p^{j}\leq up^{j}$. Thus, $p^{s}\in\left\{
1,2,\ldots,up^{j}\right\}  $ (since $p^{s}$ is a positive integer).
Furthermore, from $s\leq j$, we obtain $p^{s}\mid p^{j}$ (by Exercise
\ref{exe.ent.div.powers}, applied to $p$, $s$ and $j$ instead of $n$, $a$ and
$b$). Thus, $p^{s}\mid p^{j}\mid up^{j}$ (since $u$ is an integer). Hence,
Proposition \ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $p^{s}$ and
$up^{j}$ instead of $a$ and $b$) yields $\gcd\left(  p^{s},up^{j}\right)
=\left\vert p^{s}\right\vert =p^{s}$ (since $p^{s}$ is positive). But $p>1$,
so that $p^{s}>1$ and thus $p^{s}\neq1$. Hence, $\gcd\left(  p^{s}%
,up^{j}\right)  =p^{s}\neq1$. In other words, we don't have $p^{s}\perp
up^{j}$.
\par
So we have shown that $p^{s}$ is an element of $\left\{  1,2,\ldots
,up^{j}\right\}  $ (since $p^{s}\in\left\{  1,2,\ldots,up^{j}\right\}  $) with
the property that we don't have $p^{s}\perp up^{j}$. In other words, $p^{s}$
is an $i\in\left\{  1,2,\ldots,up^{j}\right\}  $ such that we don't have
$i\perp up^{j}$. In other words,%
\[
p^{s}\in\left\{  i\in\left\{  1,2,\ldots,up^{j}\right\}  \ \mid\ \text{we
don't have }i\perp up^{j}\right\}  .
\]
\par
Now, forget that we fixed $s$. We thus have proven that%
\[
p^{s}\in\left\{  i\in\left\{  1,2,\ldots,up^{j}\right\}  \ \mid\ \text{we
don't have }i\perp up^{j}\right\}
\]
for each $s\in\left\{  1,2,\ldots,j\right\}  $. In other words,%
\[
\left\{  p^{1},p^{2},\ldots,p^{j}\right\}  \subseteq\left\{  i\in\left\{
1,2,\ldots,up^{j}\right\}  \ \mid\ \text{we don't have }i\perp up^{j}\right\}
,
\]
qed.}. Hence,%
\begin{equation}
\left\vert \left\{  p^{1},p^{2},\ldots,p^{j}\right\}  \right\vert
\leq\left\vert \left\{  i\in\left\{  1,2,\ldots,up^{j}\right\}  \ \mid
\ \text{we don't have }i\perp up^{j}\right\}  \right\vert .
\label{sol.ent.euler.non-coprime.ineq.pf.2nd.2}%
\end{equation}


But Exercise \ref{exe.ent.phi.d-phid} \textbf{(a)} (applied to $up^{j}$
instead of $n$) yields%
\begin{align*}
up^{j}-\phi\left(  up^{j}\right)   &  =\left\vert \left\{  i\in\left\{
1,2,\ldots,up^{j}\right\}  \ \mid\ \text{we don't have }i\perp up^{j}\right\}
\right\vert \\
&  \geq\left\vert \left\{  p^{1},p^{2},\ldots,p^{j}\right\}  \right\vert
\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.ent.euler.non-coprime.ineq.pf.2nd.2})}\right) \\
&  =j\ \ \ \ \ \ \ \ \ \ \left(  \text{since the }j\text{ integers }%
p^{1},p^{2},\ldots,p^{j}\text{ are distinct}\right)  .
\end{align*}


Now, forget that we fixed $j$. We thus have proven that $up^{j}-\phi\left(
up^{j}\right)  \geq j$ for each $j\in\mathbb{N}$. Renaming $j$ as $i$ in this
statement, we conclude that $up^{i}-\phi\left(  up^{i}\right)  \geq i$ for
each $i\in\mathbb{N}$. Thus, (\ref{sol.ent.euler.non-coprime.ineq.pf.1}) is proven.]

\item {}[\textit{Third proof of (\ref{sol.ent.euler.non-coprime.ineq.pf.1}):}
The following proof is a typical estimation argument (the kind you see in analysis).

Fix $i\in\mathbb{N}$. We must prove that $up^{i}-\phi\left(  up^{i}\right)
\geq i$. This is obvious in the case when $i=0$ (because Exercise
\ref{exe.ent.phi.d-phid} \textbf{(b)} (applied to $up^{0}$ instead of $n$)
yields $up^{0}-\phi\left(  up^{0}\right)  \geq0$). Hence, for the rest of this
proof, we WLOG assume that $i\neq0$. Hence, $i$ is a positive integer (since
$i\in\mathbb{N}$). Therefore, Exercise \ref{exe.ent.phi.pk} (applied to $k=i$)
yields $\phi\left(  p^{i}\right)  =\left(  p-1\right)  p^{i-1}$. Hence,%
\begin{equation}
\underbrace{p^{i}}_{=pp^{i-1}}-\underbrace{\phi\left(  p^{i}\right)
}_{=\left(  p-1\right)  p^{i-1}}=pp^{i-1}-\left(  p-1\right)  p^{i-1}=p^{i-1}.
\label{sol.ent.euler.non-coprime.ineq.3rd.1}%
\end{equation}


Also, $i-1\in\mathbb{N}$ (since $i$ is a positive integer). Hence, Exercise
\ref{exe.ent.prime.vp-lem} (applied to $k=i-1$) yields $p^{i-1}>i-1$. Since
$p^{i-1}$ and $i-1$ are integers (because $i-1\in\mathbb{N}$), this leads to
$p^{i-1}\geq\left(  i-1\right)  +1=i$.

Note that $u$ is a positive integer. Thus, $u\geq1$. Exercise
\ref{exe.ent.phi.d-phid} \textbf{(b)} (applied to $u$ instead of $n$) yields
$u-\phi\left(  u\right)  \geq0$. In other words, $\phi\left(  u\right)  \leq
u$. Furthermore, $p^{i}$ is a positive integer; thus, $\phi\left(
p^{i}\right)  \geq0$ (because clearly, $\phi\left(  m\right)  \geq0$ for every
positive integer $m$).

But $u\perp p$. Hence, Exercise \ref{exe.ent.coprime.powers} (applied to $u$,
$p$, $1$ and $i$ instead of $a$, $b$, $n$ and $m$) yields $u^{1}\perp p^{i}$
(since $i\in\mathbb{N}$). In other words, $u\perp p^{i}$ (since $u^{1}=u$). In
other words, the integers $u$ and $p^{i}$ are coprime. Thus, Theorem
\ref{thm.ent.phi.mult} (applied to $u$ and $p^{i}$ instead of $m$ and $n$)
yields $\phi\left(  up^{i}\right)  =\phi\left(  u\right)  \cdot\phi\left(
p^{i}\right)  $ (since $u$ and $p^{i}$ are positive integers). Thus,%
\[
\phi\left(  up^{i}\right)  =\underbrace{\phi\left(  u\right)  }_{\leq u}%
\cdot\phi\left(  p^{i}\right)  \leq u\cdot\phi\left(  p^{i}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\phi\left(  p^{i}\right)
\geq0\right)  .
\]
Hence,%
\begin{align*}
up^{i}-\underbrace{\phi\left(  up^{i}\right)  }_{\leq u\cdot\phi\left(
p^{i}\right)  }  &  \geq up^{i}-u\cdot\phi\left(  p^{i}\right)  =u\cdot
\underbrace{\left(  p^{i}-\phi\left(  p^{i}\right)  \right)  }%
_{\substack{=p^{i-1}\\\text{(by (\ref{sol.ent.euler.non-coprime.ineq.3rd.1}%
))}}}=\underbrace{u}_{\geq1}p^{i-1}\\
&  \geq1p^{i-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }p^{i-1}\geq0\right) \\
&  =p^{i-1}\geq i.
\end{align*}
Thus, (\ref{sol.ent.euler.non-coprime.ineq.pf.1}) is proven again.]
\end{itemize}

Now, we can apply (\ref{sol.ent.euler.non-coprime.ineq.pf.1}) to $i=r$ (since
$r\in\mathbb{N}$). We thus obtain $up^{r}-\phi\left(  up^{r}\right)  \geq r$.
Hence,
\begin{equation}
\underbrace{n}_{=up^{r}}-\phi\left(  \underbrace{n}_{=up^{r}}\right)
=up^{r}-\phi\left(  up^{r}\right)  \geq r.
\label{sol.ent.euler.non-coprime.ineq}%
\end{equation}


Now, we are in one of the following two cases:

\textit{Case 1:} We have $p\mid a$.

\textit{Case 2:} We don't have $p\mid a$.

Let us first consider Case 1. In this case, $p\mid a$. Now,
(\ref{sol.ent.euler.non-coprime.ineq}) yields $n-\phi\left(  n\right)  \geq
r\geq0$ (since $r\in\mathbb{N}$). Hence, $n-\phi\left(  n\right)
\in\mathbb{N}$ and $r\in\mathbb{N}$. From $n-\phi\left(  n\right)  \geq r$, we
also obtain $r\leq n-\phi\left(  n\right)  $. Hence, Exercise
\ref{exe.ent.div.powers} (applied to $p$, $r$ and $n-\phi\left(  n\right)  $
instead of $n$, $a$ and $b$) yields $p^{r}\mid p^{n-\phi\left(  n\right)  }$.
But $p\mid a$. Hence, Exercise \ref{exe.ent.div.powers-ab} (applied to $p$,
$a$ and $n-\phi\left(  n\right)  $ instead of $a$, $b$ and $k$) yields
$p^{n-\phi\left(  n\right)  }\mid a^{n-\phi\left(  n\right)  }$ (since
$n-\phi\left(  n\right)  \in\mathbb{N}$). Hence, $p^{r}\mid p^{n-\phi\left(
n\right)  }\mid a^{n-\phi\left(  n\right)  }$; in other words, $a^{n-\phi
\left(  n\right)  }\equiv0\operatorname{mod}p^{r}$. Now,%
\begin{align*}
a^{n}  &  =a^{\phi\left(  n\right)  +\left(  n-\phi\left(  n\right)  \right)
}=a^{\phi\left(  n\right)  }\underbrace{a^{n-\phi\left(  n\right)  }}%
_{\equiv0\operatorname{mod}p^{r}}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}n-\phi\left(  n\right)  \in\mathbb{N}\right) \\
&  \equiv0\equiv a^{n-\phi\left(  n\right)  }\operatorname{mod}p^{r}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }a^{n-\phi\left(  n\right)  }%
\equiv0\operatorname{mod}p^{r}\right)  .
\end{align*}
This rewrites as $a^{n}\equiv a^{n-\phi\left(  n\right)  }\operatorname{mod}%
p^{v_{p}\left(  n\right)  }$ (since $r=v_{p}\left(  n\right)  $). Hence,
(\ref{sol.ent.euler.non-coprime.goal}) is proven in Case 1.

Let us now consider Case 2. In this case, we don't have $p\mid a$. But
Proposition \ref{prop.ent.prime.div-or-coprime} yields that either $p\mid a$
or $p\perp a$. Hence, $p\perp a$ (since we don't have $p\mid a$). Due to
Proposition \ref{prop.ent.coprime.perp-symm}, this leads to $a\perp p$. Thus,
Exercise \ref{exe.ent.coprime.powers} (applied to $p$, $1$ and $r$ instead of
$b$, $n$ and $m$) yields $a^{1}\perp p^{r}$ (since $r\in\mathbb{N}$). In other
words, $a\perp p^{r}$ (since $a^{1}=a$). In other words, $a$ is coprime to
$p^{r}$. Hence, Theorem \ref{thm.ent.euler} (applied to $p^{r}$ instead of
$n$) yields $a^{\phi\left(  p^{r}\right)  }\equiv1\operatorname{mod}p^{r}$.

But $u\perp p$. Hence, Exercise \ref{exe.ent.coprime.powers} (applied to $u$,
$p$, $1$ and $r$ instead of $a$, $b$, $n$ and $m$) yields $u^{1}\perp p^{r}$
(since $r\in\mathbb{N}$). In other words, $u\perp p^{r}$ (since $u^{1}=u$). In
other words, the integers $u$ and $p^{r}$ are coprime. Thus, Theorem
\ref{thm.ent.phi.mult} (applied to $u$ and $p^{r}$ instead of $m$ and $n$)
yield $\phi\left(  up^{r}\right)  =\phi\left(  u\right)  \cdot\phi\left(
p^{r}\right)  $ (since $u$ and $p^{r}$ are positive integers). Now, applying
the map $\phi$ to both sides of the equality $n=up^{r}$, we obtain
$\phi\left(  n\right)  =\phi\left(  up^{r}\right)  =\phi\left(  u\right)
\cdot\phi\left(  p^{r}\right)  =\phi\left(  p^{r}\right)  \cdot\phi\left(
u\right)  $. Hence,%
\[
a^{\phi\left(  n\right)  }=a^{\phi\left(  p^{r}\right)  \cdot\phi\left(
u\right)  }=\left(  \underbrace{a^{\phi\left(  p^{r}\right)  }}_{\equiv
1\operatorname{mod}p^{r}}\right)  ^{\phi\left(  u\right)  }\equiv
1^{\phi\left(  u\right)  }=1\operatorname{mod}p^{r}.
\]
Hence,%
\begin{align*}
a^{n}  &  =a^{\phi\left(  n\right)  +\left(  n-\phi\left(  n\right)  \right)
}=\underbrace{a^{\phi\left(  n\right)  }}_{\equiv1\operatorname{mod}p^{r}%
}a^{n-\phi\left(  n\right)  }\ \ \ \ \ \ \ \ \ \ \left(  \text{since }%
n-\phi\left(  n\right)  \in\mathbb{N}\right) \\
&  \equiv a^{n-\phi\left(  n\right)  }\operatorname{mod}p^{r}.
\end{align*}
This rewrites as $a^{n}\equiv a^{n-\phi\left(  n\right)  }\operatorname{mod}%
p^{v_{p}\left(  n\right)  }$ (since $r=v_{p}\left(  n\right)  $). Therefore,
(\ref{sol.ent.euler.non-coprime.goal}) is proven in Case 2.

We have thus shown (\ref{sol.ent.euler.non-coprime.goal}) in both Cases 1 and
2. These cases cover all possibilities, and so
(\ref{sol.ent.euler.non-coprime.goal}) is always proven.]

Hence, Exercise \ref{exe.ent.prime.modpvp} (applied to $a^{n}$ and
$a^{n-\phi\left(  n\right)  }$ instead of $a$ and $b$) yields $a^{n}\equiv
a^{n-\phi\left(  n\right)  }\operatorname{mod}n$. This solves Exercise
\ref{exe.ent.euler.non-coprime}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.binom.k!divprod}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.binom.k!divprod}.]A product of $k$ consecutive
integers always has the form \newline$\left(  a+1\right)  \left(  a+2\right)
\cdots\left(  a+k\right)  $ for some $a\in\mathbb{Z}$. Thus, we must prove
that $\left(  a+1\right)  \left(  a+2\right)  \cdots\left(  a+k\right)  $ is
divisible by $k!$ for each $a\in\mathbb{Z}$.

Let $a\in\mathbb{Z}$. We must prove that $\left(  a+1\right)  \left(
a+2\right)  \cdots\left(  a+k\right)  $ is divisible by $k!$.

Proposition \ref{prop.binom.Z->Z} (applied to $n=a+k$) yields that
$\dbinom{a+k}{k}$ is an integer. Now, the definition of $\dbinom{a+k}{k}$
yields%
\[
\dbinom{a+k}{k}=\dfrac{\left(  a+k\right)  \left(  a+k-1\right)  \left(
a+k-2\right)  \cdots\left(  a+k-k+1\right)  }{k!}.
\]
Multiplying both sides of this equality by $k!$, we find%
\begin{align*}
k!\dbinom{a+k}{k}  &  =\left(  a+k\right)  \left(  a+k-1\right)  \left(
a+k-2\right)  \cdots\left(  a+k-k+1\right) \\
&  =\left(  a+k\right)  \left(  a+k-1\right)  \left(  a+k-2\right)
\cdots\left(  a+1\right) \\
&  =\left(  a+1\right)  \left(  a+2\right)  \cdots\left(  a+k\right)
\end{align*}
(here, we have reversed the order of the factors in the product). Thus,
$\left(  a+1\right)  \left(  a+2\right)  \cdots\left(  a+k\right)
=k!\dbinom{a+k}{k}$. Since $\dbinom{a+k}{k}$ is an integer, this equality
yields that $\left(  a+1\right)  \left(  a+2\right)  \cdots\left(  a+k\right)
$ is divisible by $k!$. This solves Exercise \ref{exe.binom.k!divprod}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.binom.legendre}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.binom.legendre}.]\textbf{(a)} Let
$n\in\mathbb{N}$. Let $k$ be a positive integer. Theorem
\ref{thm.ent.quorem.full} (applied to $n$ and $k$ instead of $u$ and $n$)
shows that there exists a unique pair $\left(  q,r\right)  \in\mathbb{Z}%
\times\left\{  0,1,\ldots,k-1\right\}  $ such that $n=qk+r$. Consider this
pair. Then, $n//k=q$ (by the definition of $n//k$). From $\left(  q,r\right)
\in\mathbb{Z}\times\left\{  0,1,\ldots,k-1\right\}  $, we obtain
$q\in\mathbb{Z}$ and $r\in\left\{  0,1,\ldots,k-1\right\}  $. From
$r\in\left\{  0,1,\ldots,k-1\right\}  $, we obtain $r\geq0$ and $r\leq k-1$.
From $n=qk+r$, we obtain $qk=\underbrace{n}_{\geq0}-r\geq-\underbrace{r}_{\leq
k-1<k}>-k=\left(  -1\right)  k$. If we had $q\leq-1$, then we would have
$\underbrace{q}_{\leq-1}k\leq\left(  -1\right)  k$ (since $k$ is positive),
which would contradict $qk>\left(  -1\right)  k$. Thus, we cannot have
$q\leq-1$. Hence, $q>-1$. Therefore, $q\geq0$ (since $q\in\mathbb{Z}$). Also,
$n=qk+\underbrace{r}_{\geq0}\geq qk$ and $n=qk+\underbrace{r}_{\leq
k-1<k}<qk+k=\left(  q+1\right)  k$.

We have $1<2<\cdots<q$. Since $k$ is positive, we can multiply this chain of
inequalities by $k$, and obtain $1k<2k<\cdots<qk$. Thus, the $q$ numbers
$1k,2k,\ldots,qk$ are distinct; therefore,%
\[
\left\vert \left\{  1k,2k,\ldots,qk\right\}  \right\vert =q.
\]


We now shall show the following:

\begin{statement}
\textit{Claim 1:} We have
\[
\left\{  i\in\left\{  1,2,\ldots,n\right\}  \text{ satisfying }k\mid
i\right\}  =\left\{  1k,2k,\ldots,qk\right\}  .
\]
(We are writing the word \textquotedblleft satisfying\textquotedblright\ out,
since the \textquotedblleft$\mid$\textquotedblright\ symbol is already being
used for divisibility here.)
\end{statement}

[\textit{Proof of Claim 1:} Let $j\in\left\{  i\in\left\{  1,2,\ldots
,n\right\}  \text{ satisfying }k\mid i\right\}  $. We shall show that
$j\in\left\{  1k,2k,\ldots,qk\right\}  $.

Indeed, we have $j\in\left\{  i\in\left\{  1,2,\ldots,n\right\}  \text{
satisfying }k\mid i\right\}  $. In other words, $j$ is an element of $\left\{
1,2,\ldots,n\right\}  $ satisfying $k\mid j$. From $k\mid j$, we conclude that
there exists an integer $c$ such that $j=kc$. Consider this $c$. From
$j\in\left\{  1,2,\ldots,n\right\}  $, we obtain $j\geq1$ and $j\leq n$. Now,
$ck=kc=j\leq n<\left(  q+1\right)  k$. We can divide this inequality by $k$
(since $k$ is positive) and thus obtain $c<q+1$. Hence, $c\leq q$ (since $c$
and $q$ are integers).

Also, $ck=kc=j\geq1>0$. We can divide this inequality by $k$ (since $k$ is
positive) and thus obtain $c>0$. Hence, $c\geq1$ (since $c$ is an integer).
Combining this with $c\leq q$, we obtain $c\in\left\{  1,2,\ldots,q\right\}  $
(since $c$ is an integer) and thus $ck\in\left\{  1k,2k,\ldots,qk\right\}  $.
Hence, $j=kc=ck\in\left\{  1k,2k,\ldots,qk\right\}  $.

Now, forget that we fixed $j$. We thus have proven that $j\in\left\{
1k,2k,\ldots,qk\right\}  $ for each $j\in\left\{  i\in\left\{  1,2,\ldots
,n\right\}  \text{ satisfying }k\mid i\right\}  $. In other words,%
\begin{equation}
\left\{  i\in\left\{  1,2,\ldots,n\right\}  \text{ satisfying }k\mid
i\right\}  \subseteq\left\{  1k,2k,\ldots,qk\right\}  .
\label{sol.binom.legendre.a.c1.pf.1}%
\end{equation}


On the other hand, let $h\in\left\{  1k,2k,\ldots,qk\right\}  $. We shall show
that \newline$h\in\left\{  i\in\left\{  1,2,\ldots,n\right\}  \text{
satisfying }k\mid i\right\}  $.

Indeed, $h\in\left\{  1k,2k,\ldots,qk\right\}  $. In other words, $h=dk$ for
some $d\in\left\{  1,2,\ldots,q\right\}  $. Consider this $d$. From
$d\in\left\{  1,2,\ldots,q\right\}  $, we obtain $d\geq1$ and $d\leq q$. We
can multiply the inequality $d\geq1$ by $k$ (since $k$ is positive) and thus
obtain $dk\geq1k=k\geq1$ (since $k$ is a positive integer). Also, we can
multiply the inequality $d\leq q$ by $k$ (since $k$ is positive) and thus
obtain $dk\leq qk\leq n$ (since $n\geq qk$). Combining this with $dk\geq1$, we
obtain $dk\in\left\{  1,2,\ldots,n\right\}  $ (since $dk$ is an integer). In
other words, $h\in\left\{  1,2,\ldots,n\right\}  $ (since $h=dk$). Moreover,
$k\mid h$ (since $h=dk=kd$). Hence, $h$ is an $i\in\left\{  1,2,\ldots
,n\right\}  $ satisfying $k\mid i$ (since $h\in\left\{  1,2,\ldots,n\right\}
$ and $k\mid h$). In other words, $h\in\left\{  i\in\left\{  1,2,\ldots
,n\right\}  \text{ satisfying }k\mid i\right\}  $.

Now, forget that we fixed $h$. We thus have proven that $h\in\left\{
i\in\left\{  1,2,\ldots,n\right\}  \text{ satisfying }k\mid i\right\}  $ for
each $h\in\left\{  1k,2k,\ldots,qk\right\}  $. In other words,%
\[
\left\{  1k,2k,\ldots,qk\right\}  \subseteq\left\{  i\in\left\{
1,2,\ldots,n\right\}  \text{ satisfying }k\mid i\right\}  .
\]
Combining this with (\ref{sol.binom.legendre.a.c1.pf.1}), we obtain $\left\{
i\in\left\{  1,2,\ldots,n\right\}  \text{ satisfying }k\mid i\right\}
=\left\{  1k,2k,\ldots,qk\right\}  $. This proves Claim 1.]

Now,
\begin{align*}
\sum_{i=1}^{n}\left[  k\mid i\right]   &  =\sum_{i\in\left\{  1,2,\ldots
,n\right\}  }\left[  k\mid i\right]  =\sum_{\substack{i\in\left\{
1,2,\ldots,n\right\}  ;\\k\mid i}}\underbrace{\left[  k\mid i\right]
}_{\substack{=1\\\text{(since }k\mid i\text{)}}}+\sum_{\substack{i\in\left\{
1,2,\ldots,n\right\}  ;\\\text{we don't have }k\mid i}}\underbrace{\left[
k\mid i\right]  }_{\substack{=0\\\text{(since we don't have }k\mid i\text{)}%
}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since each }i\in\left\{  1,2,\ldots
,n\right\}  \text{ either satisfies }k\mid i\text{ or does not}\right) \\
&  =\sum_{\substack{i\in\left\{  1,2,\ldots,n\right\}  ;\\k\mid i}%
}1+\underbrace{\sum_{\substack{i\in\left\{  1,2,\ldots,n\right\}  ;\\\text{we
don't have }k\mid i}}0}_{=0}=\sum_{\substack{i\in\left\{  1,2,\ldots
,n\right\}  ;\\k\mid i}}1\\
&  =\left(  \text{the number of all }i\in\left\{  1,2,\ldots,n\right\}  \text{
satisfying }k\mid i\right)  \cdot1\\
&  =\left(  \text{the number of all }i\in\left\{  1,2,\ldots,n\right\}  \text{
satisfying }k\mid i\right) \\
&  =\left\vert \left\{  i\in\left\{  1,2,\ldots,n\right\}  \text{ satisfying
}k\mid i\right\}  \right\vert \\
&  =\left\vert \left\{  1k,2k,\ldots,qk\right\}  \right\vert
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Claim 1}\right) \\
&  =q=n//k.
\end{align*}
In other words, $n//k=\sum_{i=1}^{n}\left[  k\mid i\right]  $. This solves
Exercise \ref{exe.binom.legendre} \textbf{(a)}.

\textbf{(b)} Let $p$ be a prime. Let $n$ be a nonzero integer.

Then, $v_{p}\left(  n\right)  $ is the largest $m\in\mathbb{N}$ such that
$p^{m}\mid n$ (by Definition \ref{def.ent.prime.vp} \textbf{(a)}). Hence,
$v_{p}\left(  n\right)  \in\mathbb{N}$. Thus, $\left\{  1,2,\ldots
,v_{p}\left(  n\right)  \right\}  $ is a finite set and has size $\left\vert
\left\{  1,2,\ldots,v_{p}\left(  n\right)  \right\}  \right\vert =v_{p}\left(
n\right)  $. Every $i\in\left\{  1,2,\ldots,v_{p}\left(  n\right)  \right\}  $
satisfies%
\begin{equation}
\left[  p^{i}\mid n\right]  =1 \label{sol.binom.legendre.b.0}%
\end{equation}
\footnote{\textit{Proof.} Let $i\in\left\{  1,2,\ldots,v_{p}\left(  n\right)
\right\}  $. Thus, $i$ is a positive integer satisfying $i\leq v_{p}\left(
n\right)  $. Hence, $v_{p}\left(  n\right)  \geq i$. But Lemma
\ref{lem.ent.prime.vp-def} shows that $p^{i}\mid n$ if and only if
$v_{p}\left(  n\right)  \geq i$. Thus, we have $p^{i}\mid n$ (since we have
$v_{p}\left(  n\right)  \geq i$). Therefore, $\left[  p^{i}\mid n\right]  =1$,
qed.}. Moreover, every positive integer $i$ satisfying $i>v_{p}\left(
n\right)  $ satisfies
\begin{equation}
\left[  p^{i}\mid n\right]  =0 \label{sol.binom.legendre.b.1}%
\end{equation}
\ \footnote{\textit{Proof.} Let $i$ be a positive integer satisfying
$i>v_{p}\left(  n\right)  $. We must prove that $\left[  p^{i}\mid n\right]
=0$.
\par
We have $i>v_{p}\left(  n\right)  $. Thus, we don't have $v_{p}\left(
n\right)  \geq i$. But Lemma \ref{lem.ent.prime.vp-def} shows that $p^{i}\mid
n$ if and only if $v_{p}\left(  n\right)  \geq i$. Hence, we don't have
$p^{i}\mid n$ (since we don't have $v_{p}\left(  n\right)  \geq i$). Thus,
$\left[  p^{i}\mid n\right]  =0$. Qed.}. Hence, all but finitely many positive
integers $i$ satisfy $\left[  p^{i}\mid n\right]  =0$ (since all but finitely
many positive integers $i$ satisfy $i>v_{p}\left(  n\right)  $). In other
words, all but finitely many addends of the sum $\sum_{i\geq1}\left[
p^{i}\mid n\right]  $ are zero. In other words, this sum has only finitely
many nonzero addends. Hence, this sum is well-defined.

Now, we can split this sum at $i=v_{p}\left(  n\right)  $ (since $v_{p}\left(
n\right)  \geq0$), and thus obtain%
\[
\sum_{i\geq1}\left[  p^{i}\mid n\right]  =\sum_{i=1}^{v_{p}\left(  n\right)
}\underbrace{\left[  p^{i}\mid n\right]  }_{\substack{=1\\\text{(by
(\ref{sol.binom.legendre.b.0}))}}}+\sum_{i>v_{p}\left(  n\right)
}\underbrace{\left[  p^{i}\mid n\right]  }_{\substack{=0\\\text{(by
(\ref{sol.binom.legendre.b.1}))}}}=\sum_{i=1}^{v_{p}\left(  n\right)
}1+\underbrace{\sum_{i>v_{p}\left(  n\right)  }0}_{=0}=\sum_{i=1}%
^{v_{p}\left(  n\right)  }1=v_{p}\left(  n\right)  \cdot1=v_{p}\left(
n\right)  .
\]
In other words, $v_{p}\left(  n\right)  =\sum_{i\geq1}\left[  p^{i}\mid
n\right]  $. This solves Exercise \ref{exe.binom.legendre} \textbf{(b)}.

\textbf{(c)} Let $p$ be a prime. Let $n\in\mathbb{N}$. For every positive
integer $m$, we have%
\begin{align}
v_{p}\left(  m\right)   &  =\sum_{i\geq1}\left[  p^{i}\mid m\right]
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Exercise \ref{exe.binom.legendre} \textbf{(b)},}\\
\text{applied to }m\text{ instead of }n
\end{array}
\right) \nonumber\\
&  =\sum_{j\geq1}\left[  p^{j}\mid m\right]  \label{sol.binom.legendre.c.vpm=}%
\end{align}
(here, we have renamed the summation index $i$ as $j$). Note that the sum
$\sum_{j\geq1}\left[  p^{j}\mid m\right]  $ on the right hand side of this
equality is well-defined, i.e., has only finitely many nonzero addends.

Corollary \ref{cor.ent.prime.vp-ringk} (applied to $k=n$ and $a_{i}=i$) yields%
\[
v_{p}\left(  1\cdot2\cdot\cdots\cdot n\right)  =v_{p}\left(  1\right)
+v_{p}\left(  2\right)  +\cdots+v_{p}\left(  n\right)  =\sum_{m=1}^{n}%
v_{p}\left(  m\right)  .
\]
In view of $1\cdot2\cdot\cdots\cdot n=n!$, this rewrites as
\begin{equation}
v_{p}\left(  n!\right)  =\sum_{m=1}^{n}\underbrace{v_{p}\left(  m\right)
}_{\substack{=\sum_{j\geq1}\left[  p^{j}\mid m\right]  \\\text{(by
(\ref{sol.binom.legendre.c.vpm=}))}}}=\sum_{m=1}^{n}\sum_{j\geq1}\left[
p^{j}\mid m\right]  =\sum_{j\geq1}\sum_{m=1}^{n}\left[  p^{j}\mid m\right]  .
\label{sol.binom.legendre.c.1}%
\end{equation}
(Here, we have interchanged the two summation signs \textquotedblleft%
$\sum_{m=1}^{n}$\textquotedblright\ and \textquotedblleft$\sum_{j\geq1}%
$\textquotedblright. This is legitimate, since the first summation is finite
whereas the second summation has already been proven to be well-defined.) But
each positive integer $j$ satisfies%
\begin{align}
n//p^{j}  &  =\sum_{i=1}^{n}\left[  p^{j}\mid i\right]
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Exercise \ref{exe.binom.legendre}
\textbf{(a)}, applied to }k=p^{j}\right) \nonumber\\
&  =\sum_{m=1}^{n}\left[  p^{j}\mid m\right]
\label{sol.binom.legendre.c.n//pj=}%
\end{align}
(here, we have renamed the summation index $i$ as $m$). Thus,
(\ref{sol.binom.legendre.c.1}) becomes%
\[
v_{p}\left(  n!\right)  =\sum_{j\geq1}\underbrace{\sum_{m=1}^{n}\left[
p^{j}\mid m\right]  }_{\substack{=n//p^{j}\\\text{(by
(\ref{sol.binom.legendre.c.n//pj=}))}}}=\sum_{j\geq1}n//p^{j}=\sum_{i\geq
1}n//p^{i}%
\]
(here, we have renamed the summation index $j$ as $i$). This solves Exercise
\ref{exe.binom.legendre} \textbf{(c)}.

\textbf{(d)} \textit{Second proof of Corollary \ref{cor.binom.N->N}.} We must
prove that $\dbinom{n}{k}$ is a nonnegative integer. If $k\notin\mathbb{N}$,
then this holds (because if $k\notin\mathbb{N}$, then Definition
\ref{def.binom.binom} \textbf{(b)} yields $\dbinom{n}{k}=0$). Thus, for the
rest of this proof, we WLOG assume that $k\in\mathbb{N}$.

If $k>n$, then we have $\dbinom{n}{k}=0$ (by Theorem \ref{thm.binom.k>n0}).
Hence, if $k>n$, then $\dbinom{n}{k}$ is clearly a nonnegative integer. Thus,
for the rest of this proof, we WLOG assume that we don't have $k>n$. Hence,
$k\leq n$. Therefore, $n\geq k$ and thus $n-k\in\mathbb{N}$. Hence, Theorem
\ref{thm.binom.n!k!} yields%
\begin{equation}
\dbinom{n}{k}=\dfrac{n!}{k!\left(  n-k\right)  !}.
\label{pf.cor.binom.N->N.frac}%
\end{equation}
This yields that the number $\dbinom{n}{k}$ is positive (since the numbers
$n!$, $k!$ and $\left(  n-k\right)  !$ are all positive) and therefore
nonnegative. It remains to prove that $\dbinom{n}{k}$ is an integer.

Fix a prime $p$. We shall show that $v_{p}\left(  k!\left(  n-k\right)
!\right)  \leq v_{p}\left(  n!\right)  $. (This will then yield $k!\left(
n-k\right)  !\mid n!$, and this will in turn yield the integrality of
$\dbinom{n}{k}$ by way of (\ref{pf.cor.binom.N->N.frac}).)

Fix a positive integer $i$. Exercise \ref{exe.ent.quo-rem.u+v} \textbf{(b)}
(applied to $k$, $n-k$ and $p^{i}$ instead of $u$, $v$ and $n$) yields
$\left(  k+\left(  n-k\right)  \right)  //p^{i}-k//p^{i}-\left(  n-k\right)
//p^{i}\in\left\{  0,1\right\}  \subseteq\mathbb{N}$. This rewrites as
$n//p^{i}-k//p^{i}-\left(  n-k\right)  //p^{i}\in\mathbb{N}$ (since $k+\left(
n-k\right)  =n$). Hence,
\begin{equation}
n//p^{i}-k//p^{i}-\left(  n-k\right)  //p^{i}\geq0.
\label{pf.cor.binom.N->N.pi-ineq}%
\end{equation}


Now, forget that we fixed $i$. We thus have proven the inequality
(\ref{pf.cor.binom.N->N.pi-ineq}) for each positive integer $i$.

Theorem \ref{thm.ent.prime.vp-ring} \textbf{(a)} (applied to $a=k!$ and
$b=\left(  n-k\right)  !$) yields%
\[
v_{p}\left(  k!\left(  n-k\right)  !\right)  =v_{p}\left(  k!\right)
+v_{p}\left(  \left(  n-k\right)  !\right)  .
\]
Hence,%
\begin{align*}
&  v_{p}\left(  n!\right)  -\underbrace{v_{p}\left(  k!\left(  n-k\right)
!\right)  }_{=v_{p}\left(  k!\right)  +v_{p}\left(  \left(  n-k\right)
!\right)  }\\
&  =v_{p}\left(  n!\right)  -\left(  v_{p}\left(  k!\right)  +v_{p}\left(
\left(  n-k\right)  !\right)  \right) \\
&  =\underbrace{v_{p}\left(  n!\right)  }_{\substack{=\sum_{i\geq1}%
n//p^{i}\\\text{(by Exercise \ref{exe.binom.legendre} \textbf{(c)})}%
}}-\underbrace{v_{p}\left(  k!\right)  }_{\substack{=\sum_{i\geq1}%
k//p^{i}\\\text{(by Exercise \ref{exe.binom.legendre} \textbf{(c)}%
,}\\\text{applied to }k\text{ instead of }n\text{)}}}-\underbrace{v_{p}\left(
\left(  n-k\right)  !\right)  }_{\substack{=\sum_{i\geq1}\left(  n-k\right)
//p^{i}\\\text{(by Exercise \ref{exe.binom.legendre} \textbf{(c)}%
,}\\\text{applied to }n-k\text{ instead of }n\text{)}}}\\
&  =\sum_{i\geq1}n//p^{i}-\sum_{i\geq1}k//p^{i}-\sum_{i\geq1}\left(
n-k\right)  //p^{i}=\sum_{i\geq1}\underbrace{\left(  n//p^{i}-k//p^{i}-\left(
n-k\right)  //p^{i}\right)  }_{\substack{\geq0\\\text{(by
(\ref{pf.cor.binom.N->N.pi-ineq}))}}}\\
&  \geq\sum_{i\geq1}0=0.
\end{align*}
In other words,%
\[
v_{p}\left(  k!\left(  n-k\right)  !\right)  \leq v_{p}\left(  n!\right)  .
\]


Now, forget that we fixed $p$. We thus have proven that each prime $p$
satisfies $v_{p}\left(  k!\left(  n-k\right)  !\right)  \leq v_{p}\left(
n!\right)  $. But Proposition \ref{prop.ent.prime.n|m} (applied to $k!\left(
n-k\right)  !$ and $n!$ instead of $n$ and $m$), we have $k!\left(
n-k\right)  !\mid n!$ if and only if each prime $p$ satisfies $v_{p}\left(
k!\left(  n-k\right)  !\right)  \leq v_{p}\left(  n!\right)  $. Thus, we have
$k!\left(  n-k\right)  !\mid n!$ (since each prime $p$ satisfies $v_{p}\left(
k!\left(  n-k\right)  !\right)  \leq v_{p}\left(  n!\right)  $). In other
words, $\dfrac{n!}{k!\left(  n-k\right)  !}$ is an integer (since $k!\left(
n-k\right)  !\neq0$). In view of (\ref{pf.cor.binom.N->N.frac}), this rewrites
as follows: $\dbinom{n}{k}$ is an integer. Hence, $\dbinom{n}{k}$ is a
nonnegative integer (since we already know that $\dbinom{n}{k}$ is
nonnegative). Hence, Corollary \ref{cor.binom.N->N} is proven again.

Thus, Exercise \ref{exe.binom.legendre} \textbf{(d)} is solved.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.binom.subsets-ctg}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.binom.subsets-ctg}.]Let me first informally
present the idea of the solution, and afterwards make it into a rigorous proof.

The idea is the following: If we want to choose an $m$-element subset $S$ of
$A$ satisfying $B\subseteq S$, we cannot just arbitrarily pick $m$ elements of
$A$; this would fail to ensure that $B\subseteq S$. Thus, a better method is
to start by picking all the $b$ elements of $B$, and then supplement them with
$m-b$ further elements from $A\setminus B$ (which can be picked at random).
The only choice we have in this procedure is which $m-b$ elements of
$A\setminus B$ we pick in the second step; this can be done in $\dbinom
{a-b}{m-b}$ many ways (because it is tantamount to choosing an $\left(
m-b\right)  $-element subset of the $\left(  a-b\right)  $-element set
$A\setminus B$; but Theorem \ref{thm.binom.comb-int} tells us that
$\dbinom{a-b}{m-b}$ is the number of such subsets). Hence, the number of
$m$-element subsets $S$ of $A$ satisfying $B\subseteq S$ is $\dbinom{a-b}%
{m-b}$.

Here is a formal version of this argument: We have $\left\vert A\right\vert
=a$ (since $A$ is an $a$-element set) and $\left\vert B\right\vert =b$ (since
$B$ is a $b$-element set). But $B$ is a subset of $A$; thus, $\left\vert
A\setminus B\right\vert =\underbrace{\left\vert A\right\vert }_{=a}%
-\underbrace{\left\vert B\right\vert }_{=b}=a-b$. In other words, $A\setminus
B$ is an $\left(  a-b\right)  $-element set. Thus, Theorem
\ref{thm.binom.comb-int} (applied to $n=a-b$, $k=m-b$ and $N=A\setminus B$)
yields that $\dbinom{a-b}{m-b}$ is the number of $\left(  m-b\right)
$-element subsets of $A\setminus B$. In other words,%
\begin{equation}
\dbinom{a-b}{m-b}=\left(  \text{the number of }\left(  m-b\right)
\text{-element subsets of }A\setminus B\right)  .
\label{sol.binom.subsets-ctg.1}%
\end{equation}


Now, let $\mathbf{L}$ be the set of all $m$-element subsets $S$ of $A$
satisfying $B\subseteq S$. Hence,%
\begin{equation}
\left\vert \mathbf{L}\right\vert =\left(  \text{the number of }m\text{-element
subsets }S\text{ of }A\text{ satisfying }B\subseteq S\right)  .
\label{sol.binom.subsets-ctg.sizeL=}%
\end{equation}


Furthermore, let $\mathbf{K}$ be the set of all $\left(  m-b\right)  $-element
subsets of $A\setminus B$. Hence,%
\begin{align}
\left\vert \mathbf{K}\right\vert  &  =\left(  \text{the number of }\left(
m-b\right)  \text{-element subsets of }A\setminus B\right) \nonumber\\
&  =\dbinom{a-b}{m-b}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.binom.subsets-ctg.1})}\right)  .
\label{sol.binom.subsets-ctg.sizeK=}%
\end{align}


Now, we shall construct a bijection between $\mathbf{K}$ and $\mathbf{L}$.

For each $P\in\mathbf{L}$, we have $P\setminus B\in\mathbf{K}$%
\ \ \ \ \footnote{\textit{Proof.} Let $P\in\mathbf{L}$. Thus, $P$ is an
$m$-element subset $S$ of $A$ satisfying $B\subseteq S$ (by the definition of
$\mathbf{L}$). In other words, $P$ is an $m$-element subset of $A$ and
satisfies $B\subseteq P$.
\par
Now, $P$ is a subset of $A$; thus, $P\setminus B$ is a subset of $A\setminus
B$. Moreover, $\left\vert P\right\vert =m$ (since $P$ is an $m$-element set).
From $B\subseteq P$, we obtain $\left\vert P\setminus B\right\vert
=\underbrace{\left\vert P\right\vert }_{=m}-\underbrace{\left\vert
B\right\vert }_{=b}=m-b$. Hence, $P\setminus B$ is an $\left(  m-b\right)
$-element set. Thus, $P\setminus B$ is an $\left(  m-b\right)  $-element
subset of $A\setminus B$. In other words, $P\setminus B\in\mathbf{K}$ (by the
definition of $\mathbf{K}$). Qed.}. Thus, we can define a map%
\begin{align*}
f:\mathbf{L}  &  \rightarrow\mathbf{K},\\
P  &  \mapsto P\setminus B.
\end{align*}
Consider this map $f$.

We intend to show that $f$ is a bijection; for that purpose, let us construct
its inverse.

For each $Q\in\mathbf{K}$, we have $Q\cup B\in\mathbf{L}$%
\ \ \ \ \footnote{\textit{Proof.} Let $Q\in\mathbf{K}$. Thus, $Q$ is an
$\left(  m-b\right)  $-element subset of $A\setminus B$ (by the definition of
$\mathbf{K}$). Now, $Q$ is a subset of $A\setminus B$; hence, $Q$ is a subset
of $A$ and is disjoint from $B$. (This follows from basic set theory.)
\par
Now we know that both sets $Q$ and $B$ are subsets of $A$. Hence, their union
$Q\cup B$ is a subset of $A$ as well. Furthermore, $\left\vert Q\right\vert
=m-b$ (since $Q$ is an $\left(  m-b\right)  $-element set). Since $Q$ is
disjoint from $B$, we have $\left\vert Q\cup B\right\vert
=\underbrace{\left\vert Q\right\vert }_{=m-b}+\underbrace{\left\vert
B\right\vert }_{=b}=\left(  m-b\right)  +b=m$. Thus, $Q\cup B$ is an
$m$-element set. Hence, $Q\cup B$ is an $m$-element subset of $A$ and
satisfies $B\subseteq Q\cup B$ (obviously). In other words, $Q\cup B$ is an
$m$-element subset $S$ of $A$ satisfying $B\subseteq S$. In other words,
$Q\cup B\in\mathbf{L}$ (by the definition of $\mathbf{L}$). Qed.}. Thus, we
can define a map%
\begin{align*}
g:\mathbf{K}  &  \rightarrow\mathbf{L},\\
Q  &  \mapsto Q\cup B.
\end{align*}
Consider this map $g$.

We have $f\circ g=\operatorname*{id}$\ \ \ \ \footnote{\textit{Proof.} Let
$Q\in\mathbf{K}$. Then, $Q$ is an $\left(  m-b\right)  $-element subset of
$A\setminus B$ (by the definition of $\mathbf{K}$). Now, $Q$ is a subset of
$A\setminus B$; hence, $Q$ is a subset of $A$ and is disjoint from $B$. (This
follows from basic set theory.)
\par
The definition of $g$ yields $g\left(  Q\right)  =Q\cup B$. But the definition
of $f$ yields $f\left(  g\left(  Q\right)  \right)  =\underbrace{g\left(
Q\right)  }_{=Q\cup B}\setminus B=\left(  Q\cup B\right)  \setminus
B=Q\setminus B=Q$ (since $Q$ is disjoint from $B$). Hence, $\left(  f\circ
g\right)  \left(  Q\right)  =f\left(  g\left(  Q\right)  \right)
=Q=\operatorname*{id}\left(  Q\right)  $.
\par
Now, forget that we fixed $Q$. We thus have shown that each $Q\in\mathbf{K}$
satisfies $\left(  f\circ g\right)  \left(  Q\right)  =\operatorname*{id}%
\left(  Q\right)  $. In other words, $f\circ g=\operatorname*{id}$.} and
$g\circ f=\operatorname*{id}$\ \ \ \ \footnote{\textit{Proof.} Let
$P\in\mathbf{L}$. Thus, $P$ is an $m$-element subset $S$ of $A$ satisfying
$B\subseteq S$ (by the definition of $\mathbf{L}$). In other words, $P$ is an
$m$-element subset of $A$ and satisfies $B\subseteq P$.
\par
The definition of $f$ yields $f\left(  P\right)  =P\setminus B$. But the
definition of $g$ yields $g\left(  f\left(  P\right)  \right)
=\underbrace{f\left(  P\right)  }_{=P\setminus B}\cup B=\left(  P\setminus
B\right)  \cup B=P$ (since $B\subseteq P$). Hence, $\left(  g\circ f\right)
\left(  P\right)  =g\left(  f\left(  P\right)  \right)  =P=\operatorname*{id}%
\left(  P\right)  $.
\par
Now, forget that we fixed $P$. We thus have shown that $\left(  g\circ
f\right)  \left(  P\right)  =\operatorname*{id}\left(  P\right)  $ for each
$P\in\mathbf{L}$. In other words, $g\circ f=\operatorname*{id}$.}. These two
equalities show that the maps $f$ and $g$ are mutually inverse. Hence, the map
$f$ is invertible, i.e., bijective. Thus, there exists a bijective map from
$\mathbf{L}$ to $\mathbf{K}$ (namely, $f$). Hence, $\left\vert \mathbf{L}%
\right\vert =\left\vert \mathbf{K}\right\vert $. Comparing this with
(\ref{sol.binom.subsets-ctg.sizeL=}), we obtain%
\[
\left(  \text{the number of }m\text{-element subsets }S\text{ of }A\text{
satisfying }B\subseteq S\right)  =\left\vert \mathbf{K}\right\vert
=\dbinom{a-b}{m-b}%
\]
(by (\ref{sol.binom.subsets-ctg.sizeK=})). Thus, Exercise
\ref{exe.binom.subsets-ctg} is rigorously solved.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.binom.p-for-EGZ}}

\begin{fineprint}
We shall give two solutions to Exercise \ref{exe.binom.p-for-EGZ}: one using
Lucas's congruence (Theorem \ref{thm.binom.lucas}), and one using just basic
properties of binomial coefficients. We start with the former:

\begin{proof}
[First solution to Exercise \ref{exe.binom.p-for-EGZ}.]We have $p>1$ (since
$p$ is a prime). Thus, $0\in\left\{  0,1,\ldots,p-1\right\}  $.

\textbf{(a)} Theorem \ref{thm.binom.lucas} (applied to $a=2$, $b=1$, $c=0$ and
$d=0$) yields%
\[
\dbinom{p\cdot2+0}{p\cdot1+0}\equiv\underbrace{\dbinom{2}{1}}_{=2}%
\underbrace{\dbinom{0}{0}}_{=1}=2\cdot1=2\operatorname{mod}p.
\]
In view of $p\cdot2+0=2p$ and $p\cdot1+0=p$, this rewrites as $\dbinom{2p}%
{p}\equiv2\operatorname{mod}p$. This solves Exercise \ref{exe.binom.p-for-EGZ}
\textbf{(a)}.

\textbf{(b)} Theorem \ref{thm.binom.lucas} (applied to $a=1$, $b=1$, $c=p-1$
and $d=0$) yields%
\[
\dbinom{p\cdot1+\left(  p-1\right)  }{p\cdot1+0}\equiv\underbrace{\dbinom
{1}{1}}_{=1}\underbrace{\dbinom{p-1}{0}}_{=1}=1\cdot1=1\operatorname{mod}p.
\]
In view of $p\cdot1+\left(  p-1\right)  =2p-1$ and $p\cdot1+0=p$, this
rewrites as $\dbinom{2p-1}{p}\equiv1\operatorname{mod}p$. This solves Exercise
\ref{exe.binom.p-for-EGZ} \textbf{(b)}.

\textbf{(c)} Let $k\in\left\{  1,2,\ldots,p-1\right\}  $. Thus, $k-1\in
\left\{  0,1,\ldots,p-2\right\}  \subseteq\left\{  0,1,\ldots,p-1\right\}  $
and $k\in\left\{  1,2,\ldots,p-1\right\}  \subseteq\left\{  0,1,\ldots
,p-1\right\}  $. Hence, Theorem \ref{thm.binom.lucas} (applied to $a=1$,
$b=0$, $c=k-1$ and $d=k$) yields%
\[
\dbinom{p\cdot1+\left(  k-1\right)  }{p\cdot0+k}\equiv\underbrace{\dbinom
{1}{0}}_{=1}\dbinom{k-1}{k}=\dbinom{k-1}{k}\operatorname{mod}p.
\]
In view of $p\cdot1+\left(  k-1\right)  =p-1+k$ and $p\cdot0+k=k$, this
rewrites as
\begin{equation}
\dbinom{p-1+k}{k}\equiv\dbinom{k-1}{k}\operatorname{mod}p.
\label{sol.binom.p-for-EGZ.1st.c.1}%
\end{equation}
But Theorem \ref{thm.binom.k>n0} (applied to $n=k-1$) yields $\dbinom{k-1}%
{k}=0$ (since $k-1\in\left\{  0,1,\ldots,p-1\right\}  \subseteq\mathbb{N}$ and
$k>k-1$). Hence, (\ref{sol.binom.p-for-EGZ.1st.c.1}) becomes%
\[
\dbinom{p-1+k}{k}\equiv\dbinom{k-1}{k}=0\operatorname{mod}p.
\]
This solves Exercise \ref{exe.binom.p-for-EGZ} \textbf{(c)}.
\end{proof}

\begin{proof}
[Second solution to Exercise \ref{exe.binom.p-for-EGZ}.]We have $p>1$ (since
$p$ is a prime). Thus, $0\in\left\{  0,1,\ldots,p-1\right\}  $.

Furthermore, we have $\left(  p-1\right)  !\perp p$%
\ \ \ \ \footnote{\textit{Proof.} It is easy to derive this from Wilson's
theorem (Theorem \ref{thm.ent.wilson}), but let us give a more elementary
proof:
\par
Each $i\in\left\{  1,2,\ldots,p-1\right\}  $ is coprime to $p$ (by Proposition
\ref{prop.ent.prime.each-i-coprime}). In other words, each $i\in\left\{
1,2,\ldots,p-1\right\}  $ satisfies $i\perp p$. Hence, Exercise
\ref{exe.ent.coprime.ab-to-ck} (applied to $c=p$, $k=p-1$ and $a_{i}=i$) shows
that $1\cdot2\cdot\cdots\cdot\left(  p-1\right)  \perp p$. This rewrites as
$\left(  p-1\right)  !\perp p$ (since $\left(  p-1\right)  !=1\cdot
2\cdot\cdots\cdot\left(  p-1\right)  $).}.

\textbf{(a)} Theorem \ref{thm.binom.abs} (applied to $n=2p$ and $k=p$) yields%
\[
p\dbinom{2p}{p}=2p\dbinom{2p-1}{p-1}.
\]
We can cancel $p$ from this equality (since $p$ is nonzero); thus, we obtain%
\begin{equation}
\dbinom{2p}{p}=2\dbinom{2p-1}{p-1}. \label{sol.binom.p-for-EGZ.2nd.a.1}%
\end{equation}


Now, $p-1\in\mathbb{N}$ (since $p>1$). Thus, the definition of $\dbinom
{2p-1}{p-1}$ yields%
\[
\dbinom{2p-1}{p-1}=\dfrac{\left(  2p-1\right)  \left(  \left(  2p-1\right)
-1\right)  \left(  \left(  2p-1\right)  -2\right)  \cdots\left(  \left(
2p-1\right)  -\left(  p-1\right)  +1\right)  }{\left(  p-1\right)  !}.
\]
Hence,%
\begin{align*}
\left(  p-1\right)  !\cdot\dbinom{2p-1}{p-1}  &  =\left(  2p-1\right)  \left(
\left(  2p-1\right)  -1\right)  \left(  \left(  2p-1\right)  -2\right)
\cdots\left(  \left(  2p-1\right)  -\left(  p-1\right)  +1\right) \\
&  =\prod_{i=0}^{\left(  p-1\right)  -1}\left(  \left(  2p-1\right)
-i\right)  =\prod_{s=1}^{p-1}\underbrace{\left(  \left(  2p-1\right)  -\left(
p-1-s\right)  \right)  }_{=p+s}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have substituted }p-1-s\text{
for }i\text{ in the product}\right) \\
&  =\prod_{s=1}^{p-1}\underbrace{\left(  p+s\right)  }_{\equiv
s\operatorname{mod}p}\equiv\prod_{s=1}^{p-1}s\operatorname{mod}p
\end{align*}
\footnote{Here is a detailed justification of the last \textquotedblleft%
$\equiv$\textquotedblright\ sign in this computation: We have $p+s\equiv
s\operatorname{mod}p$ for each $s\in\left\{  1,2,\ldots,p-1\right\}  $. Hence,
(\ref{eq.exe.ent.mod.k-sum.b}) (applied to $n=p$, $S=\left\{  1,2,\ldots
,p-1\right\}  $, $a_{s}=p+s$ and $b_{s}=s$) yields%
\[
\prod_{s\in\left\{  1,2,\ldots,p-1\right\}  }\left(  p+s\right)  \equiv
\prod_{s\in\left\{  1,2,\ldots,p-1\right\}  }s\operatorname{mod}p.
\]
This congruence rewrites as $\prod_{s=1}^{p-1}\left(  p+s\right)  \equiv
\prod_{s=1}^{p-1}s\operatorname{mod}p$ (since the \textquotedblleft%
$\prod_{s\in\left\{  1,2,\ldots,p-1\right\}  }$\textquotedblright\ sign is
equivalent to \textquotedblleft$\prod_{s=1}^{p-1}$\textquotedblright). Qed.}.
Thus,%
\[
\left(  p-1\right)  !\cdot\dbinom{2p-1}{p-1}\equiv\prod_{s=1}^{p-1}%
s=1\cdot2\cdot\cdots\cdot\left(  p-1\right)  =\left(  p-1\right)  !=\left(
p-1\right)  !\cdot1\operatorname{mod}p.
\]
Hence, Lemma \ref{lem.ent.coprime.cancel} (applied to $n=p$, $a=\left(
p-1\right)  !$, $b=\dbinom{2p-1}{p-1}$ and $c=1$) shows that
\begin{equation}
\dbinom{2p-1}{p-1}\equiv1\operatorname{mod}p
\label{sol.binom.p-for-EGZ.2nd.b.1}%
\end{equation}
(since $\left(  p-1\right)  !\perp p$). Thus,
(\ref{sol.binom.p-for-EGZ.2nd.a.1}) becomes%
\[
\dbinom{2p}{p}=2\underbrace{\dbinom{2p-1}{p-1}}_{\equiv1\operatorname{mod}%
p}\equiv2\cdot1=2\operatorname{mod}p.
\]
This solves Exercise \ref{exe.binom.p-for-EGZ} \textbf{(a)}.

\textbf{(b)} We have $2p-1\in\mathbb{N}$ (since $p>1$). Thus, Theorem
\ref{thm.binom.symmetry} (applied to $n=2p-1$ and $k=p$) yields%
\begin{align*}
\dbinom{2p-1}{p}  &  =\dbinom{2p-1}{\left(  2p-1\right)  -p}=\dbinom
{2p-1}{p-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  2p-1\right)
-p=p-1\right) \\
&  \equiv1\operatorname{mod}p\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.binom.p-for-EGZ.2nd.b.1})}\right)  .
\end{align*}
This solves Exercise \ref{exe.binom.p-for-EGZ} \textbf{(b)}.

\textbf{(c)} Let $k\in\left\{  1,2,\ldots,p-1\right\}  $. Thus, $k-1\in
\left\{  0,1,\ldots,p-2\right\}  \subseteq\mathbb{N}$, so that $k-1\in\left\{
0,1,\ldots,k-1\right\}  $.

We have $k\in\left\{  1,2,\ldots,p-1\right\}  $, so that $k\leq p-1$. Hence,
$k!\perp p$\ \ \ \ \footnote{\textit{Proof.} Each $i\in\left\{  1,2,\ldots
,k\right\}  $ satisfies $i\in\left\{  1,2,\ldots,p-1\right\}  $ (since $k\leq
p-1$) and therefore is coprime to $p$ (by Proposition
\ref{prop.ent.prime.each-i-coprime}). In other words, each $i\in\left\{
1,2,\ldots,k\right\}  $ satisfies $i\perp p$. Hence, Exercise
\ref{exe.ent.coprime.ab-to-ck} (applied to $c=p$ and $a_{i}=i$) shows that
$1\cdot2\cdot\cdots\cdot k\perp p$. This rewrites as $k!\perp p$ (since
$k!=1\cdot2\cdot\cdots\cdot k$).}. Thus, $p\perp k!$ (by Proposition
\ref{prop.ent.coprime.perp-symm}).

The definition of $\dbinom{p-1+k}{k}$ yields%
\[
\dbinom{p-1+k}{k}=\dfrac{\left(  p-1+k\right)  \left(  \left(  p-1+k\right)
-1\right)  \left(  \left(  p-1+k\right)  -2\right)  \cdots\left(  \left(
p-1+k\right)  -k+1\right)  }{k!}.
\]
Hence,%
\begin{align*}
&  k!\cdot\dbinom{p-1+k}{k}\\
&  =\left(  p-1+k\right)  \left(  \left(  p-1+k\right)  -1\right)  \left(
\left(  p-1+k\right)  -2\right)  \cdots\left(  \left(  p-1+k\right)
-k+1\right) \\
&  =\prod_{i=0}^{k-1}\left(  \left(  p-1+k\right)  -i\right)
=\underbrace{\left(  \left(  p-1+k\right)  -\left(  k-1\right)  \right)
}_{=p}\cdot\prod_{i=0}^{k-2}\left(  \left(  p-1+k\right)  -i\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split off the factor for }i=k-1\\
\text{from the product, since }k-1\in\left\{  0,1,\ldots,k-1\right\}
\end{array}
\right) \\
&  =p\cdot\prod_{i=0}^{k-2}\left(  \left(  p-1+k\right)  -i\right)  .
\end{align*}
This shows that $p\mid k!\cdot\dbinom{p-1+k}{k}$ (since $\prod_{i=0}%
^{k-2}\left(  \left(  p-1+k\right)  -i\right)  $ is an integer). Thus, Theorem
\ref{thm.ent.coprime.cancel} (applied to $a=p$, $b=k!$ and $c=\dbinom
{p-1+k}{k}$) yields $p\mid\dbinom{p-1+k}{k}$ (since $p\perp k!$). In other
words, $\dbinom{p-1+k}{k}\equiv0\operatorname{mod}p$. This solves Exercise
\ref{exe.binom.p-for-EGZ} \textbf{(c)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.count-divs-k}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.ent.count-divs-k}.]\textbf{(a)} For every prime
$p>\left\vert n\right\vert $, we have $v_{p}\left(  n\right)  =0$ (by Lemma
\ref{lem.ent.prime.vpn=0} \textbf{(a)}) and thus
\[
p^{0k}+p^{1k}+\cdots+p^{v_{p}\left(  n\right)  \cdot k}=p^{0k}+p^{1k}%
+\cdots+p^{0k}=p^{0k}=p^{0}=1.
\]
Thus, all but finitely many primes $p$ satisfy $p^{0k}+p^{1k}+\cdots
+p^{v_{p}\left(  n\right)  \cdot k}=1$ (since all but finitely many primes $p$
satisfy $p>\left\vert n\right\vert $). Therefore, all but finitely many
factors of the product $\prod_{p\text{ prime}}\left(  p^{0k}+p^{1k}%
+\cdots+p^{v_{p}\left(  n\right)  \cdot k}\right)  $ are $1$. In other words,
the product \newline$\prod_{p\text{ prime}}\left(  p^{0k}+p^{1k}%
+\cdots+p^{v_{p}\left(  n\right)  \cdot k}\right)  $ has only finitely many
factors different from $1$. Hence, this product is well-defined. This solves
Exercise \ref{exe.ent.count-divs-k} \textbf{(a)}.

\textbf{(b)} Forget that we fixed $k$. Instead, fix $w\in\mathbb{Z}$. (The
only reason we are doing this is that we will have to use the letter
\textquotedblleft$k$\textquotedblright\ for a different purpose.)

For every prime $p>\left\vert n\right\vert $, we have $v_{p}\left(  n\right)
=0$ (by Lemma \ref{lem.ent.prime.vpn=0} \textbf{(a)}). Thus, all but finitely
many primes $p$ satisfy $v_{p}\left(  n\right)  =0$ (since all but finitely
many primes $p$ satisfy $p>\left\vert n\right\vert $). In other words, the set
of all primes $p$ satisfying $v_{p}\left(  n\right)  \neq0$ is finite. Let $P$
be this set. Thus, $P$ is finite.

Let $\left(  p_{1},p_{2},\ldots,p_{u}\right)  $ be a list of elements of $P$,
with no repetitions.\footnote{Such a list exists, since $P$ is finite.} Thus,
$\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  =P$. Now, the elements
$p_{1},p_{2},\ldots,p_{u}$ belong to $\left\{  p_{1},p_{2},\ldots
,p_{u}\right\}  =P$, and thus are primes (since $P$ is a set of primes).
Furthermore, the elements $p_{1},p_{2},\ldots,p_{u}$ are distinct (since
$\left(  p_{1},p_{2},\ldots,p_{u}\right)  $ was defined to be a list with no repetitions).

For each $i\in\left\{  1,2,\ldots,u\right\}  $, define a nonnegative integer
$a_{i}$ by%
\begin{equation}
a_{i}=v_{p_{i}}\left(  n\right)  . \label{sol.ent.count-divs-k.ai=}%
\end{equation}
This is well-defined, since $p_{i}$ is a prime (because $p_{1},p_{2}%
,\ldots,p_{u}$ are primes) and since $n$ is nonzero.

The following facts have been proven in the proof of Proposition
\ref{prop.ent.count-divs}:

\begin{itemize}
\item The map $\left\{  1,2,\ldots,u\right\}  \rightarrow\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  ,\ i\mapsto p_{i}$ is a bijection.

\item If $p$ is a prime such that $p\notin\left\{  p_{1},p_{2},\ldots
,p_{u}\right\}  $, then
\begin{equation}
v_{p}\left(  n\right)  =0. \label{sol.ent.count-divs-k.vpn=0}%
\end{equation}


\item We have $n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}$.
\end{itemize}

If $p$ is a prime such that $p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
$, then%
\begin{align}
p^{0w}+p^{1w}+\cdots+p^{v_{p}\left(  n\right)  \cdot w}  &  =p^{0w}%
+p^{1w}+\cdots+p^{0w}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
(\ref{sol.ent.count-divs-k.vpn=0}) yields }v_{p}\left(  n\right)  =0\right)
\nonumber\\
&  =p^{0w}=p^{0}=1. \label{sol.ent.count-divs-k.p0wetc=1}%
\end{align}


Define a set $T$ as in Lemma \ref{lem.ent.divs-bijs}. Then, Lemma
\ref{lem.ent.divs-bijs} says that the map
\begin{align*}
\Lambda:T  &  \rightarrow\left\{  \text{positive divisors of }n\right\}  ,\\
\left(  b_{1},b_{2},\ldots,b_{u}\right)   &  \mapsto p_{1}^{b_{1}}p_{2}%
^{b_{2}}\cdots p_{u}^{b_{u}}%
\end{align*}
is well-defined and bijective. Thus, this map $\Lambda$ is a bijection.

Now, the summation sign \textquotedblleft$\sum_{d\mid n}$\textquotedblright%
\ stands for a sum over all positive divisors of $n$, and thus is equivalent
to the summation sign \textquotedblleft$\sum_{d\in\left\{  \text{positive
divisors of }n\right\}  }$\textquotedblright. Hence,%
\begin{align}
\sum_{d\mid n}d^{w}  &  =\sum_{d\in\left\{  \text{positive divisors of
}n\right\}  }d^{w}=\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in
T}\left(  \underbrace{\Lambda\left(  b_{1},b_{2},\ldots,b_{u}\right)
}_{\substack{=p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}\\\text{(by the
definition of }\Lambda\text{)}}}\right)  ^{w}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }\Lambda\left(  b_{1},b_{2},\ldots
,b_{u}\right)  \text{ for }d\text{ in the}\\
\text{sum, since the map }\Lambda:T\rightarrow\left\{  \text{positive divisors
of }n\right\} \\
\text{is a bijection}%
\end{array}
\right) \nonumber\\
&  =\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in T}\underbrace{\left(
p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}\right)  ^{w}}_{=p_{1}^{b_{1}%
w}p_{2}^{b_{2}w}\cdots p_{u}^{b_{u}w}=\prod_{i=1}^{u}p_{i}^{b_{i}w}%
}\nonumber\\
&  =\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in T}\ \ \prod_{i=1}%
^{u}p_{i}^{b_{i}w}. \label{sol.ent.count-divs-k.b.3}%
\end{align}


Now, Lemma \ref{lem.prodrule.nums} (applied to $u$, $\left\{  0,1,\ldots
,a_{i}\right\}  $ and $p_{i}^{kw}$ instead of $n$, $Z_{i}$ and $p_{i,k}$)
yields%
\begin{align*}
\prod_{i=1}^{u}\sum_{k\in\left\{  0,1,\ldots,a_{i}\right\}  }p_{i}^{kw}  &
=\sum_{\left(  k_{1},k_{2},\ldots,k_{u}\right)  \in\left\{  0,1,\ldots
,a_{1}\right\}  \times\left\{  0,1,\ldots,a_{2}\right\}  \times\cdots
\times\left\{  0,1,\ldots,a_{u}\right\}  }\ \ \prod_{i=1}^{u}p_{i}^{k_{i}w}\\
&  =\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in\left\{  0,1,\ldots
,a_{1}\right\}  \times\left\{  0,1,\ldots,a_{2}\right\}  \times\cdots
\times\left\{  0,1,\ldots,a_{u}\right\}  }\ \ \prod_{i=1}^{u}p_{i}^{b_{i}w}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have renamed the summation}\\
\text{index }\left(  k_{1},k_{2},\ldots,k_{u}\right)  \text{ as }\left(
b_{1},b_{2},\ldots,b_{u}\right)
\end{array}
\right) \\
&  =\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in T}\ \ \prod_{i=1}%
^{u}p_{i}^{b_{i}w}%
\end{align*}
(since $\left\{  0,1,\ldots,a_{1}\right\}  \times\left\{  0,1,\ldots
,a_{2}\right\}  \times\cdots\times\left\{  0,1,\ldots,a_{u}\right\}  =T$).
Comparing this with (\ref{sol.ent.count-divs-k.b.3}), we find%
\[
\sum_{d\mid n}d^{w}=\prod_{i=1}^{u}\underbrace{\sum_{k\in\left\{
0,1,\ldots,a_{i}\right\}  }p_{i}^{kw}}_{=p_{i}^{0w}+p_{i}^{1w}+\cdots
+p_{i}^{a_{i}w}}=\prod_{i=1}^{u}\left(  p_{i}^{0w}+p_{i}^{1w}+\cdots
+p_{i}^{a_{i}w}\right)  .
\]
Comparing this with%
\begin{align*}
&  \prod_{p\text{ prime}}\left(  p^{0w}+p^{1w}+\cdots+p^{v_{p}\left(
n\right)  \cdot w}\right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}\left(  p^{0w}+p^{1w}+\cdots+p^{v_{p}\left(
n\right)  \cdot w}\right)  \right)  \left(  \prod_{\substack{p\text{
prime;}\\p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  }%
}\underbrace{\left(  p^{0w}+p^{1w}+\cdots+p^{v_{p}\left(  n\right)  \cdot
w}\right)  }_{\substack{=1\\\text{(by (\ref{sol.ent.count-divs-k.p0wetc=1}))}%
}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each prime }p\text{ satisfies either }p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\} \\
\text{or }p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  \text{ (but not
both simultaneously)}%
\end{array}
\right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}\left(  p^{0w}+p^{1w}+\cdots+p^{v_{p}\left(
n\right)  \cdot w}\right)  \right)  \underbrace{\left(  \prod
_{\substack{p\text{ prime;}\\p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}
}}1\right)  }_{=1}\\
&  =\underbrace{\prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  }}}_{\substack{=\prod_{p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  }\\\text{(since each }p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  \\\text{is a prime)}}}\left(  p^{0w}%
+p^{1w}+\cdots+p^{v_{p}\left(  n\right)  \cdot w}\right) \\
&  =\prod_{p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  }\left(
p^{0w}+p^{1w}+\cdots+p^{v_{p}\left(  n\right)  \cdot w}\right)  =\prod
_{i=1}^{u}\underbrace{\left(  p_{i}^{0w}+p_{i}^{1w}+\cdots+p_{i}^{v_{p_{i}%
}\left(  n\right)  \cdot w}\right)  }_{\substack{=p_{i}^{0w}+p_{i}^{1w}%
+\cdots+p_{i}^{a_{i}w}\\\text{(since (\ref{sol.ent.count-divs-k.ai=}) yields
}v_{p_{i}}\left(  n\right)  =a_{i}\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }p_{i}\text{ for }p\text{ in the product,}\\
\text{since the map }\left\{  1,2,\ldots,u\right\}  \rightarrow\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  ,\ i\mapsto p_{i}\text{ is a bijection}%
\end{array}
\right) \\
&  =\prod_{i=1}^{u}\left(  p_{i}^{0w}+p_{i}^{1w}+\cdots+p_{i}^{a_{i}w}\right)
,
\end{align*}
we obtain%
\[
\sum_{d\mid n}d^{w}=\prod_{p\text{ prime}}\left(  p^{0w}+p^{1w}+\cdots
+p^{v_{p}\left(  n\right)  \cdot w}\right)  .
\]


Now, forget that we fixed $w$. We thus have proven that every $w\in\mathbb{Z}$
satisfies%
\[
\sum_{d\mid n}d^{w}=\prod_{p\text{ prime}}\left(  p^{0w}+p^{1w}+\cdots
+p^{v_{p}\left(  n\right)  \cdot w}\right)  .
\]
Renaming the index $w$ as $k$ in this statement, we conclude that every
$k\in\mathbb{Z}$ satisfies%
\[
\sum_{d\mid n}d^{k}=\prod_{p\text{ prime}}\left(  p^{0k}+p^{1k}+\cdots
+p^{v_{p}\left(  n\right)  \cdot k}\right)  .
\]
This solves Exercise \ref{exe.ent.count-divs-k} \textbf{(b)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.count-divs-134}}

\begin{fineprint}
We shall prepare for the solution to Exercise \ref{exe.ent.count-divs-134} by
defining a function $L$ on $\mathbb{Z}$ and proving a bunch of its properties.

\begin{definition}
\label{def.sol.ent.count-divs-134.L}Throughout this section, we shall use the
following notation:

For each $u\in\mathbb{Z}$, we set%
\[
L\left(  u\right)  =%
\begin{cases}
1, & \text{if }u\%4=1;\\
-1, & \text{if }u\%4=3;\\
0, & \text{otherwise.}%
\end{cases}
\]

\end{definition}

We notice the following properties of this definition:

\begin{lemma}
\label{lem.sol.ent.count-divs-134.L0}Let $u\in\mathbb{Z}$.

\textbf{(a)} If $\gcd\left(  u,4\right)  \neq1$, then $L\left(  u\right)  =0$.

\textbf{(b)} If $\gcd\left(  u,4\right)  =1$, then $L\left(  u\right)  \equiv
u\operatorname{mod}4$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.count-divs-134.L0}.]Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $n=4$) yields
$u\%4\in\left\{  0,1,\ldots,4-1\right\}  $ and $u\%4\equiv u\operatorname{mod}%
4$. Hence, $u\equiv u\%4\operatorname{mod}4$ and $u\%4\in\left\{
0,1,\ldots,4-1\right\}  =\left\{  0,1,2,3\right\}  $.

Proposition \ref{prop.ent.gcd.props1} \textbf{(e)} (applied to $a=4$ and
$b=u$) yields $\gcd\left(  4,u\right)  =\gcd\left(  4,u\%4\right)  $. But
Proposition \ref{prop.ent.gcd.props1} \textbf{(b)} yields
\begin{equation}
\gcd\left(  u,4\right)  =\gcd\left(  4,u\right)  =\gcd\left(  4,u\%4\right)  .
\label{pf.lem.sol.ent.count-divs-134.L0.1}%
\end{equation}


We have $u\%4\in\left\{  0,1,2,3\right\}  $. In other words, we have $u\%4=0$
or $u\%4=1$ or $u\%4=2$ or $u\%4=3$. Hence, we are in one of the following
four cases:

\textit{Case 1:} We have $u\%4=0$.

\textit{Case 2:} We have $u\%4=1$.

\textit{Case 3:} We have $u\%4=2$.

\textit{Case 4:} We have $u\%4=3$.

Let us first consider Case 1. In this case, we have $u\%4=0$. Hence, we have
neither $u\%4=1$ nor $u\%4=3$.

Also, from $u\%4=0$, we obtain $\gcd\left(  u,4\right)  \neq1$%
\ \ \ \ \footnote{\textit{Proof.} Proposition \ref{prop.ent.gcd.props1}
\textbf{(a)} (applied to $a=4$) yields $\gcd\left(  4,0\right)  =\gcd\left(
4\right)  =\left\vert 4\right\vert $.
\par
Now, (\ref{pf.lem.sol.ent.count-divs-134.L0.1}) becomes $\gcd\left(
u,4\right)  =\gcd\left(  4,\underbrace{u\%4}_{=0}\right)  =\gcd\left(
4,0\right)  =\left\vert 4\right\vert =4\neq1$.}. Hence, $\gcd\left(
u,4\right)  =1$ is false. Thus, the claim of Lemma
\ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)} is vacuously true (in Case
1). Furthermore, the definition of $L\left(  u\right)  $ yields $L\left(
u\right)  =%
\begin{cases}
1, & \text{if }u\%4=1;\\
-1, & \text{if }u\%4=3;\\
0, & \text{otherwise}%
\end{cases}
=0$ (since we have neither $u\%4=1$ nor $u\%4=3$). Thus, the claim of Lemma
\ref{lem.sol.ent.count-divs-134.L0} \textbf{(a)} is true (in Case 1). Hence,
we have proven that both Lemma \ref{lem.sol.ent.count-divs-134.L0}
\textbf{(a)} and Lemma \ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)} are
true (in Case 1). In other words, Lemma \ref{lem.sol.ent.count-divs-134.L0} is
proven in Case 1.

Let us next consider Case 2. In this case, we have $u\%4=1$.

Thus, $\gcd\left(  u,4\right)  =1$\ \ \ \ \footnote{\textit{Proof.} The
equality (\ref{pf.lem.sol.ent.count-divs-134.L0.1}) becomes $\gcd\left(
u,4\right)  =\gcd\left(  4,\underbrace{u\%4}_{=1}\right)  =\gcd\left(
4,1\right)  =\gcd\left(  1,4\right)  $ (by Proposition
\ref{prop.ent.gcd.props1} \textbf{(b)}). But $1\mid4$; hence, Proposition
\ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $a=1$ and $b=4$) yields
$\gcd\left(  1,4\right)  =\left\vert 1\right\vert =1$. Hence, $\gcd\left(
u,4\right)  =\gcd\left(  1,4\right)  =1$.}. Hence, $\gcd\left(  u,4\right)
\neq1$ is false. Thus, the claim of Lemma \ref{lem.sol.ent.count-divs-134.L0}
\textbf{(a)} is vacuously true (in Case 2). Furthermore, the definition of
$L\left(  u\right)  $ yields $L\left(  u\right)  =%
\begin{cases}
1, & \text{if }u\%4=1;\\
-1, & \text{if }u\%4=3;\\
0, & \text{otherwise}%
\end{cases}
=1$ (since $u\%4=1$), so that $L\left(  u\right)  =1=u\%4\equiv
u\operatorname{mod}4$. Thus, the claim of Lemma
\ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)} is true (in Case 2). Hence,
we have proven that both Lemma \ref{lem.sol.ent.count-divs-134.L0}
\textbf{(a)} and Lemma \ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)} are
true (in Case 2). In other words, Lemma \ref{lem.sol.ent.count-divs-134.L0} is
proven in Case 2.

Let us next consider Case 3. In this case, we have $u\%4=2$. Hence, we have
neither $u\%4=1$ nor $u\%4=3$.

Also, from $u\%4=2$, we obtain $\gcd\left(  u,4\right)  \neq1$%
\ \ \ \ \footnote{\textit{Proof.} We have $2\mid4$; thus, Proposition
\ref{prop.ent.gcd.props1} \textbf{(i)} (applied to $a=2$ and $b=4$) yields
$\gcd\left(  2,4\right)  =\left\vert 2\right\vert =2$. On the other hand,
Proposition \ref{prop.ent.gcd.props1} \textbf{(b)} yields $\gcd\left(
4,2\right)  =\gcd\left(  2,4\right)  =2$.
\par
Now, (\ref{pf.lem.sol.ent.count-divs-134.L0.1}) becomes $\gcd\left(
u,4\right)  =\gcd\left(  4,\underbrace{u\%4}_{=2}\right)  =\gcd\left(
4,2\right)  =2\neq1$.}. Hence, $\gcd\left(  u,4\right)  =1$ is false. Thus,
the claim of Lemma \ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)} is
vacuously true (in Case 3). Furthermore, the definition of $L\left(  u\right)
$ yields $L\left(  u\right)  =%
\begin{cases}
1, & \text{if }u\%4=1;\\
-1, & \text{if }u\%4=3;\\
0, & \text{otherwise}%
\end{cases}
=0$ (since we have neither $u\%4=1$ nor $u\%4=3$). Thus, the claim of Lemma
\ref{lem.sol.ent.count-divs-134.L0} \textbf{(a)} is true (in Case 3). Hence,
we have proven that both Lemma \ref{lem.sol.ent.count-divs-134.L0}
\textbf{(a)} and Lemma \ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)} are
true (in Case 3). In other words, Lemma \ref{lem.sol.ent.count-divs-134.L0} is
proven in Case 3.

Finally, let us consider Case 4. In this case, we have $u\%4=3$. Thus,
$\gcd\left(  u,4\right)  =1$\ \ \ \ \footnote{\textit{Proof.} From
(\ref{pf.lem.sol.ent.count-divs-134.L0.1}), we obtain%
\begin{align*}
\gcd\left(  u,4\right)   &  =\gcd\left(  4,\underbrace{u\%4}_{=3}\right)
=\gcd\left(  4,3\right)  =\gcd\left(  3,4\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.ent.gcd.props1} \textbf{(b)}}\right) \\
&  =\gcd\left(  3,\underbrace{4\%3}_{=1}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Proposition \ref{prop.ent.gcd.props1} \textbf{(e)}, applied to
}a=3\text{ and }b=4\right) \\
&  =\gcd\left(  3,1\right)  =\gcd\left(  1,3\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition \ref{prop.ent.gcd.props1}
\textbf{(b)}}\right)  .
\end{align*}
But $1\mid3$; thus, Proposition \ref{prop.ent.gcd.props1} \textbf{(i)}
(applied to $a=1$ and $b=3$) yields $\gcd\left(  1,3\right)  =\left\vert
1\right\vert =1$. Hence, $\gcd\left(  u,4\right)  =\gcd\left(  1,3\right)
=1$.}. Hence, $\gcd\left(  u,4\right)  \neq1$ is false. Thus, the claim of
Lemma \ref{lem.sol.ent.count-divs-134.L0} \textbf{(a)} is vacuously true (in
Case 4). Furthermore, $-1\equiv3\operatorname{mod}4$ (since $\left(
-1\right)  -3=-4$ is divisible by $4$). But the definition of $L\left(
u\right)  $ yields $L\left(  u\right)  =%
\begin{cases}
1, & \text{if }u\%4=1;\\
-1, & \text{if }u\%4=3;\\
0, & \text{otherwise}%
\end{cases}
=-1$ (since $u\%4=3$), so that $L\left(  u\right)  =-1\equiv3=u\%4\equiv
u\operatorname{mod}4$. Thus, the claim of Lemma
\ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)} is true (in Case 4). Hence,
we have proven that both Lemma \ref{lem.sol.ent.count-divs-134.L0}
\textbf{(a)} and Lemma \ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)} are
true (in Case 4). In other words, Lemma \ref{lem.sol.ent.count-divs-134.L0} is
proven in Case 4.

We have now proven Lemma \ref{lem.sol.ent.count-divs-134.L0} in all four Cases
1, 2, 3 and 4. Thus, Lemma \ref{lem.sol.ent.count-divs-134.L0} always holds.
\end{proof}

\begin{lemma}
\label{lem.sol.ent.count-divs-134.xyz}Let $x,y,z$ be three elements of the set
$\left\{  -1,0,1\right\}  $. If $xy\equiv z\operatorname{mod}4$, then $xy=z$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.count-divs-134.xyz}.]It is easy to prove this
lemma by mechanically verifying that it holds for all $3^{3}$ possible choices
of $\left(  x,y,z\right)  $; but here is a \textquotedblleft
smarter\textquotedblright\ proof:

We have $x\in\left\{  -1,0,1\right\}  =\left\{  -1,0,\ldots,1\right\}  $. In
other words, $-1\leq x\leq1$. In other words, $\left\vert x\right\vert \leq1$.
Similarly, $\left\vert y\right\vert \leq1$. We can multiply the two
inequalities $\left\vert x\right\vert \leq1$ and $\left\vert y\right\vert
\leq1$ together (this is legitimate, since all of their sides $\left\vert
x\right\vert $, $1$, $\left\vert y\right\vert $ and $1$ are nonnegative
reals); thus we obtain $\left\vert x\right\vert \cdot\left\vert y\right\vert
\leq1\cdot1=1$. Now, (\ref{eq.ent.div.abs(xy)}) yields $\left\vert
xy\right\vert =\left\vert x\right\vert \cdot\left\vert y\right\vert \leq1$. In
other words, $-1\leq xy\leq1$. Furthermore, $x$ and $y$ are two elements of
$\left\{  -1,0,1\right\}  $ and thus are integers; hence, $xy$ is an integer
as well. Thus, from $-1\leq xy\leq1$, we obtain $xy\in\left\{  -1,0,\ldots
,1\right\}  =\left\{  -1,0,1\right\}  $. Therefore, $xy+1\in\left\{
0,1,2\right\}  \subseteq\left\{  0,1,2,3\right\}  =\left\{  0,1,\ldots
,4-1\right\}  $.

Also, from $z\in\left\{  -1,0,1\right\}  $, we obtain $z+1\in\left\{
0,1,2\right\}  \subseteq\left\{  0,1,2,3\right\}  =\left\{  0,1,\ldots
,4-1\right\}  $.

Adding the congruence $xy\equiv z\operatorname{mod}4$ to the trivial
congruence $1\equiv1\operatorname{mod}4$, we obtain $xy+1\equiv
z+1\operatorname{mod}4$. Hence, Corollary \ref{cor.ent.quo-rem.remmod}
\textbf{(c)} (applied to $n=4$, $u=z+1$ and $c=xy+1$) shows that
\begin{equation}
xy+1=\left(  z+1\right)  \%4 \label{pf.lem.sol.ent.count-divs-134.Luv.at}%
\end{equation}
(since $xy+1\in\left\{  0,1,\ldots,4-1\right\}  $).

On the other hand, $z+1\in\left\{  0,1,\ldots,4-1\right\}  $ and $z+1\equiv
z+1\operatorname{mod}4$ (obviously). Hence, Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $n=4$, $u=z+1$ and
$c=z+1$) shows that $z+1=\left(  z+1\right)  \%4$. Comparing this equality
with (\ref{pf.lem.sol.ent.count-divs-134.Luv.at}), we find $xy+1=z+1$.
Cancelling $1$ from this equality, we find $xy=z$. This proves Lemma
\ref{lem.sol.ent.count-divs-134.xyz}.
\end{proof}

\begin{lemma}
\label{lem.sol.ent.count-divs-134.Luv}Let $u\in\mathbb{Z}$ and $v\in
\mathbb{Z}$. Then, $L\left(  uv\right)  =L\left(  u\right)  \cdot L\left(
v\right)  $.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.count-divs-134.Luv}.]Corollary
\ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $n=4$) yields
$u\%4\in\left\{  0,1,\ldots,4-1\right\}  $ and $u\%4\equiv u\operatorname{mod}%
4$. Thus, in particular, $u\%4\equiv u\operatorname{mod}4$, so that $u\equiv
u\%4\operatorname{mod}4$. The same argument (applied to $v$ instead of $u$)
yields $v\equiv v\%4\operatorname{mod}4$.

We next observe the following:

\begin{statement}
\textit{Claim 1:} If $\gcd\left(  u,4\right)  \neq1$, then $L\left(
uv\right)  =L\left(  u\right)  \cdot L\left(  v\right)  $.
\end{statement}

[\textit{Proof of Claim 1:} Assume that $\gcd\left(  u,4\right)  \neq1$. We
must prove that $L\left(  uv\right)  =L\left(  u\right)  \cdot L\left(
v\right)  $.

Note that $\gcd\left(  u,4\right)  $ is a nonnegative integer (by the
definition of a gcd). Hence, if we had $\gcd\left(  u,4\right)  \mid1$, then
we would have $\gcd\left(  u,4\right)  =1$ (by Exercise \ref{exe.ent.div.g|1},
applied to $g=\gcd\left(  u,4\right)  $), which would contradict $\gcd\left(
u,4\right)  \neq1$. Thus, we cannot have $\gcd\left(  u,4\right)  \mid1$.

Lemma \ref{lem.sol.ent.count-divs-134.L0} \textbf{(a)} yields $L\left(
u\right)  =0$ (since $\gcd\left(  u,4\right)  \neq1$).

Also, $u\mid uv$ and $4\mid4$. Hence, Exercise \ref{exe.ent.gcd.div} (applied
to $a_{1}=u$, $a_{2}=4$, $b_{1}=uv$ and $b_{2}=4$) yields $\gcd\left(
u,4\right)  \mid\gcd\left(  uv,4\right)  $. If we had $\gcd\left(
uv,4\right)  =1$, then this would entail $\gcd\left(  u,4\right)  \mid
\gcd\left(  uv,4\right)  =1$; but this would contradict the fact that we
cannot have $\gcd\left(  u,4\right)  \mid1$. Hence, we cannot have
$\gcd\left(  uv,4\right)  =1$. In other words, we must have $\gcd\left(
uv,4\right)  \neq1$. Hence, Lemma \ref{lem.sol.ent.count-divs-134.L0}
\textbf{(a)} (applied to $uv$ instead of $u$) yields $L\left(  uv\right)  =0$.
Comparing this with $\underbrace{L\left(  u\right)  }_{=0}\cdot L\left(
v\right)  =0$, we obtain $L\left(  uv\right)  =L\left(  u\right)  \cdot
L\left(  v\right)  $. This proves Claim 1.]

\begin{statement}
\textit{Claim 2:} If $\gcd\left(  v,4\right)  \neq1$, then $L\left(
uv\right)  =L\left(  u\right)  \cdot L\left(  v\right)  $.
\end{statement}

[\textit{Proof of Claim 2:} Claim 2 is obtained from Claim 1 by interchanging
$u$ and $v$ (since $u$ and $v$ clearly play symmetric roles in the statement
\textquotedblleft$L\left(  uv\right)  =L\left(  u\right)  \cdot L\left(
v\right)  $\textquotedblright). Thus, the proof of Claim 2 is analogous to the
proof of Claim 1.]

Now, we must prove that $L\left(  uv\right)  =L\left(  u\right)  \cdot
L\left(  v\right)  $. If $\gcd\left(  u,4\right)  \neq1$, then this follows
from Claim 1. Hence, for the rest of this proof, we can WLOG assume that
$\gcd\left(  u,4\right)  =1$. Assume this.

Now, we must prove that $L\left(  uv\right)  =L\left(  u\right)  \cdot
L\left(  v\right)  $. If $\gcd\left(  v,4\right)  \neq1$, then this follows
from Claim 2. Hence, for the rest of this proof, we can WLOG assume that
$\gcd\left(  v,4\right)  =1$. Assume this.

From $\gcd\left(  u,4\right)  =1$, we obtain $u\perp4$ (by the definition of
\textquotedblleft coprime\textquotedblright). From $\gcd\left(  v,4\right)
=1$, we obtain $v\perp4$ (by the definition of \textquotedblleft
coprime\textquotedblright). Hence, Theorem \ref{thm.ent.coprime.ab-to-c}
(applied to $a=u$, $b=v$ and $c=4$) yields $uv\perp4$. In other words,
$\gcd\left(  uv,4\right)  =1$ (by the definition of \textquotedblleft
coprime\textquotedblright). Hence, Lemma \ref{lem.sol.ent.count-divs-134.L0}
\textbf{(b)} (applied to $uv$ instead of $u$) yields $L\left(  uv\right)
\equiv uv\operatorname{mod}4$. Furthermore, recall that $\gcd\left(
u,4\right)  =1$; hence, Lemma \ref{lem.sol.ent.count-divs-134.L0} \textbf{(b)}
yields $L\left(  u\right)  \equiv u\operatorname{mod}4$. Moreover,
$\gcd\left(  v,4\right)  =1$; thus, Lemma \ref{lem.sol.ent.count-divs-134.L0}
\textbf{(b)} (applied to $v$ instead of $u$) yields $L\left(  v\right)  \equiv
v\operatorname{mod}4$. Thus,%
\begin{equation}
\underbrace{L\left(  u\right)  }_{\equiv u\operatorname{mod}4}\cdot
\underbrace{L\left(  v\right)  }_{\equiv v\operatorname{mod}4}\equiv uv\equiv
L\left(  uv\right)  \operatorname{mod}4
\label{pf.lem.sol.ent.count-divs-134.Luv.mod4eq}%
\end{equation}
(since $L\left(  uv\right)  \equiv uv\operatorname{mod}4$).

The definition of $L\left(  u\right)  $ yields $L\left(  u\right)  =%
\begin{cases}
1, & \text{if }u\%4=1;\\
-1, & \text{if }u\%4=3;\\
0, & \text{otherwise}%
\end{cases}
\in\left\{  -1,0,1\right\}  $ (since all three values $1,-1,0$ belong to the
set $\left\{  -1,0,1\right\}  $). The same argument (applied to $v$ instead of
$u$) shows that $L\left(  v\right)  \in\left\{  -1,0,1\right\}  $.
Furthermore, the argument that we used to prove $L\left(  u\right)
\in\left\{  -1,0,1\right\}  $ can also be applied to $uv$ instead of $u$; thus
we obtain $L\left(  uv\right)  \in\left\{  -1,0,1\right\}  $. Thus,
altogether, we know that $L\left(  u\right)  $, $L\left(  v\right)  $ and
$L\left(  uv\right)  $ are three elements of the set $\left\{  -1,0,1\right\}
$. These elements satisfy $L\left(  u\right)  \cdot L\left(  v\right)  \equiv
L\left(  uv\right)  \operatorname{mod}4$ (by
(\ref{pf.lem.sol.ent.count-divs-134.Luv.mod4eq})). Hence, Lemma
\ref{lem.sol.ent.count-divs-134.xyz} (applied to $x=L\left(  u\right)  $,
$y=L\left(  v\right)  $ and $z=L\left(  uv\right)  $) yields $L\left(
u\right)  \cdot L\left(  v\right)  =L\left(  uv\right)  $. In other words,
$L\left(  uv\right)  =L\left(  u\right)  \cdot L\left(  v\right)  $. This
proves Lemma \ref{lem.sol.ent.count-divs-134.Luv}.
\end{proof}

\begin{lemma}
\label{lem.sol.ent.count-divs-134.Lai}Let $a_{1},a_{2},\ldots,a_{k}$ be
finitely many integers. Then,%
\[
L\left(  a_{1}a_{2}\cdots a_{k}\right)  =L\left(  a_{1}\right)  \cdot L\left(
a_{2}\right)  \cdot\cdots\cdot L\left(  a_{k}\right)  .
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.count-divs-134.Lai}.]We claim that%
\begin{equation}
L\left(  a_{1}a_{2}\cdots a_{i}\right)  =L\left(  a_{1}\right)  \cdot L\left(
a_{2}\right)  \cdot\cdots\cdot L\left(  a_{i}\right)
\label{pf.lem.sol.ent.count-divs-134.Lai.goal}%
\end{equation}
for each $i\in\left\{  0,1,\ldots,k\right\}  $.

[\textit{Proof of (\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}):} We shall
prove (\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}) by induction on $i$:

\textit{Induction base:} We have $a_{1}a_{2}\cdots a_{0}=\left(  \text{empty
product}\right)  =1$; thus,%
\begin{align*}
L\left(  a_{1}a_{2}\cdots a_{0}\right)   &  =L\left(  1\right)  =%
\begin{cases}
1, & \text{if }1\%4=1;\\
-1, & \text{if }1\%4=3;\\
0, & \text{otherwise}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }L\left(  1\right)
\right) \\
&  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }1\%4=1\right)  .
\end{align*}
Comparing this with $L\left(  a_{1}\right)  \cdot L\left(  a_{2}\right)
\cdot\cdots\cdot L\left(  a_{0}\right)  =\left(  \text{empty product}\right)
=1$, we obtain%
\[
L\left(  a_{1}a_{2}\cdots a_{0}\right)  =L\left(  a_{1}\right)  \cdot L\left(
a_{2}\right)  \cdot\cdots\cdot L\left(  a_{0}\right)  .
\]
In other words, (\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}) holds for
$i=0$. This completes the induction base.

\textit{Induction step:} Let $j\in\left\{  1,2,\ldots,k\right\}  $. Assume
that (\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}) holds for $i=j-1$. We must
prove that (\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}) holds for $i=j$.

We have assumed that (\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}) holds for
$i=j-1$. In other words, we have%
\[
L\left(  a_{1}a_{2}\cdots a_{j-1}\right)  =L\left(  a_{1}\right)  \cdot
L\left(  a_{2}\right)  \cdot\cdots\cdot L\left(  a_{j-1}\right)  .
\]
Now,%
\begin{align*}
L\left(  \underbrace{a_{1}a_{2}\cdots a_{j}}_{=\left(  a_{1}a_{2}\cdots
a_{j-1}\right)  a_{j}}\right)   &  =L\left(  \left(  a_{1}a_{2}\cdots
a_{j-1}\right)  a_{j}\right)  =\underbrace{L\left(  a_{1}a_{2}\cdots
a_{j-1}\right)  }_{=L\left(  a_{1}\right)  \cdot L\left(  a_{2}\right)
\cdot\cdots\cdot L\left(  a_{j-1}\right)  }\cdot L\left(  a_{j}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Lemma
\ref{lem.sol.ent.count-divs-134.Luv}, applied to }u=a_{1}a_{2}\cdots
a_{j-1}\text{ and }v=a_{j}\right) \\
&  =\left(  L\left(  a_{1}\right)  \cdot L\left(  a_{2}\right)  \cdot
\cdots\cdot L\left(  a_{j-1}\right)  \right)  \cdot L\left(  a_{j}\right) \\
&  =L\left(  a_{1}\right)  \cdot L\left(  a_{2}\right)  \cdot\cdots\cdot
L\left(  a_{j}\right)  .
\end{align*}
In other words, (\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}) holds for
$i=j$. This completes the induction step. Thus,
(\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}) is proven by induction.]

Now, (\ref{pf.lem.sol.ent.count-divs-134.Lai.goal}) (applied to $i=k$) yields
$L\left(  a_{1}a_{2}\cdots a_{k}\right)  =L\left(  a_{1}\right)  \cdot
L\left(  a_{2}\right)  \cdot\cdots\cdot L\left(  a_{k}\right)  $. This proves
Lemma \ref{lem.sol.ent.count-divs-134.Lai}.
\end{proof}

\begin{lemma}
\label{lem.sol.ent.count-divs-134.Lan}Let $a\in\mathbb{Z}$ and $k\in
\mathbb{N}$. Then, $L\left(  a^{k}\right)  =\left(  L\left(  a\right)
\right)  ^{k}$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.count-divs-134.Lan}.]Lemma
\ref{lem.sol.ent.count-divs-134.Lai} (applied to $a_{i}=a$) yields%
\[
L\left(  \underbrace{aa\cdots a}_{k\text{ times}}\right)
=\underbrace{L\left(  a\right)  \cdot L\left(  a\right)  \cdot\cdots\cdot
L\left(  a\right)  }_{k\text{ times}}=\left(  L\left(  a\right)  \right)
^{k}.
\]
In view of $\underbrace{aa\cdots a}_{k\text{ times}}=a^{k}$, this rewrites as
$L\left(  a^{k}\right)  =\left(  L\left(  a\right)  \right)  ^{k}$. Thus,
Lemma \ref{lem.sol.ent.count-divs-134.Lan} is proven.
\end{proof}

\begin{lemma}
\label{lem.sol.ent.count-divs-134.Lpb}Let $u\in\mathbb{N}$. Let $p_{1}%
,p_{2},\ldots,p_{u}$ be $u$ integers. Let $b_{1},b_{2},\ldots,b_{u}$ be $u$
nonnegative integers. Then,%
\[
L\left(  p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}\right)  =\prod
_{i=1}^{u}\left(  L\left(  p_{i}\right)  \right)  ^{b_{i}}.
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.count-divs-134.Lpb}.]Lemma
\ref{lem.sol.ent.count-divs-134.Lai} (applied to $k=u$ and $a_{i}=p_{i}%
^{b_{i}}$) yields%
\[
L\left(  p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}\right)  =L\left(
p_{1}^{b_{1}}\right)  \cdot L\left(  p_{2}^{b_{2}}\right)  \cdot\cdots\cdot
L\left(  p_{u}^{b_{u}}\right)  =\prod_{i=1}^{u}\underbrace{L\left(
p_{i}^{b_{i}}\right)  }_{\substack{=\left(  L\left(  p_{i}\right)  \right)
^{b_{i}}\\\text{(by Lemma \ref{lem.sol.ent.count-divs-134.Lan},}%
\\\text{applied to }a=p_{i}\\\text{and }k=b_{i}\text{)}}}=\prod_{i=1}%
^{u}\left(  L\left(  p_{i}\right)  \right)  ^{b_{i}}.
\]
This proves Lemma \ref{lem.sol.ent.count-divs-134.Lpb}.
\end{proof}

\begin{lemma}
\label{lem.sol.ent.count-divs-134.z=}Let $n$ be a positive integer. Define $z$
as in Exercise \ref{exe.ent.count-divs-134}. Then,%
\[
z=\sum_{d\mid n}L\left(  d\right)  .
\]

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.count-divs-134.z=}.]For each integer $d$, we
have the logical equivalence%
\begin{equation}
\left(  d\equiv1\operatorname{mod}4\right)  \Longleftrightarrow\left(
d\%4=1\right)  . \label{pf.lem.sol.ent.count-divs-134.z=.equiv1}%
\end{equation}


[\textit{Proof of (\ref{pf.lem.sol.ent.count-divs-134.z=.equiv1}):} Let $d$ be
an integer. Exercise \ref{exe.ent.quo-rem.mod=rem} (applied to $4$, $d$ and
$1$ instead of $n$, $u$ and $v$) shows that we have $d\equiv
1\operatorname{mod}4$ if and only if $d\%4=1\%4$. Thus, we have the following
chain of equivalences:%
\[
\left(  d\equiv1\operatorname{mod}4\right)  \ \Longleftrightarrow\ \left(
d\%4=\underbrace{1\%4}_{=1}\right)  \ \Longleftrightarrow\ \left(
d\%4=1\right)  .
\]
This proves (\ref{pf.lem.sol.ent.count-divs-134.z=.equiv1}).]

\begin{noncompile}
Do not change the above equivalence
(\ref{pf.lem.sol.ent.count-divs-134.z=.equiv1})! It is cited further below, in
the solution to Exercise \ref{exe.ent.count-divs-134} \textbf{(b)}.
\end{noncompile}

Now, for each positive divisor $d$ of $n$, the condition \textquotedblleft%
$d\equiv1\mod 4$\textquotedblright\ is equivalent to \textquotedblleft%
$d\%4=1$\textquotedblright\ (by (\ref{pf.lem.sol.ent.count-divs-134.z=.equiv1}%
)). Hence, the positive divisors $d$ of $n$ such that $d\equiv1\mod 4$ are
exactly the positive divisors $d$ of $n$ such that $d\%4=1$. Thus,%
\begin{align}
&  \left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv1\mod 4$}\right) \nonumber\\
&  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\%4=1$}\right)  . \label{pf.lem.sol.ent.count-divs-134.z=.equiv1num}%
\end{align}


The same argument (but with every appearance of \textquotedblleft%
$1$\textquotedblright\ replaced by \textquotedblleft$3$\textquotedblright)
yields%
\begin{align}
&  \left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv3\mod 4$}\right) \nonumber\\
&  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\%4=3$}\right)  . \label{pf.lem.sol.ent.count-divs-134.z=.equiv3num}%
\end{align}


Furthermore, if $d$ is an integer satisfying $d\%4=1$, then%
\begin{align*}
L\left(  d\right)   &  =%
\begin{cases}
1, & \text{if }d\%4=1;\\
-1, & \text{if }d\%4=3;\\
0, & \text{otherwise}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }L\left(  d\right)
\right) \\
&  =1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }d\%4=1\right)  .
\end{align*}
Summing up this equality over all positive divisors $d$ of $n$ satisfying
$d\%4=1$, we obtain%
\begin{align*}
\sum_{\substack{d\mid n;\\d\%4=1}}L\left(  d\right)   &  =\sum
_{\substack{d\mid n;\\d\%4=1}}1=\left(  \text{the number of positive divisors
$d$ of $n$ such that $d\%4=1$}\right)  \cdot1\\
&  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\%4=1$}\right) \\
&  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv1\mod 4$}\right)
\end{align*}
(by (\ref{pf.lem.sol.ent.count-divs-134.z=.equiv1num})).

Also, if $d$ is an integer satisfying $d\%4=3$, then%
\begin{align*}
L\left(  d\right)   &  =%
\begin{cases}
1, & \text{if }d\%4=1;\\
-1, & \text{if }d\%4=3;\\
0, & \text{otherwise}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }L\left(  d\right)
\right) \\
&  =-1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }d\%4=3\right)  .
\end{align*}
Summing up this equality over all positive divisors $d$ of $n$ satisfying
$d\%4=3$, we obtain%
\begin{align*}
\sum_{\substack{d\mid n;\\d\%4=3}}L\left(  d\right)   &  =\sum
_{\substack{d\mid n;\\d\%4=3}}\left(  -1\right) \\
&  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\%4=3$}\right)  \cdot\left(  -1\right) \\
&  =-\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\%4=3$}\right) \\
&  =-\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv3\mod 4$}\right)
\end{align*}
(by (\ref{pf.lem.sol.ent.count-divs-134.z=.equiv3num})).

Furthermore, if $d$ is an integer satisfying $\left(  \text{neither
}d\%4=1\text{ nor }d\%4=3\right)  $, then%
\begin{align*}
L\left(  d\right)   &  =%
\begin{cases}
1, & \text{if }d\%4=1;\\
-1, & \text{if }d\%4=3;\\
0, & \text{otherwise}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }L\left(  d\right)
\right) \\
&  =0\ \ \ \ \ \ \ \ \ \ \left(  \text{since we have neither }d\%4=1\text{ nor
}d\%4=3\right)  .
\end{align*}
Summing up this equality over all positive divisors $d$ of $n$ satisfying
\newline$\left(  \text{neither }d\%4=1\text{ nor }d\%4=3\right)  $, we obtain%
\[
\sum_{\substack{d\mid n;\\\text{neither }d\%4=1\text{ nor }d\%4=3}}L\left(
d\right)  =\sum_{\substack{d\mid n;\\\text{neither }d\%4=1\text{ nor }%
d\%4=3}}0=0.
\]


Recall that the summation sign \textquotedblleft$\sum_{d\mid n}$%
\textquotedblright\ stands for a sum over all positive divisors of $n$. Each
positive divisor $d$ of $n$ satisfies either $d\%4=1$ or $d\%4=3$ or $\left(
\text{neither }d\%4=1\text{ nor }d\%4=3\right)  $ (and these three options are
mutually exclusive). Hence, we can split the sum $\sum_{d\mid n}L\left(
d\right)  $ as follows:
\begin{align*}
&  \sum_{d\mid n}L\left(  d\right) \\
&  =\underbrace{\sum_{\substack{d\mid n;\\d\%4=1}}L\left(  d\right)
}_{=\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv1\mod 4$}\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\sum_{\substack{d\mid n;\\d\%4=3}}L\left(
d\right)  }_{=-\left(  \text{the number of positive divisors $d$ of $n$ such
that $d\equiv3\mod 4$}\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\sum_{\substack{d\mid n;\\\text{neither
}d\%4=1\text{ nor }d\%4=3}}L\left(  d\right)  }_{=0}\\
&  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv1\mod 4$}\right) \\
&  \ \ \ \ \ \ \ \ \ \ +\left(  -\left(  \text{the number of positive divisors
$d$ of $n$ such that $d\equiv3\mod 4$}\right)  \right) \\
&  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv1\mod 4$}\right) \\
&  \ \ \ \ \ \ \ \ \ \ -\left(  \text{the number of positive divisors $d$ of
$n$ such that $d\equiv3\mod 4$}\right) \\
&  =z
\end{align*}
(by the definition of $z$). This proves Lemma
\ref{lem.sol.ent.count-divs-134.z=}.
\end{proof}

Next, we define a further notation:

\begin{definition}
\label{def.sol.ent.count-divs-134.L'}Throughout this section, we shall use the
following notation:

For each $p\in\mathbb{Z}$ and $m\in\mathbb{N}$, we set%
\[
S\left(  p,m\right)  =\sum_{k=0}^{m}\left(  L\left(  p\right)  \right)  ^{k}.
\]
\newline
\end{definition}

\begin{lemma}
\label{lem.sol.ent.count-divs-134.Lsum}Let $p$ be an integer. Let
$m\in\mathbb{N}$.

\textbf{(a)} If $p\%4=1$, then $S\left(  p,m\right)  =m+1$.

\textbf{(b)} If $m$ is even and $p\%4=3$, then $S\left(  p,m\right)  =1$.

\textbf{(c)} If $m$ is odd and $p\%4=3$, then $S\left(  p,m\right)  =0$.

\textbf{(d)} If we have neither $p\%4=1$ nor $p\%4=3$, then $S\left(
p,m\right)  =1$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.count-divs-134.Lsum}.]\textbf{(a)} Assume
that $p\%4=1$. The definition of $L\left(  p\right)  $ yields%
\[
L\left(  p\right)  =%
\begin{cases}
1, & \text{if }p\%4=1;\\
-1, & \text{if }p\%4=3;\\
0, & \text{otherwise}%
\end{cases}
=1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }p\%4=1\right)  .
\]
Hence, the definition of $S\left(  p,m\right)  $ yields%
\[
S\left(  p,m\right)  =\sum_{k=0}^{m}\left(  \underbrace{L\left(  p\right)
}_{=1}\right)  ^{k}=\sum_{k=0}^{m}\underbrace{1^{k}}_{=1}=\sum_{k=0}%
^{m}1=\left(  m+1\right)  \cdot1=m+1.
\]
This proves Lemma \ref{lem.sol.ent.count-divs-134.Lsum} \textbf{(a)}.

\textbf{(b)} Assume that $m$ is even and $p\%4=3$. Note that $m+1$ is odd
(since $m$ is even). The definition of $L\left(  p\right)  $ yields%
\[
L\left(  p\right)  =%
\begin{cases}
1, & \text{if }p\%4=1;\\
-1, & \text{if }p\%4=3;\\
0, & \text{otherwise}%
\end{cases}
=-1\ \ \ \ \ \ \ \ \ \ \left(  \text{since }p\%4=3\right)  .
\]
Hence, the definition of $S\left(  p,m\right)  $ yields%
\begin{align*}
S\left(  p,m\right)   &  =\sum_{k=0}^{m}\left(  \underbrace{L\left(  p\right)
}_{=-1}\right)  ^{k}=\sum_{k=0}^{m}\left(  -1\right)  ^{k}\\
&  =\left(  -1\right)  ^{0}+\left(  -1\right)  ^{1}+\cdots+\left(  -1\right)
^{m}\\
&  =\underbrace{1+\left(  -1\right)  +1+\left(  -1\right)  +\cdots+1+\left(
-1\right)  +1}_{m+1\text{ many addends, alternating between }1\text{ and }%
-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }m+1\text{ is odd}\right) \\
&  =1
\end{align*}
(since $m+1$ is odd). This proves Lemma \ref{lem.sol.ent.count-divs-134.Lsum}
\textbf{(b)}.

\textbf{(c)} Assume that $m$ is odd and $p\%4=3$. Note that $m+1$ is even
(since $m$ is odd). Just as in the proof of Lemma
\ref{lem.sol.ent.count-divs-134.Lsum} \textbf{(b)} above, we can see that
$L\left(  p\right)  =-1$ and $S\left(  p,m\right)  =\left(  -1\right)
^{0}+\left(  -1\right)  ^{1}+\cdots+\left(  -1\right)  ^{m}$. Hence,%
\begin{align*}
S\left(  p,m\right)   &  =\left(  -1\right)  ^{0}+\left(  -1\right)
^{1}+\cdots+\left(  -1\right)  ^{m}\\
&  =\underbrace{1+\left(  -1\right)  +1+\left(  -1\right)  +\cdots+1+\left(
-1\right)  }_{m+1\text{ many addends, alternating between }1\text{ and }%
-1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }m+1\text{ is even}\right) \\
&  =0
\end{align*}
(since $m+1$ is even). This proves Lemma \ref{lem.sol.ent.count-divs-134.Lsum}
\textbf{(c)}.

\textbf{(d)} Assume that we have neither $p\%4=1$ nor $p\%4=3$. The definition
of $L\left(  p\right)  $ yields%
\[
L\left(  p\right)  =%
\begin{cases}
1, & \text{if }p\%4=1;\\
-1, & \text{if }p\%4=3;\\
0, & \text{otherwise}%
\end{cases}
=0\ \ \ \ \ \ \ \ \ \ \left(  \text{since we have neither }p\%4=1\text{ nor
}p\%4=3\right)  .
\]
Hence, the definition of $S\left(  p,m\right)  $ yields%
\begin{align*}
S\left(  p,m\right)   &  =\sum_{k=0}^{m}\left(  \underbrace{L\left(  p\right)
}_{=0}\right)  ^{k}=\sum_{k=0}^{m}0^{k}=\underbrace{0^{0}}_{=1}+\sum_{k=1}%
^{m}\underbrace{0^{k}}_{\substack{=0\\\text{(since }k\geq1\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{here, we have split off the addend for
}k=0\text{ from the sum}\right) \\
&  =1+\underbrace{\sum_{k=1}^{m}0}_{=0}=1.
\end{align*}
This proves Lemma \ref{lem.sol.ent.count-divs-134.Lsum} \textbf{(d)}.
\end{proof}

\begin{proof}
[Solution to Exercise \ref{exe.ent.count-divs-134}.]For every prime
$p>\left\vert n\right\vert $, we have $v_{p}\left(  n\right)  =0$ (by Lemma
\ref{lem.ent.prime.vpn=0} \textbf{(a)}). Thus, all but finitely many primes
$p$ satisfy $v_{p}\left(  n\right)  =0$ (since all but finitely many primes
$p$ satisfy $p>\left\vert n\right\vert $). In other words, the set of all
primes $p$ satisfying $v_{p}\left(  n\right)  \neq0$ is finite. Let $P$ be
this set. Thus, $P$ is finite.

Let $\left(  p_{1},p_{2},\ldots,p_{u}\right)  $ be a list of elements of $P$,
with no repetitions.\footnote{Such a list exists, since $P$ is finite.} Thus,
$\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  =P$. Now, the elements
$p_{1},p_{2},\ldots,p_{u}$ belong to $\left\{  p_{1},p_{2},\ldots
,p_{u}\right\}  =P$, and thus are primes (since $P$ is a set of primes).
Furthermore, the elements $p_{1},p_{2},\ldots,p_{u}$ are distinct (since
$\left(  p_{1},p_{2},\ldots,p_{u}\right)  $ was defined to be a list with no repetitions).

For each $i\in\left\{  1,2,\ldots,u\right\}  $, define a nonnegative integer
$a_{i}$ by%
\begin{equation}
a_{i}=v_{p_{i}}\left(  n\right)  . \label{sol.ent.count-divs-134.ai=}%
\end{equation}
This is well-defined, since $p_{i}$ is a prime (because $p_{1},p_{2}%
,\ldots,p_{u}$ are primes) and since $n$ is nonzero.

The following facts have been proven in the proof of Proposition
\ref{prop.ent.count-divs}:

\begin{itemize}
\item The map $\left\{  1,2,\ldots,u\right\}  \rightarrow\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  ,\ i\mapsto p_{i}$ is a bijection.

\item If $p$ is a prime such that $p\notin\left\{  p_{1},p_{2},\ldots
,p_{u}\right\}  $, then
\begin{equation}
v_{p}\left(  n\right)  =0. \label{sol.ent.count-divs-134.vpn=0}%
\end{equation}


\item We have $n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{u}^{a_{u}}$.
\end{itemize}

Define a set $T$ as in Lemma \ref{lem.ent.divs-bijs}. Then, Lemma
\ref{lem.ent.divs-bijs} says that the map
\begin{align*}
\Lambda:T  &  \rightarrow\left\{  \text{positive divisors of }n\right\}  ,\\
\left(  b_{1},b_{2},\ldots,b_{u}\right)   &  \mapsto p_{1}^{b_{1}}p_{2}%
^{b_{2}}\cdots p_{u}^{b_{u}}%
\end{align*}
is well-defined and bijective. Thus, this map $\Lambda$ is a bijection.

Now, the summation sign \textquotedblleft$\sum_{d\mid n}$\textquotedblright%
\ stands for a sum over all positive divisors of $n$, and thus is equivalent
to the summation sign \textquotedblleft$\sum_{d\in\left\{  \text{positive
divisors of }n\right\}  }$\textquotedblright. Hence,%
\begin{align}
\sum_{d\mid n}L\left(  d\right)   &  =\sum_{d\in\left\{  \text{positive
divisors of }n\right\}  }L\left(  d\right)  =\sum_{\left(  b_{1},b_{2}%
,\ldots,b_{u}\right)  \in T}L\left(  \underbrace{\Lambda\left(  b_{1}%
,b_{2},\ldots,b_{u}\right)  }_{\substack{=p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots
p_{u}^{b_{u}}\\\text{(by the definition of }\Lambda\text{)}}}\right)
\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }\Lambda\left(  b_{1},b_{2},\ldots
,b_{u}\right)  \text{ for }d\text{ in the}\\
\text{sum, since the map }\Lambda:T\rightarrow\left\{  \text{positive divisors
of }n\right\} \\
\text{is a bijection}%
\end{array}
\right) \nonumber\\
&  =\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in T}\underbrace{L\left(
p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{u}^{b_{u}}\right)  }_{\substack{=\prod
_{i=1}^{u}\left(  L\left(  p_{i}\right)  \right)  ^{b_{i}}\\\text{(by Lemma
\ref{lem.sol.ent.count-divs-134.Lpb})}}}\nonumber\\
&  =\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in T}\ \ \prod_{i=1}%
^{u}\left(  L\left(  p_{i}\right)  \right)  ^{b_{i}}.
\label{sol.ent.count-divs-134.b.3}%
\end{align}


Now, Lemma \ref{lem.prodrule.nums} (applied to $u$, $\left\{  0,1,\ldots
,a_{i}\right\}  $ and $\left(  L\left(  p_{i}\right)  \right)  ^{k}$ instead
of $n$, $Z_{i}$ and $p_{i,k}$) yields%
\begin{align*}
\prod_{i=1}^{u}\sum_{k\in\left\{  0,1,\ldots,a_{i}\right\}  }\left(  L\left(
p_{i}\right)  \right)  ^{k}  &  =\sum_{\left(  k_{1},k_{2},\ldots
,k_{u}\right)  \in\left\{  0,1,\ldots,a_{1}\right\}  \times\left\{
0,1,\ldots,a_{2}\right\}  \times\cdots\times\left\{  0,1,\ldots,a_{u}\right\}
}\ \ \prod_{i=1}^{u}\left(  L\left(  p_{i}\right)  \right)  ^{k_{i}}\\
&  =\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in\left\{  0,1,\ldots
,a_{1}\right\}  \times\left\{  0,1,\ldots,a_{2}\right\}  \times\cdots
\times\left\{  0,1,\ldots,a_{u}\right\}  }\ \ \prod_{i=1}^{u}\left(  L\left(
p_{i}\right)  \right)  ^{b_{i}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have renamed the summation}\\
\text{index }\left(  k_{1},k_{2},\ldots,k_{u}\right)  \text{ as }\left(
b_{1},b_{2},\ldots,b_{u}\right)
\end{array}
\right) \\
&  =\sum_{\left(  b_{1},b_{2},\ldots,b_{u}\right)  \in T}\ \ \prod_{i=1}%
^{u}\left(  L\left(  p_{i}\right)  \right)  ^{b_{i}}%
\end{align*}
(since $\left\{  0,1,\ldots,a_{1}\right\}  \times\left\{  0,1,\ldots
,a_{2}\right\}  \times\cdots\times\left\{  0,1,\ldots,a_{u}\right\}  =T$).
Comparing this with (\ref{sol.ent.count-divs-134.b.3}), we find%
\begin{equation}
\sum_{d\mid n}L\left(  d\right)  =\prod_{i=1}^{u}\underbrace{\sum
_{k\in\left\{  0,1,\ldots,a_{i}\right\}  }}_{=\sum_{k=0}^{a_{i}}}\left(
L\left(  p_{i}\right)  \right)  ^{k}=\prod_{i=1}^{u}\sum_{k=0}^{a_{i}}\left(
L\left(  p_{i}\right)  \right)  ^{k}. \label{sol.ent.count-divs-134.b.4}%
\end{equation}
But Lemma \ref{lem.sol.ent.count-divs-134.z=} yields%
\begin{equation}
z=\sum_{d\mid n}L\left(  d\right)  =\prod_{i=1}^{u}\sum_{k=0}^{a_{i}}\left(
L\left(  p_{i}\right)  \right)  ^{k} \label{sol.ent.count-divs-134.b.5}%
\end{equation}
(by (\ref{sol.ent.count-divs-134.b.4})).

On the other hand, if $p$ is a prime such that $p\notin\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  $, then%
\begin{align}
S\left(  p,\underbrace{v_{p}\left(  n\right)  }_{\substack{=0\\\text{(by
(\ref{sol.ent.count-divs-134.vpn=0}))}}}\right)   &  =S\left(  p,0\right)
=\sum_{k=0}^{0}\left(  L\left(  p\right)  \right)  ^{k}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }S\left(  p,0\right)
\right) \nonumber\\
&  =\left(  L\left(  p\right)  \right)  ^{0}=1.
\label{sol.ent.count-divs-134.S=1}%
\end{align}
Thus, all but finitely many primes $p$ satisfy $S\left(  p,v_{p}\left(
n\right)  \right)  =1$ (since all but finitely many primes $p$ satisfy
$p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  $). In other words, all but
finitely many factors of the product $\prod_{p\text{ prime}}S\left(
p,v_{p}\left(  n\right)  \right)  $ are $1$. Thus, this product is
well-defined. Moreover, we can split this product as follows:%
\begin{align*}
&  \prod_{p\text{ prime}}S\left(  p,v_{p}\left(  n\right)  \right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}S\left(  p,v_{p}\left(  n\right)  \right)  \right)
\left(  \prod_{\substack{p\text{ prime;}\\p\notin\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}\underbrace{S\left(  p,v_{p}\left(  n\right)
\right)  }_{\substack{=1\\\text{(by (\ref{sol.ent.count-divs-134.S=1}))}%
}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each prime }p\text{ satisfies either }p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\} \\
\text{or }p\notin\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  \text{ (but not
both simultaneously)}%
\end{array}
\right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1},p_{2}%
,\ldots,p_{u}\right\}  }}S\left(  p,v_{p}\left(  n\right)  \right)  \right)
\underbrace{\left(  \prod_{\substack{p\text{ prime;}\\p\notin\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  }}1\right)  }_{=1}\\
&  =\underbrace{\prod_{\substack{p\text{ prime;}\\p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  }}}_{\substack{=\prod_{p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  }\\\text{(since each }p\in\left\{  p_{1}%
,p_{2},\ldots,p_{u}\right\}  \\\text{is a prime)}}}S\left(  p,v_{p}\left(
n\right)  \right) \\
&  =\prod_{p\in\left\{  p_{1},p_{2},\ldots,p_{u}\right\}  }S\left(
p,v_{p}\left(  n\right)  \right)  =\prod_{i=1}^{u}S\left(  p_{i}%
,\underbrace{v_{p_{i}}\left(  n\right)  }_{\substack{=a_{i}\\\text{(by
(\ref{sol.ent.count-divs-134.ai=}))}}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have substituted }p_{i}\text{ for }p\text{ in the product,}\\
\text{since the map }\left\{  1,2,\ldots,u\right\}  \rightarrow\left\{
p_{1},p_{2},\ldots,p_{u}\right\}  ,\ i\mapsto p_{i}\text{ is a bijection}%
\end{array}
\right) \\
&  =\prod_{i=1}^{u}\underbrace{S\left(  p_{i},a_{i}\right)  }_{\substack{=\sum
_{k=0}^{a_{i}}\left(  L\left(  p_{i}\right)  \right)  ^{k}\\\text{(by the
definition of }S\left(  p_{i},a_{i}\right)  \text{)}}}=\prod_{i=1}^{u}%
\sum_{k=0}^{a_{i}}\left(  L\left(  p_{i}\right)  \right)  ^{k}.
\end{align*}
Comparing this with (\ref{sol.ent.count-divs-134.b.5}), we obtain%
\begin{equation}
z=\prod_{p\text{ prime}}S\left(  p,v_{p}\left(  n\right)  \right)  .
\label{sol.ent.count-divs-134.last-common}%
\end{equation}


\textbf{(a)} Assume that there exists a prime $p$ satisfying $p\equiv
3\operatorname{mod}4$ and $v_{p}\left(  n\right)  \equiv1\operatorname{mod}2$.
Consider this $p$, and denote it by $q$. Thus, $q$ is a prime satisfying
$q\equiv3\operatorname{mod}4$ and $v_{q}\left(  n\right)  \equiv
1\operatorname{mod}2$.

Exercise \ref{exe.ent.quo-rem.mod=rem} (applied to $4$, $q$ and $3$ instead of
$n$, $u$ and $v$) shows that we have $q\equiv3\operatorname{mod}4$ if and only
if $q\%4=3\%4$. Hence, from $q\equiv3\operatorname{mod}4$, we conclude that
$q\%4=3\%4=3$. From $v_{q}\left(  n\right)  \equiv1\operatorname{mod}2$, we
conclude that $v_{q}\left(  n\right)  $ is odd. Hence, Lemma
\ref{lem.sol.ent.count-divs-134.Lsum} \textbf{(c)} (applied to $q$ and
$v_{q}\left(  n\right)  $ instead of $p$ and $m$) yields $S\left(
q,v_{q}\left(  n\right)  \right)  =0$.

But $q$ is a prime. Thus, $S\left(  q,v_{q}\left(  n\right)  \right)  $ is a
factor in the product $\prod_{p\text{ prime}}S\left(  p,v_{p}\left(  n\right)
\right)  $. Splitting this factor off, we find%
\[
\prod_{p\text{ prime}}S\left(  p,v_{p}\left(  n\right)  \right)
=\underbrace{S\left(  q,v_{q}\left(  n\right)  \right)  }_{=0}\cdot
\prod_{\substack{p\text{ prime;}\\p\neq q}}S\left(  p,v_{p}\left(  n\right)
\right)  =0.
\]
Now, (\ref{sol.ent.count-divs-134.last-common}) becomes $z=\prod_{p\text{
prime}}S\left(  p,v_{p}\left(  n\right)  \right)  =0$. This solves Exercise
\ref{exe.ent.count-divs-134} \textbf{(a)}.

\textbf{(b)} Assume that there exists no prime $p$ satisfying $p\equiv
3\operatorname{mod}4$ and $v_{p}\left(  n\right)  \equiv1\operatorname{mod}2$.
Renaming $p$ as $q$ in this statement, we obtain the following:%
\begin{equation}
\text{There exists no prime }q\text{ satisfying }q\equiv3\operatorname{mod}%
4\text{ and }v_{q}\left(  n\right)  \equiv1\operatorname{mod}2.
\label{sol.ent.count-divs-134.b.1}%
\end{equation}


We can now easily see the following two auxiliary claims:

\begin{statement}
\textit{Claim 1:} Let $p$ be a prime such that $p\%4\neq1$. Then, $S\left(
p,v_{p}\left(  n\right)  \right)  =1$.
\end{statement}

[\textit{Proof of Claim 1:} We are in one of the following two cases:

\textit{Case 1:} We have $p\%4=3$.

\textit{Case 2:} We have $p\%4\neq3$.

Let us first consider Case 1. In this case, we have $p\%4=3$. Comparing this
with $3\%4=3$, we obtain $p\%4=3\%4$. But Exercise
\ref{exe.ent.quo-rem.mod=rem} (applied to $4$, $p$ and $3$ instead of $n$, $u$
and $v$) shows that we have $p\equiv3\operatorname{mod}4$ if and only if
$p\%4=3\%4$. Hence, from $p\%4=3\%4$, we conclude that $p\equiv
3\operatorname{mod}4$. If we had $v_{p}\left(  n\right)  \equiv
1\operatorname{mod}2$, then there would be a prime $q$ satisfying
$q\equiv3\operatorname{mod}4$ and $v_{q}\left(  n\right)  \equiv
1\operatorname{mod}2$ (namely, $q=p$); but this would contradict
(\ref{sol.ent.count-divs-134.b.1}). Hence, we cannot have $v_{p}\left(
n\right)  \equiv1\operatorname{mod}2$. In other words, the integer
$v_{p}\left(  n\right)  $ cannot be odd. Hence, the integer $v_{p}\left(
n\right)  $ is even. Thus, Lemma \ref{lem.sol.ent.count-divs-134.Lsum}
\textbf{(b)} (applied to $m=v_{p}\left(  n\right)  $) yields $S\left(
p,v_{p}\left(  n\right)  \right)  =1$. Hence, Claim 1 is proven in Case 1.

Let us now consider Case 2. In this case, we have $p\%4\neq3$. Now, we have
neither $p\%4=1$ nor $p\%4=3$ (since we have $p\%4\neq1$ and $p\%4\neq3$).
Hence, Lemma \ref{lem.sol.ent.count-divs-134.Lsum} \textbf{(d)} (applied to
$m=v_{p}\left(  n\right)  $) yields $S\left(  p,v_{p}\left(  n\right)
\right)  =1$. Hence, Claim 1 is proven in Case 2.

We have now proven Claim 1 in each of the Cases 1 and 2. Hence, Claim 1 always holds.]

\begin{statement}
\textit{Claim 2:} For each integer $p$, we have the logical equivalence%
\[
\left(  p\equiv1\operatorname{mod}4\right)  \Longleftrightarrow\left(
p\%4=1\right)  .
\]

\end{statement}

[\textit{Proof of Claim 2:} Claim 2 is precisely the equivalence
(\ref{pf.lem.sol.ent.count-divs-134.z=.equiv1}) (with $d$ renamed as $p$).]

Claim 2 shows that for each prime $p$, the condition \textquotedblleft%
$p\equiv1\operatorname{mod}4$\textquotedblright\ is equivalent to the
condition \textquotedblleft$p\%4=1$\textquotedblright. Hence, the product sign
\textquotedblleft$\prod_{\substack{p\text{ prime;}\\p\equiv1\operatorname{mod}%
4}}$\textquotedblright\ is equivalent to \textquotedblleft$\prod
_{\substack{p\text{ prime;}\\p\%4=1}}$\textquotedblright. Thus,%
\begin{equation}
\prod_{\substack{p\text{ prime;}\\p\equiv1\operatorname{mod}4}}\left(
v_{p}\left(  n\right)  +1\right)  =\prod_{\substack{p\text{ prime;}%
\\p\%4=1}}\left(  v_{p}\left(  n\right)  +1\right)  .
\label{sol.ent.count-divs-134.b.6}%
\end{equation}


Now, (\ref{sol.ent.count-divs-134.last-common}) becomes
\begin{align*}
z  &  =\prod_{p\text{ prime}}S\left(  p,v_{p}\left(  n\right)  \right)
=\left(  \prod_{\substack{p\text{ prime;}\\p\%4=1}}\underbrace{S\left(
p,v_{p}\left(  n\right)  \right)  }_{\substack{=v_{p}\left(  n\right)
+1\\\text{(by Lemma \ref{lem.sol.ent.count-divs-134.Lsum} \textbf{(a)}%
}\\\text{(applied to }m=v_{p}\left(  n\right)  \text{))}}}\right)
\cdot\left(  \prod_{\substack{p\text{ prime;}\\p\%4\neq1}}\underbrace{S\left(
p,v_{p}\left(  n\right)  \right)  }_{\substack{=1\\\text{(by Claim 1)}%
}}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since each prime }p\text{ satisfies
either }p\%4=1\text{ or }p\%4\neq1\text{ (but not both)}\right) \\
&  =\left(  \prod_{\substack{p\text{ prime;}\\p\%4=1}}\left(  v_{p}\left(
n\right)  +1\right)  \right)  \cdot\underbrace{\left(  \prod
_{\substack{p\text{ prime;}\\p\%4\neq1}}1\right)  }_{=1}=\prod
_{\substack{p\text{ prime;}\\p\%4=1}}\left(  v_{p}\left(  n\right)  +1\right)
=\prod_{\substack{p\text{ prime;}\\p\equiv1\operatorname{mod}4}}\left(
v_{p}\left(  n\right)  +1\right)
\end{align*}
(by (\ref{sol.ent.count-divs-134.b.6})). This solves Exercise
\ref{exe.ent.count-divs-134} \textbf{(b)}.
\end{proof}

\begin{remark}
Exercise \ref{exe.ent.count-divs-134} can be slightly generalized: Let
$N\in\left\{  3,4,6\right\}  $. Let $n$ be a positive integer. Let%
\begin{align*}
z  &  =\left(  \text{the number of positive divisors $d$ of $n$ such that
$d\equiv1\operatorname{mod}N$}\right) \\
&  \ \ \ \ \ \ \ \ \ \ -\left(  \text{the number of positive divisors $d$ of
$n$ such that $d\equiv N-1\operatorname{mod}N$}\right)  .
\end{align*}


Then:

\textbf{(a)} If there exists a prime $p$ satisfying $p\equiv
N-1\operatorname{mod}N$ and $v_{p}\left(  n\right)  \equiv1\operatorname{mod}%
2$, then $z=0$.

\textbf{(b)} If there exists no prime $p$ satisfying $p\equiv
N-1\operatorname{mod}N$ and $v_{p}\left(  n\right)  \equiv1\operatorname{mod}%
2$, then
\[
z=\prod_{\substack{p\text{ prime;}\\p\equiv1\operatorname{mod}N}}\left(
v_{p}\left(  n\right)  +1\right)  .
\]


The solution of Exercise \ref{exe.ent.count-divs-134} that we gave above can
still be used to prove these two more general claims, once the obvious changes
are made (which consist mostly in replacing \textquotedblleft$3$%
\textquotedblright\ and \textquotedblleft$4$\textquotedblright\ by
\textquotedblleft$N-1$\textquotedblright\ and \textquotedblleft$N$%
\textquotedblright, respectively, and adding a few straightforward cases in
the proof of Lemma \ref{lem.sol.ent.count-divs-134.L0}).

Note that the numbers $3,4,6$ are precisely the positive integers $m$
satisfying $\phi\left(  m\right)  =2$. This is directly connected to the fact
that they are the integers $N$ for which these two statements hold. Indeed,
Lemma \ref{lem.sol.ent.count-divs-134.L0} (modified to use $N$ instead of $4$)
quickly boils down to the observation that the only elements $i\in\left\{
0,1,\ldots,N-1\right\}  $ coprime to $N$ are the two elements $1$ and $N-1$
and these two elements are distinct; but this is equivalent to $\phi\left(
N\right)  =2$.
\end{remark}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.egz-prod}}

\begin{fineprint}
Exercise \ref{exe.ent.egz-prod} demands that we prove Lemma
\ref{lem.ent.egz-prod}; let us do this:

\begin{proof}
[Proof of Lemma \ref{lem.ent.egz-prod}.]Lemma \ref{lem.prodrule.nums} (applied
to $Z_{i}=S$ and $p_{i,k}=a_{k}$) yields%
\[
\prod_{i=1}^{n}\sum_{k\in S}a_{k}=\sum_{\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in S\times S\times\cdots\times S}\ \ \prod_{i=1}^{n}a_{k_{i}%
},
\]
where the Cartesian product $S\times S\times\cdots\times S$ has $n$ factors.
Since this Cartesian product $S\times S\times\cdots\times S$ is simply $S^{n}%
$, we can rewrite this equality as follows:%
\[
\prod_{i=1}^{n}\sum_{k\in S}a_{k}=\sum_{\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in S^{n}}\ \ \prod_{i=1}^{n}a_{k_{i}}.
\]
Comparing this with%
\[
\prod_{i=1}^{n}\underbrace{\sum_{k\in S}a_{k}}_{=\sum_{s\in S}a_{s}}%
=\prod_{i=1}^{n}\sum_{s\in S}a_{s}=\left(  \sum_{s\in S}a_{s}\right)  ^{n},
\]
we obtain
\[
\left(  \sum_{s\in S}a_{s}\right)  ^{n}=\sum_{\left(  k_{1},k_{2},\ldots
,k_{n}\right)  \in S^{n}}\ \ \prod_{i=1}^{n}a_{k_{i}}.
\]
This proves Lemma \ref{lem.ent.egz-prod}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.ent.egz-p2}}

\begin{fineprint}
Exercise \ref{exe.ent.egz-p2} asks us to prove Lemma \ref{lem.ent.egz-p2}
formally. Before we do so, let us restate Lemma \ref{lem.ent.egz-p} in a more
flexible form:

\begin{lemma}
\label{lem.sol.ent.egz-p2.p}Let $p$ be a prime. Let $U$ be a set such that
$\left\vert U\right\vert \geq2p-1$. For each $s\in U$, let $a_{s}$ be an
integer. Then, there exists a $p$-element subset $T$ of $U$ such that
$p\mid\sum_{s\in T}a_{s}$.
\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.sol.ent.egz-p2.p}.]There exist $2p-1$ distinct
elements $u_{1},u_{2},\ldots,u_{2p-1}$ of $U$ (since $\left\vert U\right\vert
\geq2p-1$). Choose such $2p-1$ elements. For each $s\in\left\{  1,2,\ldots
,2p-1\right\}  $, we define an integer $b_{s}$ by $b_{s}=a_{u_{s}}$. Thus,
$b_{1},b_{2},\ldots,b_{2p-1}$ are $2p-1$ integers. Hence, Lemma
\ref{lem.ent.egz-p} (applied to $b_{i}$ instead of $a_{i}$) shows that there
exists a $p$-element subset $S$ of $\left\{  1,2,\ldots,2p-1\right\}  $ such
that $p\mid\sum_{s\in S}b_{s}$. Consider this $S$.

Let $Z$ be the subset $\left\{  u_{s}\ \mid\ s\in S\right\}  $ of $U$. Thus,
$u_{s}\in Z$ for each $s\in S$. Hence, we can define a map%
\begin{align*}
f:S  &  \rightarrow Z,\\
s  &  \mapsto u_{s}.
\end{align*}
This map $f$ is injective\footnote{\textit{Proof.} Let $i$ and $j$ be two
elements of $S$ such that $f\left(  i\right)  =f\left(  j\right)  $. We shall
show that $i=j$.
\par
We have $f\left(  i\right)  =u_{i}$ (by the definition of $f$) and $f\left(
j\right)  =u_{j}$ (likewise). Hence, $u_{i}=f\left(  i\right)  =f\left(
j\right)  =u_{j}$. Therefore, $i=j$ (since the elements $u_{1},u_{2}%
,\ldots,u_{2p-1}$ are distinct).
\par
Now, forget that we fixed $i$ and $j$. We thus have shown that if $i$ and $j$
are two elements of $S$ such that $f\left(  i\right)  =f\left(  j\right)  $,
then $i=j$. In other words, the map $f$ is injective.} and
surjective\footnote{\textit{Proof.} Let $z\in Z$. Hence, $z\in Z=\left\{
u_{s}\ \mid\ s\in S\right\}  $. In other words, $z=u_{s}$ for some $s\in S$.
Consider this $s$. The definition of $f$ yields $f\left(  s\right)  =u_{s}=z$.
Hence, $z=f\left(  s\right)  \in f\left(  S\right)  $ (since $s\in S$).
\par
Now, forget that we fixed $z$. We thus have shown that $z\in f\left(
S\right)  $ for each $z\in Z$. In other words, $Z\subseteq f\left(  S\right)
$. In other words, the map $f$ is surjective.}. Hence, the map $f$ is
bijective, i.e., is a bijection from $S$ to $Z$. Thus, we can substitute
$f\left(  s\right)  $ for $s$ in the sum $\sum_{s\in Z}a_{s}$. We thus obtain%
\[
\sum_{s\in Z}a_{s}=\sum_{s\in S}\underbrace{a_{f\left(  s\right)  }%
}_{\substack{=a_{u_{s}}\\\text{(since }f\left(  s\right)  =u_{s}\\\text{(by
the definition of }f\text{))}}}=\sum_{s\in S}\underbrace{a_{u_{s}}%
}_{\substack{=b_{s}\\\text{(by the definition of }b_{s}\text{)}}}=\sum_{s\in
S}b_{s}.
\]
Hence, $p\mid\sum_{s\in Z}a_{s}$ (since $p\mid\sum_{s\in S}b_{s}$). Moreover,
there is a bijection from $S$ to $Z$ (namely, $f$). Hence, $\left\vert
Z\right\vert =\left\vert S\right\vert =p$ (since $S$ is a $p$-element set).
Thus, $Z$ is a $p$-element set.

This $p$-element set $Z$ is a subset of $U$ and satisfies $p\mid\sum_{s\in
Z}a_{s}$ (as we have seen). Thus, there exists a $p$-element subset $T$ of $U$
such that $p\mid\sum_{s\in T}a_{s}$ (namely, $T=Z$). This proves Lemma
\ref{lem.sol.ent.egz-p2.p}.
\end{proof}

Now we can prove Lemma \ref{lem.ent.egz-p2}:

\begin{proof}
[Proof of Lemma \ref{lem.ent.egz-p2}.]We shall prove Lemma
\ref{lem.ent.egz-p2} by induction on $u$:

\textit{Induction base:} Lemma \ref{lem.ent.egz-p2} holds for $u=1$%
\ \ \ \ \footnote{\textit{Proof.} Assume that $u=1$. Thus, $u-1=0$, so that
$\left\{  1,2,\ldots,u-1\right\}  =\varnothing$. But Lemma
\ref{lem.ent.egz-p2} claims the existence of $u-1$ disjoint $p$-element
subsets $S_{1},S_{2},\ldots,S_{u-1}$ of $\left\{  1,2,\ldots,up-1\right\}  $
such that%
\begin{equation}
p\mid\sum_{s\in S_{i}}a_{s}\ \ \ \ \ \ \ \ \ \ \text{for all }i\in\left\{
1,2,\ldots,u-1\right\}  . \label{pf.lem.ent.egz-p2.rig.IB.fn1.1}%
\end{equation}
Obviously, we can find $u-1$ disjoint $p$-element subsets $S_{1},S_{2}%
,\ldots,S_{u-1}$ of $\left\{  1,2,\ldots,up-1\right\}  $ (because $u-1=0$, so
that we don't have to find anything at all), and they will automatically
satisfy (\ref{pf.lem.ent.egz-p2.rig.IB.fn1.1}) (indeed, $\left\{
1,2,\ldots,u-1\right\}  =\varnothing$, so that
(\ref{pf.lem.ent.egz-p2.rig.IB.fn1.1}) is vacuously true). Thus, the claim of
Lemma \ref{lem.ent.egz-p2} holds.
\par
Thus, we have proven Lemma \ref{lem.ent.egz-p2} for $u=1$.}. This completes
the induction base.

\textit{Induction step:} Let $k$ be a positive integer. Assume that Lemma
\ref{lem.ent.egz-p2} holds for $u=k$. We must prove that Lemma
\ref{lem.ent.egz-p2} holds for $u=k+1$.

We have assumed that Lemma \ref{lem.ent.egz-p2} holds for $u=k$. In other
words, the following claim holds:

\begin{statement}
\textit{Claim 1:} Let $p$ be a prime. Let $a_{1},a_{2},\ldots,a_{kp-1}$ be any
$kp-1$ integers (not necessarily distinct). Then, there exist $k-1$ disjoint
$p$-element subsets $S_{1},S_{2},\ldots,S_{k-1}$ of $\left\{  1,2,\ldots
,kp-1\right\}  $ such that
\[
p\mid\sum_{s\in S_{i}}a_{s}\ \ \ \ \ \ \ \ \ \ \text{for all }i\in\left\{
1,2,\ldots,k-1\right\}  .
\]

\end{statement}

We must prove that Lemma \ref{lem.ent.egz-p2} holds for $u=k+1$. In other
words, we must prove the following claim:

\begin{statement}
\textit{Claim 2:} Let $p$ be a prime. Let $a_{1},a_{2},\ldots,a_{\left(
k+1\right)  p-1}$ be any $\left(  k+1\right)  p-1$ integers (not necessarily
distinct). Then, there exist $k$ disjoint $p$-element subsets $S_{1}%
,S_{2},\ldots,S_{k}$ of $\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}
$ such that
\[
p\mid\sum_{s\in S_{i}}a_{s}\ \ \ \ \ \ \ \ \ \ \text{for all }i\in\left\{
1,2,\ldots,k\right\}  .
\]

\end{statement}

[\textit{Proof of Claim 2:} We have $\underbrace{k}_{\leq k+1}p-1\leq\left(
k+1\right)  p-1$ and thus $\left\{  1,2,\ldots,kp-1\right\}  \subseteq\left\{
1,2,\ldots,\left(  k+1\right)  p-1\right\}  $.

Consider the first $kp-1$ of our $\left(  k+1\right)  p-1$ integers
$a_{1},a_{2},\ldots,a_{\left(  k+1\right)  p-1}$. Thus, Claim 1 shows that
there exist $k-1$ disjoint $p$-element subsets $S_{1},S_{2},\ldots,S_{k-1}$ of
$\left\{  1,2,\ldots,kp-1\right\}  $ such that
\begin{equation}
p\mid\sum_{s\in S_{i}}a_{s}\ \ \ \ \ \ \ \ \ \ \text{for all }i\in\left\{
1,2,\ldots,k-1\right\}  . \label{pf.lem.ent.egz-p2.rig.IS.1}%
\end{equation}
Consider these $S_{1},S_{2},\ldots,S_{k-1}$. These $k-1$ sets $S_{1}%
,S_{2},\ldots,S_{k-1}$ are subsets of $\left\{  1,2,\ldots,kp-1\right\}  $ and
thus also subsets of $\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}
$\ \ \ \ \footnote{since $\left\{  1,2,\ldots,kp-1\right\}  \subseteq\left\{
1,2,\ldots,\left(  k+1\right)  p-1\right\}  $}. Moreover, these $k-1$ sets are
disjoint; thus, the size of their union is the sum of their sizes. In other
words,
\[
\left\vert S_{1}\cup S_{2}\cup\cdots\cup S_{k-1}\right\vert =\left\vert
S_{1}\right\vert +\left\vert S_{2}\right\vert +\cdots+\left\vert
S_{k-1}\right\vert =\sum_{i=1}^{k-1}\underbrace{\left\vert S_{i}\right\vert
}_{\substack{=p\\\text{(since }S_{i}\text{ is}\\\text{a }p\text{-element
set)}}}=\sum_{i=1}^{k-1}p=\left(  k-1\right)  p.
\]


Define a subset $U$ of $\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}  $
by%
\[
U=\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}  \setminus\left(
S_{1}\cup S_{2}\cup\cdots\cup S_{k-1}\right)  .
\]
Then,%
\begin{align*}
\left\vert U\right\vert  &  =\left\vert \left\{  1,2,\ldots,\left(
k+1\right)  p-1\right\}  \setminus\left(  S_{1}\cup S_{2}\cup\cdots\cup
S_{k-1}\right)  \right\vert \\
&  =\underbrace{\left\vert \left\{  1,2,\ldots,\left(  k+1\right)
p-1\right\}  \right\vert }_{=\left(  k+1\right)  p-1}-\underbrace{\left\vert
S_{1}\cup S_{2}\cup\cdots\cup S_{k-1}\right\vert }_{=\left(  k-1\right)  p}\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }S_{1}\cup S_{2}\cup\cdots\cup S_{k-1}\text{ is a subset of
}\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\} \\
\text{(because }S_{1},S_{2},\ldots,S_{k-1}\text{ are subsets of }\left\{
1,2,\ldots,\left(  k+1\right)  p-1\right\}  \text{)}%
\end{array}
\right) \\
&  =\left(  k+1\right)  p-1-\left(  k-1\right)  p=2p-1.
\end{align*}
Hence, Lemma \ref{lem.sol.ent.egz-p2.p} shows that there exists a $p$-element
subset $T$ of $U$ such that $p\mid\sum_{s\in T}a_{s}$. Consider this $T$.

Extend our $\left(  k-1\right)  $-tuple $\left(  S_{1},S_{2},\ldots
,S_{k-1}\right)  $ of sets to a $k$-tuple $\left(  S_{1},S_{2},\ldots
,S_{k}\right)  $ by setting $S_{k}=T$. Thus, $S_{1},S_{2},\ldots,S_{k}$ are
$p$-element subsets of $\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}
$\ \ \ \ \footnote{\textit{Proof.} We only need to prove that $S_{k}$ is a
$p$-element subset of $\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}  $
(since we already know that $S_{1},S_{2},\ldots,S_{k-1}$ are $p$-element
subsets of $\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}  $). But this
is easy: We know that $T$ is a $p$-element subset of $U$. In other words,
$S_{k}$ is a $p$-element subset of $U$ (since $S_{k}=T$). Hence,
\[
S_{k}\subseteq U=\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}
\setminus\left(  S_{1}\cup S_{2}\cup\cdots\cup S_{k-1}\right)  \subseteq
\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}  .
\]
Thus, $S_{k}$ is a subset of $\left\{  1,2,\ldots,\left(  k+1\right)
p-1\right\}  $. Hence, $S_{k}$ is a $p$-element subset of $\left\{
1,2,\ldots,\left(  k+1\right)  p-1\right\}  $, qed.}. They are furthermore
disjoint\footnote{\textit{Proof.} We must prove that the $k$ sets $S_{1}%
,S_{2},\ldots,S_{k}$ are disjoint. Since we already know that the first $k-1$
of them are disjoint (because $S_{1},S_{2},\ldots,S_{k-1}$ are disjoint), we
only need to check that $S_{k}$ is disjoint from each of the sets $S_{1}%
,S_{2},\ldots,S_{k-1}$. In other words, we only need to check that $S_{k}$ is
disjoint from $S_{i}$ for each $i\in\left\{  1,2,\ldots,k-1\right\}  $.
\par
So let $i\in\left\{  1,2,\ldots,k-1\right\}  $ be arbitrary. Then,
\begin{align*}
S_{k}  &  =T\subseteq U\ \ \ \ \ \ \ \ \ \ \left(  \text{since }T\text{ is a
subset of }U\right) \\
&  =\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}  \setminus
\underbrace{\left(  S_{1}\cup S_{2}\cup\cdots\cup S_{k-1}\right)
}_{\substack{\supseteq S_{i}\\\text{(since }i\in\left\{  1,2,\ldots
,k-1\right\}  \text{)}}}\\
&  \subseteq\left\{  1,2,\ldots,\left(  k+1\right)  p-1\right\}  \setminus
S_{i}.
\end{align*}
In other words, $S_{k}$ is a subset of $\left\{  1,2,\ldots,\left(
k+1\right)  p-1\right\}  $ that is disjoint from $S_{i}$. In particular,
$S_{k}$ is disjoint from $S_{i}$.
\par
Forget that we fixed $i$. We thus have shown that $S_{k}$ is disjoint from
$S_{i}$ for each $i\in\left\{  1,2,\ldots,k-1\right\}  $. As we have
explained, this completes our proof.}, and satisfy%
\begin{equation}
p\mid\sum_{s\in S_{i}}a_{s}\ \ \ \ \ \ \ \ \ \ \text{for all }i\in\left\{
1,2,\ldots,k\right\}  \label{pf.lem.ent.egz-p2.rig.IS.2}%
\end{equation}
\footnote{\textit{Proof of (\ref{pf.lem.ent.egz-p2.rig.IS.2}):} Let
$i\in\left\{  1,2,\ldots,k\right\}  $. We must prove that $p\mid\sum_{s\in
S_{i}}a_{s}$. If $i\in\left\{  1,2,\ldots,k-1\right\}  $, then this follows
from (\ref{pf.lem.ent.egz-p2.rig.IS.1}); thus, for the rest of this proof, we
WLOG assume that $i\notin\left\{  1,2,\ldots,k-1\right\}  $. Hence,
$i\in\left\{  1,2,\ldots,k\right\}  $ but $i\notin\left\{  1,2,\ldots
,k-1\right\}  $. Therefore, $i\in\left\{  1,2,\ldots,k\right\}  \setminus
\left\{  1,2,\ldots,k-1\right\}  =\left\{  k\right\}  $, so that $i=k$. Thus,
$S_{i}=S_{k}=T$, so that $\sum_{s\in S_{i}}a_{s}=\sum_{s\in T}a_{s}$. Hence,
from $p\mid\sum_{s\in T}a_{s}$, we obtain $p\mid\sum_{s\in S_{i}}a_{s}$. This
proves (\ref{pf.lem.ent.egz-p2.rig.IS.2}).}. Hence, we have constructed $k$
disjoint $p$-element subsets $S_{1},S_{2},\ldots,S_{k}$ of \newline$\left\{
1,2,\ldots,\left(  k+1\right)  p-1\right\}  $ such that
\[
p\mid\sum_{s\in S_{i}}a_{s}\ \ \ \ \ \ \ \ \ \ \text{for all }i\in\left\{
1,2,\ldots,k\right\}  .
\]
Therefore, such $k$ subsets exist. This proves Claim 2.]

We have now proven Claim 2. In other words, we have shown that Lemma
\ref{lem.ent.egz-p2} holds for $u=k+1$. This completes the induction step.
Thus, Lemma \ref{lem.ent.egz-p2} is proven by induction.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.eqrel.eqcl.dj}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.eqrel.eqcl.dj}.]Let $\alpha$ and $\beta$ be two
equivalence classes of $\sim$. Thus, $\alpha=\left[  x\right]  _{\sim}$ and
$\beta=\left[  y\right]  _{\sim}$ for two elements $x$ and $y$ of $S$ (by the
definition of \textquotedblleft equivalence classes of $\sim$%
\textquotedblright). Consider these $x$ and $y$.

If $x\sim y$, then the classes $\left[  x\right]  _{\sim}$ and $\left[
y\right]  _{\sim}$ are identical (by Theorem \ref{thm.eqrel.eqcl.disj}
\textbf{(a)}). Otherwise, they are disjoint (by Theorem
\ref{thm.eqrel.eqcl.disj} \textbf{(b)}). Thus, in either case, the classes
$\left[  x\right]  _{\sim}$ and $\left[  y\right]  _{\sim}$ are either
identical or disjoint. In view of $\alpha=\left[  x\right]  _{\sim}$ and
$\beta=\left[  y\right]  _{\sim}$, this rewrites as follows: The classes
$\alpha$ and $\beta$ are either identical or disjoint.

Now, forget that we fixed $\alpha$ and $\beta$. We thus have shown that if
$\alpha$ and $\beta$ are two equivalence classes of $\sim$, then $\alpha$ and
$\beta$ are either identical or disjoint. This solves Exercise
\ref{exe.eqrel.eqcl.dj}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.eqrel.eqcl.perm.eq}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.eqrel.eqcl.perm.eq}.]Indeed:

\begin{itemize}
\item The relation $\underset{\operatorname*{perm}}{\sim}$ is reflexive.

[\textit{Proof:} Informally, this is obvious, because each $k$-tuple is a
permutation of itself (just permute it by leaving all its entries in place).
The formal version of this argument proceeds as follows:

Let $\mathbf{a}\in A^{k}$. Write the $k$-tuple $\mathbf{a}$ in the form
$\mathbf{a}=\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ for some $a_{1}%
,a_{2},\ldots,a_{k}\in A$. Then, $\mathbf{a}=\left(  a_{1},a_{2},\ldots
,a_{k}\right)  =\left(  a_{\operatorname*{id}\left(  1\right)  }%
,a_{\operatorname*{id}\left(  2\right)  },\ldots,a_{\operatorname*{id}\left(
k\right)  }\right)  $. Hence, the $k$-tuple $\mathbf{a}$ has the form $\left(
a_{\sigma\left(  1\right)  },a_{\sigma\left(  2\right)  },\ldots
,a_{\sigma\left(  k\right)  }\right)  $ for some permutation $\sigma$ of the
set $\left\{  1,2,\ldots,k\right\}  $ (namely, for $\sigma=\operatorname*{id}%
$). In other words, $\mathbf{a}$ is a permutation of the $k$-tuple $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ (by Definition
\ref{def.comb.tuples.perm-tup}). In other words, $\mathbf{a}$ is a permutation
of the $k$-tuple $\mathbf{a}$ (since $\mathbf{a}=\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $). In other words, $\mathbf{a}%
\underset{\operatorname*{perm}}{\sim}\mathbf{a}$ (by the definition of the
relation $\underset{\operatorname*{perm}}{\sim}$).

Now, forget that we fixed $\mathbf{a}$. We thus have proven that every
$\mathbf{a}\in A^{k}$ satisfies $\mathbf{a}\underset{\operatorname*{perm}%
}{\sim}\mathbf{a}$. In other words, the relation
$\underset{\operatorname*{perm}}{\sim}$ is reflexive.]

\item The relation $\underset{\operatorname*{perm}}{\sim}$ is symmetric.

[\textit{Proof:} Let $\mathbf{a},\mathbf{b}\in A^{k}$ be such that
$\mathbf{a}\underset{\operatorname*{perm}}{\sim}\mathbf{b}$. We shall prove
that $\mathbf{b}\underset{\operatorname*{perm}}{\sim}\mathbf{a}$.

Write the $k$-tuple $\mathbf{a}$ in the form $\mathbf{a}=\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $ for some $a_{1},a_{2},\ldots,a_{k}\in A$. Write
the $k$-tuple $\mathbf{b}$ in the form $\mathbf{b}=\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $ for some $b_{1},b_{2},\ldots,b_{k}\in A$. We have
$\mathbf{a}\underset{\operatorname*{perm}}{\sim}\mathbf{b}$. In other words,
$\mathbf{a}$ is a permutation of $\mathbf{b}$ (by the definition of the
relation $\underset{\operatorname*{perm}}{\sim}$). In other words, $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ is a permutation of $\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $ (since $\mathbf{a}=\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $ and $\mathbf{b}=\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $). Hence, Proposition \ref{prop.comb.tuples.perm.symm}
(applied to $p_{i}=b_{i}$ and $q_{i}=a_{i}$) shows that $\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $ is a permutation of $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $. In other words, $\mathbf{b}$ is a permutation of
$\mathbf{a}$ (since $\mathbf{a}=\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ and
$\mathbf{b}=\left(  b_{1},b_{2},\ldots,b_{k}\right)  $). In other words,
$\mathbf{b}\underset{\operatorname*{perm}}{\sim}\mathbf{a}$.

Forget that we fixed $\mathbf{a}$ and $\mathbf{b}$. We thus have shown that
every $\mathbf{a},\mathbf{b}\in A^{k}$ satisfying $\mathbf{a}%
\underset{\operatorname*{perm}}{\sim}\mathbf{b}$ satisfy $\mathbf{b}%
\underset{\operatorname*{perm}}{\sim}\mathbf{a}$. In other words, the relation
$\underset{\operatorname*{perm}}{\sim}$ is symmetric.]

\item The relation $\underset{\operatorname*{perm}}{\sim}$ is transitive.

[\textit{Proof:} Let $\mathbf{a},\mathbf{b},\mathbf{c}\in A^{k}$ be such that
$\mathbf{a}\underset{\operatorname*{perm}}{\sim}\mathbf{b}$ and $\mathbf{b}%
\underset{\operatorname*{perm}}{\sim}\mathbf{c}$. We shall prove that
$\mathbf{a}\underset{\operatorname*{perm}}{\sim}\mathbf{c}$.

Write the $k$-tuple $\mathbf{a}$ in the form $\mathbf{a}=\left(  a_{1}%
,a_{2},\ldots,a_{k}\right)  $ for some $a_{1},a_{2},\ldots,a_{k}\in A$. Write
the $k$-tuple $\mathbf{b}$ in the form $\mathbf{b}=\left(  b_{1},b_{2}%
,\ldots,b_{k}\right)  $ for some $b_{1},b_{2},\ldots,b_{k}\in A$. Write the
$k$-tuple $\mathbf{c}$ in the form $\mathbf{c}=\left(  c_{1},c_{2}%
,\ldots,c_{k}\right)  $ for some $c_{1},c_{2},\ldots,c_{k}\in A$.

We have $\mathbf{a}\underset{\operatorname*{perm}}{\sim}\mathbf{b}$. In other
words, $\mathbf{a}$ is a permutation of $\mathbf{b}$ (by the definition of the
relation $\underset{\operatorname*{perm}}{\sim}$). In other words, $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ is a permutation of $\left(  b_{1}%
,b_{2},\ldots,b_{k}\right)  $ (since $\mathbf{a}=\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $ and $\mathbf{b}=\left(  b_{1},b_{2},\ldots
,b_{k}\right)  $). In other words, the $k$-tuple $\left(  a_{1},a_{2}%
,\ldots,a_{k}\right)  $ has the form $\left(  b_{\sigma\left(  1\right)
},b_{\sigma\left(  2\right)  },\ldots,b_{\sigma\left(  k\right)  }\right)  $
for some permutation $\sigma$ of the set $\left\{  1,2,\ldots,k\right\}  $ (by
Definition \ref{def.comb.tuples.perm-tup}). Consider this $\sigma$, and denote
it by $\lambda$. Thus, $\lambda$ is a permutation of $\left\{  1,2,\ldots
,k\right\}  $ and has the property that $\left(  a_{1},a_{2},\ldots
,a_{k}\right)  =\left(  b_{\lambda\left(  1\right)  },b_{\lambda\left(
2\right)  },\ldots,b_{\lambda\left(  k\right)  }\right)  $. Likewise, we can
find a permutation $\mu$ of $\left\{  1,2,\ldots,k\right\}  $ with the
property that $\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\left(  c_{\mu\left(
1\right)  },c_{\mu\left(  2\right)  },\ldots,c_{\mu\left(  k\right)  }\right)
$ (because of our assumption that $\mathbf{b}\underset{\operatorname*{perm}%
}{\sim}\mathbf{c}$). Consider this $\mu$ as well.

Now $\mu$ and $\lambda$ are permutations of the set $\left\{  1,2,\ldots
,k\right\}  $, that is, bijective maps $\left\{  1,2,\ldots,k\right\}
\rightarrow\left\{  1,2,\ldots,k\right\}  $. Hence, their composition
$\mu\circ\lambda$ is a bijective map $\left\{  1,2,\ldots,k\right\}
\rightarrow\left\{  1,2,\ldots,k\right\}  $ as well, i.e., is a permutation of
the set $\left\{  1,2,\ldots,k\right\}  $.

Recall that $\left(  b_{1},b_{2},\ldots,b_{k}\right)  =\left(  c_{\mu\left(
1\right)  },c_{\mu\left(  2\right)  },\ldots,c_{\mu\left(  k\right)  }\right)
$. In other words, each $j\in\left\{  1,2,\ldots,k\right\}  $ satisfies%
\begin{equation}
b_{j}=c_{\mu\left(  j\right)  }. \label{sol.eqrel.eqcl.perm.eq.trans-bc}%
\end{equation}


Also, $\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(  b_{\lambda\left(
1\right)  },b_{\lambda\left(  2\right)  },\ldots,b_{\lambda\left(  k\right)
}\right)  $. Hence, each $i\in\left\{  1,2,\ldots,k\right\}  $ satisfies%
\begin{align*}
a_{i}  &  =b_{\lambda\left(  i\right)  }=c_{\mu\left(  \lambda\left(
i\right)  \right)  }\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.eqrel.eqcl.perm.eq.trans-bc}), applied to }j=\lambda\left(
i\right)  \right) \\
&  =c_{\left(  \mu\circ\lambda\right)  \left(  i\right)  }.
\end{align*}
In other words, we have $\left(  a_{1},a_{2},\ldots,a_{k}\right)  =\left(
c_{\left(  \mu\circ\lambda\right)  \left(  1\right)  },c_{\left(  \mu
\circ\lambda\right)  \left(  2\right)  },\ldots,c_{\left(  \mu\circ
\lambda\right)  \left(  k\right)  }\right)  $. Hence, the $k$-tuple $\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ has the form $\left(  c_{\sigma\left(
1\right)  },c_{\sigma\left(  2\right)  },\ldots,c_{\sigma\left(  k\right)
}\right)  $ for some permutation $\sigma$ of the set $\left\{  1,2,\ldots
,k\right\}  $ (namely, for $\sigma=\mu\circ\lambda$). In other words, the
$k$-tuple $\left(  a_{1},a_{2},\ldots,a_{k}\right)  $ is a permutation of
$\left(  c_{1},c_{2},\ldots,c_{k}\right)  $ (by Definition
\ref{def.comb.tuples.perm-tup}). In other words, $\mathbf{a}$ is a permutation
of $\mathbf{c}$ (since $\mathbf{a}=\left(  a_{1},a_{2},\ldots,a_{k}\right)  $
and $\mathbf{c}=\left(  c_{1},c_{2},\ldots,c_{k}\right)  $). In other words,
$\mathbf{a}\underset{\operatorname*{perm}}{\sim}\mathbf{c}$.

Forget that we fixed $\mathbf{a},\mathbf{b},\mathbf{c}$. We thus have shown
that every $\mathbf{a},\mathbf{b},\mathbf{c}\in A^{k}$ satisfying
$\mathbf{a}\underset{\operatorname*{perm}}{\sim}\mathbf{b}$ and $\mathbf{b}%
\underset{\operatorname*{perm}}{\sim}\mathbf{c}$ satisfy $\mathbf{a}%
\underset{\operatorname*{perm}}{\sim}\mathbf{c}$. In other words, the relation
$\underset{\operatorname*{perm}}{\sim}$ is transitive.]
\end{itemize}

We now know that the relation $\underset{\operatorname*{perm}}{\sim}$ is
reflexive, symmetric and transitive. In other words,
$\underset{\operatorname*{perm}}{\sim}$ is an equivalence relation. This
solves Exercise \ref{exe.eqrel.eqcl.perm.eq}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.eqrel.eqrel.=f}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.eqrel.eqrel.=f}.]Let $T$ be the quotient set
$S/\sim$, and let $f:S\rightarrow T$ be the canonical projection $\pi_{\sim
}:S\rightarrow S/\sim$. We shall prove that the relation $\sim$ equals the
relation $\underset{f}{\equiv}$.

Let $a\in S$ and $b\in S$. Recall that $f$ is the map $\pi_{\sim}$. Thus,
$f=\pi_{\sim}$, so that $f\left(  a\right)  =\pi_{\sim}\left(  a\right)
=\left[  a\right]  _{\sim}$ (by the definition of $\pi_{\sim}$). The same
argument (applied to $b$ instead of $a$) yields $f\left(  b\right)  =\left[
b\right]  _{\sim}$.

Theorem \ref{thm.eqrel.eqcl.disj} \textbf{(e)} (applied to $x=a$ and $y=b$)
shows that we have $a\sim b$ if and only if $\left[  a\right]  _{\sim}=\left[
b\right]  _{\sim}$. In other words, we have the logical equivalence%
\begin{equation}
\left(  a\sim b\right)  \ \Longleftrightarrow\ \left(  \left[  a\right]
_{\sim}=\left[  b\right]  _{\sim}\right)  . \label{sol.eqrel.eqrel.=f.2}%
\end{equation}


We have the following chain of logical equivalences:%
\begin{align}
\left(  a\underset{f}{\equiv}b\right)  \  &  \Longleftrightarrow\ \left(
\underbrace{f\left(  a\right)  }_{=\left[  a\right]  _{\sim}}%
=\underbrace{f\left(  b\right)  }_{=\left[  b\right]  _{\sim}}\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the relation
}\underset{f}{\equiv}\right) \nonumber\\
&  \Longleftrightarrow\ \left(  \left[  a\right]  _{\sim}=\left[  b\right]
_{\sim}\right)  \ \Longleftrightarrow\ \left(  a\sim b\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.eqrel.eqrel.=f.2})}\right)  .
\label{sol.eqrel.eqrel.=f.4}%
\end{align}


Now, forget that we fixed $a$ and $b$. We thus have proven the equivalence
(\ref{sol.eqrel.eqrel.=f.4}) for all $a\in S$ and $b\in S$. Now, recall that
we have defined a relation on the set $S$ to be a subset of $S\times S$
(namely, the subset of all pairs $\left(  a,b\right)  \in S\times S$
satisfying this relation). Hence, the relation $\sim$ is actually the subset%
\[
\left\{  \left(  a,b\right)  \in S\times S\ \mid\ a\sim b\right\}
\]
of $S\times S$, whereas the relation $\underset{f}{\equiv}$ is actually the
subset%
\[
\left\{  \left(  a,b\right)  \in S\times S\ \mid\ a\underset{f}{\equiv
}b\right\}
\]
of $S\times S$. But these two subsets are clearly identical, because we have
shown the equivalence (\ref{sol.eqrel.eqrel.=f.4}) for all $a\in S$ and $b\in
S$. In other words, the two relations $\sim$ and $\underset{f}{\equiv}$ are
identical. In other words, the relation $\sim$ equals the relation
$\underset{f}{\equiv}$. This solves Exercise \ref{exe.eqrel.eqrel.=f}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.eqrel.quot.wp}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.eqrel.quot.wp}.]\textbf{(a)} Let $r$ be a
nonzero rational number. We must prove that the integer $w_{p}\left(
r\right)  $ is well-defined. Recall that we have defined $w_{p}\left(
r\right)  $ by setting $w_{p}\left(  r\right)  =v_{p}\left(  a\right)
-v_{p}\left(  b\right)  $, where we write $r$ in the form $r=a/b$ for two
nonzero integers $a$ and $b$. In order to prove that $w_{p}\left(  r\right)  $
is well-defined, we must thus verify the following three claims:

\begin{statement}
\textit{Claim 1:} It is possible to write $r$ in the form $r=a/b$ for two
nonzero integers $a$ and $b$.
\end{statement}

\begin{statement}
\textit{Claim 2:} If we write $r$ in the form $r=a/b$ for two nonzero integers
$a$ and $b$, then $v_{p}\left(  a\right)  -v_{p}\left(  b\right)  $ is a
well-defined integer.\footnote{This needs saying, because $p$-valuations can
be $\infty$ and thus their differences may fail to be well-defined integers
(for example, $\infty-\infty$ is not even well-defined).}
\end{statement}

\begin{statement}
\textit{Claim 3:} If we write $r$ in the form $r=a/b$ for two nonzero integers
$a$ and $b$, then the integer $v_{p}\left(  a\right)  -v_{p}\left(  b\right)
$ depends only on $p$ and $r$ (but not on $a$ and $b$).
\end{statement}

Claim 1 and Claim 2 are easy to verify:

[\textit{Proof of Claim 1:} We know that $r$ is a rational number. Hence, we
can write $r$ in the form $r=c/d$ for some integer $c$ and some nonzero
integer $d$. Consider these $c$ and $d$. If we had $c=0$, then we would have
$r=\underbrace{c}_{=0}/d=0$; but this would contradict the fact that $r$ is
nonzero. Hence, we cannot have $c=0$. Thus, $c$ is nonzero. Thus, there exist
two nonzero integers $a$ and $b$ such that $r=a/b$ (namely, $a=c$ and $b=d$).
In other words, it is possible to write $r$ in the form $r=a/b$ for two
nonzero integers $a$ and $b$. This proves Claim 1.]

[\textit{Proof of Claim 2:} Assume that $r$ is written in the form $r=a/b$ for
two nonzero integers $a$ and $b$. Definition \ref{def.ent.prime.vp}
\textbf{(a)} shows that $v_{p}\left(  n\right)  \in\mathbb{N}$ for each
nonzero integer $n$. Thus, $v_{p}\left(  a\right)  \in\mathbb{N}$ (since $a$
is nonzero) and $v_{p}\left(  b\right)  \in\mathbb{N}$ (since $b$ is nonzero).
Hence, $\underbrace{v_{p}\left(  a\right)  }_{\in\mathbb{N}}-\underbrace{v_{p}%
\left(  b\right)  }_{\in\mathbb{N}}\in\mathbb{Z}$. In other words,
$v_{p}\left(  a\right)  -v_{p}\left(  b\right)  $ is a well-defined integer.
This proves Claim 2.]

It remains to prove Claim 3. Clearly, Claim 3 can be restated as follows:

\begin{statement}
\textit{Claim 4:} Let $\left(  a_{1},b_{1}\right)  $ and $\left(  a_{2}%
,b_{2}\right)  $ be two pairs $\left(  a,b\right)  $ of nonzero integers $a$
and $b$ satisfying $r=a/b$. Then, $v_{p}\left(  a_{1}\right)  -v_{p}\left(
b_{1}\right)  =v_{p}\left(  a_{2}\right)  -v_{p}\left(  b_{2}\right)  $.
\end{statement}

[\textit{Proof of Claim 4:} We have assumed that $\left(  a_{1},b_{1}\right)
$ is a pair $\left(  a,b\right)  $ of nonzero integers $a$ and $b$ satisfying
$r=a/b$. In other words, $\left(  a_{1},b_{1}\right)  $ is a pair of nonzero
integers satisfying $r=a_{1}/b_{1}$. Similarly, $\left(  a_{2},b_{2}\right)  $
is a pair of nonzero integers satisfying $r=a_{2}/b_{2}$.

We have $r=a_{1}/b_{1}$, thus $a_{1}/b_{1}=r=a_{2}/b_{2}$. Multiplying this
equality by $b_{1}b_{2}$, we find $a_{1}b_{2}=a_{2}b_{1}$. Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(a)} (applied to $a=a_{1}$ and $b=b_{2}$)
yields $v_{p}\left(  a_{1}b_{2}\right)  =v_{p}\left(  a_{1}\right)
+v_{p}\left(  b_{2}\right)  $. Theorem \ref{thm.ent.prime.vp-ring}
\textbf{(a)} (applied to $a=a_{2}$ and $b=b_{1}$) yields $v_{p}\left(
a_{2}b_{1}\right)  =v_{p}\left(  a_{2}\right)  +v_{p}\left(  b_{1}\right)  $.
Now, from $v_{p}\left(  a_{1}b_{2}\right)  =v_{p}\left(  a_{1}\right)
+v_{p}\left(  b_{2}\right)  $, we obtain%
\begin{equation}
v_{p}\left(  a_{1}\right)  +v_{p}\left(  b_{2}\right)  =v_{p}\left(
\underbrace{a_{1}b_{2}}_{=a_{2}b_{1}}\right)  =v_{p}\left(  a_{2}b_{1}\right)
=v_{p}\left(  a_{2}\right)  +v_{p}\left(  b_{1}\right)  .
\label{sol.eqrel.quot.wp.a.3}%
\end{equation}
But $b_{1}$ is a nonzero integer (since $\left(  a_{1},b_{1}\right)  $ is a
pair of nonzero integers); thus, $v_{p}\left(  b_{1}\right)  \in\mathbb{N}$
(since Definition \ref{def.ent.prime.vp} \textbf{(a)} shows that $v_{p}\left(
n\right)  \in\mathbb{N}$ for each nonzero integer $n$). Similarly,
$v_{p}\left(  b_{2}\right)  \in\mathbb{N}$. Hence, $\underbrace{v_{p}\left(
b_{1}\right)  }_{\in\mathbb{N}}+\underbrace{v_{p}\left(  b_{2}\right)  }%
_{\in\mathbb{N}}\in\mathbb{N}$. Thus, we can subtract $v_{p}\left(
b_{1}\right)  +v_{p}\left(  b_{2}\right)  $ from both sides of the equality
(\ref{sol.eqrel.quot.wp.a.3})\footnote{The reason why we are so circumspect
about this is that $p$-valuations can be $\infty$, and $\infty$ cannot be
subtracted. So when subtracting a $p$-valuation, it is important to ensure
that this $p$-valuation is an element of $\mathbb{N}$ (that is, it is not
$\infty$).}. We thus obtain $v_{p}\left(  a_{1}\right)  -v_{p}\left(
b_{1}\right)  =v_{p}\left(  a_{2}\right)  -v_{p}\left(  b_{2}\right)  $. This
proves Claim 4.]

As we recall, Claim 4 is just a restatement of Claim 3. Hence, Claim 3 is
proven (since Claim 4 is proven). From Claims 1, 2 and 3, we conclude that
$w_{p}\left(  r\right)  $ is well-defined. Thus, Exercise
\ref{exe.eqrel.quot.wp} \textbf{(a)} is solved.

Let us state a consequence of the definition of $w_{p}\left(  r\right)  $: If
$r$ is a nonzero rational number, and if $a$ and $b$ are two nonzero integers
satisfying $r=a/b$, then%
\begin{equation}
w_{p}\left(  r\right)  =v_{p}\left(  a\right)  -v_{p}\left(  b\right)  .
\label{sol.eqrel.quot.wp.a.cons}%
\end{equation}


\textbf{(b)} Let $n$ be a nonzero integer. We must prove that $w_{p}\left(
n\right)  =v_{p}\left(  n\right)  $.

We know that $n$ and $1$ are two nonzero integers satisfying $n=n/1$. Hence,
(\ref{sol.eqrel.quot.wp.a.cons}) (applied to $r=n$, $a=n$ and $b=1$) yields%
\[
w_{p}\left(  n\right)  =v_{p}\left(  n\right)  -\underbrace{v_{p}\left(
1\right)  }_{\substack{=0\\\text{(by Theorem \ref{thm.ent.prime.vp-ring}
\textbf{(c)})}}}=v_{p}\left(  n\right)  .
\]
This solves Exercise \ref{exe.eqrel.quot.wp} \textbf{(b)}.

\textbf{(c)} Let $a$ and $b$ be two nonzero rational numbers. We must show
that $w_{p}\left(  ab\right)  =w_{p}\left(  a\right)  +w_{p}\left(  b\right)
$.

We know that $a$ is a rational number. Thus, we can write $a$ in the form
$a=n_{1}/d_{1}$ for some integer $n_{1}$ and some nonzero integer $d_{1}$.
Consider these $n_{1}$ and $d_{1}$. If we had $n_{1}=0$, then we would have
$a=\underbrace{n_{1}}_{=0}/d_{1}=0$, which would contradict the assumption
that $a$ is nonzero. Hence, we do not have $n_{1}=0$. In other words, $n_{1}$
is nonzero. Thus, (\ref{sol.eqrel.quot.wp.a.cons}) (applied to $a$, $n_{1}$
and $d_{1}$ instead of $r$, $a$ and $b$) yields
\begin{equation}
w_{p}\left(  a\right)  =v_{p}\left(  n_{1}\right)  -v_{p}\left(  d_{1}\right)
. \label{sol.eqrel.quot.wp.c.wpa=}%
\end{equation}


We know that $b$ is a rational number. Thus, we can write $b$ in the form
$b=n_{2}/d_{2}$ for some integer $n_{2}$ and some nonzero integer $d_{2}$.
Consider these $n_{2}$ and $d_{2}$. If we had $n_{2}=0$, then we would have
$b=\underbrace{n_{2}}_{=0}/d_{2}=0$, which would contradict the assumption
that $b$ is nonzero. Hence, we do not have $n_{2}=0$. In other words, $n_{2}$
is nonzero. Thus, (\ref{sol.eqrel.quot.wp.a.cons}) (applied to $b$, $n_{2}$
and $d_{2}$ instead of $r$, $a$ and $b$) yields
\begin{equation}
w_{p}\left(  b\right)  =v_{p}\left(  n_{2}\right)  -v_{p}\left(  d_{2}\right)
. \label{sol.eqrel.quot.wp.c.wpb=}%
\end{equation}


From $a=n_{1}/d_{1}$ and $b=n_{2}/d_{2}$, we obtain%
\[
ab=\left(  n_{1}/d_{1}\right)  \left(  n_{2}/d_{2}\right)  =\left(  n_{1}%
n_{2}\right)  /\left(  d_{1}d_{2}\right)  .
\]
Moreover, the integer $n_{1}n_{2}$ is nonzero (since $n_{1}$ and $n_{2}$ are
nonzero), and the integer $d_{1}d_{2}$ is nonzero (since $d_{1}$ and $d_{2}$
are nonzero). Hence, (\ref{sol.eqrel.quot.wp.a.cons}) (applied to $ab$,
$n_{1}n_{2}$ and $d_{1}d_{2}$ instead of $r$, $a$ and $b$) yields
\begin{align*}
w_{p}\left(  ab\right)   &  =\underbrace{v_{p}\left(  n_{1}n_{2}\right)
}_{\substack{=v_{p}\left(  n_{1}\right)  +v_{p}\left(  n_{2}\right)
\\\text{(by Theorem \ref{thm.ent.prime.vp-ring} \textbf{(a),}}\\\text{applied
to }n_{1}\text{ and }n_{2}\text{ instead of }a\text{ and }b\text{)}%
}}-\underbrace{v_{p}\left(  d_{1}d_{2}\right)  }_{\substack{=v_{p}\left(
d_{1}\right)  +v_{p}\left(  d_{2}\right)  \\\text{(by Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(a),}}\\\text{applied to }d_{1}\text{ and
}d_{2}\text{ instead of }a\text{ and }b\text{)}}}\\
&  =\left(  v_{p}\left(  n_{1}\right)  +v_{p}\left(  n_{2}\right)  \right)
-\left(  v_{p}\left(  d_{1}\right)  +v_{p}\left(  d_{2}\right)  \right) \\
&  =\underbrace{\left(  v_{p}\left(  n_{1}\right)  -v_{p}\left(  d_{1}\right)
\right)  }_{\substack{=w_{p}\left(  a\right)  \\\text{(by
(\ref{sol.eqrel.quot.wp.c.wpa=}))}}}+\underbrace{\left(  v_{p}\left(
n_{2}\right)  -v_{p}\left(  d_{2}\right)  \right)  }_{\substack{=w_{p}\left(
b\right)  \\\text{(by (\ref{sol.eqrel.quot.wp.c.wpb=}))}}}\\
&  =w_{p}\left(  a\right)  +w_{p}\left(  b\right)  .
\end{align*}
This solves Exercise \ref{exe.eqrel.quot.wp} \textbf{(c)}.

\textbf{(d)} Let $a$ and $b$ be two nonzero rational numbers such that
$a+b\neq0$. We must show that $w_{p}\left(  a+b\right)  \geq\min\left\{
w_{p}\left(  a\right)  ,w_{p}\left(  b\right)  \right\}  $.

Note that $a+b$ is a nonzero rational number (since $a+b\neq0$); thus,
$w_{p}\left(  a+b\right)  $ is well-defined.

We know that $a$ is a rational number. Thus, we can write $a$ in the form
$a=n_{1}/d_{1}$ for some integer $n_{1}$ and some nonzero integer $d_{1}$.
Consider these $n_{1}$ and $d_{1}$. Then, $n_{1}$ is nonzero (this is proven
in the same way as in our solution to Exercise \ref{exe.eqrel.quot.wp}
\textbf{(c)}). Thus, (\ref{sol.eqrel.quot.wp.a.cons}) (applied to $a$, $n_{1}$
and $d_{1}$ instead of $r$, $a$ and $b$) yields
\begin{equation}
w_{p}\left(  a\right)  =v_{p}\left(  n_{1}\right)  -v_{p}\left(  d_{1}\right)
. \label{sol.eqrel.quot.wp.d.wpa=}%
\end{equation}


We know that $b$ is a rational number. Thus, we can write $b$ in the form
$b=n_{2}/d_{2}$ for some integer $n_{2}$ and some nonzero integer $d_{2}$.
Consider these $n_{2}$ and $d_{2}$. Then, $n_{2}$ is nonzero (this is proven
in the same way as in our solution to Exercise \ref{exe.eqrel.quot.wp}
\textbf{(c)}). Thus, (\ref{sol.eqrel.quot.wp.a.cons}) (applied to $b$, $n_{2}$
and $d_{2}$ instead of $r$, $a$ and $b$) yields
\begin{equation}
w_{p}\left(  b\right)  =v_{p}\left(  n_{2}\right)  -v_{p}\left(  d_{2}\right)
. \label{sol.eqrel.quot.wp.d.wpb=}%
\end{equation}


From $a=n_{1}/d_{1}$ and $b=n_{2}/d_{2}$, we obtain%
\[
a+b=\left(  n_{1}/d_{1}\right)  +\left(  n_{2}/d_{2}\right)  =\left(
n_{1}d_{2}+n_{2}d_{1}\right)  /\left(  d_{1}d_{2}\right)  .
\]
Moreover, the integer $n_{1}d_{2}+n_{2}d_{1}$ is nonzero (because otherwise,
we would have $n_{1}d_{2}+n_{2}d_{1}=0$ and therefore $a+b=\underbrace{\left(
n_{1}d_{2}+n_{2}d_{1}\right)  }_{=0}/\left(  d_{1}d_{2}\right)  =0$, which
would contradict $a+b\neq0$), and the integer $d_{1}d_{2}$ is nonzero (since
$d_{1}$ and $d_{2}$ are nonzero). Hence, (\ref{sol.eqrel.quot.wp.a.cons})
(applied to $a+b$, $n_{1}d_{2}+n_{2}d_{1}$ and $d_{1}d_{2}$ instead of $r$,
$a$ and $b$) yields
\begin{align}
w_{p}\left(  a+b\right)   &  =\underbrace{v_{p}\left(  n_{1}d_{2}+n_{2}%
d_{1}\right)  }_{\substack{\geq\min\left\{  v_{p}\left(  n_{1}d_{2}\right)
,v_{p}\left(  n_{2}d_{1}\right)  \right\}  \\\text{(by Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(b),}}\\\text{applied to }n_{1}d_{2}\text{
and }n_{2}d_{1}\text{ instead of }a\text{ and }b\text{)}}}-\underbrace{v_{p}%
\left(  d_{1}d_{2}\right)  }_{\substack{=v_{p}\left(  d_{1}\right)
+v_{p}\left(  d_{2}\right)  \\\text{(by Theorem \ref{thm.ent.prime.vp-ring}
\textbf{(a),}}\\\text{applied to }d_{1}\text{ and }d_{2}\text{ instead of
}a\text{ and }b\text{)}}}\nonumber\\
&  \geq\min\left\{  \underbrace{v_{p}\left(  n_{1}d_{2}\right)  }%
_{\substack{=v_{p}\left(  n_{1}\right)  +v_{p}\left(  d_{2}\right)
\\\text{(by Theorem \ref{thm.ent.prime.vp-ring} \textbf{(a),}}\\\text{applied
to }n_{1}\text{ and }d_{2}\\\text{instead of }a\text{ and }b\text{)}%
}},\underbrace{v_{p}\left(  n_{2}d_{1}\right)  }_{\substack{=v_{p}\left(
n_{2}\right)  +v_{p}\left(  d_{1}\right)  \\\text{(by Theorem
\ref{thm.ent.prime.vp-ring} \textbf{(a),}}\\\text{applied to }n_{2}\text{ and
}d_{1}\\\text{instead of }a\text{ and }b\text{)}}}\right\}  -\left(
v_{p}\left(  d_{1}\right)  +v_{p}\left(  d_{2}\right)  \right) \nonumber\\
&  =\min\left\{  v_{p}\left(  n_{1}\right)  +v_{p}\left(  d_{2}\right)
,v_{p}\left(  n_{2}\right)  +v_{p}\left(  d_{1}\right)  \right\}  -\left(
v_{p}\left(  d_{1}\right)  +v_{p}\left(  d_{2}\right)  \right)  .
\label{sol.eqrel.quot.wp.d.6}%
\end{align}


But it is easy to see that any three numbers $i,j,k\in\mathbb{N}$ satisfy%
\begin{equation}
\min\left\{  i,j\right\}  -k=\min\left\{  i-k,j-k\right\}
\label{sol.eqrel.quot.wp.d.min-}%
\end{equation}
\footnote{\textit{Proof of (\ref{sol.eqrel.quot.wp.d.min-}):} Let
$i,j,k\in\mathbb{N}$ be three numbers. We must prove the equality
(\ref{sol.eqrel.quot.wp.d.min-}). We can WLOG assume that $i\leq j$ (since $i$
and $j$ play symmetric roles in our claim, and thus swapping $i$ with $j$ will
not change anything). Assume this. Hence, $\underbrace{i}_{\leq j}-k\leq j-k$,
thus $\min\left\{  i-k,j-k\right\}  =i-k$. Comparing this with
$\underbrace{\min\left\{  i,j\right\}  }_{\substack{=i\\\text{(since }i\leq
j\text{)}}}-k=i-k$, we obtain $\min\left\{  i,j\right\}  -k=\min\left\{
i-k,j-k\right\}  $. This proves (\ref{sol.eqrel.quot.wp.d.min-}).}. Also, it
is easy to see that the three numbers $v_{p}\left(  n_{1}\right)
+v_{p}\left(  d_{2}\right)  ,v_{p}\left(  n_{2}\right)  +v_{p}\left(
d_{1}\right)  ,v_{p}\left(  d_{1}\right)  +v_{p}\left(  d_{2}\right)  $ belong
to $\mathbb{N}$ (since $n_{1},n_{2},d_{1},d_{2}$ are all nonzero). Hence,
(\ref{sol.eqrel.quot.wp.d.min-}) (applied to $i=v_{p}\left(  n_{1}\right)
+v_{p}\left(  d_{2}\right)  $, $j=v_{p}\left(  n_{2}\right)  +v_{p}\left(
d_{1}\right)  $ and $k=v_{p}\left(  d_{1}\right)  +v_{p}\left(  d_{2}\right)
$) yields%
\begin{align*}
&  \min\left\{  v_{p}\left(  n_{1}\right)  +v_{p}\left(  d_{2}\right)
,v_{p}\left(  n_{2}\right)  +v_{p}\left(  d_{1}\right)  \right\}  -\left(
v_{p}\left(  d_{1}\right)  +v_{p}\left(  d_{2}\right)  \right) \\
&  =\min\left\{  \underbrace{v_{p}\left(  n_{1}\right)  +v_{p}\left(
d_{2}\right)  -\left(  v_{p}\left(  d_{1}\right)  +v_{p}\left(  d_{2}\right)
\right)  }_{\substack{=v_{p}\left(  n_{1}\right)  -v_{p}\left(  d_{1}\right)
=w_{p}\left(  a\right)  \\\text{(by (\ref{sol.eqrel.quot.wp.d.wpa=}))}%
}},\underbrace{v_{p}\left(  n_{2}\right)  +v_{p}\left(  d_{1}\right)  -\left(
v_{p}\left(  d_{1}\right)  +v_{p}\left(  d_{2}\right)  \right)  }%
_{\substack{=v_{p}\left(  n_{2}\right)  -v_{p}\left(  d_{2}\right)
=w_{p}\left(  b\right)  \\\text{(by (\ref{sol.eqrel.quot.wp.d.wpb=}))}%
}}\right\} \\
&  =\min\left\{  w_{p}\left(  a\right)  ,w_{p}\left(  b\right)  \right\}  .
\end{align*}
Thus, (\ref{sol.eqrel.quot.wp.d.6}) becomes%
\begin{align*}
w_{p}\left(  a+b\right)   &  \geq\min\left\{  v_{p}\left(  n_{1}\right)
+v_{p}\left(  d_{2}\right)  ,v_{p}\left(  n_{2}\right)  +v_{p}\left(
d_{1}\right)  \right\}  -\left(  v_{p}\left(  d_{1}\right)  +v_{p}\left(
v_{2}\right)  \right) \\
&  =\min\left\{  w_{p}\left(  a\right)  ,w_{p}\left(  b\right)  \right\}  .
\end{align*}
This solves Exercise \ref{exe.eqrel.quot.wp} \textbf{(d)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.eqrel.quot.wp-glob}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.eqrel.quot.wp-glob}.]It is possible to write
$r$ in the form $r=a/b$ for two nonzero integers $a$ and $b$%
.\ \ \ \ \footnote{Indeed, this is precisely Claim 1 in our above solution of
Exercise \ref{exe.eqrel.quot.wp} \textbf{(a)}.} Consider these $a$ and $b$.

We have $r=a/b$. Thus, for each prime $p$, we have%
\begin{equation}
w_{p}\left(  r\right)  =v_{p}\left(  a\right)  -v_{p}\left(  b\right)
\label{sol.eqrel.quot.wp.e.wp=}%
\end{equation}
(by (\ref{sol.eqrel.quot.wp.a.cons})). Also, $rb=a$ (since $r=a/b$).

\textbf{(a)} Let $p$ be a prime such that $p>\max\left\{  \left\vert
a\right\vert ,\left\vert b\right\vert \right\}  $. Then, $p>\max\left\{
\left\vert a\right\vert ,\left\vert b\right\vert \right\}  \geq\left\vert
a\right\vert $. Hence, Lemma \ref{lem.ent.prime.vpn=0} \textbf{(a)} (applied
to $n=a$) yields $v_{p}\left(  a\right)  =0$. The same argument (applied to
$b$ instead of $a$) leads to $v_{p}\left(  b\right)  =0$ (since $p>\max
\left\{  \left\vert a\right\vert ,\left\vert b\right\vert \right\}
\geq\left\vert b\right\vert $). Now, (\ref{sol.eqrel.quot.wp.e.wp=}) yields
$w_{p}\left(  r\right)  =\underbrace{v_{p}\left(  a\right)  }_{=0}%
-\underbrace{v_{p}\left(  b\right)  }_{=0}=0-0=0$.

Now, forget that we fixed $p$. We thus have proven that every prime $p$
satisfying $p>\max\left\{  \left\vert a\right\vert ,\left\vert b\right\vert
\right\}  $ satisfies $w_{p}\left(  r\right)  =0$. Hence, all but finitely
many primes $p$ satisfy $w_{p}\left(  r\right)  =0$ (since all but finitely
many primes $p$ satisfy $p>\max\left\{  \left\vert a\right\vert ,\left\vert
b\right\vert \right\}  $). This solves Exercise \ref{exe.eqrel.quot.wp-glob}
\textbf{(a)}.

\textbf{(b)} Exercise \ref{exe.eqrel.quot.wp-glob} \textbf{(a)} shows that all
but finitely many primes $p$ satisfy $w_{p}\left(  r\right)  =0$. Hence, all
but finitely many primes $p$ satisfy $p^{w_{p}\left(  r\right)  }=p^{0}=1$. In
other words, only finitely many primes $p$ satisfy $p^{w_{p}\left(  r\right)
}\neq1$. In other words, the product $\prod_{p\text{ prime}}p^{w_{p}\left(
r\right)  }$ has only finitely many factors different from $1$. Hence, this
product $\prod_{p\text{ prime}}p^{w_{p}\left(  r\right)  }$ is well-defined.

It remains to prove that $\left\vert r\right\vert =\prod_{p\text{ prime}%
}p^{w_{p}\left(  r\right)  }$.

Corollary \ref{cor.ent.prime.can-facZ} (applied to $n=a$) yields that%
\begin{equation}
\left\vert a\right\vert =\prod_{p\text{ prime}}p^{v_{p}\left(  a\right)  }
\label{sol.eqrel.quot.wp-glob.b.a=}%
\end{equation}
(and, in particular, the infinite product $\prod_{p\text{ prime}}%
p^{v_{p}\left(  a\right)  }$ is well-defined). Corollary
\ref{cor.ent.prime.can-facZ} (applied to $n=b$) yields that%
\begin{equation}
\left\vert b\right\vert =\prod_{p\text{ prime}}p^{v_{p}\left(  b\right)  }
\label{sol.eqrel.quot.wp-glob.b.b=}%
\end{equation}
(and, in particular, the infinite product $\prod_{p\text{ prime}}%
p^{v_{p}\left(  b\right)  }$ is well-defined). But $\left\vert b\right\vert $
is nonzero (since $b$ is nonzero). Hence, we can divide the equality
(\ref{sol.eqrel.quot.wp-glob.b.a=}) by the equality
(\ref{sol.eqrel.quot.wp-glob.b.b=}). We thus obtain%
\[
\dfrac{\left\vert a\right\vert }{\left\vert b\right\vert }=\dfrac
{\prod_{p\text{ prime}}p^{v_{p}\left(  a\right)  }}{\prod_{p\text{ prime}%
}p^{v_{p}\left(  b\right)  }}=\prod_{p\text{ prime}}\underbrace{\dfrac
{p^{v_{p}\left(  a\right)  }}{p^{v_{p}\left(  b\right)  }}}_{=p^{v_{p}\left(
a\right)  -v_{p}\left(  b\right)  }}=\prod_{p\text{ prime}}p^{v_{p}\left(
a\right)  -v_{p}\left(  b\right)  }.
\]


But (\ref{eq.ent.div.abs(xy)}) (applied to $x=r$ and $y=b$) yields $\left\vert
rb\right\vert =\left\vert r\right\vert \cdot\left\vert b\right\vert $. We can
divide this equality by $\left\vert b\right\vert $ (since $\left\vert
b\right\vert $ is nonzero), and thus obtain $\left\vert rb\right\vert
/\left\vert b\right\vert =\left\vert r\right\vert $. Hence,%
\[
\left\vert r\right\vert =\left\vert \underbrace{rb}_{=a}\right\vert
/\left\vert b\right\vert =\left\vert a\right\vert /\left\vert b\right\vert
=\dfrac{\left\vert a\right\vert }{\left\vert b\right\vert }=\prod_{p\text{
prime}}p^{v_{p}\left(  a\right)  -v_{p}\left(  b\right)  }.
\]
Comparing this with%
\[
\prod_{p\text{ prime}}\underbrace{p^{w_{p}\left(  r\right)  }}%
_{\substack{=p^{v_{p}\left(  a\right)  -v_{p}\left(  b\right)  }\\\text{(by
(\ref{sol.eqrel.quot.wp.e.wp=}))}}}=\prod_{p\text{ prime}}p^{v_{p}\left(
a\right)  -v_{p}\left(  b\right)  },
\]
we obtain $\left\vert r\right\vert =\prod_{p\text{ prime}}p^{w_{p}\left(
r\right)  }$. This completes the solution to Exercise
\ref{exe.eqrel.quot.wp-glob} \textbf{(b)}.

\textbf{(c)} We have $b\neq0$ (since $b$ is nonzero). Thus, Proposition
\ref{prop.ent.div.1} \textbf{(c)} (applied to $b$ and $a$ instead of $a$ and
$b$) shows that $b\mid a$ if and only if $\dfrac{a}{b}\in\mathbb{Z}$. In other
words, $b\mid a$ if and only if $r\in\mathbb{Z}$ (since $r=a/b=\dfrac{a}{b}$).
In other words, we have the following logical equivalence:%
\begin{equation}
\left(  b\mid a\right)  \ \Longleftrightarrow\ \left(  r\in\mathbb{Z}\right)
. \label{sol.eqrel.quot.wp.e.equiv1}%
\end{equation}


But Proposition \ref{prop.ent.prime.n|m} (applied to $m=a$ and $n=b$) shows
that we have $b\mid a$ if and only if each prime $p$ satisfies $v_{p}\left(
b\right)  \leq v_{p}\left(  a\right)  $. In other words, we have the following
logical equivalence:%
\begin{equation}
\left(  b\mid a\right)  \ \Longleftrightarrow\ \left(  \text{each prime
}p\text{ satisfies }v_{p}\left(  b\right)  \leq v_{p}\left(  a\right)
\right)  . \label{sol.eqrel.quot.wp.e.equiv2}%
\end{equation}


Now, we have the following chain of equivalences:%
\begin{align*}
\left(  r\in\mathbb{Z}\right)  \  &  \Longleftrightarrow\ \left(  b\mid
a\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.eqrel.quot.wp.e.equiv1})}\right) \\
&  \Longleftrightarrow\ \left(  \text{each prime }p\text{ satisfies }%
v_{p}\left(  b\right)  \leq v_{p}\left(  a\right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.eqrel.quot.wp.e.equiv2}%
)}\right) \\
&  \Longleftrightarrow\ \left(  \text{each prime }p\text{ satisfies
}\underbrace{v_{p}\left(  a\right)  -v_{p}\left(  b\right)  }%
_{\substack{=w_{p}\left(  r\right)  \\\text{(by (\ref{sol.eqrel.quot.wp.e.wp=}%
))}}}\geq0\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{because for each prime }p\text{, the inequality }v_{p}\left(  b\right)
\leq v_{p}\left(  a\right) \\
\text{is equivalent to the inequality }v_{p}\left(  a\right)  -v_{p}\left(
b\right)  \geq0
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  \text{each prime }p\text{ satisfies }%
w_{p}\left(  r\right)  \geq0\right)  .
\end{align*}
In other words, $r\in\mathbb{Z}$ if and only if each prime $p$ satisfies
$w_{p}\left(  r\right)  \geq0$. This solves Exercise
\ref{exe.eqrel.quot.wp-glob} \textbf{(c)}.

\textbf{(d)} We must prove the equivalence%
\begin{align*}
&  \ \left(  \text{there exists a }k\in\mathbb{N}\text{ satisfying }m^{k}%
r\in\mathbb{Z}\right) \\
&  \Longleftrightarrow\ \left(  \text{every prime }p\text{ satisfying }%
w_{p}\left(  r\right)  <0\text{ satisfies }p\mid m\right)  .
\end{align*}
We shall prove its \textquotedblleft$\Longrightarrow$\textquotedblright\ and
\textquotedblleft$\Longleftarrow$\textquotedblright\ directions separately:

$\Longrightarrow:$ Assume that there exists a $k\in\mathbb{N}$ satisfying
$m^{k}r\in\mathbb{Z}$. We must prove that every prime $p$ satisfying
$w_{p}\left(  r\right)  <0$ satisfies $p\mid m$.

Let $p$ be a prime satisfying $w_{p}\left(  r\right)  <0$. We must then prove
that $p\mid m$.

If $m=0$, then this is obvious\footnote{because in this case, we have
$m=0=p\cdot0$ and thus $p\mid m$}. Hence, for the rest of this proof, we WLOG
assume that $m\neq0$. Hence, $m$ is nonzero.

We have assumed that there exists a $k\in\mathbb{N}$ satisfying $m^{k}%
r\in\mathbb{Z}$. Consider this $k$.

Note that $m^{k}$ is a nonzero integer (since $m$ is a nonzero integer and
$k\in\mathbb{N}$). Hence, Exercise \ref{exe.eqrel.quot.wp} \textbf{(b)}
(applied to $n=m^{k}$) yields $w_{p}\left(  m^{k}\right)  =v_{p}\left(
m^{k}\right)  =kv_{p}\left(  m\right)  $ (by Exercise
\ref{exe.ent.prime.vp-pow}, applied to $m$ instead of $a$). Also, $m^{k}r$ is
an integer (since $m^{k}r\in\mathbb{Z}$) and is nonzero (since $m^{k}$ and $r$
are nonzero). Thus, Exercise \ref{exe.eqrel.quot.wp} \textbf{(b)} (applied to
$n=m^{k}r$) yields $w_{p}\left(  m^{k}r\right)  =v_{p}\left(  m^{k}r\right)
\in\mathbb{N}$ (since the $p$-valuation of any nonzero integer belongs to
$\mathbb{N}$). Hence, $w_{p}\left(  m^{k}r\right)  \geq0$.

But Exercise \ref{exe.eqrel.quot.wp} \textbf{(c)} (applied to $m^{k}$ and $r$
instead of $a$ and $b$) yields
\[
w_{p}\left(  m^{k}r\right)  =\underbrace{w_{p}\left(  m^{k}\right)  }%
_{=kv_{p}\left(  m\right)  }+\underbrace{w_{p}\left(  r\right)  }_{<0}%
<kv_{p}\left(  m\right)  ,
\]
so that $kv_{p}\left(  m\right)  >w_{p}\left(  m^{k}r\right)  \geq0$. Thus,
$kv_{p}\left(  m\right)  \neq0$, so that $v_{p}\left(  m\right)  \neq0$. In
other words, we don't have $v_{p}\left(  m\right)  =0$.

But Corollary \ref{cor.ent.prime.vp-0} (applied to $n=m$) shows that
$v_{p}\left(  m\right)  =0$ if and only if $p\nmid m$. Hence, we don't have
$p\nmid m$ (since we don't have $v_{p}\left(  m\right)  =0$). In other words,
we have $p\mid m$.

Now, forget that we fixed $p$. We thus have proven that every prime $p$
satisfying $w_{p}\left(  r\right)  <0$ satisfies $p\mid m$. This completes the
proof of the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction
of Exercise \ref{exe.eqrel.quot.wp-glob} \textbf{(d)}.

$\Longleftarrow:$ Assume that every prime $p$ satisfying $w_{p}\left(
r\right)  <0$ satisfies $p\mid m$. We must prove that there exists a
$k\in\mathbb{N}$ satisfying $m^{k}r\in\mathbb{Z}$.

If $m=0$, then this is obvious\footnote{because in this case, we can take
$k=1$ and obtain $\underbrace{m^{k}}_{=m^{1}=m=0}r=0\in\mathbb{Z}$}. Hence,
for the rest of this proof, we WLOG assume that $m\neq0$. Hence, $m$ is nonzero.

We have assumed that%
\begin{equation}
\text{every prime }p\text{ satisfying }w_{p}\left(  r\right)  <0\text{
satisfies }p\mid m. \label{sol.eqrel.quot.wp-glob.d.1}%
\end{equation}


Exercise \ref{exe.eqrel.quot.wp-glob} \textbf{(a)} shows that all but finitely
many primes $p$ satisfy $w_{p}\left(  r\right)  =0$. In other words, there is
a finite set $P$ of primes such that
\begin{equation}
\text{every prime }p\notin P\text{ must satisfy }w_{p}\left(  r\right)  =0
\label{sol.eqrel.quot.wp-glob.d.2}%
\end{equation}
(where \textquotedblleft prime $p\notin P$\textquotedblright\ means
\textquotedblleft prime $p$ satisfying $p\notin P$\textquotedblright).
Consider this $P$. Clearly, the set $\left\{  w_{p}\left(  r\right)
\ \mid\ p\in P\right\}  $ is finite (since $P$ is finite).

Define a subset $W$ of $\mathbb{Z}$ by
\[
W=\left\{  w_{p}\left(  r\right)  \ \mid\ p\in P\right\}  \cup\left\{
0\right\}
\]
\footnote{This is well-defined, since $w_{p}\left(  r\right)  \in\mathbb{Z}$
for each $p\in P$.}. This set $W$ is finite\footnote{since it is the union of
the two finite sets $\left\{  w_{p}\left(  r\right)  \ \mid\ p\in P\right\}  $
and $\left\{  0\right\}  $}. Moreover, $0\in\left\{  0\right\}  \subseteq
\left\{  w_{p}\left(  r\right)  \ \mid\ p\in P\right\}  \cup\left\{
0\right\}  =W$. In other words, the set $W$ contains $0$, and thus is nonempty.

We have $\left\{  w_{p}\left(  r\right)  \ \mid\ p\in P\right\}
\subseteq\left\{  w_{p}\left(  r\right)  \ \mid\ p\in P\right\}  \cup\left\{
0\right\}  =W$. In other words,%
\begin{equation}
w_{p}\left(  r\right)  \in W\ \ \ \ \ \ \ \ \ \ \text{for each }p\in P.
\label{sol.eqrel.quot.wp-glob.d.wprinW}%
\end{equation}


But every nonempty finite subset of $\mathbb{Z}$ has a smallest element.
Hence, $W$ has a smallest element (since $W$ is a nonempty finite subset of
$\mathbb{Z}$). Let $g$ be this smallest element. Thus, $g\in W\subseteq
\mathbb{Z}$ and
\begin{equation}
g\leq i\ \ \ \ \ \ \ \ \ \ \text{for each }i\in W
\label{sol.eqrel.quot.wp-glob.d.gleqi}%
\end{equation}
(since $g$ is the smallest element of $W$). Applying
(\ref{sol.eqrel.quot.wp-glob.d.gleqi}) to $i=0$, we obtain $g\leq0$ (since
$0\in W$). Hence, $-g\geq0$, so that $-g\in\mathbb{N}$ (since $-g$ is an integer).

Set $h=-g$. Then, $h=-g\in\mathbb{N}$, so that $h\geq0$.

Now, we shall show that $m^{h}r\in\mathbb{Z}$. We shall achieve this by
applying Exercise \ref{exe.eqrel.quot.wp-glob} \textbf{(c)} to $m^{h}r$
instead of $r$.

Indeed, $m^{h}$ is a nonzero integer (since $m$ is a nonzero integer, and
$h\in\mathbb{N}$), thus a nonzero rational number. Hence, $m^{h}r$ is a
nonzero rational number (since $m^{h}$ and $r$ are nonzero rational numbers).
Now, let $p$ be any prime. We shall show that $w_{p}\left(  m^{h}r\right)
\geq0$.

Indeed, assume the contrary. Thus, $w_{p}\left(  m^{h}r\right)  <0$. But
$m^{h}$ is a nonzero integer; hence, Exercise \ref{exe.eqrel.quot.wp}
\textbf{(b)} (applied to $n=m^{h}$) yields $w_{p}\left(  m^{h}\right)
=v_{p}\left(  m^{h}\right)  =hv_{p}\left(  m\right)  $ (by Exercise
\ref{exe.ent.prime.vp-pow}, applied to $m$ and $h$ instead of $a$ and $k$).
Also, $m$ is a nonzero integer; thus, $v_{p}\left(  m\right)  \in\mathbb{N}$
(since the $p$-valuation of any nonzero integer belongs to $\mathbb{N}$).
Thus, $\underbrace{h}_{\in\mathbb{N}}\underbrace{v_{p}\left(  m\right)  }%
_{\in\mathbb{N}}\in\mathbb{N}$, so that $hv_{p}\left(  m\right)  \geq0$.

But Exercise \ref{exe.eqrel.quot.wp} \textbf{(c)} (applied to $m^{h}$ and $r$
instead of $a$ and $b$) yields%
\begin{align}
w_{p}\left(  m^{h}r\right)   &  =\underbrace{w_{p}\left(  m^{h}\right)
}_{=hv_{p}\left(  m\right)  }+w_{p}\left(  r\right)  =\underbrace{hv_{p}%
\left(  m\right)  }_{\geq0}+w_{p}\left(  r\right)
\label{sol.eqrel.quot.wp-glob.d.6}\\
&  \geq w_{p}\left(  r\right)  ,\nonumber
\end{align}
and thus $w_{p}\left(  r\right)  \leq w_{p}\left(  m^{h}r\right)  <0$. Thus,
(\ref{sol.eqrel.quot.wp-glob.d.1}) shows that $p\mid m$. In other words, we
don't have $p\nmid m$.

But Corollary \ref{cor.ent.prime.vp-0} (applied to $n=m$) shows that
$v_{p}\left(  m\right)  =0$ if and only if $p\nmid m$. Hence, we don't have
$v_{p}\left(  m\right)  =0$ (since we don't have $p\nmid m$). Thus,
$v_{p}\left(  m\right)  \neq0$, so that $v_{p}\left(  m\right)  \geq1$ (since
$v_{p}\left(  m\right)  \in\mathbb{N}$). Thus, $h\underbrace{v_{p}\left(
m\right)  }_{\geq1}\geq h$ (since $h\geq0$).

If we had $p\notin P$, then we would have $w_{p}\left(  r\right)  =0$ (by
(\ref{sol.eqrel.quot.wp-glob.d.2})), which would contradict $w_{p}\left(
r\right)  <0$. Thus, we cannot have $p\notin P$. Hence, we have $p\in P$.
Thus, (\ref{sol.eqrel.quot.wp-glob.d.wprinW}) yields $w_{p}\left(  r\right)
\in W$. Hence, (\ref{sol.eqrel.quot.wp-glob.d.gleqi}) (applied to
$i=w_{p}\left(  r\right)  $) yields $g\leq w_{p}\left(  r\right)  $, so that
$w_{p}\left(  r\right)  \geq g$.

Now, (\ref{sol.eqrel.quot.wp-glob.d.6}) becomes%
\[
w_{p}\left(  m^{h}r\right)  =\underbrace{hv_{p}\left(  m\right)  }_{\geq
h}+\underbrace{w_{p}\left(  r\right)  }_{\geq g}\geq
h+g=0\ \ \ \ \ \ \ \ \ \ \left(  \text{since }h=-g\right)  .
\]
This contradicts $w_{p}\left(  m^{h}r\right)  <0$. This contradiction shows
that our assumption was false. Hence, $w_{p}\left(  m^{h}r\right)  \geq0$ is proven.

Now, forget that we fixed $p$. We thus have shown that each prime $p$
satisfies $w_{p}\left(  m^{h}r\right)  \geq0$.

But Exercise \ref{exe.eqrel.quot.wp-glob} \textbf{(c)} (applied to $m^{h}r$
instead of $r$) shows that we have $m^{h}r\in\mathbb{Z}$ if and only if each
prime $p$ satisfies $w_{p}\left(  m^{h}r\right)  \geq0$. Hence, we have
$m^{h}r\in\mathbb{Z}$ (since each prime $p$ satisfies $w_{p}\left(
m^{h}r\right)  \geq0$). Thus, there exists a $k\in\mathbb{N}$ satisfying
$m^{k}r\in\mathbb{Z}$ (namely, $k=h$). This proves the \textquotedblleft%
$\Longleftarrow$\textquotedblright\ direction of Exercise
\ref{exe.eqrel.quot.wp-glob} \textbf{(d)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.equiv.modinv.ab}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.equiv.modinv.ab}.]\textbf{(a)} The inverse
$\alpha^{-1}$ of $\alpha$ exists (since $\alpha$ has an inverse). We have
$\alpha\cdot\alpha^{-1}=\left[  1\right]  _{n}$ (since $\alpha^{-1}$ is an
inverse of $\alpha$). But Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(e)}
(applied to $\alpha^{-1}$ and $\alpha$ instead of $\alpha$ and $\beta$) yields
$\alpha^{-1}\cdot\alpha=\alpha\cdot\alpha^{-1}=\left[  1\right]  _{n}$. In
other words, $\alpha$ is an inverse of $\alpha^{-1}$. Thus, $\alpha^{-1}$ has
an inverse (namely, $\alpha$). Therefore, we can speak of \textquotedblleft
the inverse of $\alpha^{-1}$\textquotedblright. Moreover, $\left(  \alpha
^{-1}\right)  ^{-1}=\left(  \text{the inverse of }\alpha^{-1}\right)  =\alpha$
(since $\alpha$ is an inverse of $\alpha^{-1}$). This solves Exercise
\ref{exe.equiv.modinv.ab} \textbf{(a)}.

\textbf{(b)} The inverse $\alpha^{-1}$ of $\alpha$ exists (since $\alpha$ has
an inverse). We have $\alpha\cdot\alpha^{-1}=\left[  1\right]  _{n}$ (since
$\alpha^{-1}$ is an inverse of $\alpha$). The inverse $\beta^{-1}$ of $\beta$
exists (since $\beta$ has an inverse). We have $\beta\cdot\beta^{-1}=\left[
1\right]  _{n}$ (since $\beta^{-1}$ is an inverse of $\beta$). Theorem
\ref{thm.eqrel.Z/n.rules} \textbf{(e)} yields $\alpha\cdot\beta=\beta
\cdot\alpha$. In other words, $\alpha\beta=\beta\alpha$.

Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(f)} (applied to $\beta$, $\alpha$
and $\alpha^{-1}$) yields $\beta\cdot\left(  \alpha\cdot\alpha^{-1}\right)
=\left(  \beta\cdot\alpha\right)  \cdot\alpha^{-1}=\left(  \beta\alpha\right)
\cdot\alpha^{-1}$, so that%
\[
\left(  \beta\alpha\right)  \cdot\alpha^{-1}=\beta\cdot\underbrace{\left(
\alpha\cdot\alpha^{-1}\right)  }_{=\left[  1\right]  _{n}}=\beta\cdot\left[
1\right]  _{n}=\beta
\]
(by Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(d)}).

Now, Theorem \ref{thm.eqrel.Z/n.rules} \textbf{(f)} (applied to $\alpha\beta$,
$\alpha^{-1}$ and $\beta^{-1}$ instead of $\alpha$, $\beta$ and $\gamma$)
yields%
\[
\left(  \alpha\beta\right)  \cdot\left(  \alpha^{-1}\beta^{-1}\right)
=\left(  \underbrace{\left(  \alpha\beta\right)  }_{=\beta\alpha}\cdot
\alpha^{-1}\right)  \cdot\beta^{-1}=\underbrace{\left(  \left(  \beta
\alpha\right)  \cdot\alpha^{-1}\right)  }_{=\beta}\cdot\beta^{-1}=\beta
\cdot\beta^{-1}=\left[  1\right]  _{n}.
\]
In other words, $\alpha^{-1}\beta^{-1}$ is an inverse of $\alpha\beta$. Thus,
$\alpha\beta$ has an inverse (namely, $\alpha^{-1}\beta^{-1}$). Therefore, we
can speak of \textquotedblleft the inverse of $\alpha\beta$\textquotedblright.
Moreover, $\left(  \alpha\beta\right)  ^{-1}=\left(  \text{the inverse of
}\alpha\beta\right)  =\alpha^{-1}\beta^{-1}$ (since $\alpha^{-1}\beta^{-1}$ is
an inverse of $\alpha\beta$). This solves Exercise \ref{exe.equiv.modinv.ab}
\textbf{(b)}.

[\textit{Remark:} In the above solution, we have avoided writing products of
the form $\alpha_{1}\alpha_{2}\cdots\alpha_{k}$ with more than $2$ factors
without explicitly placing parentheses. This was done for the purpose of
making each single use of associativity explicit. Had we instead written such
products without parenthesization, our solution would have become much
simpler; namely, we could simply argue that%
\[
\left(  \alpha\beta\right)  \cdot\left(  \alpha^{-1}\beta^{-1}\right)
=\underbrace{\alpha\beta}_{=\beta\alpha}\alpha^{-1}\beta^{-1}=\beta
\underbrace{\alpha\alpha^{-1}}_{=\left[  1\right]  _{n}}\beta^{-1}%
=\underbrace{\beta\left[  1\right]  _{n}}_{\substack{=\beta\\\text{(by Theorem
\ref{thm.eqrel.Z/n.rules} \textbf{(d)})}}}\beta^{-1}=\beta\beta^{-1}=\left[
1\right]  _{n}.
\]
Computations of this kind are perfectly legitimate, because Proposition
\ref{prop.eqrel.Z/n.sums.wd} shows that products of the form $\alpha_{1}%
\alpha_{2}\cdots\alpha_{k}$ are well-defined and satisfy the standard rules
(which include the one saying that $\alpha_{1}\alpha_{2}\cdots\alpha
_{k}=\left(  \alpha_{1}\alpha_{2}\cdots\alpha_{i}\right)  \left(  \alpha
_{i+1}\alpha_{i+2}\cdots\alpha_{k}\right)  $ for each $i\in\left\{
0,1,\ldots,k\right\}  $).]
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.CC.CC.power-rules}}

\begin{fineprint}
\begin{proof}
[Proof of Proposition \ref{prop.CC.CC.power-rules}.]\textbf{(a)} Let
$\alpha\in\mathbb{C}$ and $n\in\mathbb{N}$. The definition of $\alpha^{n}$
yields $\alpha^{n}=\underbrace{\alpha\alpha\cdots\alpha}_{n\text{ times}}$.
The definition of $\alpha^{n+1}$ yields
\[
\alpha^{n+1}=\underbrace{\alpha\alpha\cdots\alpha}_{n+1\text{ times}}%
=\alpha\cdot\underbrace{\alpha\alpha\cdots\alpha}_{n\text{ times}}.
\]
Comparing this with%
\[
\alpha\underbrace{\alpha^{n}}_{=\underbrace{\alpha\alpha\cdots\alpha}_{n\text{
times}}}=\alpha\cdot\underbrace{\alpha\alpha\cdots\alpha}_{n\text{ times}},
\]
we obtain $\alpha^{n+1}=\alpha\alpha^{n}$. This proves Proposition
\ref{prop.CC.CC.power-rules} \textbf{(a)}.

\textbf{(b)} \textit{First proof of Proposition \ref{prop.CC.CC.power-rules}
\textbf{(b)}:} Let $\alpha\in\mathbb{C}$ and $n,m\in\mathbb{N}$. Definition
\ref{def.CC.CC.power} \textbf{(a)} yields $\alpha^{n}=\underbrace{\alpha
\alpha\cdots\alpha}_{n\text{ times}}$ and $\alpha^{m}=\underbrace{\alpha
\alpha\cdots\alpha}_{m\text{ times}}$. Multiplying these two equalities, we
obtain%
\[
\alpha^{n}\alpha^{m}=\underbrace{\alpha\alpha\cdots\alpha}_{n\text{ times}%
}\cdot\underbrace{\alpha\alpha\cdots\alpha}_{m\text{ times}}%
=\underbrace{\alpha\alpha\cdots\alpha}_{n+m\text{ times}}.
\]
Comparing this with%
\[
\alpha^{n+m}=\underbrace{\alpha\alpha\cdots\alpha}_{n+m\text{ times}%
}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Definition \ref{def.CC.CC.power}
\textbf{(a)}}\right)  ,
\]
we obtain $\alpha^{n+m}=\alpha^{n}\alpha^{m}$. This proves Proposition
\ref{prop.CC.CC.power-rules} \textbf{(b)}.

\textit{Second proof of Proposition \ref{prop.CC.CC.power-rules}
\textbf{(b)}:} We shall prove Proposition \ref{prop.CC.CC.power-rules}
\textbf{(b)} by induction on $n$:

\textit{Induction base:} If $\alpha\in\mathbb{C}$ and $m\in\mathbb{N}$, then
$\underbrace{\alpha^{0}}_{=1}\alpha^{m}=1\cdot\alpha^{m}=\alpha^{m}%
=\alpha^{0+m}$ (since $m=0+m$). In other words, we have $\alpha^{0+m}%
=\alpha^{0}\alpha^{m}$ for all $\alpha\in\mathbb{C}$ and $m\in\mathbb{N}$. In
other words, Proposition \ref{prop.CC.CC.power-rules} \textbf{(b)} holds for
$n=0$. This completes the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Proposition
\ref{prop.CC.CC.power-rules} \textbf{(b)} holds for $n=k$. We must prove that
Proposition \ref{prop.CC.CC.power-rules} \textbf{(b)} holds for $n=k+1$.

Let $\alpha\in\mathbb{C}$ and $m\in\mathbb{N}$. We have assumed that
Proposition \ref{prop.CC.CC.power-rules} \textbf{(b)} holds for $n=k$. Hence,
we can apply Proposition \ref{prop.CC.CC.power-rules} \textbf{(b)} to $n=k$.
We thus obtain $\alpha^{k+m}=\alpha^{k}\alpha^{m}$.

Proposition \ref{prop.CC.CC.power-rules} \textbf{(a)} (applied to $n=k$)
yields $\alpha^{k+1}=\alpha\alpha^{k}$. Also, Proposition
\ref{prop.CC.CC.power-rules} \textbf{(a)} (applied to $n=k+m$) yields
$\alpha^{\left(  k+m\right)  +1}=\alpha\alpha^{k+m}$.

But $\left(  k+1\right)  +m=\left(  k+m\right)  +1$ and hence%
\begin{align*}
\alpha^{\left(  k+1\right)  +m}  &  =\alpha^{\left(  k+m\right)  +1}%
=\alpha\underbrace{\alpha^{k+m}}_{=\alpha^{k}\alpha^{m}}=\alpha\left(
\alpha^{k}\alpha^{m}\right)  =\underbrace{\left(  \alpha\alpha^{k}\right)
}_{=\alpha^{k+1}}\alpha^{m}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.CC.CC.rules} \textbf{(f)}}\right) \\
&  =\alpha^{k+1}\alpha^{m}.
\end{align*}


Now, forget that we fixed $\alpha$ and $m$. We thus have shown that
$\alpha^{\left(  k+1\right)  +m}=\alpha^{k+1}\alpha^{m}$ for all $\alpha
\in\mathbb{C}$ and $m\in\mathbb{N}$. In other words, Proposition
\ref{prop.CC.CC.power-rules} \textbf{(b)} holds for $n=k+1$. This completes
the induction step. Thus, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(b)} is proven by induction.

\textbf{(c)} We shall prove Proposition \ref{prop.CC.CC.power-rules}
\textbf{(c)} by induction on $n$:

\textit{Induction base:} Let $\alpha,\beta\in\mathbb{C}$. Then, $\left(
\alpha\beta\right)  ^{0}=1=\alpha^{0}\beta^{0}$ (since $\underbrace{\alpha
^{0}}_{=1}\underbrace{\beta^{0}}_{=1}=1\cdot1=1$).

Forget that we fixed $\alpha,\beta$. We thus have shown that $\left(
\alpha\beta\right)  ^{0}=\alpha^{0}\beta^{0}$ for all $\alpha,\beta
\in\mathbb{C}$. In other words, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(c)} holds for $n=0$. This completes the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Proposition
\ref{prop.CC.CC.power-rules} \textbf{(c)} holds for $n=k$. We must prove that
Proposition \ref{prop.CC.CC.power-rules} \textbf{(c)} holds for $n=k+1$.

Let $\alpha,\beta\in\mathbb{C}$. We have assumed that Proposition
\ref{prop.CC.CC.power-rules} \textbf{(c)} holds for $n=k$. Hence, $\left(
\alpha\beta\right)  ^{k}=\alpha^{k}\beta^{k}$. But Proposition
\ref{prop.CC.CC.power-rules} \textbf{(a)} (applied to $n=k$) yields
$\alpha^{k+1}=\alpha\alpha^{k}$. Similarly, $\beta^{k+1}=\beta\beta^{k}$.
Multiplying these two equalities together, we obtain%
\begin{equation}
\alpha^{k+1}\beta^{k+1}=\left(  \alpha\alpha^{k}\right)  \left(  \beta
\beta^{k}\right)  =\left(  \left(  \alpha\alpha^{k}\right)  \beta\right)
\beta^{k} \label{sol.CC.CC.power-rules.a.c3.pf.1}%
\end{equation}
(by Theorem \ref{thm.CC.CC.rules} \textbf{(f)}). But Proposition
\ref{prop.CC.CC.power-rules} \textbf{(a)} (applied to $\alpha\beta$ and $k$
instead of $\alpha$ and $n$) yields\footnote{The following computation could
be much shorter if I used unparenthesized products (i.e., if I wrote
\textquotedblleft$\alpha\beta\alpha^{k}\beta^{k}$\textquotedblright\ instead
of explicitly invoking the associativity of multiplication to move between
various ways of parenthesizing this product). I am avoiding unparenthesized
products here for the purpose of illustrating how to live without them; in the
future I will simply use them wherever they can help.}%
\begin{align*}
\left(  \alpha\beta\right)  ^{k+1}  &  =\left(  \alpha\beta\right)
\underbrace{\left(  \alpha\beta\right)  ^{k}}_{=\alpha^{k}\beta^{k}}=\left(
\alpha\beta\right)  \left(  \alpha^{k}\beta^{k}\right)  =\alpha
\underbrace{\left(  \beta\left(  \alpha^{k}\beta^{k}\right)  \right)
}_{\substack{=\left(  \beta\alpha^{k}\right)  \beta^{k}\\\text{(by Theorem
\ref{thm.CC.CC.rules} \textbf{(f)})}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since Theorem \ref{thm.CC.CC.rules}
\textbf{(f) }yields }\alpha\left(  \beta\left(  \alpha^{k}\beta^{k}\right)
\right)  =\left(  \alpha\beta\right)  \left(  \alpha^{k}\beta^{k}\right)
\right) \\
&  =\alpha\left(  \left(  \beta\alpha^{k}\right)  \beta^{k}\right)  =\left(
\alpha\underbrace{\left(  \beta\alpha^{k}\right)  }_{\substack{=\alpha
^{k}\beta\\\text{(by Theorem \ref{thm.CC.CC.rules} \textbf{(e)})}}}\right)
\beta^{k}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.CC.CC.rules}
\textbf{(f)}}\right) \\
&  =\underbrace{\left(  \alpha\left(  \alpha^{k}\beta\right)  \right)
}_{\substack{=\left(  \alpha\alpha^{k}\right)  \beta\\\text{(by Theorem
\ref{thm.CC.CC.rules} \textbf{(f)})}}}\beta^{k}=\left(  \left(  \alpha
\alpha^{k}\right)  \beta\right)  \beta^{k}.
\end{align*}
Comparing this with (\ref{sol.CC.CC.power-rules.a.c3.pf.1}), we obtain
$\left(  \alpha\beta\right)  ^{k+1}=\alpha^{k+1}\beta^{k+1}$.

Now, forget that we fixed $\alpha,\beta$. We thus have shown that $\left(
\alpha\beta\right)  ^{k+1}=\alpha^{k+1}\beta^{k+1}$ for all $\alpha,\beta
\in\mathbb{C}$. In other words, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(c)} holds for $n=k+1$. Thus, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(c)} is proven by induction.

\textbf{(d)} We shall prove Proposition \ref{prop.CC.CC.power-rules}
\textbf{(d)} by induction on $m$:

\textit{Induction base:} For all $\alpha\in\mathbb{C}$ and $n\in\mathbb{N}$,
we have $\left(  \alpha^{n}\right)  ^{0}=1=\alpha^{0}=\alpha^{n\cdot0}$ (since
$0=n\cdot0$). In other words, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(d)} holds for $m=0$. This completes the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Proposition
\ref{prop.CC.CC.power-rules} \textbf{(d)} holds for $m=k$. We must prove that
Proposition \ref{prop.CC.CC.power-rules} \textbf{(d)} holds for $m=k+1$.

Let $\alpha\in\mathbb{C}$ and $n\in\mathbb{N}$. Then, $\left(  \alpha
^{n}\right)  ^{k}=\alpha^{nk}$ (since Proposition \ref{prop.CC.CC.power-rules}
\textbf{(d)} holds for $m=k$). Now, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(a)} (applied to $\alpha^{n}$ and $k$ instead of $\alpha$ and $n$)
yields%
\[
\left(  \alpha^{n}\right)  ^{k+1}=\alpha^{n}\underbrace{\left(  \alpha
^{n}\right)  ^{k}}_{=\alpha^{nk}}=\alpha^{n}\alpha^{nk}.
\]
Comparing this with%
\begin{align*}
\alpha^{n\left(  k+1\right)  }  &  =\alpha^{n+nk}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }n\left(  k+1\right)  =n+nk\right) \\
&  =\alpha^{n}\alpha^{nk}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.CC.CC.power-rules} \textbf{(b)}, applied to }m=nk\right)  ,
\end{align*}
we obtain $\left(  \alpha^{n}\right)  ^{k+1}=\alpha^{n\left(  k+1\right)  }$.

Now, forget that we fixed $\alpha$ and $n$. We thus have shown that $\left(
\alpha^{n}\right)  ^{k+1}=\alpha^{n\left(  k+1\right)  }$ for all $\alpha
\in\mathbb{C}$ and $n\in\mathbb{N}$. In other words, Proposition
\ref{prop.CC.CC.power-rules} \textbf{(d)} holds for $m=k+1$. Hence,
Proposition \ref{prop.CC.CC.power-rules} \textbf{(d)} is proven by induction.

\textbf{(e)} We shall prove Proposition \ref{prop.CC.CC.power-rules}
\textbf{(e)} by induction on $n$:

\textit{Induction base:} Proposition \ref{prop.CC.CC.power-rules} \textbf{(e)}
holds for $n=0$ (since $1^{0}=1$). This completes the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Proposition
\ref{prop.CC.CC.power-rules} \textbf{(e)} holds for $n=k$. We must prove that
Proposition \ref{prop.CC.CC.power-rules} \textbf{(e)} holds for $n=k+1$.

We have assumed that Proposition \ref{prop.CC.CC.power-rules} \textbf{(e)}
holds for $n=k$. In other words, $1^{k}=1$. Now, Proposition
\ref{prop.CC.CC.power-rules} \textbf{(a)} (applied to $\alpha=1$ and $n=k$)
yields $1^{k+1}=1\cdot\underbrace{1^{k}}_{=1}=1\cdot1=1$. In other words,
Proposition \ref{prop.CC.CC.power-rules} \textbf{(e)} holds for $n=k+1$. This
completes the induction step. Hence, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(e)} is proven by induction.

\textbf{(f)} Let $\alpha\in\mathbb{C}$ be nonzero. Let $n\in\mathbb{Z}$. We
must prove that $\alpha^{n+1}=\alpha\alpha^{n}$.

Recall that $\alpha^{-1}$ is the inverse of $\alpha$; hence, $\alpha
\alpha^{-1}=1$ (by the definition of \textquotedblleft
inverse\textquotedblright).

We are in one of the following three cases:

\textit{Case 1:} We have $n>-1$.

\textit{Case 2:} We have $n=-1$.

\textit{Case 3:} We have $n<-1$.

Let us first consider Case 1. In this case, we have $n>-1$. Thus, $n\geq0$
(since $n$ is an integer), so that $n\in\mathbb{N}$. Hence, Proposition
\ref{prop.CC.CC.power-rules} \textbf{(a)} yields $\alpha^{n+1}=\alpha
\alpha^{n}$. Thus, $\alpha^{n+1}=\alpha\alpha^{n}$ is proven in Case 1.

Let us next consider Case 2. In this case, we have $n=-1$. Thus, $n+1=0$, so
that $\alpha^{n+1}=\alpha^{0}=1$. On the other hand, from $n=-1$, we obtain
$\alpha\alpha^{n}=\alpha\alpha^{-1}=1$. Comparing this with $\alpha^{n+1}=1$,
we find $\alpha^{n+1}=\alpha\alpha^{n}$. Hence, $\alpha^{n+1}=\alpha\alpha
^{n}$ is proven in Case 2.

Let us finally consider Case 3. In this case, we have $n<-1$. Hence, $n+1<0$.
Therefore, Definition \ref{def.CC.CC.power-} (applied to $n+1$ instead of $n$)
yields
\begin{equation}
\alpha^{n+1}=\left(  \alpha^{-1}\right)  ^{-\left(  n+1\right)  }.
\label{pf.prop.CC.CC.power-rules.e.3}%
\end{equation}


On the other hand, $n+1<0$, hence $-\left(  n+1\right)  >0$ and thus $-\left(
n+1\right)  \in\mathbb{N}$. Hence, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(a)} (applied to $\alpha^{-1}$ and $-\left(  n+1\right)  $ instead of
$\alpha$ and $n$) yields $\left(  \alpha^{-1}\right)  ^{-\left(  n+1\right)
+1}=\alpha^{-1}\left(  \alpha^{-1}\right)  ^{-\left(  n+1\right)  }$. On the
other hand, $n<-1<0$. Hence, Definition \ref{def.CC.CC.power-} yields
\begin{align*}
\alpha^{n}  &  =\left(  \alpha^{-1}\right)  ^{-n}=\left(  \alpha^{-1}\right)
^{-\left(  n+1\right)  +1}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }-n=-\left(
n+1\right)  +1\right) \\
&  =\alpha^{-1}\underbrace{\left(  \alpha^{-1}\right)  ^{-\left(  n+1\right)
}}_{\substack{=\alpha^{n+1}\\\text{(by (\ref{pf.prop.CC.CC.power-rules.e.3}%
))}}}=\alpha^{-1}\alpha^{n+1}.
\end{align*}
Thus,%
\[
\alpha\underbrace{\alpha^{n}}_{=\alpha^{-1}\alpha^{n+1}}=\underbrace{\alpha
\alpha^{-1}}_{=1}\alpha^{n+1}=\alpha^{n+1}.
\]
In other words, $\alpha^{n+1}=\alpha\alpha^{n}$. Hence, $\alpha^{n+1}%
=\alpha\alpha^{n}$ is proven in Case 3.

We have now proven $\alpha^{n+1}=\alpha\alpha^{n}$ in all three Cases 1, 2 and
3. Thus, $\alpha^{n+1}=\alpha\alpha^{n}$ always holds. This proves Proposition
\ref{prop.CC.CC.power-rules} \textbf{(f)}.

\textbf{(g)} Let $\alpha\in\mathbb{C}$ be nonzero. Let $n\in\mathbb{Z}$. We
must prove that $\alpha^{-n}=\left(  \alpha^{-1}\right)  ^{n}$.

We are in one of the following three Cases:

\textit{Case 1:} We have $n>0$.

\textit{Case 2:} We have $n=0$.

\textit{Case 3:} We have $n<0$.

Let us first consider Case 1. In this case, we have $n>0$. Hence, $-n<0$. In
other words, $-n$ is negative. Hence, Definition \ref{def.CC.CC.power-}
(applied to $-n$ instead of $n$) yields $\alpha^{-n}=\left(  \alpha
^{-1}\right)  ^{-\left(  -n\right)  }=\left(  \alpha^{-1}\right)  ^{n}$ (since
$-\left(  -n\right)  =n$). Hence, $\alpha^{-n}=\left(  \alpha^{-1}\right)
^{n}$ is proven in Case 1.

Let us next consider Case 2. In this case, we have $n=0$. Hence, $\alpha
^{-n}=\alpha^{-0}=\alpha^{0}=1$ and $\left(  \alpha^{-1}\right)  ^{n}=\left(
\alpha^{-1}\right)  ^{0}=1$. Comparing these two equalities, we obtain
$\alpha^{-n}=\left(  \alpha^{-1}\right)  ^{n}$. Hence, $\alpha^{-n}=\left(
\alpha^{-1}\right)  ^{n}$ is proven in Case 2.

Let us next consider Case 3. In this case, we have $n<0$. In other words, $n$
is negative.

Recall that $\alpha^{-1}$ is the inverse of $\alpha$; hence, $\alpha
\alpha^{-1}=1$ (by the definition of \textquotedblleft
inverse\textquotedblright). Hence, $\alpha^{-1}\neq0$ (since otherwise, we
would have $\alpha^{-1}=0$ and thus $1=\alpha\underbrace{\alpha^{-1}}_{=0}=0$,
which would be absurd). Hence, Definition \ref{def.CC.CC.power-} (applied to
$\alpha^{-1}$ instead of $\alpha$) yields $\left(  \alpha^{-1}\right)
^{n}=\left(  \left(  \alpha^{-1}\right)  ^{-1}\right)  ^{-n}$ (since $n$ is negative).

But Proposition \ref{prop.CC.CC.inverse.ab} \textbf{(a)} yields $\left(
\alpha^{-1}\right)  ^{-1}=\alpha$. Thus, $\left(  \alpha^{-1}\right)
^{n}=\left(  \underbrace{\left(  \alpha^{-1}\right)  ^{-1}}_{=\alpha}\right)
^{-n}=\alpha^{-n}$, so that $\alpha^{-n}=\left(  \alpha^{-1}\right)  ^{n}$.
Hence, $\alpha^{-n}=\left(  \alpha^{-1}\right)  ^{n}$ is proven in Case 3.

We have now proven that $\alpha^{-n}=\left(  \alpha^{-1}\right)  ^{n}$ in all
three Cases 1, 2 and 3. Thus, $\alpha^{-n}=\left(  \alpha^{-1}\right)  ^{n}$
always holds. This completes the proof of Proposition
\ref{prop.CC.CC.power-rules} \textbf{(g)}.

\textbf{(h)} We must prove that $\alpha^{n+m}=\alpha^{n}\alpha^{m}$ for all
nonzero $\alpha\in\mathbb{C}$ and all $n,m\in\mathbb{Z}$. We shall first prove
the following less general result:

\begin{statement}
\textit{Claim 1:} We have $\alpha^{n+m}=\alpha^{n}\alpha^{m}$ for all nonzero
$\alpha\in\mathbb{C}$ and all $n\in\mathbb{N}$ and $m\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 1:} The following proof is very similar to our Second
proof of Proposition \ref{prop.CC.CC.power-rules} \textbf{(b)} above.

We shall prove Claim 1 by induction on $n$:

\textit{Induction base:} If $\alpha\in\mathbb{C}$ is nonzero, and if
$m\in\mathbb{Z}$, then $\underbrace{\alpha^{0}}_{=1}\alpha^{m}=1\cdot
\alpha^{m}=\alpha^{m}=\alpha^{0+m}$ (since $m=0+m$). In other words, we have
$\alpha^{0+m}=\alpha^{0}\alpha^{m}$ for all nonzero $\alpha\in\mathbb{C}$ and
all $m\in\mathbb{Z}$. In other words, Claim 1 holds for $n=0$. This completes
the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Claim 1 holds for
$n=k$. We must prove that Claim 1 holds for $n=k+1$.

Let $\alpha\in\mathbb{C}$ be nonzero, and let $m\in\mathbb{Z}$. We have
assumed that Claim 1 holds for $n=k$. Hence, we can apply Claim 1 to $n=k$. We
thus obtain $\alpha^{k+m}=\alpha^{k}\alpha^{m}$.

Proposition \ref{prop.CC.CC.power-rules} \textbf{(f)} (applied to $n=k$)
yields $\alpha^{k+1}=\alpha\alpha^{k}$. Also, Proposition
\ref{prop.CC.CC.power-rules} \textbf{(f)} (applied to $n=k+m$) yields
$\alpha^{\left(  k+m\right)  +1}=\alpha\alpha^{k+m}$.

But $\left(  k+1\right)  +m=\left(  k+m\right)  +1$ and hence%
\[
\alpha^{\left(  k+1\right)  +m}=\alpha^{\left(  k+m\right)  +1}=\alpha
\underbrace{\alpha^{k+m}}_{=\alpha^{k}\alpha^{m}}=\underbrace{\alpha\alpha
^{k}}_{=\alpha^{k+1}}\alpha^{m}=\alpha^{k+1}\alpha^{m}.
\]


Now, forget that we fixed $m$. We thus have shown that $\alpha^{\left(
k+1\right)  +m}=\alpha^{k+1}\alpha^{m}$ for all nonzero $\alpha\in\mathbb{C}$
and all $m\in\mathbb{Z}$. In other words, Claim 1 holds for $n=k+1$. This
completes the induction step. Thus, Claim 1 is proven by induction.]

Now, let us prove Proposition \ref{prop.CC.CC.power-rules} \textbf{(h)} in
full generality: Fix a nonzero $\alpha\in\mathbb{C}$. Fix $n,m\in\mathbb{Z}$.
We must prove that $\alpha^{n+m}=\alpha^{n}\alpha^{m}$. If $n\in\mathbb{N}$,
then this follows from Claim 1. Hence, for the rest of this proof, we WLOG
assume that we don't have $n\in\mathbb{N}$. Combining this with $n\in
\mathbb{Z}$, we obtain $n\in\mathbb{Z}\setminus\mathbb{N}=\left\{
-1,-2,-3,\ldots\right\}  $. In other words, $n$ is negative. Hence, $-n$ is
positive. Thus, $-n\in\mathbb{N}$.

Recall that $\alpha^{-1}$ is the inverse of $\alpha$; hence, $\alpha
\alpha^{-1}=1$ (by the definition of \textquotedblleft
inverse\textquotedblright). Hence, $\alpha^{-1}\neq0$ (since otherwise, we
would have $\alpha^{-1}=0$ and thus $1=\alpha\underbrace{\alpha^{-1}}_{=0}=0$,
which would be absurd). So we have $\alpha^{-1}\neq0$ and $-n\in\mathbb{N}$.
Hence, Claim 1 (applied to $\alpha^{-1}$, $-n$ and $-m$ instead of $\alpha$,
$n$ and $m$) yields%
\begin{equation}
\left(  \alpha^{-1}\right)  ^{\left(  -n\right)  +\left(  -m\right)  }=\left(
\alpha^{-1}\right)  ^{-n}\left(  \alpha^{-1}\right)  ^{-m}.
\label{pf.prop.CC.CC.power-rules.h.5}%
\end{equation}


Definition \ref{def.CC.CC.power-} yields $\alpha^{n}=\left(  \alpha
^{-1}\right)  ^{-n}$ (since $n$ is negative). Proposition
\ref{prop.CC.CC.power-rules} \textbf{(g)} (applied to $-m$ instead of $n$)
yields $\alpha^{-\left(  -m\right)  }=\left(  \alpha^{-1}\right)  ^{-m}$. In
view of $-\left(  -m\right)  =m$, this rewrites as $\alpha^{m}=\left(
\alpha^{-1}\right)  ^{-m}$. The same argument (applied to $n+m$ instead of
$m$) yields $\alpha^{n+m}=\left(  \alpha^{-1}\right)  ^{-\left(  n+m\right)
}$. Hence,%
\begin{align*}
\alpha^{n+m}  &  =\left(  \alpha^{-1}\right)  ^{-\left(  n+m\right)  }=\left(
\alpha^{-1}\right)  ^{\left(  -n\right)  +\left(  -m\right)  }%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }-\left(  n+m\right)  =\left(
-n\right)  +\left(  -m\right)  \right) \\
&  =\left(  \alpha^{-1}\right)  ^{-n}\left(  \alpha^{-1}\right)
^{-m}\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{pf.prop.CC.CC.power-rules.h.5}%
)}\right)  .
\end{align*}
Comparing this with%
\[
\underbrace{\alpha^{n}}_{=\left(  \alpha^{-1}\right)  ^{-n}}\underbrace{\alpha
^{m}}_{=\left(  \alpha^{-1}\right)  ^{-m}}=\left(  \alpha^{-1}\right)
^{-n}\left(  \alpha^{-1}\right)  ^{-m},
\]
we obtain $\alpha^{n+m}=\alpha^{n}\alpha^{m}$. This completes our proof of
Proposition \ref{prop.CC.CC.power-rules} \textbf{(h)}.

\textbf{(i)} Let $\alpha,\beta\in\mathbb{C}$ be nonzero. Let $n\in\mathbb{Z}$.
We must prove that $\left(  \alpha\beta\right)  ^{n}=\alpha^{n}\beta^{n}$.

If $n\in\mathbb{N}$, then this follows from Proposition
\ref{prop.CC.CC.power-rules} \textbf{(c)}. Hence, for the rest of this proof,
we WLOG assume that we don't have $n\in\mathbb{N}$. Combining this with
$n\in\mathbb{Z}$, we obtain $n\in\mathbb{Z}\setminus\mathbb{N}=\left\{
-1,-2,-3,\ldots\right\}  $. In other words, $n$ is negative. Hence, $-n$ is
positive. Thus, $-n\in\mathbb{N}$. Hence, Proposition
\ref{prop.CC.CC.power-rules} \textbf{(c)} (applied to $-n$, $\alpha^{-1}$ and
$\beta^{-1}$ instead of $n$, $\alpha$ and $\beta$) yields $\left(  \alpha
^{-1}\beta^{-1}\right)  ^{-n}=\left(  \alpha^{-1}\right)  ^{-n}\left(
\beta^{-1}\right)  ^{-n}$.

Proposition \ref{prop.CC.CC.inverse.ab} \textbf{(b)} yields that $\left(
\alpha\beta\right)  ^{-1}=\alpha^{-1}\beta^{-1}$. Also, Corollary
\ref{cor.CC.CC.intdom} shows that $\alpha\beta$ is nonzero. Recall also that
$n$ is negative. Thus, Definition \ref{def.CC.CC.power-} (applied to
$\alpha\beta$ instead of $\alpha$) yields%
\begin{equation}
\left(  \alpha\beta\right)  ^{n}=\left(  \underbrace{\left(  \alpha
\beta\right)  ^{-1}}_{=\alpha^{-1}\beta^{-1}}\right)  ^{-n}=\left(
\alpha^{-1}\beta^{-1}\right)  ^{-n}=\left(  \alpha^{-1}\right)  ^{-n}\left(
\beta^{-1}\right)  ^{-n}. \label{pf.prop.CC.CC.power-rules.2}%
\end{equation}


On the other hand, Definition \ref{def.CC.CC.power-} yields $\alpha
^{n}=\left(  \alpha^{-1}\right)  ^{-n}$ (since $n$ is negative). Similarly,
$\beta^{n}=\left(  \beta^{-1}\right)  ^{-n}$. Multiplying these two
equalities, we obtain $\alpha^{n}\beta^{n}=\left(  \alpha^{-1}\right)
^{-n}\left(  \beta^{-1}\right)  ^{-n}$. Comparing this with
(\ref{pf.prop.CC.CC.power-rules.2}), we find $\left(  \alpha\beta\right)
^{n}=\alpha^{n}\beta^{n}$. This completes our proof of Proposition
\ref{prop.CC.CC.power-rules} \textbf{(i)}.

\textbf{(j)} Let $n\in\mathbb{Z}$. We must prove that $1^{n}=1$. If
$n\in\mathbb{N}$, then this follows from Proposition
\ref{prop.CC.CC.power-rules} \textbf{(e)}. Hence, for the rest of this proof,
we WLOG assume that we don't have $n\in\mathbb{N}$. Combining this with
$n\in\mathbb{Z}$, we obtain $n\in\mathbb{Z}\setminus\mathbb{N}=\left\{
-1,-2,-3,\ldots\right\}  $. In other words, $n$ is negative. Hence, $-n$ is
positive. Thus, $-n\in\mathbb{N}$. Hence, Proposition
\ref{prop.CC.CC.power-rules} \textbf{(e)} (applied to $-n$ instead of $n$)
yields $1^{-n}=1$.

Also, $1\cdot1=1$. Hence, $1$ is an inverse of $1$ (by the definition of
\textquotedblleft inverse\textquotedblright). Thus, the inverse of $1$ is $1$.
In other words, $1^{-1}=1$.

But $n$ is negative. Thus, Definition \ref{def.CC.CC.power-} (applied to
$\alpha=1$) yields $1^{n}=\left(  \underbrace{1^{-1}}_{=1}\right)
^{-n}=1^{-n}=1$. Hence, Proposition \ref{prop.CC.CC.power-rules} \textbf{(j)}
is proven.

\textbf{(k)} Let $\alpha\in\mathbb{C}$ be nonzero. Let $n\in\mathbb{Z}$.

Proposition \ref{prop.CC.CC.power-rules} \textbf{(h)} (applied to $m=-n$)
yields $\alpha^{n+\left(  -n\right)  }=\alpha^{n}\alpha^{-n}$. Hence,
$\alpha^{n}\alpha^{-n}=\alpha^{n+\left(  -n\right)  }=\alpha^{0}$ (since
$n+\left(  -n\right)  =0$). Thus, $\alpha^{n}\alpha^{-n}=\alpha^{0}=1$.

Proposition \ref{prop.CC.CC.power-rules} \textbf{(h)} (applied to $-n$ and $n$
instead of $n$ and $m$) yields $\alpha^{\left(  -n\right)  +n}=\alpha
^{-n}\alpha^{n}$. Hence, $\alpha^{-n}\alpha^{n}=\alpha^{\left(  -n\right)
+n}=\alpha^{0}$ (since $\left(  -n\right)  +n=0$). Thus, $\alpha^{-n}%
\alpha^{n}=\alpha^{0}=1$.

If we had $\alpha^{n}=0$, then we would have $\underbrace{\alpha^{n}}%
_{=0}\alpha^{-n}=0$, which would contradict $\alpha^{n}\alpha^{-n}=1\neq0$.
Hence, we cannot have $\alpha^{n}=0$. In other words, $\alpha^{n}\neq0$. Thus,
$\alpha^{n}$ is nonzero. Hence, the inverse $\left(  \alpha^{n}\right)  ^{-1}$
of $\alpha^{n}$ is well-defined.

We have $\alpha^{n}\alpha^{-n}=1$. This equality shows that $\alpha^{-n}$ is
an inverse of $\alpha^{n}$ (by the definition of \textquotedblleft
inverse\textquotedblright). In other words, the inverse of $\alpha^{n}$ is
$\alpha^{-n}$. In other words, $\left(  \alpha^{n}\right)  ^{-1}=\alpha^{-n}$.
Thus, Proposition \ref{prop.CC.CC.power-rules} \textbf{(k)} is proven.

\textbf{(l)} We must prove that $\left(  \alpha^{n}\right)  ^{m}=\alpha^{nm}$
for all nonzero $\alpha\in\mathbb{C}$ and all $n,m\in\mathbb{Z}$.

We shall first prove this in lesser generality:

\begin{statement}
\textit{Claim 2:} We have $\left(  \alpha^{n}\right)  ^{m}=\alpha^{nm}$ for
all nonzero $\alpha\in\mathbb{C}$ and all $n\in\mathbb{Z}$ and $m\in
\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 2:} The following proof is very similar to our proof
of Proposition \ref{prop.CC.CC.power-rules} \textbf{(d)} above.

We shall prove Claim 2 by induction on $m$:

\textit{Induction base:} For all $\alpha\in\mathbb{C}$ and $n\in\mathbb{Z}$,
we have $\left(  \alpha^{n}\right)  ^{0}=1=\alpha^{0}=\alpha^{n\cdot0}$ (since
$0=n\cdot0$). In other words, Claim 2 holds for $m=0$. This completes the
induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Claim 2 holds for
$m=k$. We must prove that Claim 2 holds for $m=k+1$.

Let $\alpha\in\mathbb{C}$ and $n\in\mathbb{Z}$. Then, $\left(  \alpha
^{n}\right)  ^{k}=\alpha^{nk}$ (since Claim 2 holds for $m=k$). Now,
Proposition \ref{prop.CC.CC.power-rules} \textbf{(a)} (applied to $\alpha^{n}$
and $k$ instead of $\alpha$ and $n$) yields%
\[
\left(  \alpha^{n}\right)  ^{k+1}=\alpha^{n}\underbrace{\left(  \alpha
^{n}\right)  ^{k}}_{=\alpha^{nk}}=\alpha^{n}\alpha^{nk}.
\]
Comparing this with%
\begin{align*}
\alpha^{n\left(  k+1\right)  }  &  =\alpha^{n+nk}\ \ \ \ \ \ \ \ \ \ \left(
\text{since }n\left(  k+1\right)  =n+nk\right) \\
&  =\alpha^{n}\alpha^{nk}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.CC.CC.power-rules} \textbf{(h)}, applied to }m=nk\right)  ,
\end{align*}
we obtain $\left(  \alpha^{n}\right)  ^{k+1}=\alpha^{n\left(  k+1\right)  }$.

Now, forget that we fixed $\alpha$ and $n$. We thus have shown that $\left(
\alpha^{n}\right)  ^{k+1}=\alpha^{n\left(  k+1\right)  }$ for all $\alpha
\in\mathbb{C}$ and $n\in\mathbb{Z}$. In other words, Claim 2 holds for
$m=k+1$. Hence, Claim 2 is proven by induction.]

Now, let us prove Proposition \ref{prop.CC.CC.power-rules} \textbf{(l)} in
full generality: Fix a nonzero $\alpha\in\mathbb{C}$. Fix $n,m\in\mathbb{Z}$.
We must prove that $\left(  \alpha^{n}\right)  ^{m}=\alpha^{nm}$. If
$m\in\mathbb{N}$, then this follows from Claim 2. Hence, for the rest of this
proof, we WLOG assume that we don't have $m\in\mathbb{N}$. Combining this with
$m\in\mathbb{Z}$, we obtain $m\in\mathbb{Z}\setminus\mathbb{N}=\left\{
-1,-2,-3,\ldots\right\}  $. In other words, $m$ is negative. Hence, $-m$ is
positive. Thus, $-m\in\mathbb{N}$. Hence, Claim 2 (applied to $-m$ instead of
$m$) yields
\[
\left(  \alpha^{n}\right)  ^{-m}=\alpha^{n\left(  -m\right)  }=\alpha
^{-nm}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n\left(  -m\right)
=-nm\right)  .
\]
But Proposition \ref{prop.CC.CC.power-rules} \textbf{(k)} yields that $\left(
\alpha^{n}\right)  ^{-1}=\alpha^{-n}$. In particular, $\left(  \alpha
^{n}\right)  ^{-1}$ is well-defined, so that $\alpha^{n}$ is invertible, and
thus $\alpha^{n}$ is nonzero. Hence, Proposition \ref{prop.CC.CC.power-rules}
\textbf{(k)} (applied to $\alpha^{n}$ and $-m$ instead of $\alpha$ and $n$)
yields%
\[
\left(  \left(  \alpha^{n}\right)  ^{-m}\right)  ^{-1}=\left(  \alpha
^{n}\right)  ^{-\left(  -m\right)  }=\left(  \alpha^{n}\right)  ^{m}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }-\left(  -m\right)  =m\right)  .
\]
Thus,%
\[
\left(  \alpha^{n}\right)  ^{m}=\left(  \underbrace{\left(  \alpha^{n}\right)
^{-m}}_{=\alpha^{-nm}}\right)  ^{-1}=\left(  \alpha^{-nm}\right)  ^{-1}.
\]
But Proposition \ref{prop.CC.CC.power-rules} \textbf{(k)} (applied to $-nm$
instead of $n$) yields%
\[
\left(  \alpha^{-nm}\right)  ^{-1}=\alpha^{-\left(  -nm\right)  }=\alpha
^{nm}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }-\left(  -nm\right)  =nm\right)
.
\]
Hence, $\left(  \alpha^{n}\right)  ^{m}=\left(  \alpha^{-nm}\right)
^{-1}=\alpha^{nm}$. This completes the proof of Proposition
\ref{prop.CC.CC.power-rules} \textbf{(l)}.

\textbf{(m)} This is proven in the same way as the usual binomial formula
(i.e., Theorem \ref{thm.binom.binf}) is proven. (The only difference is that
we are now calling our two numbers $\alpha$ and $\beta$ rather than $x$ and
$y$, and that we now need to use Theorem \ref{thm.CC.CC.rules} and Proposition
\ref{prop.CC.CC.power-rules} \textbf{(a)} instead of the analogous rules for
real numbers.)
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].gauss.uneqcon}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].gauss.uneqcon}.]Write the complex number
$\alpha$ in the form $\alpha=\left(  x,y\right)  $ for some $x,y\in\mathbb{R}%
$. Then, $x,y\in\mathbb{Z}$ (since $\alpha$ is a Gaussian integer). Moreover,
from $\alpha=\left(  x,y\right)  $, we obtain $\overline{\alpha}=\left(
x,-y\right)  $ (by the definition of $\overline{\alpha}$). Also,
$\overline{\alpha}$ is a Gaussian integer (by Proposition
\ref{prop.Z[i].gauss.conj}).

From $\overline{\alpha}=\left(  x,-y\right)  $, we obtain
\[
-\overline{\alpha}=-\left(  x,-y\right)  =\left(  -x,\underbrace{-\left(
-y\right)  }_{=y}\right)  =\left(  -x,y\right)
\]
and%
\begin{align*}
\underbrace{i}_{=\left(  0,1\right)  }\underbrace{\overline{\alpha}}_{=\left(
x,-y\right)  }  &  =\left(  0,1\right)  \left(  x,-y\right)  =\left(
\underbrace{0\cdot x-1\cdot\left(  -y\right)  }_{=y},\underbrace{0\cdot\left(
-y\right)  +1\cdot x}_{=x}\right) \\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of the operation }%
\cdot\text{ on }\mathbb{C}\right) \\
&  =\left(  y,x\right)
\end{align*}
and%
\[
-\underbrace{i\overline{\alpha}}_{=\left(  y,x\right)  }=-\left(  y,x\right)
=\left(  -y,-x\right)  .
\]


\textbf{(a)} Proposition \ref{prop.Z[i].gauss.uniteq} (applied to
$\beta=\overline{\alpha}$) shows that we have $\alpha\sim\overline{\alpha}$ if
and only if
\[
\left(  \alpha=\overline{\alpha}\text{ or }\alpha=-\overline{\alpha}\text{ or
}\alpha=i\overline{\alpha}\text{ or }\alpha=-i\overline{\alpha}\right)  .
\]
Hence, we have $\left(  \alpha=\overline{\alpha}\text{ or }\alpha
=-\overline{\alpha}\text{ or }\alpha=i\overline{\alpha}\text{ or }%
\alpha=-i\overline{\alpha}\right)  $ (since we have $\alpha\sim\overline
{\alpha}$). Thus, we are in one of the following four cases:

\textit{Case 1:} We have $\alpha=\overline{\alpha}$.

\textit{Case 2:} We have $\alpha=-\overline{\alpha}$.

\textit{Case 3:} We have $\alpha=i\overline{\alpha}$.

\textit{Case 4:} We have $\alpha=-i\overline{\alpha}$.

Let us first consider Case 1. In this case, we have $\alpha=\overline{\alpha}%
$. Thus, $\left(  x,y\right)  =\alpha=\overline{\alpha}=\left(  x,-y\right)
$. In other words, $x=x$ and $y=-y$. From $y=-y$, we obtain $2y=0$, thus
$y=0$. Hence, $\alpha=\left(  x,\underbrace{y}_{=0}\right)  =\left(
x,0\right)  =x\cdot\underbrace{\left(  1,0\right)  }_{=1}=x\cdot1$. Thus,
there exist some $g\in\mathbb{Z}$ and $\tau\in\left\{  1,i,1+i,1-i\right\}  $
such that $\alpha=g\tau$ (namely, $g=x$ and $\tau=1$). Thus, Exercise
\ref{exe.Z[i].gauss.uneqcon} \textbf{(a)} is solved in Case 1.

Let us next consider Case 2. In this case, we have $\alpha=-\overline{\alpha}%
$. Thus, $\left(  x,y\right)  =\alpha=-\overline{\alpha}=\left(  -x,y\right)
$. In other words, $x=-x$ and $y=y$. From $x=-x$, we obtain $2x=0$, thus
$x=0$. Hence, $\alpha=\left(  \underbrace{x}_{=0},y\right)  =\left(
0,y\right)  =y\cdot\underbrace{\left(  0,1\right)  }_{=i}=yi$. Thus, there
exist some $g\in\mathbb{Z}$ and $\tau\in\left\{  1,i,1+i,1-i\right\}  $ such
that $\alpha=g\tau$ (namely, $g=y$ and $\tau=i$). Thus, Exercise
\ref{exe.Z[i].gauss.uneqcon} \textbf{(a)} is solved in Case 2.

Let us now consider Case 3. In this case, we have $\alpha=i\overline{\alpha}$.
Thus, $\left(  x,y\right)  =\alpha=i\overline{\alpha}=\left(  y,x\right)  $.
In other words, $x=y$ and $y=x$. Hence, $\alpha=\left(  x,\underbrace{y}%
_{=x}\right)  =\left(  x,x\right)  =x\cdot\underbrace{\left(  1,1\right)
}_{=1+i}=x\left(  1+i\right)  $. Thus, there exist some $g\in\mathbb{Z}$ and
$\tau\in\left\{  1,i,1+i,1-i\right\}  $ such that $\alpha=g\tau$ (namely,
$g=x$ and $\tau=1+i$). Thus, Exercise \ref{exe.Z[i].gauss.uneqcon}
\textbf{(a)} is solved in Case 3.

Let us finally consider Case 4. In this case, we have $\alpha=-i\overline
{\alpha}$. Thus, $\left(  x,y\right)  =\alpha=-i\overline{\alpha}=\left(
-y,-x\right)  $. In other words, $x=-y$ and $y=-x$. Hence, $\alpha=\left(
x,\underbrace{y}_{=-x}\right)  =\left(  x,-x\right)  =x\cdot
\underbrace{\left(  1,-1\right)  }_{=1-i}=x\left(  1-i\right)  $. Thus, there
exist some $g\in\mathbb{Z}$ and $\tau\in\left\{  1,i,1+i,1-i\right\}  $ such
that $\alpha=g\tau$ (namely, $g=x$ and $\tau=1-i$). Thus, Exercise
\ref{exe.Z[i].gauss.uneqcon} \textbf{(a)} is solved in Case 4.

We have now solved Exercise \ref{exe.Z[i].gauss.uneqcon} \textbf{(a)} in all
four Cases 1, 2, 3 and 4. Hence, Exercise \ref{exe.Z[i].gauss.uneqcon}
\textbf{(a)} is solved (since these four Cases cover all possibilities).

\textbf{(b)} Let $g\in\mathbb{Z}$ and $\tau\in\left\{  1,i,1+i,1-i\right\}  $
be such that $\alpha=g\tau$. We must prove that $\operatorname*{N}\left(
\alpha\right)  \in\left\{  g^{2},2g^{2}\right\}  $.

We have $1+i=\left(  1,1\right)  $. Thus, the definition of $\operatorname*{N}%
\left(  1+i\right)  $ yields $\operatorname*{N}\left(  1+i\right)
=1^{2}+1^{2}=2$.

We have $1-i=\left(  1,-1\right)  $. Thus, the definition of
$\operatorname*{N}\left(  1-i\right)  $ yields $\operatorname*{N}\left(
1-i\right)  =1^{2}+\left(  -1\right)  ^{2}=2$.

We have $i=\left(  0,1\right)  $. Thus, the definition of $\operatorname*{N}%
\left(  i\right)  $ yields $\operatorname*{N}\left(  i\right)  =0^{2}+1^{2}=1$.

Proposition \ref{prop.CC.norm.aa} (applied to $a=1$) yields $\operatorname*{N}%
\left(  1_{\mathbb{C}}\right)  =1^{2}=1$. In other words, $\operatorname*{N}%
\left(  1\right)  =1$ (since we identify $1_{\mathbb{C}}$ with $1$).

Now, from $\tau\in\left\{  1,i,1+i,1-i\right\}  $, we obtain%
\[
\operatorname*{N}\left(  \tau\right)  \in\left\{
\underbrace{\operatorname*{N}\left(  1\right)  }_{=1}%
,\underbrace{\operatorname*{N}\left(  i\right)  }_{=1}%
,\underbrace{\operatorname*{N}\left(  1+i\right)  }_{=2}%
,\underbrace{\operatorname*{N}\left(  1-i\right)  }_{=2}\right\}  =\left\{
1,1,2,2\right\}  =\left\{  1,2\right\}  .
\]


Proposition \ref{prop.CC.norm.aa} (applied to $a=g$) yields $\operatorname*{N}%
\left(  g_{\mathbb{C}}\right)  =g^{2}$. In other words, $\operatorname*{N}%
\left(  g\right)  =g^{2}$ (since we identify $g_{\mathbb{C}}$ with $g$).

Now, Proposition \ref{prop.CC.conj.hom} \textbf{(d)} (applied to $g$ and
$\tau$ instead of $\alpha$ and $\beta$) yields%
\begin{align*}
\operatorname*{N}\left(  g\tau\right)   &  =\underbrace{\operatorname*{N}%
\left(  g\right)  }_{=g^{2}}\cdot\operatorname*{N}\left(  \tau\right)
=g^{2}\cdot\operatorname*{N}\left(  \tau\right)  =\operatorname*{N}\left(
\tau\right)  \cdot g^{2}\in\left\{  \underbrace{1g^{2}}_{=g^{2}}%
,2g^{2}\right\}  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\operatorname*{N}%
\left(  \tau\right)  \in\left\{  1,2\right\}  \right) \\
&  =\left\{  g^{2},2g^{2}\right\}  .
\end{align*}
In view of $\alpha=g\tau$, this rewrites as $\operatorname*{N}\left(
\alpha\right)  \in\left\{  g^{2},2g^{2}\right\}  $. This solves Exercise
\ref{exe.Z[i].gauss.uneqcon} \textbf{(b)}.

\textbf{(c)} Assume the contrary. Thus, $\operatorname*{N}\left(
\alpha\right)  $ is an odd prime.

Exercise \ref{exe.Z[i].gauss.uneqcon} \textbf{(b)} yields $\operatorname*{N}%
\left(  \alpha\right)  \in\left\{  g^{2},2g^{2}\right\}  $. In other words, we
have $\operatorname*{N}\left(  \alpha\right)  =g^{2}$ or $\operatorname*{N}%
\left(  \alpha\right)  =2g^{2}$. But if we had $\operatorname*{N}\left(
\alpha\right)  =2g^{2}$, then $\operatorname*{N}\left(  \alpha\right)  $ would
be even (since $g^{2}\in\mathbb{Z}$), which would contradict the fact that
$\operatorname*{N}\left(  \alpha\right)  $ is odd. Hence, we cannot have
$\operatorname*{N}\left(  \alpha\right)  =2g^{2}$. Thus, we must have
$\operatorname*{N}\left(  \alpha\right)  =g^{2}$ (because we know that
$\operatorname*{N}\left(  \alpha\right)  =g^{2}$ or $\operatorname*{N}\left(
\alpha\right)  =2g^{2}$). Hence, $\operatorname*{N}\left(  \alpha\right)  $ is
the square of an integer (since $g$ is an integer), i.e., a perfect square.

But a prime can never be a perfect square\footnote{\textit{Proof.} Let $p$ be
a prime. We must prove that $p$ cannot be a perfect square.
\par
Indeed, assume the contrary. Thus, $p$ is a perfect square. In other words,
$p=m^{2}$ for some integer $m$. Consider this $m$. Let $n=\left\vert
m\right\vert $. Then, $n$ is a nonnegative integer (since $m$ is an integer)
and satisfies $n^{2}=\left\vert m\right\vert ^{2}=m^{2}=p$.
\par
But $p$ is a prime. Thus, $p>1$. Hence, $n^{2}=p>1=1^{2}$. We can take square
roots on both sides of this inequality, and obtain $n>1$ (since $n$ and $1$
are nonnegative). Hence, $n$ is positive. Thus, we can multiply the inequality
$n>1$ by $n$, and obtain $nn>n$. Hence, $n<nn=n^{2}=p$, so that $n\neq p$.
Also, $n\neq1$ (since $n>1$). But $n$ is positive and is a divisor of $p$
(since $n\mid nn=p$). Thus, $n$ is a positive divisor of $p$. But the only
positive divisors of $p$ are $1$ and $p$ (since $p$ is prime). Hence, $n$ is
either $1$ or $p$ (since $n$ is a positive divisor of $p$). This contradicts
the fact that $n\neq1$ and $n\neq p$. This contradiction shows that our
assumption was false.
\par
Hence, we have proven that $p$ cannot be a perfect square. Qed.}. Thus,
$\operatorname*{N}\left(  \alpha\right)  $ cannot be a perfect square (since
$\operatorname*{N}\left(  \alpha\right)  $ is prime). This contradicts the
fact that $\operatorname*{N}\left(  \alpha\right)  $ is a perfect square. This
contradiction shows that our assumption was wrong; hence, Exercise
\ref{exe.Z[i].gauss.uneqcon} \textbf{(c)} is solved.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].div.abba}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].div.abba}.]We are in one of the following
two cases:

\textit{Case 1:} We have $\beta\neq0$.

\textit{Case 2:} We have $\beta=0$.

Let us first consider Case 1. In this case, we have $\beta\neq0$. Thus, the
complex number $\beta$ has an inverse $\beta^{-1}$ (by Definition
\ref{def.CC.CC.inverse.notations}). (This $\beta^{-1}$ may and may not be a
Gaussian integer.)

We have $\alpha\mid\beta$. In other words, there exists a Gaussian integer
$\gamma$ such that $\beta=\alpha\gamma$ (by Definition
\ref{def.Z[i].gauss.div}). Consider this $\gamma$.

We have $\beta\mid\alpha$. In other words, there exists a Gaussian integer
$\delta$ such that $\alpha=\beta\delta$ (by Definition
\ref{def.Z[i].gauss.div}). Consider this $\delta$.

Now, $\beta=\underbrace{\alpha}_{=\beta\delta}\gamma=\beta\delta\gamma$. But
$\beta^{-1}\beta=1$. Comparing this with%
\[
\beta^{-1}\underbrace{\beta}_{=\beta\delta\gamma}=\underbrace{\beta^{-1}\beta
}_{=1}\delta\gamma=\delta\gamma,
\]
we obtain $\delta\gamma=1$. In other words, $\gamma$ is an inverse of $\delta$
(by Definition \ref{def.CC.CC.inverse.inverse}). Thus, the Gaussian integer
$\delta$ has an inverse in $\mathbb{Z}\left[  i\right]  $ (namely, $\gamma$).
In other words, the Gaussian integer $\delta$ is invertible in $\mathbb{Z}%
\left[  i\right]  $ (by the definition of \textquotedblleft invertible in
$\mathbb{Z}\left[  i\right]  $\textquotedblright). In other words, $\delta$ is
a unit (by the definition of \textquotedblleft unit\textquotedblright). Hence,
from $\alpha=\beta\delta=\delta\beta$, we conclude that $\alpha\sim\beta$ (by
the definition of unit-equivalence). Thus, Exercise \ref{exe.Z[i].div.abba} is
solved in Case 1.

Let us now consider Case 2. In this case, we have $\beta=0$. But we have
$\beta\mid\alpha$. In other words, there exists a Gaussian integer $\gamma$
such that $\alpha=\beta\gamma$ (by Definition \ref{def.Z[i].gauss.div}).
Consider this $\gamma$. Hence, $\alpha=\underbrace{\beta}_{=0}\gamma
=0\gamma=0=\beta$ (since $\beta=0$). Thus, $\alpha=\beta=1\beta$, so that
$\alpha\sim\beta$ (by the definition of unit-equivalence, since $1$ is a
unit). Hence, Exercise \ref{exe.Z[i].div.abba} is solved in Case 2.

Now, we have solved Exercise \ref{exe.Z[i].div.abba} in both Cases 1 and 2.
Hence, Exercise \ref{exe.Z[i].div.abba} always holds.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].div.abba-conv}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].div.abba-conv}.]$\Longrightarrow:$ Assume
that $\alpha\sim\beta$. We must prove that $\left(  \alpha\mid\beta\text{ and
}\beta\mid\alpha\right)  $.

The relation $\sim$ is an equivalence relation (by Proposition
\ref{prop.Z[i].gauss.uniteq.eqrel}), and thus is symmetric (since every
equivalence relation is symmetric). Hence, from $\alpha\sim\beta$, we obtain
$\beta\sim\alpha$.

We have $\alpha\sim\beta$. In other words, $\alpha=\gamma\beta$ for some unit
$\gamma\in\mathbb{Z}\left[  i\right]  $ (by the definition of
unit-equivalence). Consider this $\gamma$. From $\alpha=\gamma\beta$, we
obtain $\beta\mid\alpha$ (since $\gamma$ is a Gaussian integer). The same
argument (with the roles of $\alpha$ and $\beta$ swapped) yields $\alpha
\mid\beta$ (since $\beta\sim\alpha$). Hence, $\left(  \alpha\mid\beta\text{
and }\beta\mid\alpha\right)  $. This proves the \textquotedblleft%
$\Longrightarrow$\textquotedblright\ direction of Exercise
\ref{exe.Z[i].div.abba-conv}.

$\Longleftarrow:$ We have the logical implication $\left(  \alpha\sim
\beta\right)  \ \Longleftarrow\ \left(  \alpha\mid\beta\text{ and }\beta
\mid\alpha\right)  $ (due to Exercise \ref{exe.Z[i].div.abba}). Thus, the
\textquotedblleft$\Longleftarrow$\textquotedblright\ direction of Exercise
\ref{exe.Z[i].div.abba-conv} is proven.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].div.acbc}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].div.acbc}.]The solution to Exercise
\ref{exe.Z[i].div.acbc} is completely analogous to the above solution to
Exercise \ref{exe.ent.div.acbc}. (As usual, you need to make the obvious
changes: Replace all Roman letters $a,b,c,a_{1},b_{1},a_{2},b_{2}$ by Greek
letters $\alpha,\beta,\gamma,\alpha_{1},\beta_{1},\alpha_{2},\beta_{2}$;
replace integers by Gaussian integers; replace the reference to Proposition
\ref{prop.ent.div.2} by a reference to its analogue for Gaussian integers
(which is Proposition \ref{prop.Z[i].div.2}). The resulting argument will make
use of the fact that we can divide any complex number by any nonzero complex
number; but we know this fact from Definition
\ref{def.CC.CC.division.notations} \textbf{(a)}.)
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].div.powers}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].div.powers}.]The solution to Exercise
\ref{exe.Z[i].div.powers} is completely analogous to the above solution to
Exercise \ref{exe.ent.div.powers}. (Of course, you will have to replace the
letter $n$ by $\nu$, and replace integers by Gaussian integers.)
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].div.g|1}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].div.g|1}.]The following argument is an
analogue of the Second solution to Exercise \ref{exe.ent.div.g|1} we gave above:

We have $\gamma=1\gamma$. Hence, there exists a Gaussian integer $\delta$ such
that $\gamma=1\delta$ (namely, $\delta=\gamma$). In other words, $1\mid\gamma$
(by the definition of divisibility). But we also have $\gamma\mid1$ (by
assumption). Hence, Exercise \ref{exe.Z[i].div.abba} (applied to
$\alpha=\gamma$ and $\beta=1$) yields $\gamma\sim1$.

But Proposition \ref{prop.Z[i].gauss.uniteq.1} (applied to $\alpha=\gamma$)
shows that $\gamma\sim1$ if and only if $\gamma$ is a unit. Hence, $\gamma$ is
a unit (since $\gamma\sim1$).

Proposition \ref{prop.Z[i].gauss.units} shows that the units are $1,-1,i,-i$.
Hence, $\gamma$ is either $1$ or $-1$ or $i$ or $-i$ (since $\gamma$ is a
unit). This solves Exercise \ref{exe.Z[i].div.g|1}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].div.conj}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].div.conj}.]We have $\alpha\mid\beta$. In
other words, there exists a Gaussian integer $\gamma$ such that $\beta
=\alpha\gamma$ (by Definition \ref{def.Z[i].gauss.div}). Consider this
$\gamma$, and denote it by $\delta$. Thus, $\delta$ is a Gaussian integer and
satisfies $\beta=\alpha\delta$.

From $\beta=\alpha\delta$, we obtain $\overline{\beta}=\overline{\alpha\delta
}=\overline{\alpha}\cdot\overline{\delta}$ (by Proposition
\ref{prop.CC.conj.hom} \textbf{(c)}, applied to $\delta$ instead of $\beta$).
Also, $\overline{\delta}$ is a Gaussian integer (by Proposition
\ref{prop.Z[i].gauss.conj}, applied to $\delta$ instead of $\alpha$). Hence,
there exists a Gaussian integer $\gamma$ such that $\overline{\beta}%
=\overline{\alpha}\gamma$ (namely, $\gamma=\overline{\delta}$). In other
words, $\overline{\alpha}\mid\overline{\beta}$ (by Definition
\ref{def.Z[i].gauss.div}). This solves Exercise \ref{exe.Z[i].div.conj}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].div.uneq}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].div.uneq}.]The relation $\sim$ on
$\mathbb{Z}\left[  i\right]  $ is an equivalence relation (by Proposition
\ref{prop.Z[i].gauss.uniteq.eqrel}), and thus is symmetric.

\textbf{(a)} Assume that $\beta\sim\gamma$. But Exercise
\ref{exe.Z[i].div.abba-conv} (applied to $\beta$ and $\gamma$ instead of
$\alpha$ and $\beta$) shows that we have the logical equivalence $\left(
\beta\sim\gamma\right)  \ \Longleftrightarrow\ \left(  \beta\mid\gamma\text{
and }\gamma\mid\beta\right)  $. Hence, we have $\left(  \beta\mid\gamma\text{
and }\gamma\mid\beta\right)  $ (since $\beta\sim\gamma$). Thus, $\beta
\mid\gamma$ and $\gamma\mid\beta$.

Thus, in particular, $\beta\mid\gamma$. Hence, if $\alpha\mid\beta$, then
$\alpha\mid\gamma$ (by Proposition \ref{prop.Z[i].div.2} \textbf{(b)}). In
other words, we have proven the implication $\left(  \alpha\mid\beta\right)
\Longrightarrow\left(  \alpha\mid\gamma\right)  $. The same argument (with the
roles of $\beta$ and $\gamma$ switched) proves the implication $\left(
\alpha\mid\gamma\right)  \Longrightarrow\left(  \alpha\mid\beta\right)  $
(since $\gamma\mid\beta$). Combining these two implications, we obtain the
equivalence $\left(  \alpha\mid\beta\right)  \Longleftrightarrow\left(
\alpha\mid\gamma\right)  $. This solves Exercise \ref{exe.Z[i].div.uneq}
\textbf{(a)}.

\textbf{(b)} Assume that $\alpha\sim\beta$. But Exercise
\ref{exe.Z[i].div.abba-conv} shows that we have the logical equivalence
$\left(  \alpha\sim\beta\right)  \ \Longleftrightarrow\ \left(  \alpha
\mid\beta\text{ and }\beta\mid\alpha\right)  $. Hence, we have $\left(
\alpha\mid\beta\text{ and }\beta\mid\alpha\right)  $ (since $\alpha\sim\beta
$). Thus, $\alpha\mid\beta$ and $\beta\mid\alpha$.

Thus, in particular, $\alpha\mid\beta$. Hence, if $\beta\mid\gamma$, then
$\alpha\mid\gamma$ (by Proposition \ref{prop.Z[i].div.2} \textbf{(b)}). In
other words, we have proven the implication $\left(  \beta\mid\gamma\right)
\Longrightarrow\left(  \alpha\mid\gamma\right)  $. The same argument (with the
roles of $\alpha$ and $\beta$ switched) proves the implication $\left(
\alpha\mid\gamma\right)  \Longrightarrow\left(  \beta\mid\gamma\right)  $
(since $\beta\mid\alpha$). Combining these two implications, we obtain the
equivalence $\left(  \alpha\mid\gamma\right)  \Longleftrightarrow\left(
\beta\mid\gamma\right)  $. This solves Exercise \ref{exe.Z[i].div.uneq}
\textbf{(b)}.

\textbf{(c)} Exercise \ref{exe.Z[i].div.uneq} \textbf{(a)} (applied to
$\gamma$ and $\delta$ instead of $\beta$ and $\gamma$) yields the logical
equivalence $\left(  \alpha\mid\gamma\right)  \Longleftrightarrow\left(
\alpha\mid\delta\right)  $ (since $\gamma\sim\delta$). Exercise
\ref{exe.Z[i].div.uneq} \textbf{(b)} (applied to $\delta$ instead of $\gamma$)
yields the logical equivalence $\left(  \alpha\mid\delta\right)
\Longleftrightarrow\left(  \beta\mid\delta\right)  $ (since $\alpha\sim\beta
$). Hence, we obtain the following chain of equivalences:%
\[
\left(  \alpha\mid\gamma\right)  \Longleftrightarrow\left(  \alpha\mid
\delta\right)  \Longleftrightarrow\left(  \beta\mid\delta\right)  .
\]
This solves Exercise \ref{exe.Z[i].div.uneq} \textbf{(c)}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].div.proper}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].div.proper}.]Proposition
\ref{prop.Z[i].gauss.uniteq.eqrel} shows that the relation $\sim$ on
$\mathbb{Z}\left[  i\right]  $ is an equivalence relation. Thus, this relation
is reflexive and symmetric.

We have $\alpha\mid\beta$. In other words, there exists a Gaussian integer
$\gamma$ such that $\beta=\alpha\gamma$ (by Definition
\ref{def.Z[i].gauss.div}). Consider this $\gamma$, and denote it by $\delta$.
Thus, $\delta$ is a Gaussian integer and satisfies $\beta=\alpha\delta$.

We must prove that $\alpha\sim\beta$. If $\operatorname*{N}\left(
\alpha\right)  =0$, then this is easy to see\footnote{\textit{Proof.} Assume
that $\operatorname*{N}\left(  \alpha\right)  =0$. Thus, Proposition
\ref{prop.CC.norm.basics} \textbf{(b)} yields $\alpha=0$. Hence,
$\beta=\underbrace{\alpha}_{=0}\delta=0\delta=0=\alpha$. But the relation
$\sim$ on $\mathbb{Z}\left[  i\right]  $ is reflexive. Hence, $\alpha
\sim\alpha$. This rewrites as $\alpha\sim\beta$ (since $\beta=\alpha$). Thus,
we have proven that $\alpha\sim\beta$ under the assumption that
$\operatorname*{N}\left(  \alpha\right)  =0$.}. Thus, for the rest of this
proof, we WLOG assume that we don't have $\operatorname*{N}\left(
\alpha\right)  =0$. Hence, $\operatorname*{N}\left(  \alpha\right)  \neq0$.

Proposition \ref{prop.CC.conj.hom} \textbf{(d)} (applied to $\delta$ instead
of $\beta$) yields $\operatorname*{N}\left(  \alpha\delta\right)
=\operatorname*{N}\left(  \alpha\right)  \cdot\operatorname*{N}\left(
\delta\right)  $. In view of $\beta=\alpha\delta$, this rewrites as
$\operatorname*{N}\left(  \beta\right)  =\operatorname*{N}\left(
\alpha\right)  \cdot\operatorname*{N}\left(  \delta\right)  $. Thus,
$\operatorname*{N}\left(  \alpha\right)  \cdot\operatorname*{N}\left(
\delta\right)  =\operatorname*{N}\left(  \beta\right)  =\operatorname*{N}%
\left(  \alpha\right)  $. We can divide both sides of this equality by
$\operatorname*{N}\left(  \alpha\right)  $ (since $\operatorname*{N}\left(
\alpha\right)  \neq0$). Thus, we find $\operatorname*{N}\left(  \delta\right)
=1$.

But Proposition \ref{prop.Z[i].gauss.norm1} \textbf{(b)} (applied to $\delta$
instead of $\alpha$) shows that we have $\operatorname*{N}\left(
\delta\right)  =1$ if and only if $\delta$ is a unit. Hence, $\delta$ is a
unit (since $\operatorname*{N}\left(  \delta\right)  =1$). This unit $\delta$
satisfies $\beta=\alpha\delta=\delta\alpha$. Thus, we have $\beta=\gamma
\alpha$ for some unit $\gamma\in\mathbb{Z}\left[  i\right]  $ (namely, for
$\gamma=\delta$). In other words, we have $\beta\sim\alpha$ (by the definition
of the relation $\sim$ on $\mathbb{Z}\left[  i\right]  $). Hence, $\alpha
\sim\beta$ (since the relation $\sim$ on $\mathbb{Z}\left[  i\right]  $ is
symmetric). This solves Exercise \ref{exe.Z[i].div.proper}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].modn.split}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].modn.split}.]We have $a,b\in\mathbb{Z}$
(since $\left(  a,b\right)  $ is a Gaussian integer) and $c,d\in\mathbb{Z}$
(since $\left(  c,d\right)  $ is a Gaussian integer). Thus, all of $a,b,c,d$
are integers. Hence, the statements \textquotedblleft$a\equiv
c\operatorname{mod}n$\textquotedblright\ and \textquotedblleft$b\equiv
d\operatorname{mod}n$\textquotedblright\ make sense. Moreover, $a-c,b-d\in
\mathbb{Z}$ (since $a,b,c,d\in\mathbb{Z}$); thus, $\left(  a-c,b-d\right)  $
is a Gaussian integer. Proposition \ref{prop.Z[i].gauss.div.int|gauss}
(applied to $n$ and $\left(  a-c,b-d\right)  $ instead of $a$ and $\beta$)
yields that we have $n\mid\left(  a-c,b-d\right)  $ if and only if $n$ divides
both $a-c$ and $b-d$. In other words, we have the following logical
equivalence:%
\[
\left(  n\mid\left(  a-c,b-d\right)  \right)  \ \Longleftrightarrow\ \left(
n\text{ divides both }a-c\text{ and }b-d\right)  .
\]


Now, we have the following chain of logical equivalences:%
\begin{align*}
&  \ \left(  \left(  a,b\right)  \equiv\left(  c,d\right)  \operatorname{mod}%
n\right) \\
&  \Longleftrightarrow\ \left(  n\mid\underbrace{\left(  a,b\right)  -\left(
c,d\right)  }_{=\left(  a-c,b-d\right)  }\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Definition \ref{def.Z[i].cong}}\right) \\
&  \Longleftrightarrow\ \left(  n\mid\left(  a-c,b-d\right)  \right)
\ \Longleftrightarrow\ \left(  n\text{ divides both }a-c\text{ and }b-d\right)
\\
&  \Longleftrightarrow\ \left(  \underbrace{n\mid a-c}%
_{\substack{\Longleftrightarrow\ \left(  a\equiv c\operatorname{mod}n\right)
\\\text{(by Definition \ref{def.ent.cong})}}}\text{ and }\underbrace{n\mid
b-d}_{\substack{\Longleftrightarrow\ \left(  b\equiv d\operatorname{mod}%
n\right)  \\\text{(by Definition \ref{def.ent.cong})}}}\right) \\
&  \Longleftrightarrow\ \left(  a\equiv c\operatorname{mod}n\text{ and
}b\equiv d\operatorname{mod}n\right)  .
\end{align*}
This solves Exercise \ref{exe.Z[i].modn.split}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.Z[i].modn.classes}}

\begin{fineprint}
\begin{proof}
[Solution to Exercise \ref{exe.Z[i].modn.classes}.]\textbf{(a)} The solution
to Exercise \ref{exe.Z[i].modn.classes} \textbf{(a)} is analogous to the proof
of Example \ref{exa.eqrel.eqrel.eqrelmodn} (with the only difference that we
have to replace Roman letters by Greek letters, replace integers by Gaussian
integers, and use Proposition \ref{prop.Z[i].mod.basics} instead of
Proposition \ref{prop.ent.mod.basics}).

\textbf{(b)} We must prove the following two claims:

\begin{statement}
\textit{Claim 1:} The equivalence classes of the relation $\underset{n}{\equiv
}$ (on $\mathbb{Z}\left[  i\right]  $) are the classes $\left[  a+bi\right]
_{\underset{n}{\equiv}}$ for $\left(  a,b\right)  \in\left\{  0,1,\ldots
,n-1\right\}  ^{2}$.
\end{statement}

\begin{statement}
\textit{Claim 2:} The $n^{2}$ classes $\left[  a+bi\right]
_{\underset{n}{\equiv}}$ for $\left(  a,b\right)  \in\left\{  0,1,\ldots
,n-1\right\}  ^{2}$ are distinct.
\end{statement}

Let us start with the proof of Claim 2:

[\textit{Proof of Claim 2:} Let $\left(  a,b\right)  ,\left(  c,d\right)
\in\left\{  0,1,\ldots,n-1\right\}  ^{2}$ be two pairs such that $\left[
a+bi\right]  _{\underset{n}{\equiv}}=\left[  c+di\right]
_{\underset{n}{\equiv}}$. We shall prove that $\left(  a,b\right)  =\left(
c,d\right)  $.

From $\left(  a,b\right)  ,\left(  c,d\right)  \in\left\{  0,1,\ldots
,n-1\right\}  ^{2}$, we conclude that $a,b,c,d\in\left\{  0,1,\ldots
,n-1\right\}  \subseteq\mathbb{Z}$.

Proposition \ref{prop.CC.RRtoCC.a+bi} yields $\left(  a,b\right)  =a+bi$
(since $a$ and $b$ are reals). Thus, $\left[  \left(  a,b\right)  \right]
_{\underset{n}{\equiv}}=\left[  a+bi\right]  _{\underset{n}{\equiv}}$.
Similarly, $\left[  \left(  c,d\right)  \right]  _{\underset{n}{\equiv}%
}=\left[  c+di\right]  _{\underset{n}{\equiv}}$. Hence,%
\[
\left[  \left(  a,b\right)  \right]  _{\underset{n}{\equiv}}=\left[
a+bi\right]  _{\underset{n}{\equiv}}=\left[  c+di\right]
_{\underset{n}{\equiv}}=\left[  \left(  c,d\right)  \right]
_{\underset{n}{\equiv}}.
\]
But Theorem \ref{thm.eqrel.eqcl.disj} \textbf{(e)} (applied to $\mathbb{Z}%
\left[  i\right]  $, $\underset{n}{\equiv}$, $\left(  a,b\right)  $ and
$\left(  c,d\right)  $ instead of $S$, $\sim$, $x$ and $y$) shows that we have
$\left(  a,b\right)  \underset{n}{\equiv}\left(  c,d\right)  $ if and only if
$\left[  \left(  a,b\right)  \right]  _{\underset{n}{\equiv}}=\left[  \left(
c,d\right)  \right]  _{\underset{n}{\equiv}}$. Hence, $\left(  a,b\right)
\underset{n}{\equiv}\left(  c,d\right)  $ (since we have $\left[  \left(
a,b\right)  \right]  _{\underset{n}{\equiv}}=\left[  \left(  c,d\right)
\right]  _{\underset{n}{\equiv}}$). In other words, $\left(  a,b\right)
\equiv\left(  c,d\right)  \operatorname{mod}n$ (by the definition of the
relation $\underset{n}{\equiv}$ on $\mathbb{Z}\left[  i\right]  $).

But $\left(  a,b\right)  $ and $\left(  c,d\right)  $ are two Gaussian
integers (since $a,b,c,d\in\mathbb{Z}$). Hence, Exercise
\ref{exe.Z[i].modn.split} shows that we have the following logical
equivalence:%
\[
\left(  \left(  a,b\right)  \equiv\left(  c,d\right)  \operatorname{mod}%
n\right)  \ \Longleftrightarrow\ \left(  a\equiv c\operatorname{mod}n\text{
and }b\equiv d\operatorname{mod}n\right)  .
\]
Thus, we have $\left(  a\equiv c\operatorname{mod}n\text{ and }b\equiv
d\operatorname{mod}n\right)  $ (since we have $\left(  a,b\right)
\equiv\left(  c,d\right)  \operatorname{mod}n$).

Now, $a\in\left\{  0,1,\ldots,n-1\right\}  $ and $a\equiv c\operatorname{mod}%
n$. Hence, Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $c$
and $a$ instead of $u$ and $c$) yields $a=c\%n$. On the other hand,
$c\in\left\{  0,1,\ldots,n-1\right\}  $ and $c\equiv c\operatorname{mod}n$.
Hence, Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(c)} (applied to $c$ and
$c$ instead of $u$ and $c$) yields $c=c\%n$. Comparing this with $a=c\%n$, we
obtain $a=c$. The same argument (but with $a$ and $c$ replaced by $b$ and $d$)
yields $b=d$. Hence, $\left(  \underbrace{a}_{=c},\underbrace{b}_{=d}\right)
=\left(  c,d\right)  $.

Now, forget that we fixed $\left(  a,b\right)  ,\left(  c,d\right)  $. We thus
have shown that if $\left(  a,b\right)  ,\left(  c,d\right)  \in\left\{
0,1,\ldots,n-1\right\}  ^{2}$ are two pairs such that $\left[  a+bi\right]
_{\underset{n}{\equiv}}=\left[  c+di\right]  _{\underset{n}{\equiv}}$, then
$\left(  a,b\right)  =\left(  c,d\right)  $. In other words, the $n^{2}$
classes $\left[  a+bi\right]  _{\underset{n}{\equiv}}$ for $\left(
a,b\right)  \in\left\{  0,1,\ldots,n-1\right\}  ^{2}$ are distinct. This
proves Claim 2.]

[\textit{Proof of Claim 1:} Let $\xi$ be an equivalence class of the relation
$\underset{n}{\equiv}$ (on $\mathbb{Z}\left[  i\right]  $). Thus, $\xi=\left[
\alpha\right]  _{\underset{n}{\equiv}}$ for some $\alpha\in\mathbb{Z}\left[
i\right]  $ (by the definition of an equivalence class). Consider this
$\alpha$. Write the complex number $\alpha$ as $\alpha=\left(  x,y\right)  $
for some $x,y\in\mathbb{R}$. Then, $x,y\in\mathbb{Z}$ (since $\alpha$ is a
Gaussian integer).

Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)} (applied to $u=x$) shows
that $x\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and $x\%n\equiv
x\operatorname{mod}n$. Corollary \ref{cor.ent.quo-rem.remmod} \textbf{(a)}
(applied to $u=y$) shows that $y\%n\in\left\{  0,1,\ldots,n-1\right\}  $ and
$y\%n\equiv y\operatorname{mod}n$. From $x\%n\in\left\{  0,1,\ldots
,n-1\right\}  $ and $y\%n\in\left\{  0,1,\ldots,n-1\right\}  $, we obtain
$\left(  x\%n,y\%n\right)  \in\left\{  0,1,\ldots,n-1\right\}  ^{2}$.

Also, of course, $x\%n,y\%n\in\mathbb{Z}$; thus, the complex number $\left(
x\%n,y\%n\right)  $ is a Gaussian integer. Denote this Gaussian integer by
$\beta$. Thus, $\beta=\left(  x\%n,y\%n\right)  =x\%n+\left(  y\%n\right)  i$
(by Proposition \ref{prop.CC.RRtoCC.a+bi}, applied to $\left(  a,b\right)
=\left(  x\%n,y\%n\right)  $). Hence, $\beta$ is a Gaussian integer of the
form $a+bi$ for $\left(  a,b\right)  \in\left\{  0,1,\ldots,n-1\right\}  ^{2}$
(namely, for $\left(  a,b\right)  =\left(  x\%n,y\%n\right)  $). Thus, the
equivalence class $\left[  \beta\right]  _{\underset{n}{\equiv}}$ is one of
the classes $\left[  a+bi\right]  _{\underset{n}{\equiv}}$ for $\left(
a,b\right)  \in\left\{  0,1,\ldots,n-1\right\}  ^{2}$.

Recall that $\left(  x\%n,y\%n\right)  $ is a Gaussian integer. Hence,
Exercise \ref{exe.Z[i].modn.split} (applied to $\left(  a,b\right)  =\left(
x\%n,y\%n\right)  $ and $\left(  c,d\right)  =\left(  x,y\right)  $) shows
that we have the following logical equivalence:%
\[
\left(  \left(  x\%n,y\%n\right)  \equiv\left(  x,y\right)  \operatorname{mod}%
n\right)  \ \Longleftrightarrow\ \left(  x\%n\equiv x\operatorname{mod}n\text{
and }y\%n\equiv y\operatorname{mod}n\right)  .
\]
Hence, we have $\left(  x\%n,y\%n\right)  \equiv\left(  x,y\right)
\operatorname{mod}n$ (since we have $x\%n\equiv x\operatorname{mod}n$ and
$y\%n\equiv y\operatorname{mod}n$). In view of $\left(  x,y\right)  =\alpha$
and $\left(  x\%n,y\%n\right)  =\beta$, this rewrites as $\beta\equiv
\alpha\operatorname{mod}n$. In other words, $\beta\underset{n}{\equiv}\alpha$
(by the definition of the relation $\underset{n}{\equiv}$ on $\mathbb{Z}%
\left[  i\right]  $).

But Theorem \ref{thm.eqrel.eqcl.disj} \textbf{(e)} (applied to $\mathbb{Z}%
\left[  i\right]  $, $\underset{n}{\equiv}$, $\beta$ and $\alpha$ instead of
$S$, $\sim$, $x$ and $y$) shows that we have $\beta\underset{n}{\equiv}\alpha$
if and only if $\left[  \beta\right]  _{\underset{n}{\equiv}}=\left[
\alpha\right]  _{\underset{n}{\equiv}}$. Hence, we have $\left[  \beta\right]
_{\underset{n}{\equiv}}=\left[  \alpha\right]  _{\underset{n}{\equiv}}$ (since
we have $\beta\underset{n}{\equiv}\alpha$). Comparing this with $\xi=\left[
\alpha\right]  _{\underset{n}{\equiv}}$, we obtain $\xi=\left[  \beta\right]
_{\underset{n}{\equiv}}$.

But recall that $\left[  \beta\right]  _{\underset{n}{\equiv}}$ is one of the
classes $\left[  a+bi\right]  _{\underset{n}{\equiv}}$ for $\left(
a,b\right)  \in\left\{  0,1,\ldots,n-1\right\}  ^{2}$. In view of $\xi=\left[
\beta\right]  _{\underset{n}{\equiv}}$, this rewrites as follows: $\xi$ is one
of the classes $\left[  a+bi\right]  _{\underset{n}{\equiv}}$ for $\left(
a,b\right)  \in\left\{  0,1,\ldots,n-1\right\}  ^{2}$.

Forget that we fixed $\xi$. We thus have proven that if $\xi$ is any
equivalence class of the relation $\underset{n}{\equiv}$ (on $\mathbb{Z}%
\left[  i\right]  $), then $\xi$ is one of the classes $\left[  a+bi\right]
_{\underset{n}{\equiv}}$ for $\left(  a,b\right)  \in\left\{  0,1,\ldots
,n-1\right\}  ^{2}$. In other words, each equivalence class of the relation
$\underset{n}{\equiv}$ (on $\mathbb{Z}\left[  i\right]  $) is one of the
classes $\left[  a+bi\right]  _{\underset{n}{\equiv}}$ for $\left(
a,b\right)  \in\left\{  0,1,\ldots,n-1\right\}  ^{2}$. Conversely, of course,
each of the latter classes is an equivalence class of the relation
$\underset{n}{\equiv}$ (on $\mathbb{Z}\left[  i\right]  $). Combining these
two statements, we conclude that the equivalence classes of the relation
$\underset{n}{\equiv}$ (on $\mathbb{Z}\left[  i\right]  $) are the classes
$\left[  a+bi\right]  _{\underset{n}{\equiv}}$ for $\left(  a,b\right)
\in\left\{  0,1,\ldots,n-1\right\}  ^{2}$. This proves Claim 1.]

Having proven both Claim 1 and Claim 2, we now conclude that the equivalence
classes of the relation $\underset{n}{\equiv}$ (on $\mathbb{Z}\left[
i\right]  $) are the $n^{2}$ classes $\left[  a+bi\right]
_{\underset{n}{\equiv}}$ for $\left(  a,b\right)  \in\left\{  0,1,\ldots
,n-1\right\}  ^{2}$, and that these $n^{2}$ classes are all distinct. This
solves Exercise \ref{exe.Z[i].modn.classes}.
\end{proof}
\end{fineprint}

\subsection{Solution to Exercise \ref{exe.rings.Zscal.rules}}

\begin{fineprint}
In order to solve Exercise \ref{exe.rings.Zscal.rules}, we need to prove
Proposition \ref{prop.rings.Zscal.rules}.

\begin{proof}
[Proof of Proposition \ref{prop.rings.Zscal.rules}.]The proofs of these rules
are analogous to the proofs of the corresponding rules for rationals -- at
least if you know the right proofs of the latter.

Here are the proofs in detail:

First of all, let us prove (\ref{eq.prop.rings.Zscal.rules.0a}). Indeed, each
$a\in\mathbb{K}$ satisfies%
\begin{align*}
0a  &  =\underbrace{a+a+\cdots+a}_{0\text{ times}}\ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of }0a\text{, since }0\geq0\right) \\
&  =\left(  \text{empty sum}\right)  =0_{\mathbb{K}}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{since empty sums of elements of }%
\mathbb{K}\text{ are defined to be }0_{\mathbb{K}}\right)  .
\end{align*}
Thus, (\ref{eq.prop.rings.Zscal.rules.0a}) is proven.

Next, let us prove (\ref{eq.prop.rings.Zscal.rules.1a}). Indeed, each
$a\in\mathbb{K}$ satisfies%
\begin{align*}
1a  &  =\underbrace{a+a+\cdots+a}_{1\text{ times}}\ \ \ \ \ \ \ \ \ \ \left(
\text{by the definition of }1a\text{, since }1\geq0\right) \\
&  =a.
\end{align*}
Thus, (\ref{eq.prop.rings.Zscal.rules.1a}) is proven.

Next, let us prove (\ref{eq.prop.rings.Zscal.rules.-1a}). Indeed, each
$a\in\mathbb{K}$ satisfies%
\begin{align*}
\left(  -1\right)  a  &  =-\left(  \underbrace{a+a+\cdots+a}_{-\left(
-1\right)  \text{ times}}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by the
definition of }\left(  -1\right)  a\text{, since }-1<0\right) \\
&  =-\underbrace{\left(  \underbrace{a+a+\cdots+a}_{1\text{ times}}\right)
}_{=a}\ \ \ \ \ \ \ \ \ \ \left(  \text{since }-\left(  -1\right)  =1\right)
\\
&  =-a.
\end{align*}
Thus, (\ref{eq.prop.rings.Zscal.rules.-1a}) is proven.

Next, recall that Proposition \ref{prop.rings.inv-add.rules} \textbf{(c)}
yields $-0=0$; in other words, $-0_{\mathbb{K}}=0_{\mathbb{K}}$.

We organize the rest of the proof of Proposition \ref{prop.rings.Zscal.rules}
as a sequence of claims, each bringing us one step further to the goals:

\begin{statement}
\textit{Claim 1:} We have $na=-\left(  \left(  -n\right)  a\right)  $ for all
$a\in\mathbb{K}$ and all negative $n\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 1:} Let $a\in\mathbb{K}$. Let $n\in\mathbb{Z}$ be
negative. Thus, $n<0$; hence, the definition of $na$ yields%
\begin{equation}
na=-\left(  \underbrace{a+a+\cdots+a}_{-n\text{ times}}\right)  .
\label{pf.prop.rings.Zscal.rules.c1.pf.1}%
\end{equation}
But $-n>0$ (since $n<0$) and thus $-n\in\mathbb{N}$. Hence, the definition of
$\left(  -n\right)  a$ yields%
\[
\left(  -n\right)  a=\underbrace{a+a+\cdots+a}_{-n\text{ times}}.
\]
Thus,%
\[
-\left(  \left(  -n\right)  a\right)  =-\left(  \underbrace{a+a+\cdots
+a}_{-n\text{ times}}\right)  =na\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{pf.prop.rings.Zscal.rules.c1.pf.1})}\right)  .
\]
This proves Claim 1.]

\begin{statement}
\textit{Claim 2:} We have $\left(  -n\right)  a=-\left(  na\right)  $ for all
$a\in\mathbb{K}$ and $n\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 2:} Let $a\in\mathbb{K}$ and $n\in\mathbb{Z}$. We are
in one of the following three cases:

\textit{Case 1:} We have $n>0$.

\textit{Case 2:} We have $n=0$.

\textit{Case 3:} We have $n<0$.

Let us first consider Case 1. In this case, we have $n>0$. Hence, $-n<0$. In
other words, $-n$ is negative. Thus, Claim 1 (applied to $-n$ instead of $n$)
yields $\left(  -n\right)  a=-\left(  \underbrace{\left(  -\left(  -n\right)
\right)  }_{=n}a\right)  =-\left(  na\right)  $. Thus, Claim 2 is proven in
Case 1.

Let us next consider Case 2. In this case, we have $n=0$. Thus,
$na=0a=0_{\mathbb{K}}$ (by (\ref{eq.prop.rings.Zscal.rules.0a})). Hence,
$-\left(  na\right)  =-0_{\mathbb{K}}=0_{\mathbb{K}}$. Comparing this with
$\left(  -\underbrace{n}_{=0}\right)  a=\underbrace{\left(  -0\right)  }%
_{=0}a=0a=0_{\mathbb{K}}$, we obtain $\left(  -n\right)  a=-\left(  na\right)
$. Thus, Claim 2 is proven in Case 2.

Let us finally consider Case 3. In this case, we have $n<0$. Thus, $n$ is
negative. Hence, Claim 1 yields $na=-\left(  \left(  -n\right)  a\right)  $.
Thus, $-\left(  na\right)  =-\left(  -\left(  \left(  -n\right)  a\right)
\right)  =\left(  -n\right)  a$ (by Proposition \ref{prop.rings.inv-add.rules}
\textbf{(e)}, applied to $\left(  -n\right)  a$, $0$ and $0$ instead of $a$,
$b$ and $c$). Thus, $\left(  -n\right)  a=-\left(  na\right)  $. Hence, Claim
2 is proven in Case 3.

Thus, we have proven Claim 2 in all three Cases 1, 2 and 3. Hence, Claim 2 is proven.]

\begin{statement}
\textit{Claim 3:} We have $\left(  n+m\right)  a=na+ma$ for all $a\in
\mathbb{K}$ and $n,m\in\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 3:} Let $a\in\mathbb{K}$ and $n,m\in\mathbb{N}$. We
have $n\in\mathbb{N}$ and thus $n\geq0$; thus, the definition of $na$ yields%
\[
na=\underbrace{a+a+\cdots+a}_{n\text{ times}}.
\]
The same argument (applied to $m$ instead of $n$) yields%
\[
ma=\underbrace{a+a+\cdots+a}_{m\text{ times}}.
\]
Adding these two equalities together, we find%
\begin{equation}
na+ma=\underbrace{a+a+\cdots+a}_{n\text{ times}}+\underbrace{a+a+\cdots
+a}_{m\text{ times}}=\underbrace{a+a+\cdots+a}_{n+m\text{ times}}.
\label{pf.prop.rings.Zscal.rules.c3.pf.2}%
\end{equation}


On the other hand, $n+m\in\mathbb{N}$ (since $n\in\mathbb{N}$ and
$m\in\mathbb{N}$); thus, the definition of $\left(  n+m\right)  a$ yields%
\[
\left(  n+m\right)  a=\underbrace{a+a+\cdots+a}_{n+m\text{ times}}.
\]
Comparing this with (\ref{pf.prop.rings.Zscal.rules.c3.pf.2}), we obtain
$\left(  n+m\right)  a=na+ma$. This proves Claim 3.]

\begin{statement}
\textit{Claim 4:} We have $\left(  n-m\right)  a=na-ma$ for all $a\in
\mathbb{K}$ and $n,m\in\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 4:} Let $a\in\mathbb{K}$ and $n,m\in\mathbb{N}$. We
are in one of the following two cases:

\textit{Case 1:} We have $n\geq m$.

\textit{Case 2:} We have $n<m$.

Let us first consider Case 1. In this case, we have $n\geq m$. Thus,
$n-m\geq0$. Hence, $n-m\in\mathbb{N}$. Thus, Claim 3 (applied to $m$ and $n-m$
instead of $n$ and $m$) yields
\[
\left(  m+\left(  n-m\right)  \right)  a=ma+\left(  n-m\right)  a.
\]
In view of $m+\left(  n-m\right)  =n$, this rewrites as $na=ma+\left(
n-m\right)  a$. But Proposition \ref{prop.rings.inv-add.rules} \textbf{(a)}
(applied to $na$, $ma$ and $\left(  n-m\right)  a$ instead of $a$, $b$ and
$c$) yields that we have $na-ma=\left(  n-m\right)  a$ if and only if
$na=ma+\left(  n-m\right)  a$. Hence, we have $na-ma=\left(  n-m\right)  a$
(since $na=ma+\left(  n-m\right)  a$). In other words, $\left(  n-m\right)
a=na-ma$. Thus, Claim 4 is proven in Case 1.

Let us now consider Case 2. In this case, we have $n<m$. Thus, $m-n>0$. Hence,
$m-n\in\mathbb{N}$. Thus, Claim 3 (applied to $m-n$ instead of $m$) yields
$\left(  n+\left(  m-n\right)  \right)  a=na+\left(  m-n\right)  a$. In view
of $n+\left(  m-n\right)  =m$, this rewrites as $ma=na+\left(  m-n\right)  a$.
But Proposition \ref{prop.rings.inv-add.rules} \textbf{(a)} (applied to $ma$,
$na$ and $\left(  m-n\right)  a$ instead of $a$, $b$ and $c$) yields that we
have $ma-na=\left(  m-n\right)  a$ if and only if $ma=na+\left(  m-n\right)
a$. Hence, we have
\begin{equation}
ma-na=\left(  m-n\right)  a \label{pf.prop.rings.Zscal.rules.c4.pf.5}%
\end{equation}
(since $ma=na+\left(  m-n\right)  a$).

But Claim 2 (applied to $m-n$ instead of $n$) yields%
\[
\left(  -\left(  m-n\right)  \right)  a=-\underbrace{\left(  \left(
m-n\right)  a\right)  }_{\substack{=ma-na\\\text{(by
(\ref{pf.prop.rings.Zscal.rules.c4.pf.5}))}}}=-\left(  ma-na\right)  =na-ma
\]
(by Proposition \ref{prop.rings.inv-add.rules} \textbf{(i)}, applied to $ma$,
$na$ and $0$ instead of $a$, $b$ and $c$). In view of $-\left(  m-n\right)
=n-m$, this rewrites as $\left(  n-m\right)  a=na-ma$. Hence, Claim 4 is
proven in Case 2.

We have now proven Claim 4 in both Cases 1 and 2. Hence, Claim 4 is proven.]

Next let us generalize Claim 3 by allowing $m$ to be negative:

\begin{statement}
\textit{Claim 5:} We have $\left(  n+m\right)  a=na+ma$ for all $a\in
\mathbb{K}$ and $n\in\mathbb{N}$ and $m\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 5:} Let $a\in\mathbb{K}$ and $n\in\mathbb{N}$ and
$m\in\mathbb{Z}$. We must prove that $\left(  n+m\right)  a=na+ma$. If
$m\in\mathbb{N}$, then this follows from Claim 3. Hence, for the rest of this
proof, we WLOG assume that we don't have $m\in\mathbb{N}$. Thus, we have
$m\in\mathbb{Z}$ but not $m\in\mathbb{N}$. Hence, $m\in\mathbb{Z}%
\setminus\mathbb{N}=\left\{  -1,-2,-3,\ldots\right\}  $. In other words,
$m<0$. Hence, $-m>0$, so that $-m\in\mathbb{N}$. Hence, Claim 4 (applied to
$-m$ instead of $m$) yields $\left(  n-\left(  -m\right)  \right)
a=na-\left(  -m\right)  a$. In view of $n-\left(  -m\right)  =n+m$, this
rewrites as $\left(  n+m\right)  a=na-\left(  -m\right)  a$. But Claim 2
(applied to $m$ instead of $n$) yields $\left(  -m\right)  a=-\left(
ma\right)  $. Hence,%
\[
\left(  n+m\right)  a=na-\underbrace{\left(  -m\right)  a}_{=-\left(
-ma\right)  }=na-\left(  -\left(  ma\right)  \right)  =na+ma
\]
(by Proposition \ref{prop.rings.inv-add.rules} \textbf{(j)}, applied to $na$,
$ma$ and $0$ instead of $a$, $b$ and $c$). This proves Claim 5.]

Finally, we can generalize this further by allowing $n$ to be negative as well:

\begin{statement}
\textit{Claim 6:} We have $\left(  n+m\right)  a=na+ma$ for all $a\in
\mathbb{K}$ and $n,m\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 6:} Let $a\in\mathbb{K}$ and $n,m\in\mathbb{Z}$. We
must prove that $\left(  n+m\right)  a=na+ma$. If $n\in\mathbb{N}$, then this
follows from Claim 5. Hence, for the rest of this proof, we WLOG assume that
we don't have $n\in\mathbb{N}$. Thus, we have $n\in\mathbb{Z}$ but not
$n\in\mathbb{N}$. Hence, $n\in\mathbb{Z}\setminus\mathbb{N}=\left\{
-1,-2,-3,\ldots\right\}  $. In other words, $n<0$. Hence, $-n>0$, so that
$-n\in\mathbb{N}$. Hence, Claim 5 (applied to $-n$ and $-m$ instead of $n$ and
$m$) yields $\left(  \left(  -n\right)  +\left(  -m\right)  \right)  a=\left(
-n\right)  a+\left(  -m\right)  a$. In view of $\left(  -n\right)  +\left(
-m\right)  =-\left(  n+m\right)  $, this rewrites as%
\begin{equation}
\left(  -\left(  n+m\right)  \right)  a=\left(  -n\right)  a+\left(
-m\right)  a. \label{pf.prop.rings.Zscal.rules.c6.pf.1}%
\end{equation}


But Claim 2 yields $\left(  -n\right)  a=-\left(  na\right)  $. Also, Claim 2
(applied to $m$ instead of $n$) yields $\left(  -m\right)  a=-\left(
ma\right)  $. Hence, (\ref{pf.prop.rings.Zscal.rules.c6.pf.1}) becomes%
\begin{equation}
\left(  -\left(  n+m\right)  \right)  a=\underbrace{\left(  -n\right)
a}_{=-\left(  na\right)  }+\underbrace{\left(  -m\right)  a}_{=-\left(
ma\right)  }=\left(  -\left(  na\right)  \right)  +\left(  -\left(  ma\right)
\right)  . \label{pf.prop.rings.Zscal.rules.c6.pf.3}%
\end{equation}
Also, Claim 2 (applied to $n+m$ instead of $n$) yields $\left(  -\left(
n+m\right)  \right)  a=-\left(  \left(  n+m\right)  a\right)  $. Comparing
this with (\ref{pf.prop.rings.Zscal.rules.c6.pf.3}), we obtain%
\begin{equation}
-\left(  \left(  n+m\right)  a\right)  =\left(  -\left(  na\right)  \right)
+\left(  -\left(  ma\right)  \right)  .
\label{pf.prop.rings.Zscal.rules.c6.pf.4}%
\end{equation}
But Proposition \ref{prop.rings.inv-add.rules} \textbf{(b)} (applied to $na$,
$ma$ and $0$ instead of $a$, $b$ and $c$) yields%
\[
-\left(  na+ma\right)  =\left(  -\left(  na\right)  \right)  +\left(  -\left(
ma\right)  \right)  .
\]
Comparing this with (\ref{pf.prop.rings.Zscal.rules.c6.pf.4}), we find
$-\left(  \left(  n+m\right)  a\right)  =-\left(  na+ma\right)  $. Hence,
Proposition \ref{prop.rings.inv-add.rules} \textbf{(l)} (applied to $\left(
n+m\right)  a$, $na+ma$ and $0$ instead of $a$, $b$ and $c$) yields $\left(
n+m\right)  a=na+ma$. This proves Claim 6.]

Claim 6 is precisely the statement of (\ref{eq.prop.rings.Zscal.rules.(n+m)a}%
). Thus, (\ref{eq.prop.rings.Zscal.rules.(n+m)a}) is now proven.

\begin{statement}
\textit{Claim 7:} We have $\left(  nm\right)  a=n\left(  ma\right)  $ for all
$a\in\mathbb{K}$ and $n\in\mathbb{N}$ and $m\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 7:} We shall prove Claim 7 by induction on $n$:

\textit{Induction base:} We have $\left(  0m\right)  a=0\left(  ma\right)  $
for all $a\in\mathbb{K}$ and $m\in\mathbb{Z}$ (because if $a\in\mathbb{K}$ and
$m\in\mathbb{Z}$, then
\[
\underbrace{\left(  0m\right)  }_{=0}a=0a=0_{\mathbb{K}}%
\ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{eq.prop.rings.Zscal.rules.0a}%
)}\right)
\]
and
\[
0\left(  ma\right)  =0_{\mathbb{K}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{eq.prop.rings.Zscal.rules.0a}), applied to }ma\text{ instead of
}a\right)
\]
and thus $\left(  0m\right)  a=0_{\mathbb{K}}=0\left(  ma\right)  $). In other
words, Claim 7 holds for $n=0$. This completes the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Claim 7 holds for
$n=k$. We must prove that Claim 7 holds for $n=k+1$.

We have assumed that Claim 7 holds for $n=k$. In other words, we have
\begin{equation}
\left(  km\right)  a=k\left(  ma\right)  \ \ \ \ \ \ \ \ \ \ \text{for all
}a\in\mathbb{K}\text{ and }m\in\mathbb{Z}.
\label{pf.prop.rings.Zscal.rules.c7.pf.IH}%
\end{equation}


Now, let $a\in\mathbb{K}$ and $m\in\mathbb{Z}$. Then,%
\begin{align*}
\underbrace{\left(  \left(  k+1\right)  m\right)  }_{=km+m}a  &  =\left(
km+m\right)  a=\underbrace{\left(  km\right)  a}_{\substack{=k\left(
ma\right)  \\\text{(by (\ref{pf.prop.rings.Zscal.rules.c7.pf.IH}))}%
}}+ma\ \ \ \ \ \ \ \ \ \ \left(  \text{by Claim 6, applied to }n=km\right) \\
&  =k\left(  ma\right)  +ma.
\end{align*}
Comparing this with%
\begin{align*}
\left(  k+1\right)  \left(  ma\right)   &  =k\left(  ma\right)
+\underbrace{1\left(  ma\right)  }_{\substack{=ma\\\text{(by
(\ref{eq.prop.rings.Zscal.rules.1a}), applied}\\\text{to }ma\text{ instead of
}a\text{)}}}\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Claim 6, applied to }k\text{, }1\text{
and }ma\text{ instead of }n\text{, }m\text{ and }a\right) \\
&  =k\left(  ma\right)  +ma,
\end{align*}
we find $\left(  \left(  k+1\right)  m\right)  a=\left(  k+1\right)  \left(
ma\right)  $.

Now, forget that we fixed $a$ and $m$. We thus have shown that $\left(
\left(  k+1\right)  m\right)  a=\left(  k+1\right)  \left(  ma\right)  $ for
all $a\in\mathbb{K}$ and $m\in\mathbb{Z}$. In other words, Claim 7 holds for
$n=k+1$. This completes the induction step. Thus, Claim 7 is proven.]

\begin{statement}
\textit{Claim 8:} We have $\left(  nm\right)  a=n\left(  ma\right)  $ for all
$a\in\mathbb{K}$ and $n,m\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 8:} Let $a\in\mathbb{K}$ and $n,m\in\mathbb{Z}$. We
must prove that $\left(  nm\right)  a=n\left(  ma\right)  $. If $n\in
\mathbb{N}$, then this follows from Claim 7. Hence, for the rest of this
proof, we WLOG assume that we don't have $n\in\mathbb{N}$. Thus, we have
$n\in\mathbb{Z}$ but not $n\in\mathbb{N}$. Hence, $n\in\mathbb{Z}%
\setminus\mathbb{N}=\left\{  -1,-2,-3,\ldots\right\}  $. In other words,
$n<0$. Hence, $-n>0$, so that $-n\in\mathbb{N}$. Hence, Claim 7 (applied to
$-n$ instead of $n$) yields $\left(  \left(  -n\right)  m\right)  a=\left(
-n\right)  \left(  ma\right)  $. Thus,%
\begin{equation}
\underbrace{\left(  -nm\right)  }_{=\left(  -n\right)  m}a=\left(  \left(
-n\right)  m\right)  a=\left(  -n\right)  \left(  ma\right)  =-\left(
n\left(  ma\right)  \right)  \label{pf.prop.rings.Zscal.rules.c8.pf.1}%
\end{equation}
(by Claim 2, applied to $ma$ instead of $a$). On the other hand, Claim 2
(applied to $nm$ instead of $n$) yields $\left(  -nm\right)  a=-\left(
\left(  nm\right)  a\right)  $. Comparing this with
(\ref{pf.prop.rings.Zscal.rules.c8.pf.1}), we obtain $-\left(  \left(
nm\right)  a\right)  =-\left(  n\left(  ma\right)  \right)  $. Thus,
Proposition \ref{prop.rings.inv-add.rules} \textbf{(l)} (applied to $\left(
nm\right)  a$, $n\left(  ma\right)  $ and $0$ instead of $a$, $b$ and $c$)
yields $\left(  nm\right)  a=n\left(  ma\right)  $. Thus, Claim 8 is proven.]

Claim 8 is precisely (\ref{eq.prop.rings.Zscal.rules.nma}). Thus, we have now
proven (\ref{eq.prop.rings.Zscal.rules.nma}).

\begin{statement}
\textit{Claim 9:} We have $n\left(  a+b\right)  =na+nb$ for all $a,b\in
\mathbb{K}$ and $n\in\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 9:} We shall prove Claim 9 by induction on $n$:

\textit{Induction base:} If $a,b\in\mathbb{K}$, then
\[
\underbrace{0a}_{\substack{=0_{\mathbb{K}}\\\text{(by
(\ref{eq.prop.rings.Zscal.rules.0a}))}}}+\underbrace{0b}%
_{\substack{=0_{\mathbb{K}}\\\text{(by (\ref{eq.prop.rings.Zscal.rules.0a}),
applied}\\\text{to }b\text{ instead of }a\text{)}}}=0_{\mathbb{K}%
}+0_{\mathbb{K}}=0_{\mathbb{K}}=0\left(  a+b\right)
\]
(since (\ref{eq.prop.rings.Zscal.rules.0a}) (applied to $a+b$ instead of $a$)
yields $0\left(  a+b\right)  =0_{\mathbb{K}}$). Hence, we have $0\left(
a+b\right)  =0a+0b$ for all $a,b\in\mathbb{K}$. In other words, Claim 9 holds
for $n=0$. This completes the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Claim 9 holds for
$n=k$. We must prove that Claim 9 holds for $n=k+1$.

We have assumed that Claim 9 holds for $n=k$. In other words, we have%
\begin{equation}
k\left(  a+b\right)  =ka+kb\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in
\mathbb{K}. \label{pf.prop.rings.Zscal.rules.c9.pf.IH}%
\end{equation}


Now, let $a,b\in\mathbb{K}$. Then,%
\begin{align}
\left(  k+1\right)  \left(  a+b\right)   &  =\underbrace{k\left(  a+b\right)
}_{\substack{=ka+kb\\\text{(by (\ref{pf.prop.rings.Zscal.rules.c9.pf.IH}))}%
}}+\underbrace{1\left(  a+b\right)  }_{\substack{=a+b\\\text{(by
(\ref{eq.prop.rings.Zscal.rules.1a})}\\\text{(applied to }a+b\text{ instead of
}a\text{))}}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Claim 3, applied to }k\text{, }1\text{
and }a+b\text{ instead of }n\text{, }m\text{ and }a\right) \nonumber\\
&  =ka+kb+a+b=ka+a+kb+b. \label{pf.prop.rings.Zscal.rules.c9.pf.2}%
\end{align}
On the other hand, Claim 3 (applied to $n=k$ and $m=1$) yields $\left(
k+1\right)  a=ka+\underbrace{1a}_{\substack{=a\\\text{(by
(\ref{eq.prop.rings.Zscal.rules.1a}))}}}=ka+a$. The same argument (applied to
$b$ instead of $a$) yields $\left(  k+1\right)  b=kb+b$. Adding these two
equalities together, we obtain%
\[
\left(  k+1\right)  a+\left(  k+1\right)  b=\left(  ka+a\right)  +\left(
kb+b\right)  =ka+a+kb+b.
\]
Comparing this with (\ref{pf.prop.rings.Zscal.rules.c9.pf.2}), we find
$\left(  k+1\right)  \left(  a+b\right)  =\left(  k+1\right)  a+\left(
k+1\right)  b$.

Now, forget that we fixed $a,b$. We thus have proven that%
\[
\left(  k+1\right)  \left(  a+b\right)  =\left(  k+1\right)  a+\left(
k+1\right)  b\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{K}.
\]
In other words, Claim 9 holds for $n=k+1$. This completes the induction step.
Thus, Claim 9 is proven.]

\begin{statement}
\textit{Claim 10:} We have $n\left(  a+b\right)  =na+nb$ for all
$a,b\in\mathbb{K}$ and $n\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 10:} Let $a,b\in\mathbb{K}$ and $n\in\mathbb{Z}$. We
must prove that $n\left(  a+b\right)  =na+nb$. If $n\in\mathbb{N}$, then this
follows from Claim 9. Hence, for the rest of this proof, we WLOG assume that
we don't have $n\in\mathbb{N}$. Thus, we have $n\in\mathbb{Z}$ but not
$n\in\mathbb{N}$. Hence, $n\in\mathbb{Z}\setminus\mathbb{N}=\left\{
-1,-2,-3,\ldots\right\}  $. In other words, $n<0$. Hence, $-n>0$, so that
$-n\in\mathbb{N}$. Hence, Claim 9 (applied to $-n$ instead of $n$) yields
\[
\left(  -n\right)  \left(  a+b\right)  =\underbrace{\left(  -n\right)
a}_{\substack{=-\left(  na\right)  \\\text{(by Claim 2)}}}+\underbrace{\left(
-n\right)  b}_{\substack{=-\left(  nb\right)  \\\text{(by Claim 2,}%
\\\text{applied to }b\text{ instead of }a\text{)}}}=\left(  -\left(
na\right)  \right)  +\left(  -\left(  nb\right)  \right)  .
\]
Comparing this with%
\[
\left(  -n\right)  \left(  a+b\right)  =-\left(  n\left(  a+b\right)  \right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Claim 2, applied to }a+b\text{ instead of
}a\right)  ,
\]
we find
\[
-\left(  n\left(  a+b\right)  \right)  =\left(  -\left(  na\right)  \right)
+\left(  -\left(  nb\right)  \right)  .
\]
On the other hand, Proposition \ref{prop.rings.inv-add.rules} \textbf{(b)}
(applied to $na$ and $nb$ instead of $a$ and $b$) yields%
\[
-\left(  na+nb\right)  =\left(  -\left(  na\right)  \right)  +\left(  -\left(
nb\right)  \right)  .
\]
Comparing these two equalities, we obtain $-\left(  n\left(  a+b\right)
\right)  =-\left(  na+nb\right)  $. Thus, Proposition
\ref{prop.rings.inv-add.rules} \textbf{(l)} (applied to $n\left(  a+b\right)
$, $na+nb$ and $0$ instead of $a$, $b$ and $c$) yields $n\left(  a+b\right)
=na+nb$. Thus, Claim 10 is proven.]

Claim 10 is precisely (\ref{eq.prop.rings.Zscal.rules.n(a+b)}). Thus, we have
proven (\ref{eq.prop.rings.Zscal.rules.n(a+b)}).

\begin{statement}
\textit{Claim 11:} We have $n0_{\mathbb{K}}=0_{\mathbb{K}}$ for all
$n\in\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 11:} We shall prove Claim 11 by induction on $n$:

\textit{Induction base:} The equality (\ref{eq.prop.rings.Zscal.rules.0a})
(applied to $a=0_{\mathbb{K}}$) yields $0\cdot0_{\mathbb{K}}=0_{\mathbb{K}}$.
In other words, Claim 11 holds for $n=0$. This completes the induction base.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Claim 11 holds for
$n=k$. We must prove that Claim 11 holds for $n=k+1$.

We have assumed that Claim 11 holds for $n=k$. In other words, we have
$k0_{\mathbb{K}}=0_{\mathbb{K}}$. Now, Claim 3 (applied to $n=k$, $m=1$ and
$a=0_{\mathbb{K}}$) yields $\left(  k+1\right)  0_{\mathbb{K}}=k0_{\mathbb{K}%
}+\underbrace{1\cdot0_{\mathbb{K}}}_{\substack{=0_{\mathbb{K}}\\\text{(by
(\ref{eq.prop.rings.Zscal.rules.1a}))}}}=k0_{\mathbb{K}}=0_{\mathbb{K}}$. In
other words, Claim 11 holds for $n=k+1$. This completes the induction step.
Thus, Claim 11 is proven.]

\begin{statement}
\textit{Claim 12:} We have $n0_{\mathbb{K}}=0_{\mathbb{K}}$ for all
$n\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 12:} Let $n\in\mathbb{Z}$. We must prove that
$n0_{\mathbb{K}}=0_{\mathbb{K}}$. If $n\in\mathbb{N}$, then this follows from
Claim 12. Hence, for the rest of this proof, we WLOG assume that we don't have
$n\in\mathbb{N}$. Thus, we have $n\in\mathbb{Z}$ but not $n\in\mathbb{N}$.
Hence, $n\in\mathbb{Z}\setminus\mathbb{N}=\left\{  -1,-2,-3,\ldots\right\}  $.
In other words, $n<0$. Hence, $-n>0$, so that $-n\in\mathbb{N}$. Hence, Claim
12 (applied to $-n$ instead of $n$) yields $\left(  -n\right)  0_{\mathbb{K}%
}=0_{\mathbb{K}}$. But Claim 2 (applied to $a=0_{\mathbb{K}}$) yields $\left(
-n\right)  0_{\mathbb{K}}=-\left(  n0_{\mathbb{K}}\right)  $. Hence, $-\left(
n0_{\mathbb{K}}\right)  =\left(  -n\right)  0_{\mathbb{K}}=0_{\mathbb{K}%
}=-0_{\mathbb{K}}$ (since $-0_{\mathbb{K}}=0_{\mathbb{K}}$). Thus, Proposition
\ref{prop.rings.inv-add.rules} \textbf{(l)} (applied to $n0_{\mathbb{K}}$,
$0_{\mathbb{K}}$ and $0_{\mathbb{K}}$ instead of $a$, $b$ and $c$) yields
$n0_{\mathbb{K}}=0_{\mathbb{K}}$. This proves Claim 12.]

Claim 12 is precisely (\ref{eq.prop.rings.Zscal.rules.n0}). Thus,
(\ref{eq.prop.rings.Zscal.rules.n0}) is now proven.

\begin{statement}
\textit{Claim 13:} We have $\left(  -n\right)  a=n\left(  -a\right)  $ for all
$a\in\mathbb{K}$ and $n\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 13:} Let $a\in\mathbb{K}$ and $n\in\mathbb{Z}$. Then,
Claim 10 (applied to $b=-a$) yields $n\left(  a+\left(  -a\right)  \right)
=na+n\left(  -a\right)  $. Comparing this with%
\[
n\underbrace{\left(  a+\left(  -a\right)  \right)  }_{=0_{\mathbb{K}}%
}=n0_{\mathbb{K}}=0_{\mathbb{K}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Claim
12}\right)  ,
\]
we obtain $na+n\left(  -a\right)  =0_{\mathbb{K}}$. Subtracting $na$ from both
sides of this equality, we find $n\left(  -a\right)  =0_{\mathbb{K}%
}-na=0-na=-\left(  na\right)  $ (by Proposition \ref{prop.rings.inv-add.rules}
\textbf{(d)}, applied to $na$ instead of $a$). But Claim 2 yields $\left(
-n\right)  a=-\left(  na\right)  =n\left(  -a\right)  $ (since $n\left(
-a\right)  =-\left(  na\right)  $). This proves Claim 13.]

Now, any $a\in\mathbb{K}$ and $n\in\mathbb{Z}$ satisfy%
\begin{align*}
-\left(  na\right)   &  =\left(  -n\right)  a\ \ \ \ \ \ \ \ \ \ \left(
\text{by Claim 2}\right) \\
&  =n\left(  -a\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Claim 13}\right)
.
\end{align*}
This proves (\ref{eq.prop.rings.Zscal.rules.-na}).

\begin{statement}
\textit{Claim 14:} We have $n\left(  ab\right)  =\left(  na\right)  b=a\left(
nb\right)  $ for all $a,b\in\mathbb{K}$ and $n\in\mathbb{N}$.
\end{statement}

[\textit{Proof of Claim 14:} We shall prove Claim 14 by induction on $n$:

\textit{Induction base:} It is easy to see that $0\left(  ab\right)  =\left(
0a\right)  b=a\left(  0b\right)  $ for all $a,b\in\mathbb{K}$%
\ \ \ \ \footnote{\textit{Proof.} Let $a,b\in\mathbb{K}$. Then,
$0a=0_{\mathbb{K}}$ (by (\ref{eq.prop.rings.Zscal.rules.0a})). Thus, $\left(
0a\right)  b=0_{\mathbb{K}}b=0_{\mathbb{K}}$ (by the \textquotedblleft
Annihilation\textquotedblright\ axiom for the ring $\mathbb{K}$). Furthermore,
$0b=0_{\mathbb{K}}$ (by (\ref{eq.prop.rings.Zscal.rules.0a}), applied to $b$
instead of $a$). Thus, $a\left(  0b\right)  =a0_{\mathbb{K}}=0_{\mathbb{K}}$
(by the \textquotedblleft Annihilation\textquotedblright\ axiom for the ring
$\mathbb{K}$). Finally, $0\left(  a+b\right)  =0_{\mathbb{K}}$ (by
(\ref{eq.prop.rings.Zscal.rules.0a}), applied to $a+b$ instead of $a$). Thus,
$0\left(  ab\right)  =0_{\mathbb{K}}$ (by the \textquotedblleft
Annihilation\textquotedblright\ axiom for the ring $\mathbb{K}$). Comparing
this equality with the equalities $\left(  0a\right)  b=0_{\mathbb{K}}$ and
$a\left(  0b\right)  =0_{\mathbb{K}}$, we obtain $0\left(  ab\right)  =\left(
0a\right)  b=a\left(  0b\right)  $. Qed.}. In other words, Claim 14 holds for
$n=0$.

\textit{Induction step:} Let $k\in\mathbb{N}$. Assume that Claim 14 holds for
$n=k$. We must prove that Claim 14 holds for $n=k+1$.

We have assumed that Claim 14 holds for $n=k$. In other words, we have%
\begin{equation}
k\left(  ab\right)  =\left(  ka\right)  b=a\left(  kb\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }a,b\in\mathbb{K}.
\label{pf.prop.rings.Zscal.rules.c14.pf.IH}%
\end{equation}


Now, let $a,b\in\mathbb{K}$. Then, (\ref{pf.prop.rings.Zscal.rules.c14.pf.IH})
yields $k\left(  ab\right)  =\left(  ka\right)  b=a\left(  kb\right)  $.

Claim 3 (applied to $n=k$ and $m=1$) yields $\left(  k+1\right)
a=ka+\underbrace{1a}_{\substack{=a\\\text{(by
(\ref{eq.prop.rings.Zscal.rules.1a}))}}}=ka+a$. The same argument (applied to
$b$ instead of $a$) yields $\left(  k+1\right)  b=kb+b$. Also, the same
argument that we used to prove $\left(  k+1\right)  a=ka+a$ can be applied to
$ab$ instead of $a$; it then shows that $\left(  k+1\right)  \left(
ab\right)  =k\left(  ab\right)  +ab$.

Now,%
\[
\underbrace{\left(  \left(  k+1\right)  a\right)  }_{=ka+a}b=\left(
ka+a\right)  b=\left(  ka\right)  b+ab\ \ \ \ \ \ \ \ \ \ \left(  \text{by the
distributivity axiom}\right)  .
\]
Comparing this with%
\[
\left(  k+1\right)  \left(  ab\right)  =\underbrace{k\left(  ab\right)
}_{=\left(  ka\right)  b}+ab=\left(  ka\right)  b+ab,
\]
we obtain%
\begin{equation}
\left(  k+1\right)  \left(  ab\right)  =\left(  \left(  k+1\right)  a\right)
b. \label{pf.prop.rings.Zscal.rules.c14.pf.1}%
\end{equation}


Furthermore,%
\[
a\underbrace{\left(  \left(  k+1\right)  b\right)  }_{=kb+b}=a\left(
kb+b\right)  =a\left(  kb\right)  +ab\ \ \ \ \ \ \ \ \ \ \left(  \text{by the
distributivity axiom}\right)  .
\]
Comparing this with%
\[
\left(  k+1\right)  \left(  ab\right)  =\underbrace{k\left(  ab\right)
}_{=a\left(  kb\right)  }+ab=a\left(  kb\right)  +ab,
\]
we obtain%
\[
\left(  k+1\right)  \left(  ab\right)  =a\left(  \left(  k+1\right)  b\right)
.
\]
Combining this equality with (\ref{pf.prop.rings.Zscal.rules.c14.pf.1}), we
obtain%
\[
\left(  k+1\right)  \left(  ab\right)  =\left(  \left(  k+1\right)  a\right)
b=a\left(  \left(  k+1\right)  b\right)  .
\]


Now, forget that we fixed $a,b$. We thus have proven that $\left(  k+1\right)
\left(  ab\right)  =\left(  \left(  k+1\right)  a\right)  b=a\left(  \left(
k+1\right)  b\right)  $ for all $a,b\in\mathbb{K}$. In other words, Claim 14
holds for $n=k+1$. This completes the induction step. Thus, Claim 14 is proven.]

\begin{statement}
\textit{Claim 15:} We have $n\left(  ab\right)  =\left(  na\right)  b=a\left(
nb\right)  $ for all $a,b\in\mathbb{K}$ and $n\in\mathbb{Z}$.
\end{statement}

[\textit{Proof of Claim 15:} Let $a,b\in\mathbb{K}$ and $n\in\mathbb{Z}$. We
must prove that $n\left(  ab\right)  =\left(  na\right)  b=a\left(  nb\right)
$. If $n\in\mathbb{N}$, then this follows from Claim 14. Hence, for the rest
of this proof, we WLOG assume that we don't have $n\in\mathbb{N}$. Thus, we
have $n\in\mathbb{Z}$ but not $n\in\mathbb{N}$. Hence, $n\in\mathbb{Z}%
\setminus\mathbb{N}=\left\{  -1,-2,-3,\ldots\right\}  $. In other words,
$n<0$. Hence, $-n>0$, so that $-n\in\mathbb{N}$. Hence, Claim 14 (applied to
$-n$ instead of $n$) yields $\left(  -n\right)  \left(  ab\right)  =\left(
\left(  -n\right)  a\right)  b=a\left(  \left(  -n\right)  b\right)  $.

Proposition \ref{prop.rings.inv-add.rules} \textbf{(f)} (applied to $na$ and
$0$ instead of $a$ and $c$) yields $-\left(  \left(  na\right)  b\right)
=\left(  -\left(  na\right)  \right)  b=\left(  na\right)  \left(  -b\right)
$. Proposition \ref{prop.rings.inv-add.rules} \textbf{(f)} (applied to $nb$
and $0$ instead of $b$ and $c$) yields $-\left(  a\left(  nb\right)  \right)
=\left(  -a\right)  \left(  nb\right)  =a\left(  -\left(  nb\right)  \right)
$.

But Claim 2 (applied to $ab$ instead of $a$) yields $\left(  -n\right)
\left(  ab\right)  =-\left(  n\left(  ab\right)  \right)  $. Thus,%
\[
-\left(  n\left(  ab\right)  \right)  =\left(  -n\right)  \left(  ab\right)
=\underbrace{\left(  \left(  -n\right)  a\right)  }_{\substack{=-\left(
na\right)  \\\text{(by Claim 2)}}}b=\left(  -\left(  na\right)  \right)
b=-\left(  \left(  na\right)  b\right)
\]
(since $-\left(  \left(  na\right)  b\right)  =\left(  -\left(  na\right)
\right)  b$). Hence, Proposition \ref{prop.rings.inv-add.rules} \textbf{(l)}
(applied to $n\left(  ab\right)  $, $\left(  na\right)  b$ and $0$ instead of
$a$, $b$ and $c$) yields $n\left(  ab\right)  =\left(  na\right)  b$.

Also,
\[
-\left(  n\left(  ab\right)  \right)  =\left(  -n\right)  \left(  ab\right)
=a\underbrace{\left(  \left(  -n\right)  b\right)  }_{\substack{=-\left(
nb\right)  \\\text{(by Claim 2, applied}\\\text{to }b\text{ instead of
}a\text{)}}}=a\left(  -\left(  nb\right)  \right)  =-\left(  a\left(
nb\right)  \right)
\]
(since $-\left(  a\left(  nb\right)  \right)  =a\left(  -\left(  nb\right)
\right)  $). Hence, Proposition \ref{prop.rings.inv-add.rules} \textbf{(l)}
(applied to $n\left(  ab\right)  $, $a\left(  nb\right)  $ and $0$ instead of
$a$, $b$ and $c$) yields $n\left(  ab\right)  =a\left(  nb\right)  $.

Combining the equalities $n\left(  ab\right)  =\left(  na\right)  b$ and
$n\left(  ab\right)  =a\left(  nb\right)  $, we obtain $n\left(  ab\right)
=\left(  na\right)  b=a\left(  nb\right)  $. This proves Claim 15.]

But Claim 15 is precisely (\ref{eq.prop.rings.Zscal.rules.nab}). Hence,
(\ref{eq.prop.rings.Zscal.rules.nab}) is proven. Thus, our proof of
Proposition \ref{prop.rings.Zscal.rules} is complete.
\end{proof}
\end{fineprint}

\begin{thebibliography}{999999999}                                                                                        %


\bibitem[AigZie18]{AigZie}%
\href{https://doi.org/10.1007/978-3-662-44205-0}{Martin Aigner, G\"{u}nter M.
Ziegler, \textit{Proofs from the Book}, 6th edition, Springer 2018.}

\bibitem[AloDub93]{AloDub93}Noga Alon and Moshe Dubiner, \textit{Zero-sum sets
of prescribed size}, in: \textquotedblleft Combinatorics, Paul Erd\H{o}s is
Eighty\textquotedblright, Bolyai Society, Mathematical Studies, Keszthely,
Hungary, 1993, pp. 33--50.\newline\url{https://m.tau.ac.il/~nogaa/PDFS/egz1.pdf}

\bibitem[AmaEsc05]{AmaEsc05}%
\href{https://doi.org/10.1007/978-3-7643-7756-4}{Herbert Amann, Joachim
Escher, \textit{Analysis I}, translated from the German by Gary Brookfield,
Birkh\"{a}user 2005}.

\bibitem[AndAnd14]{AndAnd14}%
\href{https://doi.org/10.1007/978-0-8176-8415-0}{Titu Andreescu, Dorin
Andrica, \textit{Complex Numbers from A to\ldots Z}, 2nd edition, Springer
2014.}

\bibitem[Armstr18]{Armstrong}Drew Armstrong, \textit{Abstract Algebra I
\&\ Abstract Algebra II}, 2019.\newline I:
\url{https://www.math.miami.edu/~armstrong/561fa18.php} ;\newline II: \url{https://www.math.miami.edu/~armstrong/562sp19.php}

\bibitem[Artin10]{Artin}Michael Artin, \textit{Algebra}, 2nd edition, Pearson 2010.

\bibitem[Boreic08]{Boreic08}Iurie Boreico, \textit{Linear Independence of
Radicals}, The Harvard College Mathematics Review 2.1 (2008).\newline\url{https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.630.1024&rep=rep1&type=pdf}

\bibitem[Bosch18]{Bosch}Siegfried Bosch, \textit{Algebra -- From the Viewpoint
of Galois Theory}, Springer 2018. \newline\url{https://www.springer.com/la/book/9783319951768}

\bibitem[Bump02]{Bump02}Daniel Bump, \textit{Mathematics of the Rubik's Cube},
lecture notes (in 2 versions).\newline\url{http://sporadic.stanford.edu/bump/match/rubik.html}

\bibitem[Burton10]{Burton}David M. Burton, \textit{Elementary Number Theory},
7th edition, McGraw-Hill 2010.

\bibitem[Carrel05]{Carrel05}James B. Carrell, \textit{Fundamentals of Linear
Algebra}, 31 October 2005.\newline\url{https://www.math.ubc.ca/~carrell/NB.pdf}

\bibitem[Carrel17]{Carrel17}James B. Carrell, \textit{Groups, Matrices, and
Vector Spaces: A Group Theoretic Approach}, Springer 2017.\newline\url{https://dx.doi.org/10.1007/978-0-387-79428-0}

\bibitem[Childs00]{Childs00}%
\href{https://doi.org/10.1007/978-0-387-74725-5}{Lindsay N. Childs, \textit{A
Concrete Introduction to Higher Algebra}, 3rd edition, Springer 2009}.

\bibitem[CoLiOs15]{CoLiOs15}David A. Cox, John Little, Donal O'Shea,
\textit{Ideals, Varieties, and Algorithms}, Undergraduate Texts in
Mathematics, 4th edition, Springer 2015.\newline\url{https://dx.doi.org/10.1007/978-3-319-16721-3}

\bibitem[Conrad*]{Conrad*}Keith Conrad, \textit{Expository notes
(\textquotedblleft blurbs\textquotedblright)}.\newline\url{https://kconrad.math.uconn.edu/blurbs/}

\bibitem[ConradD]{Conrad-dim}Keith Conrad, \textit{The dimension of a vector
space}.\newline\url{https://kconrad.math.uconn.edu/blurbs/linmultialg/dimension.pdf}

\bibitem[ConradE]{Conrad-Euler}Keith Conrad, \textit{Euler's theorem}.\newline\url{https://kconrad.math.uconn.edu/blurbs/ugradnumthy/eulerthm.pdf}

\bibitem[ConradF]{Conrad-FF}Keith Conrad, \textit{Finite fields}, 4 February
2018.\newline\url{https://kconrad.math.uconn.edu/blurbs/galoistheory/finitefields.pdf}

\bibitem[ConradG]{Conrad-Gauss}Keith Conrad, \textit{The Gaussian
integers}.\newline\url{https://kconrad.math.uconn.edu/blurbs/ugradnumthy/Zinotes.pdf}

\bibitem[ConradI]{Conrad-Induction}Keith Conrad, \textit{Examples of proofs by
induction}.\newline\url{https://kconrad.math.uconn.edu/blurbs/proofs/induction.pdf}

\bibitem[ConradS]{Conrad-subPID}Keith Conrad, \textit{Modules over a
PID}.\newline\url{https://kconrad.math.uconn.edu/blurbs/linmultialg/modulesoverPID.pdf}

\bibitem[ConradW]{Conrad-Well}Keith Conrad, \textit{Well-defined
functions}.\newline\url{https://kconrad.math.uconn.edu/blurbs/proofs/welldefined.pdf}

\bibitem[Cox13]{Cox13}David A. Cox, \textit{Primes of the form }$x^{2}+ny^{2}%
$, Wiley, 2nd edition 2013.

\bibitem[daSilv12]{daSilv12}%
\href{https://math.stackexchange.com/users/10704/}{Patrick Da Silva},
\textit{\href{https://math.stackexchange.com/questions/108296/polynomial-in-mathbbqx-sending-integers-to-integers}{\textit{Polynomial
in }$\mathbb{Q}\left[  x\right]  $\textit{ sending integers to integers?},
math.stackexchange answer \#108318}}.

\bibitem[Day16]{Day}Martin V. Day, \textit{An Introduction to Proofs and the
Mathematical Vernacular}, 7 December 2016.\newline%
\url{https://www.math.vt.edu/people/day/ProofsBook/IPaMV.pdf} .

\bibitem[DumFoo04]{Dummit-Foote}David S. Dummit, Richard M. Foote,
\textit{Abstract Algebra}, 3rd edition, Wiley 2004. \newline See
\url{http://www.cems.uvm.edu/~rfoote/errata_3rd_edition.pdf} for errata.

\bibitem[Dummit16]{Dummit16}Evan Dummit, \textit{Mathematical Cryptography,
Spring 2016}, handouts.\newline\url{https://math.la.asu.edu/~dummit/handouts.html}

\bibitem[Elman18]{Elman18}Richard Elman, \textit{Lectures on Abstract
Algebra}, 17 September 2018.\newline\url{https://www.math.ucla.edu/~rse/algebra_book.pdf}

\bibitem[ErGiZi61]{ErGiZi61}P. Erd\H{o}s, A. Ginzburg, A. Ziv, \textit{Theorem
in the additive number theory}, Bull. Research Council Israel 10F (1961), pp.
41--43.\newline\url{https://pdfs.semanticscholar.org/2860/2b7734c115bbab7141a1942a2c974057ddc0.pdf}

\bibitem[Escofi01]{Escofi01}%
\href{https://dx.doi.org/10.1007/978-1-4613-0191-2}{Jean-Pierre Escofier,
\textit{Galois Theory}, translated by Leila Schneps, Springer 2001}.

\bibitem[Galvin17]{Galvin}David Galvin, \textit{Basic discrete mathematics},
13 December 2017.\newline%
\url{http://www-users.math.umn.edu/~dgrinber/comb/60610lectures2017-Galvin.pdf}
\newline(The URL might change, and the text may get updated. In order to
reliably obtain the version of 13 December 2017, you can use the archive.org
Wayback Machine:
\url{https://web.archive.org/web/20180205122609/http://www-users.math.umn.edu/~dgrinber/comb/60610lectures2017-Galvin.pdf}
.)

\bibitem[GalQua17]{Gallier-RSA}Jean Gallier, Jocelyn Quaintance, \textit{Notes
on Primality Testing And Public Key Cryptography, Part 1}, 27 February
2019.\newline\url{https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf}

\bibitem[GalQua18]{GalQua18}Jean Gallier and Jocelyn Quaintance,
\textit{Algebra, Topology, Differential Calculus, and Optimization Theory For
Computer Science and Engineering}, 2 August 2019.\newline\url{https://www.cis.upenn.edu/~jean/gbooks/geomath.html}

\bibitem[Garret03]{Garret03}Paul Garrett, \textit{Crypto and Number Theory},
slides, 2003.\newline\url{http://www-users.math.umn.edu/~garrett/crypto/}

\bibitem[Garret07]{Garret07}Paul Garrett, \textit{The Mathematics of Coding:
Information, Compression, Error Correction, and Finite Fields}, 2007.\newline\url{http://www-users.math.umn.edu/~garrett/coding/CodingNotes.pdf}

\bibitem[Goodma16]{Goodman}Frederick M. Goodman, \textit{Algebra: Abstract and
Concrete}, edition 2.6, 12 October 2016.\newline\url{https://homepage.divms.uiowa.edu/~goodman/algebrabook.dir/algebrabook.html}

\bibitem[Granvi05]{Granvi05}Andrew Granville, \textit{Binomial coefficients
modulo prime powers}, preprint.\newline\url{https://web.archive.org/web/20181024055320/http://ebooks.bharathuniv.ac.in/gdlc1/gdlc1/Engineering Merged Library v3.0/Andrew Granville/Binomial Coefficients Modulo Prime Powers (5579)/Binomial Coefficients Modulo Prime Powers - Andrew Granville.pdf}

\bibitem[Grinbe15]{detnotes}Darij Grinberg, \textit{Notes on the combinatorial
fundamentals of algebra}, 10 January 2019.\newline%
\url{https://www.cip.ifi.lmu.de/~grinberg/primes2015/sols.pdf} \newline The
numbering of theorems and formulas in this link might shift when the project
gets updated; for a \textquotedblleft frozen\textquotedblright\ version whose
numbering is guaranteed to match that in the citations above, see
\url{https://github.com/darijgr/detnotes/releases/tag/2019-01-10} or
\href{https://arxiv.org/abs/2008.09862v1}{arXiv:2008.09862v1}.

\bibitem[Grinbe16]{floor}Darij Grinberg, \textit{18.781 (Spring 2016): Floor
and arithmetic functions}, 13 April 2019.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/floor.pdf}

\bibitem[Grinbe17]{lucas}Darij Grinberg, \textit{The Lucas and Babbage
congruences}, 10 January 2019.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/lucascong.pdf}

\bibitem[Grinbe18]{lina}Darij Grinberg, \textit{Notes on linear algebra},
version of 13 December 2016.\newline\url{https://github.com/darijgr/lina}

\bibitem[Grinbe19a]{regpol}Darij Grinberg, \textit{Regular elements of a ring,
monic polynomials and \textquotedblleft lcm-coprimality\textquotedblright},
2019.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/algebra/regpol.pdf}

\bibitem[Grinbe19b]{fpnexists}Darij Grinberg, \textit{The existence of finite
fields, again}, 31 May 2019.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/t/19s/fpnexists.pdf}

\bibitem[GrKnPa94]{GKP}Ronald L. Graham, Donald E. Knuth, Oren Patashnik,
\textit{Concrete Mathematics, Second Edition}, Addison-Wesley 1994.\newline
See \url{https://www-cs-faculty.stanford.edu/~knuth/gkp.html} for errata.

\bibitem[Hammac18]{Hammack}Richard Hammack, \textit{Book of Proof}, 3rd
edition 2018.\newline\url{https://www.people.vcu.edu/~rhammack/BookOfProof/}

\bibitem[Heffer17]{Hefferon}Jim Hefferon, \textit{Linear Algebra}, 3rd edition
2017.\newline\url{http://joshua.smcvt.edu/linearalgebra/}

\bibitem[Hunger03]{Hungerford-03}%
\href{https://link.springer.com/book/10.1007/978-1-4612-6101-8}{Thomas W.
Hungerford, \textit{Algebra}, 12th printing, Springer 2003.}

\bibitem[Hunger14]{Hungerford}Thomas W. Hungerford, \textit{Abstract Algebra:
An Introduction}, 3rd edition, Brooks/Cole 2014.

\bibitem[Jia13]{Jia13}Yan-Bin Jia, \textit{Quaternions and Rotations (Com S
477/577 Notes)}, 10 September 2013.\newline\url{https://graphics.stanford.edu/courses/cs348a-17-winter/Papers/quaternion.pdf}

\bibitem[Joyner08]{Joyner08}W. D. Joyner, \textit{Mathematics of the Rubik's
cube}, 19 August 2008.\newline%
\url{https://web.archive.org/web/20160304122348/http://www.permutationpuzzles.org/rubik/webnotes/}
(link to the PDF at the bottom).

\bibitem[Knapp16a]{Knapp1}Anthony W. Knapp, \textit{Basic Algebra}, digital
2nd edition 2016. \newline\url{https://www.math.stonybrook.edu/~aknapp/download.html}

\bibitem[Knapp16b]{Knapp2}Anthony W. Knapp, \textit{Advanced Algebra}, digital
2nd edition 2016. \newline\url{https://www.math.stonybrook.edu/~aknapp/download.html}

\bibitem[Knuth98]{TAoCP2}Donald Ervin Knuth, \textit{The art of computer
programming, volume 2}, Addison--Wesley 1998.

\bibitem[LaNaSc16]{LaNaSc16}Isaiah Lankham, Bruno Nachtergaele, Anne
Schilling, \textit{Linear Algebra As an Introduction to Abstract Mathematics},
2016.\newline\url{https://www.math.ucdavis.edu/~anne/linear_algebra/mat67_course_notes.pdf}

\bibitem[LeLeMe18]{LeLeMe}Eric Lehman, F. Thomson Leighton, Albert R. Meyer,
\textit{Mathematics for Computer Science}, revised Tuesday 6th June
2018.\newline\url{https://courses.csail.mit.edu/6.042/spring18/mcs.pdf} .

\bibitem[LidNie97]{LidNie97}Rudolf Lidl, Harald Niederreiter, \textit{Finite
fields}, 2nd edition, Cambridge University Press 1997.

\bibitem[Loehr11]{Loehr-BC}%
\href{https://www.math.vt.edu/people/nloehr/bijbook.html}{Nicholas A. Loehr,
\textit{Bijective Combinatorics}, Chapman \& Hall/CRC 2011.}

\bibitem[Mate14]{Mate14}Attila Mat\'{e}, \textit{Determinants}, version 1
October 2017.\newline\url{http://www.sci.brooklyn.cuny.edu/~mate/misc/determinants.pdf}

\bibitem[Muir30]{Muir}%
\href{http://phalanstere.univ-mlv.fr/~al/#Classiques}{Thomas Muir, \textit{The
theory of determinants in the historical order of development}, 5 volumes
(1906--1930), later reprinted by Dover.}

\bibitem[MuiMet60]{MuiMet60}Thomas Muir, \textit{A Treatise on the Theory of
Determinants}, revised and enlarged by William H. Metzler, Dover 1960.

\bibitem[Mestro14]{Mestro14}\href{https://arxiv.org/abs/1409.3820v1}{Romeo
Me\v{s}trovi\'{c}, \textit{Lucas' theorem: its generalizations, extensions and
applications (1878--2014)}, arXiv:1409.3820v1.}

\bibitem[Milne17]{Milne17}James S. Milne, \textit{Group theory}, version
v3.14, March 17, 2017.\newline\url{https://www.jmilne.org/math/CourseNotes/gt.html}

\bibitem[Mulhol16]{Mulhol16}Jamie Mulholland, \textit{Permutation Puzzles: A
Mathematical Perspective},\newline\url{https://www.sfu.ca/~jtmulhol/math302/}

\bibitem[NiZuMo91]{NiZuMo91}Ivan Niven, Herbert S. Zuckerman, Hugh L.
Montgomery, \textit{An Introduction to the Theory of Numbers}, 5th edition 1991.

\bibitem[Payne09]{Payne09}S. E. Payne, \textit{A Second Semester of Linear
Algebra}, 19 January 2009.\newline\url{https://web.archive.org/web/20161207060453/http://math.ucdenver.edu/~spayne/classnotes/09LinAlg.pdf}

\bibitem[Pinkha15]{Pinkha15}Henry C. Pinkham, \textit{Linear Algebra}, draft
of a textbook, version 10 July 2015.\newline\url{https://www.math.columbia.edu/~pinkham/HCP_LinearAlgebra.pdf}

\bibitem[Pinter10]{Pinter}Charles C. Pinter, \textit{A book of abstract
algebra}, 2nd edition, Dover 2010.\newline\url{https://www.amazon.com/Book-Abstract-Algebra-Second-Mathematics/dp/0486474178}

\bibitem[Polya19]{Polya19}\href{https://eudml.org/doc/149483}{Georg P\'{o}lya,
\textit{\"{U}ber ganzwertige Polynome in algebraischen Zahlk\"{o}rpern},
Journal f\"{u}r die Reine und Angewandte Mathematik (Crelle's Journal),
\textbf{149} (1919), pp. 97--116}.

\bibitem[Rothma15]{Rothma15}\href{https://arxiv.org/abs/1308.2181v5}{Tony
Rothman, \textit{Cardano v Tartaglia: The Great Feud Goes Supernatural},
arXiv:1308.2181v5}, published in: The Mathematical Intelligencer, 36(4), pp. 53--66.

\bibitem[Siksek15]{Siksek}Samir Siksek, \textit{Introduction to Abstract
Algebra}, 2015.\newline\url{https://homepages.warwick.ac.uk/staff/S.Siksek/teaching/aa/aanotes.pdf}

\bibitem[Stewar15]{Stewar15}Ian Stewart, \textit{Galois theory}, 4th edition,
CRC Press 2015.\newline\url{http://matematicaeducativa.com/foro/download/file.php?id=1647}

\bibitem[Strick13]{Strickland}Neil Strickland, \textit{Linear mathematics for
applications}, 11 February 2020.\newline\url{https://neilstrickland.github.io/linear_maths/notes/linear_maths.pdf}

\bibitem[Swanso18]{Swanso18}Irena Swanson, \textit{Introduction to Analysis},
with construction of the number systems, 19 June 2019.\newline\url{https://people.reed.edu/~iswanson/analysisconstructR.pdf}

\bibitem[Tignol01]{Tignol}Jean-Pierre Tignol, \textit{Galois' Theory of
Algebraic Equations}, World Scientific 2001.

\bibitem[Trefet11]{Trefet11}Lloyd N. Trefethen, \textit{Six Myths of
Polynomial Interpolation and Quadrature}, Maths. Today \textbf{47} (2011), pp.
184--188.\newline\url{https://people.maths.ox.ac.uk/trefethen/publication/PDF/2011_139.pdf}

\bibitem[UspHea39]{Uspensky-Heaslet}J. V. Uspensky, M. A. Heaslet,
\textit{Elementary Number Theory}, McGraw-Hill 1939.

\bibitem[Vogan07]{Vogan07}%
\href{https://www.ams.org/notices/200709/tx070901122p.pdf}{David Vogan,
\textit{The Character Table for }$E_{8}$, Notices of the American Mathematical
Society 2007/09}.

\bibitem[Waerde91a]{Waerden1}B.L. van der Waerden, \textit{Algebra, Volume I},
translated 7th edition, Springer 1991.

\bibitem[Waerde91b]{Waerden2}B.L. van der Waerden, \textit{Algebra, Volume
II}, translated 5th edition, Springer 1991.

\bibitem[Walker87]{Walker87}%
\href{https://web.archive.org/web/20170809055317/https://www.math.nmsu.edu/~elbert/AbsAlgeb.pdf}{Elbert
A. Walker, \textit{Introduction to Abstract Algebra}, Random House/Birkhauser,
New York, 1987.}

\bibitem[Wan11]{Wan11}\href{https://doi.org/10.1142/8250}{Zhe-Xian Wan,
\textit{Finite fields and Galois rings}, World Scientific 2011}.

\bibitem[Ward91]{Ward91}James Ward, \textit{100 years of Dixon's identity},
Irish Mathematical Society Bulletin \textbf{27} (1991), pp. 46--54.\newline\url{https://www.maths.tcd.ie/pub/ims/bull27/bull27_46-54.pdf}

\bibitem[Warner71]{Warner71}Seth Warner, \textit{Classical Modern Algebra},
Prentice-Hall 1971.

\bibitem[Wilf94]{Wilf94}Herbert S. Wilf, \textit{generatingfunctionology},
1999.\newline\url{https://www.math.upenn.edu/~wilf/DownldGF.html}
\end{thebibliography}


\end{document}