\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[breaklinks=True]{hyperref}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{needspace}
\usepackage{tabls}
\usepackage{tikz}
\usepackage{bbding}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Thursday, February 09, 2023 17:22:23}
%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.meta}
\usetikzlibrary{chains}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations.pathmorphing}
\newcounter{exer}
\newcounter{exera}
\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{warning}[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{convention}[1][Convention]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\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}
\newcommand\arxiv[1]{\href{http://www.arxiv.org/abs/#1}{\texttt{arXiv:#1}}}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\setlength\textheight{22.5cm}
\setlength\textwidth{14.8cm}
\newenvironment{verlong}{}{}
\newenvironment{vershort}{}{}
\newenvironment{noncompile}{}{}
\excludecomment{verlong}
\includecomment{vershort}
\excludecomment{noncompile}
\newcommand{\defn}[1]{{\color{darkred}\emph{#1}}}
\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{\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{\are}{\ar@{-}}
\newcommand{\arebi}[1][]{\ar@{<-}@/_/[#1] \ar@/^/[#1]}
\newcommand{\of}{\text{ of }}
\newtheoremstyle{plainsl}
{8pt plus 2pt minus 4pt}
{8pt plus 2pt minus 4pt}
{\slshape}
{0pt}
{\bfseries}
{.}
{5pt plus 1pt minus 1pt}
{}
\theoremstyle{plainsl}
\ihead{Lecture 10, version \today}
\ohead{page \thepage}
\cfoot{}
\begin{document}
\section*{Math 221 Winter 2023, Lecture 10: Elementary number theory}

\textbf{website:}
\texttt{\href{https://www.cip.ifi.lmu.de/~grinberg/t/23wd}{\texttt{https://www.cip.ifi.lmu.de/\symbol{126}%
grinberg/t/23wd}}}

\setcounter{section}{2}

\section{Elementary number theory}

\setcounter{subsection}{3}

\subsection{Greatest common divisors (cont'd)}

\setcounter{subsubsection}{5}

Last time, we proved two important properties of gcds:

\setcounter{theo}{4}

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

\end{theorem}

\setcounter{theo}{7}

\begin{theorem}
[universal property of the gcd]\label{thm.ent.gcd.uniprop}Let $a,b,m\in
\mathbb{Z}$. Then, we have the equivalence%
\[
\left(  m\mid a\text{ and }m\mid b\right)  \ \Longleftrightarrow\ \left(
m\mid\gcd\left(  a,b\right)  \right)  .
\]

\end{theorem}

\setcounter{theo}{8}

We note that Theorem \ref{thm.ent.gcd.uniprop} is commonly used in the
\textquotedblleft$\Longrightarrow$\textquotedblright\ direction (since the
\textquotedblleft$\Longleftarrow$\textquotedblright\ direction is trivial).
That is, the following fact is used most of the time:

\begin{corollary}
[universal property of the gcd, forward direction]%
\label{cor.ent.gcd.uniprop.==>}Let $a,b,m\in\mathbb{Z}$. If $m\mid a$ and
$m\mid b$, then $m\mid\gcd\left(  a,b\right)  $.
\end{corollary}

\begin{proof}
This is the \textquotedblleft$\Longrightarrow$\textquotedblright\ direction of
Theorem \ref{thm.ent.gcd.uniprop}.
\end{proof}

\subsubsection{Factoring out a common factor from a gcd}

The following theorem has an \textquotedblleft intuitively
obvious\textquotedblright\ feel, but its proof is not as simple as you might suspect:

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

\end{theorem}

This is saying that when two integers have a common factor $s$, then this
common factor can be pulled out of their gcd. (The caveat is, of course, that
the common factor must be replaced by its absolute value, since a gcd cannot
be negative by definition.)

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.sasb}.]Let
\[
g=\gcd\left(  a,b\right)  \ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ h=\gcd\left(  sa,sb\right)  .
\]
Thus, we must prove that $h=\left\vert s\right\vert \cdot g$. Note that $h$
and $g$ are nonnegative (because Proposition 3.4.3 \textbf{(a)} from Lecture 9
shows that gcds are always nonnegative). Thus, $h=\left\vert h\right\vert $
and $g=\left\vert g\right\vert $, so that $\left\vert s\right\vert \cdot
g=\left\vert s\right\vert \cdot\left\vert g\right\vert =\left\vert
sg\right\vert $ (since $\left\vert x\right\vert \cdot\left\vert y\right\vert
=\left\vert xy\right\vert $ for any two real numbers $x$ and $y$).

Our goal is to prove that $h=\left\vert s\right\vert \cdot g$. Since
$h=\left\vert h\right\vert $ and $\left\vert s\right\vert \cdot g=\left\vert
sg\right\vert $, this amounts to proving that $\left\vert h\right\vert
=\left\vert sg\right\vert $. So this is our goal now.

One good way to prove that two integers $p$ and $q$ satisfy $\left\vert
p\right\vert =\left\vert q\right\vert $ is by showing that $p\mid q$ and
$q\mid p$. Indeed, from $p\mid q$ and $q\mid p$, it follows that $\left\vert
p\right\vert =\left\vert q\right\vert $ (by Proposition 3.1.4 \textbf{(c)} in
Lecture 7).

Thus, in order to prove that $\left\vert h\right\vert =\left\vert
sg\right\vert $, it will suffice to show that $h\mid sg$ and $sg\mid h$. Now,
let us do this.

\begin{itemize}
\item \textit{Proof of }$sg\mid h$\textit{:} We have $g=\gcd\left(
a,b\right)  \mid a$. Multiplying both sides by $s$, we thus obtain $sg\mid
sa$\ \ \ \ \footnote{\textquotedblleft Multiplying both sides by
$s$\textquotedblright\ means using the following simple fact: If two integers
$x$ and $y$ satisfy $x\mid y$, then $sx\mid sy$.}. Similarly, $sg\mid sb$.
Hence, Corollary \ref{cor.ent.gcd.uniprop.==>} (applied to $sg$, $sa$ and $sb$
instead of $m$, $a$ and $b$) yields $sg\mid\gcd\left(  sa,sb\right)  $. In
other words, $sg\mid h$ (since $h=\gcd\left(  sa,sb\right)  $).

\item \textit{First proof of }$h\mid sg$\textit{:} If $s=0$, then the claim
$h\mid sg$ is obvious (since $\underbrace{s}_{=0}g=0=h\cdot0$). Thus, let us
consider the case when $s\neq0$.

We have just showed that $sg\mid h$, but we also clearly have $s\mid sg$.
Thus, $s\mid sg\mid h$. Since $s\neq0$, this entails that $\dfrac{h}{s}%
\in\mathbb{Z}$ (by Proposition 3.1.4 \textbf{(d)} in Lecture 7, applied to $s$
and $h$ instead of $a$ and $b$).

This integer $\dfrac{h}{s}$ satisfies $s\cdot\dfrac{h}{s}=h=\gcd\left(
sa,sb\right)  \mid sa$. Dividing both sides by $s$, we thus obtain $\dfrac
{h}{s}\mid a$\ \ \ \ \footnote{\textquotedblleft Dividing both sides by
$s$\textquotedblright\ means using the following simple fact: If two integers
$x$ and $y$ satisfy $sx\mid sy$, then $x\mid y$. (Note that this relies on
$s\neq0$.)}. Similarly, $\dfrac{h}{s}\mid b$. Hence, Corollary
\ref{cor.ent.gcd.uniprop.==>} (applied to $m=\dfrac{h}{s}$) yields $\dfrac
{h}{s}\mid\gcd\left(  a,b\right)  $. In other words, $\dfrac{h}{s}\mid g$
(since $g=\gcd\left(  a,b\right)  $). Multiplying both sides by $s$, we thus
obtain $s\cdot\dfrac{h}{s}\mid sg$. In other words, $h\mid sg$. Thus, $h\mid
sg$ is proved.

\item \textit{Second proof of }$h\mid sg$\textit{:} We have $h=\gcd\left(
sa,sb\right)  \mid sa$. In other words, $sa=hu$ for some integer $u$.
Similarly, $sb=hv$ for some integer $v$. Consider these integers $u$ and $v$.

However, Bezout's theorem (Theorem \ref{thm.ent.gcd.bezout}) shows that there
exist two integers $x$ and $y$ such that $\gcd\left(  a,b\right)  =xa+yb$.
Consider these $x$ and $y$.

Now, $g=\gcd\left(  a,b\right)  =xa+yb$, so that%
\[
sg=s\left(  xa+yb\right)  =sxa+syb=\underbrace{sa}_{=hu}x+\underbrace{sb}%
_{=hv}y=hux+hvy=h\underbrace{\left(  ux+vy\right)  }_{\text{an integer}}.
\]
This again proves that $h\mid sg$.
\end{itemize}

We have now proved that $h\mid sg$ (proved in two different ways) and $sg\mid
h$. Hence, as explained above, we obtain $\left\vert h\right\vert =\left\vert
sg\right\vert $. As we also explained above, this completes our proof of
Theorem \ref{thm.ent.gcd.sasb}.
\end{proof}

\subsection{Coprime integers}

\subsubsection{Definition and examples}

Greatest common divisors are at their most useful when they are $1$. This is
called \textquotedblleft coprimality\textquotedblright:

\begin{definition}
\label{def.ent.coprime.coprime}Two integers $a$ and $b$ are said to be
\textbf{coprime} (or \textbf{relatively prime}) if $\gcd\left(  a,b\right)
=1$.
\end{definition}

\begin{remark}
This is a symmetric relation: If $a$ and $b$ are coprime, then $b$ and $a$ are
coprime (since $\gcd\left(  b,a\right)  =\gcd\left(  a,b\right)  $).
\end{remark}

\begin{example}
\textbf{(a)} An integer $n$ is coprime to $2$ if and only if $n$ is odd.
Indeed, we know that $\gcd\left(  n,2\right)  $ is a divisor of $2$ and is a
nonnegative integer (since any gcd is a nonnegative integer). Thus,
$\gcd\left(  n,2\right)  $ must be either $1$ or $2$ (since the only
nonnegative divisors of $2$ are $1$ and $2$). Now:

\begin{itemize}
\item If $\gcd\left(  n,2\right)  =2$, then $n$ is even (since $2=\gcd\left(
n,2\right)  \mid n$).

\item If $\gcd\left(  n,2\right)  =1$, then $n$ is odd (because otherwise, $2$
would be a common divisor of $n$ and $2$, but this cannot happen when the
greatest common divisor of $n$ and $2$ is $1$).
\end{itemize}

\textbf{(b)} An integer $n$ is coprime to $3$ if and only if $n$ is not
divisible by $3$. (This can be proved just as part \textbf{(a)}, since the
only nonnegative divisors of $3$ are $1$ and $3$.)

\textbf{(c)} An integer $n$ is coprime to $4$ if and only if $n$ is odd. (If
you expected \textquotedblleft... if $n$ is not divisible by $4$%
\textquotedblright\ here, then you were wrong. The nonnegative divisors of $4$
are not only $1$ and $4$ but also $2$.)

\textbf{(d)} An integer $n$ is coprime to $5$ if and only if $n$ is not
divisible by $5$. (This can be proved just as part \textbf{(a)}, since the
only nonnegative divisors of $5$ are $1$ and $5$.)
\end{example}

Informally, I think of coprimality as some sort of \textquotedblleft
unrelatedness\textquotedblright\ or \textquotedblleft
independence\textquotedblright\ or \textquotedblleft
orthogonality\textquotedblright\ or \textquotedblleft
noninterference\textquotedblright\ relation. In other words, two integers $a$
and $b$ are coprime if and only if they have \textquotedblleft nothing to do
with each other\textquotedblright, in some sense. This is nowhere near a
rigorous statement, but it motivates many properties of coprimality, including
the ones we will see below.

\subsubsection{Three theorems about coprimality}

The following three theorems are useful properties of coprime integers:

\begin{theorem}
[coprime divisors theorem]\label{thm.ent.coprime.ab|c}Let $a,b,c\in\mathbb{Z}$
satisfy $a\mid c$ and $b\mid c$. Assume that $a$ and $b$ are coprime. Then,
$ab\mid c$.

(In other words, a product of two coprime divisors of $c$ is again a divisor
of $c$.)
\end{theorem}

\begin{proof}
We have $ab\mid ac$ (since $b\mid c$) and $ba\mid bc$ (because $a\mid c$).
Since $ba=ab$ and $ac=ca$ and $bc=cb$, we can rewrite this as follows: We have
$ab\mid ca$ and $ab\mid cb$. Thus, Corollary \ref{cor.ent.gcd.uniprop.==>}
(applied to $ab$, $ca$ and $cb$ instead of $m$, $a$ and $b$) yields%
\begin{align*}
ab  &  \mid\gcd\left(  ca,cb\right)  =\left\vert c\right\vert \cdot
\underbrace{\gcd\left(  a,b\right)  }_{\substack{=1\\\text{(since }a\text{ is
coprime to }b\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.ent.gcd.sasb}}\right) \\
&  =\left\vert c\right\vert .
\end{align*}
Since divisibility does not depend on signs (Proposition 3.1.4 \textbf{(a)} in
Lecture 7), we thus obtain $ab\mid c$\ \ \ \ \footnote{Here is this argument
in detail: We have just proved that $ab\mid\operatorname*{abs}c$ (where we
write $\operatorname*{abs}x$ for $\left\vert x\right\vert $ in order to avoid
confusing absolute-value bars with divisibility symbols). Proposition 3.1.4
\textbf{(a)} in Lecture 7 shows that we have $ab\mid c$ if and only if
$\operatorname*{abs}\left(  ab\right)  \mid\operatorname*{abs}c$. However, the
same proposition shows that we have $ab\mid\operatorname*{abs}c$ if and only
if $\operatorname*{abs}\left(  ab\right)  \mid\operatorname*{abs}\left(
\operatorname*{abs}c\right)  $. Since $\operatorname*{abs}\left(
\operatorname*{abs}c\right)  =\operatorname*{abs}c$, the latter statement can
be rewritten as $\operatorname*{abs}\left(  ab\right)  \mid\operatorname*{abs}%
c$. Thus, both statements $ab\mid c$ and $ab\mid\operatorname*{abs}c$ are
equivalent to $\operatorname*{abs}\left(  ab\right)  \mid\operatorname*{abs}%
c$, and thus are equivalent to each other. Hence, from $ab\mid
\operatorname*{abs}c$, we obtain $ab\mid c$.}. This proves Theorem
\ref{thm.ent.coprime.ab|c}.
\end{proof}

\begin{example}
We have $4\mid56$ and $7\mid56$. Since $4$ and $7$ are coprime, we can thus
conclude (by Theorem \ref{thm.ent.coprime.ab|c}, applied to $a=4$, $b=7$ and
$c=56$) that $4\cdot7\mid56$.

In contrast, from $6\mid12$ and $4\mid12$, we cannot conclude that
$6\cdot4\mid12$, since $6$ and $4$ are not coprime.
\end{example}

\begin{fineprint}
In terms of our \textquotedblleft coprimality as
independence\textquotedblright\ heuristic, Theorem \ref{thm.ent.coprime.ab|c}
can be made intuitive as follows: If $a$ and $b$ are two coprime divisors of
$c$, then (because $a$ and $b$ are coprime) $a$ and $b$ must divide
\textquotedblleft different parts\textquotedblright\ of $c$, and thus their
product $ab$ is still a divisor of $c$. Of course, the notion of
\textquotedblleft different parts\textquotedblright\ here is not a real thing,
but it is helpful as a mnemonic device.
\end{fineprint}

\begin{theorem}
[coprime removal theorem]\label{thm.ent.coprime.a|c}Let $a,b,c\in\mathbb{Z}$
satisfy $a\mid bc$. Assume that $a$ is coprime to $b$. Then, $a\mid c$.
\end{theorem}

\begin{proof}
We have $a\mid ca$ and $a\mid bc=cb$. Thus, Corollary
\ref{cor.ent.gcd.uniprop.==>} (applied to $a$, $ca$ and $cb$ instead of $m$,
$a$ and $b$) yields
\begin{align*}
a  &  \mid\gcd\left(  ca,cb\right)  =\left\vert c\right\vert \cdot
\underbrace{\gcd\left(  a,b\right)  }_{\substack{=1\\\text{(since }a\text{ is
coprime to }b\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.ent.gcd.sasb}}\right) \\
&  =\left\vert c\right\vert .
\end{align*}
Since divisibility does not depend on signs, this means that $a\mid c$. Thus,
Theorem \ref{thm.ent.coprime.a|c} holds.
\end{proof}

\begin{example}
We have $6\mid7\cdot12$, but $6$ is coprime to $7$. Thus, Theorem
\ref{thm.ent.coprime.a|c} (applied to $a=6$, $b=7$ and $c=12$) yields
$6\mid12$ (as if you didn't know this already).

But we cannot obtain $6\mid7$ from $6\mid12\cdot7$, since $6$ is not coprime
to $12$.
\end{example}

\begin{fineprint}
Again, Theorem \ref{thm.ent.coprime.a|c} can be motivated using the
\textquotedblleft independence\textquotedblright\ view on coprimality: If $a$
is coprime to $b$, then $b$ cannot be the \textquotedblleft
reason\textquotedblright\ for the divisibility $a\mid bc$, and thus $b$ can be
removed from this divisibility. Again, this is neither a proof nor even a
rigorous statement, but it makes Theorem \ref{thm.ent.coprime.a|c} looks less surprising.
\end{fineprint}

\begin{theorem}
[coprime product theorem]\label{thm.ent.coprime.ab-co-c}Let $a,b,c\in
\mathbb{Z}$. Assume that each of the numbers $a$ and $b$ is coprime to $c$.
Then, $ab$ is also coprime to $c$.
\end{theorem}

\begin{proof}
Let $g=\gcd\left(  ab,c\right)  $. Thus, we must prove that $g=1$.

We have $g=\gcd\left(  ab,c\right)  \mid ab$ and $g=\gcd\left(  ab,c\right)
\mid c\mid ac$. Hence, Corollary \ref{cor.ent.gcd.uniprop.==>} (applied to
$g$, $ab$ and $ac$ instead of $m$, $a$ and $b$) yields
\begin{align*}
g  &  \mid\gcd\left(  ab,ac\right)  =\left\vert a\right\vert \cdot
\underbrace{\gcd\left(  b,c\right)  }_{\substack{=1\\\text{(because }b\text{
is coprime to }c\text{)}}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.ent.gcd.sasb}}\right) \\
&  =\left\vert a\right\vert \cdot1=\left\vert a\right\vert .
\end{align*}
Hence, $g\mid a$ (since divisibility does not depend on signs). Combining this
with $g\mid c$, we obtain $g\mid\gcd\left(  a,c\right)  $ (by Corollary
\ref{cor.ent.gcd.uniprop.==>}, applied to $g$, $a$ and $c$ instead of $m$, $a$
and $b$). However, $\gcd\left(  a,c\right)  =1$ (since $a$ is coprime to $c$),
so we obtain $g\mid\gcd\left(  a,c\right)  =1$.

However, $g$ is a nonnegative integer (since any gcd is a nonnegative
integer). Thus, $g$ is a nonnegative divisor of $1$ (since $g\mid1$). Since
the only nonnegative divisor of $1$ is $1$, we thus conclude that $g=1$.
Hence, $\gcd\left(  ab,c\right)  =g=1$. This shows that $ab$ is coprime to
$c$, and we have proved Theorem \ref{thm.ent.coprime.ab-co-c}.
\end{proof}

\begin{example}
Each of the numbers $3$ and $4$ is coprime to $5$. Thus, Theorem
\ref{thm.ent.coprime.ab-co-c} (applied to $a=3$, $b=4$ and $c=5$) yields that
$3\cdot4$ is coprime to $5$.
\end{example}

\begin{fineprint}
Again, Theorem \ref{thm.ent.coprime.ab-co-c} can be viewed within the
\textquotedblleft independence\textquotedblright\ paradigm: If each of $a$ and
$b$ is coprime to $c$, then so should be $ab$, because any \textquotedblleft
dependence\textquotedblright\ between $ab$ and $c$ should come from $a$ or
from $b$. Alternatively, if you think of coprimality as an analogue of
orthogonality, then you can view Theorem \ref{thm.ent.coprime.ab-co-c} as an
analogue of the fact that if two vectors $\overrightarrow{a}$ and
$\overrightarrow{b}$ are both orthogonal to a given vector $\overrightarrow{c}%
$, then so is their sum $\overrightarrow{a}+\overrightarrow{b}$. Again, none
of these metaphors should be mistaken for a proof of Theorem
\ref{thm.ent.coprime.ab-co-c}.
\end{fineprint}

\begin{fineprint}
Theorems \ref{thm.ent.coprime.ab|c}, \ref{thm.ent.coprime.a|c} and
\ref{thm.ent.coprime.ab-co-c} can be generalized, dropping some of the
coprimality assumptions (but leading to less memorable results). Here is the
generalization of Theorem \ref{thm.ent.coprime.ab|c}:

\begin{theorem}
\label{thm.ent.coprime.ab|c-gen}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{proof}
Read our above proof of Theorem \ref{thm.ent.coprime.ab|c} until the point
where it shows that $ab\mid\left\vert c\right\vert \cdot\gcd\left(
a,b\right)  $. Now, observe that $\left\vert c\right\vert $ divides $c$ (since
$\left\vert c\right\vert $ is either $c$ or $-c$), and thus $\left\vert
c\right\vert \cdot\gcd\left(  a,b\right)  $ divides $c\cdot\gcd\left(
a,b\right)  $. Hence,%
\[
ab\mid\left\vert c\right\vert \cdot\gcd\left(  a,b\right)  \mid c\cdot
\gcd\left(  a,b\right)  =\gcd\left(  a,b\right)  \cdot c.
\]
This proves Theorem \ref{thm.ent.coprime.ab|c-gen}.
\end{proof}

Here is the generalization of Theorem \ref{thm.ent.coprime.a|c}:

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

\begin{proof}
Read our above proof of Theorem \ref{thm.ent.coprime.a|c} until the point
where it shows that $a\mid\left\vert c\right\vert \cdot\gcd\left(  a,b\right)
$. Now, observe that $\left\vert c\right\vert $ divides $c$ (since $\left\vert
c\right\vert $ is either $c$ or $-c$), and thus $\left\vert c\right\vert
\cdot\gcd\left(  a,b\right)  $ divides $c\cdot\gcd\left(  a,b\right)  $.
Hence,%
\[
a\mid\left\vert c\right\vert \cdot\gcd\left(  a,b\right)  \mid c\cdot
\gcd\left(  a,b\right)  =\gcd\left(  a,b\right)  \cdot c.
\]
This proves Theorem \ref{thm.ent.coprime.a|c-gen}.
\end{proof}
\end{fineprint}

\subsubsection{Reducing a fraction}

Here is one more property of gcds:

\begin{theorem}
\label{thm.ent.gcd.reduce}Let $a$ and $b$ be two integers that are not both
$0$. Let $g=\gcd\left(  a,b\right)  $. Then, the integers $\dfrac{a}{g}$ and
$\dfrac{b}{g}$ are coprime.
\end{theorem}

This theorem is important for understanding rational numbers. Indeed, a ratio
$\dfrac{u}{v}$ of two integers is said to be in \textbf{reduced form} if $u$
and $v$ are coprime. Now, Theorem \ref{thm.ent.gcd.reduce} shows that if we
start with a ratio $\dfrac{a}{b}$ of two integers, and cancel $\gcd\left(
a,b\right)  $ from the numerator and the denominator, then the result will be
a ratio in reduced form. Hence, each rational number can be brought to a
reduced form. For example, $\dfrac{12}{21}=\dfrac{12/3}{21/3}=\dfrac{4}{7}$.

\begin{proof}
[Proof of Theorem \ref{thm.ent.gcd.reduce}.]Since $a$ and $b$ are not both
$0$, we have $\gcd\left(  a,b\right)  \neq0$ (since $0$ cannot divide any
nonzero integer). Since we know that $\gcd\left(  a,b\right)  \in\mathbb{N}$,
we thus conclude that $\gcd\left(  a,b\right)  >0$. In other words, $g>0$
(since $g=\gcd\left(  a,b\right)  $). Thus, $\dfrac{a}{g}$ and $\dfrac{b}{g}$
are well-defined. Also, from $g>0$, we obtain $\left\vert g\right\vert =g$.

Since $g=\gcd\left(  a,b\right)  $, we have $g\mid a$ and $g\mid b$. Hence,
$\dfrac{a}{g}$ and $\dfrac{b}{g}$ are integers. Moreover,
\begin{align*}
g  &  =\gcd\left(  a,b\right)  =\gcd\left(  g\cdot\dfrac{a}{g},\ g\cdot
\dfrac{b}{g}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }a=g\cdot
\dfrac{a}{g}\text{ and }b=g\cdot\dfrac{b}{g}\right) \\
&  =\underbrace{\left\vert g\right\vert }_{=g}\cdot\gcd\left(  \dfrac{a}%
{g},\dfrac{b}{g}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Theorem \ref{thm.ent.gcd.sasb},}\\
\text{since }\dfrac{a}{g}\text{ and }\dfrac{b}{g}\text{ are integers}%
\end{array}
\right) \\
&  =g\cdot\gcd\left(  \dfrac{a}{g},\dfrac{b}{g}\right)  .
\end{align*}
Dividing this equality by $g$, we find%
\[
1=\gcd\left(  \dfrac{a}{g},\dfrac{b}{g}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{since }g\neq0\right)  .
\]
This shows that $\dfrac{a}{g}$ and $\dfrac{b}{g}$ are coprime. Thus, Theorem
\ref{thm.ent.gcd.reduce} is proven.
\end{proof}

\subsection{Prime numbers}

\subsubsection{Definition}

The following is one of the most famous concepts in mathematics:

\begin{definition}
\label{def.ent.prime.prime}An integer $n>1$ is said to be \textbf{prime} (or
\textbf{a prime}) if the only positive divisors of $n$ are $1$ and $n$.
\end{definition}

The first few primes (= prime numbers) are%
\[
2,\ \ 3,\ \ 5,\ \ 7,\ \ 11,\ \ 13,\ \ 17,\ \ 19,\ \ 23,\ \ 29,\ \ 31,\ \ 37,\ \ 41,\ \ 43.
\]


It can be shown that there are infinitely many primes (see Exercise 4
\textbf{(b)} on homework set \#4 for one proof).

\subsubsection{The friend-or-foe lemma}

The first property of primes that we will show is an important result that we
call the \textbf{friend-or-foe lemma}:

\begin{lemma}
[friend-or-foe lemma]\label{lem.ent.prime.fof}Let $p$ be a prime. Let
$n\in\mathbb{Z}$. Then, $n$ is either divisible by $p$ or coprime to $p$, but
not both.
\end{lemma}

\begin{proof}
The number $p$ is prime, and thus its only positive divisors are $1$ and $p$.
Since $\gcd\left(  n,p\right)  $ is a positive divisor of $p$ (this is easy to
see\footnote{\textit{Proof.} The number $\gcd\left(  n,p\right)  $ is a
divisor of $p$, and thus is nonzero (since $0$ does not divide $p$).
Furthermore, $\gcd\left(  n,p\right)  $ is nonnegative (since any gcd is
nonnegative). Thus, $\gcd\left(  n,p\right)  $ is positive. Hence,
$\gcd\left(  n,p\right)  $ is a positive divisor of $p$.}), we thus conclude
that $\gcd\left(  n,p\right)  $ must be either $1$ or $p$. So we are in one of
the following two cases:

\textit{Case 1:} We have $\gcd\left(  n,p\right)  =1$.

\textit{Case 2:} We have $\gcd\left(  n,p\right)  =p$.

Let us first consider Case 1. In this case, we have $\gcd\left(  n,p\right)
=1$. In other words, $n$ is coprime to $p$. Furthermore, the greatest common
divisor of $n$ and $p$ is $\gcd\left(  n,p\right)  =1$; therefore, $p$ cannot
be a common divisor of $n$ and $p$ (since $p>1$). Thus, $n$ is not divisible
by $p$ (since this would entail that $p$ is a common divisor of $n$ and $p$).
So we have shown that $n$ is coprime to $p$ and not divisible by $p$. Thus,
Lemma \ref{lem.ent.prime.fof} is proved in Case 1.

Let us now consider Case 2. In this case, we have $\gcd\left(  n,p\right)
=p\neq1$. Thus, $n$ is not coprime to $p$. Also, $p=\gcd\left(  n,p\right)
\mid n$ shows that $n$ is divisible by $p$. So we have shown that $n$ is
divisible by $p$ and not coprime to $p$. Hence, Lemma \ref{lem.ent.prime.fof}
is proved in Case 2.

We have now proved Lemma \ref{lem.ent.prime.fof} in both Cases 1 and 2; thus,
Lemma \ref{lem.ent.prime.fof} is fully proved.
\end{proof}

(The moniker \textquotedblleft friend-or-foe lemma\textquotedblright\ is
metaphorical: You can think of integers that are divisible by $p$ as
\textquotedblleft friends of $p$\textquotedblright, and think of integers
coprime to $p$ as \textquotedblleft foes of $p$\textquotedblright. Thus, a
prime number cleanly divides the integers into its \textquotedblleft
friends\textquotedblright\ and its \textquotedblleft foes\textquotedblright.
In contrast, the non-prime number $4$ has a more \textquotedblleft
nuanced\textquotedblright\ relationship with certain integers such as $2$
(since $2$ is neither divisible by $4$ nor coprime to $4$).)

\subsubsection{Binomial coefficients and primes}

The friend-or-foe lemma has myriad applications. As a first example, recall
Pascal's triangle (which we first saw in \S 2.4 in Lecture 5):%
\[
\hspace{-1.0076pc}\hspace{-0.3cm}%
\begin{tabular}
[c]{ll|ccccccccccccccccc}%
\vphantom{$\overset{k=0}{\swarrow}$} &  & $\phantom{20}$ & $\phantom{20}$ &
$\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ &  &  &  &
$\overset{k=0}{\swarrow}$ & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ &
$\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$ & $\phantom{20}$\\
\vphantom{$\overset{k=0}{\swarrow}$}$n=0$ & $\rightarrow$ &  &  &  &  &  &  &
&  & $1$ &  & $\overset{k=1}{\swarrow}$ &  &  &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=1$ & $\rightarrow$ &  &  &  &  &  &  &
& $1$ &  & $1$ &  & $\overset{k=2}{\swarrow}$ &  &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=2$ & $\rightarrow$ &  &  &  &  &  &  &
$1$ &  & $2$ &  & $1$ &  & $\overset{k=3}{\swarrow}$ &  &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=3$ & $\rightarrow$ &  &  &  &  &  & $1$
&  & $3$ &  & $3$ &  & $1$ &  & $\overset{k=4}{\swarrow}$ &  &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=4$ & $\rightarrow$ &  &  &  &  & $1$ &
& $4$ &  & $6$ &  & $4$ &  & $1$ &  & $\overset{k=5}{\swarrow}$ &  & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=5$ & $\rightarrow$ &  &  &  & $1$ &  &
$5$ &  & $10$ &  & $10$ &  & $5$ &  & $1$ &  & $\overset{k=6}{\swarrow}$ & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=6$ & $\rightarrow$ &  &  & $1$ &  & $6$
&  & $15$ &  & $20$ &  & $15$ &  & $6$ &  & $1$ &  & $\overset{k=7}{\swarrow}%
$\\
\vphantom{$\overset{k=0}{\swarrow}$}$n=7$ & $\rightarrow$ &  & $1$ &  & $7$ &
& $21$ &  & $35$ &  & $35$ &  & $21$ &  & $7$ &  & $1$ & \\
\vphantom{$\overset{k=0}{\swarrow}$}$n=8$ & $\rightarrow$ & $1$ &  & $8$ &  &
$28$ &  & $56$ &  & $70$ &  & $56$ &  & $28$ &  & $8$ &  & $1$%
\end{tabular}
\ \ \ \ \ \ \ \ \ \ \
\]


One property of Pascal's triangle that you might have already noticed is the
following: All entries in its $n=7$ row except for the two $1$'s (i.e., all
the binomial coefficients $\dbinom{7}{1},\dbinom{7}{2},\ldots,\dbinom{7}{6}$)
are divisible by $7$; all entries in the $n=5$ row except for the two $1$'s
are divisible by $5$; likewise for the $n=3$ and $n=2$ rows. The pattern here
can be generalized to any prime number instead of $7,5,3,2$:

\begin{theorem}
\label{thm.ent.prime.p|(pck)}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}
Exercise 5 \textbf{(a)} on homework set \#3 (applied to $n=p$) yields%
\[
k\dbinom{p}{k}=p\underbrace{\dbinom{p-1}{k-1}}_{\substack{\text{an
integer}\\\text{(by Theorem 2.5.11}\\\text{in Lecture 6)}}}.
\]
Thus, $p\mid k\dbinom{p}{k}$.

From $k\in\left\{  1,2,\ldots,p-1\right\}  $, we furthermore obtain $p\nmid k$
(because if we had $p\mid k$, then Proposition 3.1.4 \textbf{(b)} in Lecture 7
would entail $\left\vert p\right\vert \leq\left\vert k\right\vert $, which
would contradict $\left\vert k\right\vert =k\leq p-1<p=\left\vert p\right\vert
$). In other words, $k$ is not divisible by $p$.

But the friend-or-foe lemma (Lemma \ref{lem.ent.prime.fof}, applied to $n=k$)
says that $k$ is either divisible by $p$ or coprime to $p$. Since $k$ is not
divisible by $p$, we thus conclude that $k$ must be coprime to $p$. In other
words, $p$ is coprime to $k$. Hence, from $p\mid k\dbinom{p}{k}$, we obtain
$p\mid\dbinom{p}{k}$ using the coprime cancellation theorem (Theorem
\ref{thm.ent.coprime.a|c}, applied to $a=p$ and $b=k$ and $c=\dbinom{p}{k}$).
This proves Theorem \ref{thm.ent.prime.p|(pck)}.
\end{proof}

\subsubsection{Fermat's little theorem}

It is easy to see that every integer $a$ satisfies $a^{2}\equiv
a\operatorname{mod}2$. Indeed, the difference $a^{2}-a=a\left(  a-1\right)  $
is divisible by $2$, since at least one of the two consecutive integers $a$
and $a-1$ must be even and thus contributes a factor of $2$ to the product
$a\left(  a-1\right)  $.

Likewise, every integer $a$ satisfies $a^{3}\equiv a\operatorname{mod}3$,
since the difference $a^{3}-a=\left(  a-1\right)  a\left(  a+1\right)  $ is
divisible by $3$ (because at least one of the three consecutive integers
$a-1$, $a$ and $a+1$ must be divisible by $3$).

This pattern does not persist for $4$: Indeed, $a^{4}\equiv
a\operatorname{mod}4$ does not hold for $a=2$. However, for $5$, the pattern
emerges again: Every integer $a$ satisfies $a^{5}\equiv a\operatorname{mod}5$.
This is not as easy to see as the analogous claims for $a^{2}$ and $a^{3}$
(since $a^{5}-a$ does not factor into linear factors any more), but still can
be checked with a bit of work (there are only $5$ possible values for the
remainder $a\%5$, and each of these values allows us to check $a^{5}\equiv
a\operatorname{mod}5$ by reducing both sides modulo $5$).

The pattern is lost again for $6$ (the congruence $a^{6}\equiv
a\operatorname{mod}6$ fails for $a=2$), but reemerges for $7$.

As you may have guessed, there is a general result here:

\begin{theorem}
[Fermat's Little Theorem]\label{thm.ent.prime.flt}Let $p$ be a prime. Let
$a\in\mathbb{Z}$. Then,%
\[
a^{p}\equiv a\operatorname{mod}p.
\]

\end{theorem}

\begin{proof}
We shall induct on $a$. This will only cover the case $a\geq0$, so we will
have to handle the case $a<0$ by a separate argument afterwards.

\textit{Base case:} The congruence $a^{p}\equiv a\operatorname{mod}p$ clearly
holds for $a=0$ (since $0^{p}=0\equiv0\operatorname{mod}p$).

\textit{Induction step:} Let $a\in\mathbb{N}$. Assume (as the induction
hypothesis) that $a^{p}\equiv a\operatorname{mod}p$. We must prove that
$\left(  a+1\right)  ^{p}\equiv a+1\operatorname{mod}p$.

But the binomial formula (Theorem 2.6.1 in Lecture 6) yields%
\begin{align*}
\left(  a+1\right)  ^{p}  &  =\sum_{k=0}^{p}\dbinom{p}{k}a^{k}%
\underbrace{1^{p-k}}_{=1}=\sum_{k=0}^{p}\dbinom{p}{k}a^{k}\\
&  =\underbrace{\dbinom{p}{0}}_{=1}\underbrace{a^{0}}_{=1}+\sum_{k=1}%
^{p-1}\dbinom{p}{k}a^{k}+\underbrace{\dbinom{p}{p}}_{=1}a^{p}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have split off the addends}\\
\text{for }k=0\text{ and for }k=p\text{ from the sum}%
\end{array}
\right) \\
&  =1+\sum_{k=1}^{p-1}\dbinom{p}{k}a^{k}+a^{p}=\sum_{k=1}^{p-1}\dbinom{p}%
{k}a^{k}+a^{p}+1.
\end{align*}
In other words,%
\begin{equation}
\left(  a+1\right)  ^{p}-\left(  a^{p}+1\right)  =\sum_{k=1}^{p-1}\dbinom
{p}{k}a^{k}. \label{pf.thm.ent.prime.flt.3}%
\end{equation}


However, Theorem \ref{thm.ent.prime.p|(pck)} shows that each $k\in\left\{
1,2,\ldots,p-1\right\}  $ satisfies $p\mid\dbinom{p}{k}\mid\dbinom{p}{k}a^{k}%
$. In other words, $\dbinom{p}{k}a^{k}$ is a multiple of $p$ for each
$k\in\left\{  1,2,\ldots,p-1\right\}  $. Hence, $\sum_{k=1}^{p-1}\dbinom{p}%
{k}a^{k}$ is a sum of multiples of $p$, and thus itself a multiple of $p$.
That is, we have $p\mid\sum_{k=1}^{p-1}\dbinom{p}{k}a^{k}$. In view of
(\ref{pf.thm.ent.prime.flt.3}), we can rewrite this as $p\mid\left(
a+1\right)  ^{p}-\left(  a^{p}+1\right)  $. In other words,%
\begin{equation}
\left(  a+1\right)  ^{p}\equiv a^{p}+1\operatorname{mod}p.
\label{pf.thm.ent.prime.flt.4}%
\end{equation}


However, the induction hypothesis says that $a^{p}\equiv a\operatorname{mod}%
p$. Adding the obvious congruence $1\equiv1\operatorname{mod}p$ to this, we
obtain%
\[
a^{p}+1\equiv a+1\operatorname{mod}p.
\]
Combining this congruence with (\ref{pf.thm.ent.prime.flt.4}), we obtain%
\[
\left(  a+1\right)  ^{p}\equiv a^{p}+1\equiv a+1\operatorname{mod}p,
\]
which shows that $\left(  a+1\right)  ^{p}\equiv a+1\operatorname{mod}p$ (by
the transitivity of congruence). This completes the induction step.

Thus, Theorem \ref{thm.ent.prime.flt} is proved for all $a\geq0$. It remains
to prove it for all $a<0$ now. This can be done with a neat trick:

Let $a\in\mathbb{Z}$ satisfy $a<0$. Then, we must prove that $a^{p}\equiv
a\operatorname{mod}p$.

But we already know that $b^{p}\equiv b\operatorname{mod}p$ for all integers
$b\geq0$ (because we have already proved Theorem \ref{thm.ent.prime.flt} for
all $a\geq0$). We can apply this to $b=a\%p$ (since the remainder $a\%p$ is
$\geq0$), and thus obtain%
\[
\left(  a\%p\right)  ^{p}\equiv a\%p\operatorname{mod}p.
\]


However, Proposition 3.3.11 \textbf{(a)} (applied to $n=a$ and $d=p$) shows
that $a\%p\in\left\{  0,1,\ldots,p-1\right\}  $ and $a\%p\equiv
a\operatorname{mod}p$. We can take the congruence $a\%p\equiv
a\operatorname{mod}p$ to the $p$-th power, we obtain $\left(  a\%p\right)
^{p}\equiv a^{p}\operatorname{mod}p$ (we have here used Exercise 1
\textbf{(b)} on homework set \#3). Therefore, $a^{p}\equiv\left(  a\%p\right)
^{p}\operatorname{mod}p$. Combining all the congruences we have obtained so
far, we obtain%
\[
a^{p}\equiv\left(  a\%p\right)  ^{p}\equiv a\%p\equiv a\operatorname{mod}p,
\]
from which we can conclude that $a^{p}\equiv a\operatorname{mod}p$ (by
transitivity of congruence). Thus, we have proved Theorem
\ref{thm.ent.prime.flt} for $a<0$. This completes the proof of Theorem
\ref{thm.ent.prime.flt}.
\end{proof}

Fermat's Little Theorem has a bunch of applications, some of which we might
see later.

\begin{fineprint}
One wrinkle in the pattern we have discussed above: Theorem
\ref{thm.ent.prime.flt} shows that every prime $p$ satisfies $a^{p}\equiv
a\operatorname{mod}p$ for all $a\in\mathbb{Z}$. But there are some positive
integers $p$ that satisfy this even though they are not prime! The smallest
such integers are $1,\ \ 561,\ \ 1105,\ \ 1729,\ \ 2465$. See
\href{https://en.wikipedia.org/wiki/Carmichael_number}{Carmichael numbers} for
more details.
\end{fineprint}

\subsubsection{Prime divisor separation theorem}

You can think of the primes as \textquotedblleft inseparable\textquotedblright%
\ positive integers: They cannot be written as products of two smaller
positive integers. (Of course, $1$ also has this property but does not count
as a prime. In a way, $1$ is inseparable because there is nothing to separate,
so it doesn't count as a prime.)

One useful consequence of this \textquotedblleft
inseparability\textquotedblright\ is that if a prime $p$ divides a product
$ab$ of two integers, then it must divide one of the two factors $a$ and $b$,
since (speaking heuristically) it cannot be \textquotedblleft
separated\textquotedblright\ into a part that divides $a$ and a part that
divides $b$. Nevermind that this is not a valid argument, the conclusion is a
true fact:

\begin{theorem}
[prime divisor separation theorem]\label{thm.ent.prime.sep}Let $p$ be a prime.
Let $a,b\in\mathbb{Z}$ be such that $p\mid ab$. Then, $p\mid a$ or $p\mid b$.
\end{theorem}

\begin{proof}
[Proof of Theorem \ref{thm.ent.prime.sep}.]We shall prove the claim of Theorem
\ref{thm.ent.prime.sep} in the following equivalent form: \textquotedblleft If
$p\nmid a$, then $p\mid b$.\textquotedblright

Assume that $p\nmid a$. We must then prove that $p\mid b$.

The friend-or-foe lemma (Lemma \ref{lem.ent.prime.fof}) yields that $a$ is
either divisible by $p$ or coprime to $p$. Thus, $a$ is coprime to $p$ (since
$p\nmid a$). In other words, $p$ is coprime to $a$. Hence, we can use the
coprime cancellation theorem (Theorem \ref{thm.ent.coprime.a|c}, applied to
$p$, $a$ and $b$ instead of $a$, $b$ and $c$) to obtain $p\mid b$ from $p\mid
ab$. This is precisely what we wanted to prove. Theorem
\ref{thm.ent.prime.sep} is thus proved.
\end{proof}

Theorem \ref{thm.ent.prime.sep} shows that if a prime number $p$ divides a
product $ab$, then it must divide $a$ or $b$ (or both). In contrast, a
non-prime number like $4$ can divide a product $ab$ without dividing $a$ or
$b$. For example, $4\mid2\cdot6$ but $4\nmid2$ and $4\nmid6$.

We can extend Theorem \ref{thm.ent.prime.sep} to products of several factors:

\begin{corollary}
[prime divisor separation theorem for $k$ factors]\label{cor.ent.prime.sepk}%
Let $p$ be a prime. Let $a_{1},a_{2},\ldots,a_{k}\in\mathbb{Z}$ be 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\}  $.

(In words: If a prime divides a product of several integers, then it must
divide at least one of the factors.)
\end{corollary}

\begin{proof}
[Proof sketch.]Induct on $k$. In the induction step, use Theorem
\ref{thm.ent.prime.sep}. (The base case is the case $k=0$, in which case
Corollary \ref{cor.ent.prime.sepk} is vacuously true because $p\nmid1$.)
\end{proof}

\subsubsection{$p$-valuations}

We will need the following simple lemma:

\begin{lemma}
\label{lem.ent.prime.vpn.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}

\begin{proof}
The relation $p^{m}\mid n$ means that $\dfrac{n}{p^{m}}\in\mathbb{Z}$. In
other words, it means that we can divide $n$ by $p$ at least $m$ times without
obtaining a non-integer. So the claim of Lemma \ref{lem.ent.prime.vpn.wd} is
saying that there is a largest number of times that we can divide $n$ by $p$
without obtaining a non-integer. But this is clear: Every time we divide $n$
by $p$, the absolute value $\left\vert n\right\vert $ decreases (since $p>1$),
and obviously this cannot go on forever without eventually yielding a non-integer.

(See \cite[Proof of Lemma 2.13.22]{19s} for a more formal proof of Lemma
\ref{lem.ent.prime.vpn.wd}.)
\end{proof}

Lemma \ref{lem.ent.prime.vpn.wd} allows us to make the following definition:

\begin{definition}
\label{def.ent.prime.vpn}Let $p$ be a prime. \medskip

\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.vpn.wd}. Thus, $v_{p}\left(
n\right)  $ is the number of times that you can divide $n$ by $p$ without
getting a non-integer.)

This number $v_{p}\left(  n\right)  $ will be called the $p$%
\textbf{-valuation} (or the $p$\textbf{-adic valuation}) of $n$. \medskip

\textbf{(b)} In order to have $v_{p}\left(  n\right)  $ defined for all
integers $n$ (as opposed to just for nonzero $n$), we also define
$v_{p}\left(  0\right)  $ to be $\infty$ (because $0$ can be divided by $p$ an
arbitrary number of times without any changes). This symbol $\infty$ is not an
actual number, but we shall pretend that it behaves like a number at least in
some regards. In particular, we will eventually add or compare it to other
numbers. In doing so, we shall follow the rules that%
\begin{align*}
k+\infty &  =\infty+k=\infty\ \ \ \ \ \ \ \ \ \ \text{for all }k\in
\mathbb{Z};\\
\infty+\infty &  =\infty;\\
k  &  <\infty\text{ and }\infty>k\ \ \ \ \ \ \ \ \ \ \text{for all }%
k\in\mathbb{Z};\\
\max\left\{  \infty,k\right\}   &  =\max\left\{  k,\infty\right\}
=\infty\ \ \ \ \ \ \ \ \ \ \text{for all }k\in\mathbb{Z};\\
\min\left\{  \infty,k\right\}   &  =\min\left\{  k,\infty\right\}
=k\ \ \ \ \ \ \ \ \ \ \text{for all }k\in\mathbb{Z}.
\end{align*}
Thus, $\infty$ acts like a \textquotedblleft mythical number that is larger
than any actual number\textquotedblright. We can keep up this charade as long
as we only add and compare, but never subtract $\infty$ from anything (since
$1+\infty=\infty$ would turn into $1=0$ if you subtracted $\infty$).
\end{definition}

Next time, we will learn more about $p$-valuations.

\begin{thebibliography}{999}                                                                                              %


\bibitem[19s]{19s}Darij Grinberg, \textit{Introduction to Modern Algebra (UMN
Spring 2019 Math 4281 notes)}, 29 June 2019.\newline\url{http://www.cip.ifi.lmu.de/~grinberg/t/19s/notes.pdf}
\end{thebibliography}


\end{document}