\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{wasysym}
\usepackage{easytable}
\usepackage{ytableau}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Thursday, September 14, 2023 20:14:53}
%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}
\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{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}{\medskip \begin{small}}{\end{small} \medskip}
\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{warning}[1][Warning]{\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{http://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{\are}{\ar@{-}}
\newcommand{\nnn}{\nonumber\\}
\newcommand{\sslash}{\mathbin{/\mkern-6mu/}}
\newcommand{\numboxed}[2]{\underbrace{\boxed{#1}}_{\text{box } #2}}
\newcommand{\ig}[2]{\includegraphics[scale=#1]{#2.png}}
\iffalse
\NOEXPAND{\today}{\today}
\NOEXPAND{\sslash}{\sslash}
\NOEXPAND{\numboxed}[2]{\numboxed}
\fi
\ihead{Math 235 Fall 2021, Worksheet 5, version \today}
\ohead{page \thepage}
\cfoot{Darij Grinberg}
\begin{document}
\setcounter{section}{4}

\section{Math 235 Fall 2021, Worksheet 5: $p$-valuations}

On this worksheet, we will see how prime numbers and $p$-valuations can help
solve problems in number theory.

As before, $\mathbb{N}$ means the set $\left\{  0,1,2,\ldots\right\}  $.

\subsection{Primes}

We recall that an integer $p$ is said to be \emph{prime} if it is greater than
$1$ and its only positive divisors are $1$ and $p$. Thus, the first $10$
primes are $2,3,5,7,11,13,17,19,23,29$. An integer that is prime is also
called a \emph{prime number} or, for short, a \emph{prime}.

The following properties of primes are well-known (see, e.g., \cite[\S 9.1.2
and \S 9.1.3]{20f}):\footnote{Recall that an integer $a$ is said to be
\emph{coprime} to an integer $b$ if $\gcd\left(  a,b\right)  =1$.}

\begin{proposition}
\label{prop.pval.prime-div-exi}Each integer $n>1$ has at least one prime divisor.
\end{proposition}

\begin{proposition}
There are infinitely many primes.
\end{proposition}

\begin{proposition}
Let $p$ be a prime. Then, each $i\in\left\{  1,2,\ldots,p-1\right\}  $ is
coprime to $p$.
\end{proposition}

\begin{proposition}
Let $p$ be a prime. Let $a\in\mathbb{Z}$. Then, we have either $p\mid a$, or
the integer $p$ is coprime to $a$.
\end{proposition}

\begin{proposition}
\label{prop.pval.p-div-ab}Let $p$ be a prime. Let $a,b\in\mathbb{Z}$ satisfy
$p\mid ab$. Then, $p\mid a$ or $p\mid b$.
\end{proposition}

A crucial property of primes is that they are the \textquotedblleft
multiplicative building blocks\textquotedblright\ of all positive integers. In
other words:

\begin{theorem}
[Fundamental Theorem of Arithmetic]\label{thm.pval.fac-uni}Let $n$ be a
positive integer. Then, $n$ can be represented as a product of primes.
Moreover, this representation is unique up to the order of the factors.
\end{theorem}

For instance, the integer $200$ can be represented as a product of primes as
follows:%
\[
200=2\cdot2\cdot2\cdot5\cdot5.
\]
Of course, the factors in this product can be reordered at will (e.g., we can
get $200=2\cdot5\cdot2\cdot5\cdot2$). Theorem \ref{thm.pval.fac-uni} yields
that except for such reordering, there is no other way to write $200$ as a
product of primes.

Note that Theorem \ref{thm.pval.fac-uni} is perfectly valid for $n=1$; in this
case, the product is empty (and thus equals $1$ by definition).

Theorem \ref{thm.pval.fac-uni} is \cite[Theorem 9.2.5]{20f}; its proof can be
found in any text on elementary number theory (and many others\footnote{In
particular, it appears in \cite[\S 9.2]{20f}.}). Alternatively, you can treat
it as an exercise (hint: use Proposition \ref{prop.pval.prime-div-exi} for the
existence part, and Proposition \ref{prop.pval.p-div-ab} for the uniqueness).

The representation of a positive integer $n$ as a product of primes is called
the \emph{prime factorization} of $n$. (The definite article is more-or-less
justified by the uniqueness part of Theorem \ref{thm.pval.fac-uni}.)

\subsection{$p$-valuations}

We shall now introduce the notion of the \textquotedblleft$p$%
-valuation\textquotedblright\ of an integer $n$ (where $p$ is a prime).
Roughly speaking, this is counting how often $n$ can be divided by $p$ without
remainder, or, equivalently, how often $p$ appears in the prime factorization
of $n$ (when $n$ is positive). Here is the formal definition:

\begin{definition}
\label{def.pval.vp}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 (see \cite[Lemma 2.13.22]{19s} for a detailed proof). This
nonnegative integer $v_{p}\left(  n\right)  $ will be called the
$p$\emph{-valuation} (or the $p$\emph{-adic valuation}) of $n$. \medskip

\textbf{(b)} We extend this definition of $v_{p}\left(  n\right)  $ to the
case of $n=0$ by setting $v_{p}\left(  0\right)  :=\infty$. Here, $\infty$ is
a new symbol (\textquotedblleft positive infinity\textquotedblright) that is
supposed to model an \textquotedblleft infinitely large
number\textquotedblright; to some extent, we can do basic arithmetic with it
(using the rules $k+\infty=\infty+k=\infty$ and $k<\infty$ for all integers
$k$, as well as $\infty+\infty=\infty$), as long as we don't involve it in
subtraction, multiplication or division. (See \cite[Definition 9.3.1
\textbf{(b)}]{20f} for the details of what can and what cannot be done with
$\infty$.)
\end{definition}

\begin{example}
\label{exa.pval.vp}\textbf{(a)} We have $v_{3}\left(  18\right)  =2$. Indeed,
$2$ is the largest $m\in\mathbb{N}$ such that $3^{m}\mid18$ (because
$3^{2}\mid18$ but $3^{3}\nmid18$). \medskip

\textbf{(b)} We have $v_{3}\left(  14\right)  =0$. Indeed, $0$ is the largest
$m\in\mathbb{N}$ such that $3^{m}\mid14$ (because $3^{0}\mid14$ but
$3^{1}\nmid14$). \medskip

\textbf{(c)} We have $v_{3}\left(  51\right)  =1$ and $v_{3}\left(  54\right)
=3$. \medskip

\textbf{(d)} We have $v_{3}\left(  0\right)  =\infty$ (by Definition
\ref{def.pval.vp} \textbf{(b)}).
\end{example}

Let us now collect some properties of $p$-valuations. Almost all of them are
easy to prove, and all the proofs can be found in \cite[\S 9.3.1 and
\S 9.3.2]{20f}:

\begin{lemma}
\label{lem.pval.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{corollary}
\label{cor.pval.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{theorem}
\label{thm.pval.vp-ring}Let $p$ be a prime. \medskip

\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$. \medskip

\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$. \medskip

\textbf{(c)} We have $v_{p}\left(  1\right)  =0$. \medskip

\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}

\begin{corollary}
\label{cor.pval.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{proposition}
\label{prop.pval.vp-abs}Let $p$ be a prime. Let $n\in\mathbb{Z}$. Then,
$v_{p}\left(  \left\vert n\right\vert \right)  =v_{p}\left(  n\right)  $.
\end{proposition}

\begin{corollary}
\label{cor.pval.vp-pow}Let $p$ be a prime. Let $a\in\mathbb{Z}$ and
$k\in\mathbb{N}$. Then, $v_{p}\left(  a^{k}\right)  =kv_{p}\left(  a\right)  $.
\end{corollary}

\begin{proposition}
\label{prop.pval.mult-in-pf}Let $n$ be a positive integer. Let $n=a_{1}%
a_{2}\cdots a_{k}$ be a prime factorization of $n$ (where $a_{1},a_{2}%
,\ldots,a_{k}$ are primes). Let $p$ be a prime. Then,%
\[
\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{proposition}

Of course, Proposition \ref{prop.pval.mult-in-pf} just repeats what we have
said just before Definition \ref{def.pval.vp}: The $p$-valuation of $n$ is the
number of times that $p$ appears in the prime factorization of $n$.

Thanks to Proposition \ref{prop.pval.mult-in-pf}, we can rewrite the prime
factorization of a positive integer in an \textquotedblleft
explicit\textquotedblright\ form, at least if one considers an infinite
product that involves $p$-valuations to be explicit. The infinite product is
not as scary as it sounds: It is an infinite product that has only finitely
many factors different from $1$. Such a product is analogous to an infinite
sum that has only finitely many addends different from $0$; it is always
well-defined, because a factor that equals $1$ does not affect the product
(just like an addend that equals $0$ does not affect the sum).

\begin{theorem}
[canonical factorization, or explicit prime factorization]%
\label{thm.pval.can-fac}Let $n$ be a nonzero integer. Then: \medskip

\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.) \medskip

\textbf{(b)} The product $\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }$
has only finitely many factors different from $1$, and thus is well-defined.
\medskip

\textbf{(c)} We have%
\[
\left\vert n\right\vert =\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }.
\]


\textbf{(d)} If $n$ is positive, then%
\[
n=\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }.
\]

\end{theorem}

The expression $n=\prod_{p\text{ prime}}p^{v_{p}\left(  n\right)  }$ in
Theorem \ref{thm.pval.can-fac} \textbf{(d)} is called the \emph{canonical
factorization} of $n$. For example, the canonical factorization of $60$ is%
\[
60=2^{2}\cdot3^{1}\cdot5^{1}\cdot\underbrace{7^{0}\cdot11^{0}\cdot13^{0}%
\cdot17^{0}\cdot\cdots}_{\substack{\text{all exponents here are }%
0\text{'s,}\\\text{so all these factors equal }1}}.
\]
Of course, most people would write this as $60=2^{2}\cdot3\cdot5$ (omitting
exponents that are $1$, and omitting factors that are $1$).

Theorem \ref{thm.pval.can-fac} is \cite[Theorem 9.3.17]{20f}. Its majestic
look should not distract from the fact that it is an easy consequence of
Proposition \ref{prop.pval.mult-in-pf} and Theorem \ref{thm.pval.fac-uni}. It
is nevertheless quite useful. Some of its consequences (all proved in
\cite[\S 9.3.3]{20f}) are the following:

\begin{proposition}
\label{prop.pval.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{corollary}
\label{cor.pval.vp=vp}Let $n$ and $m$ be two 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}


\textbf{(a)} Then, $\left\vert n\right\vert =\left\vert m\right\vert $.
\medskip

\textbf{(b)} If $n$ and $m$ are nonnegative, then $n=m$.
\end{corollary}

\begin{corollary}
\label{cor.pval.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}
Then, $a\equiv b\operatorname{mod}n$.
\end{corollary}

\begin{corollary}
\label{cor.pval.vp-of-can}For each prime $p$, let $b_{p}$ be a nonnegative
integer. Assume that only finitely many primes $p$ satisfy $b_{p}\neq0$. Let
$n=\prod_{p\text{ prime}}p^{b_{p}}$. Then,%
\[
v_{q}\left(  n\right)  =b_{q}\ \ \ \ \ \ \ \ \ \ \text{for each prime }q.
\]

\end{corollary}

Proposition \ref{prop.pval.n|m} shows that divisibilities between integers can
be proved \textquotedblleft one prime at a time\textquotedblright. Corollary
\ref{cor.pval.modpvp} says the same about congruences (not surprisingly, since
a congruence $a\equiv b\operatorname{mod}n$ is just a divisibility $n\mid a-b$).

Corollary \ref{cor.pval.vp=vp} \textbf{(b)} shows that a nonnegative integer
is uniquely determined by its $p$-valuations for all primes $p$. Let us use
the above to thus determine the gcd and the lcm of several integers through
their $p$-valuations:\footnote{We recall that $\operatorname{lcm}\left(
n_{1},n_{2},\ldots,n_{k}\right)  $ denotes the lowest common multiple (aka
least common multiple) of $k$ integers $n_{1},n_{2},\ldots,n_{k}$.}

\begin{proposition}
\label{prop.pval.gcd-lcm-k}Let $n_{1},n_{2},\ldots,n_{k}$ be finitely many
integers, with $k>0$. Let $p$ be a prime. Then: \medskip

\textbf{(a)} We have%
\[
v_{p}\left(  \gcd\left(  n_{1},n_{2},\ldots,n_{k}\right)  \right)
=\min\left\{  v_{p}\left(  n_{1}\right)  ,v_{p}\left(  n_{2}\right)
,\ldots,v_{p}\left(  n_{k}\right)  \right\}  .
\]


\textbf{(b)} We have%
\[
v_{p}\left(  \operatorname{lcm}\left(  n_{1},n_{2},\ldots,n_{k}\right)
\right)  =\max\left\{  v_{p}\left(  n_{1}\right)  ,v_{p}\left(  n_{2}\right)
,\ldots,v_{p}\left(  n_{k}\right)  \right\}  .
\]

\end{proposition}

You might know this proposition already, since it is simply the way to compute
gcds and lcms using prime factorizations\footnote{Namely: For $\gcd\left(
n_{1},n_{2},\ldots,n_{k}\right)  $, you take each prime to the smallest of the
exponents with which it appears in the prime factorizations of $n_{1}%
,n_{2},\ldots,n_{k}$. For $\operatorname{lcm}\left(  n_{1},n_{2},\ldots
,n_{k}\right)  $, you take each prime to the largest of the exponents with
which it appears in the prime factorizations of $n_{1},n_{2},\ldots,n_{k}$.}.
This method of computing gcds and lcms is not the fastest one, since it relies
on prime factorizations\footnote{Using the Euclidean algorithm to compute gcds
(and then the formula $\gcd\left(  a,b\right)  \cdot\operatorname{lcm}\left(
a,b\right)  =\left\vert ab\right\vert $ to compute lcms using gcds) is faster.
(Beware: It is not true that $\gcd\left(  a,b,c\right)  \cdot
\operatorname{lcm}\left(  a,b,c\right)  =\left\vert abc\right\vert $. Instead,
lcms of more than $2$ numbers must be computed by iteration: for instance,
$\operatorname{lcm}\left(  a,b,c\right)  =\operatorname{lcm}\left(
a,\operatorname{lcm}\left(  b,c\right)  \right)  $.)}; but it is helpful for a
theoretical understanding of gcds and lcms.

A proof of Proposition \ref{prop.pval.gcd-lcm-k} is given in the appendix
(Section \ref{sec.pval.app-pf}).

\subsection{Example problems}

We shall now see some applications of $p$-valuations.

\begin{exercise}
\label{exe.pval.e1}Let $a,b,c$ be three integers. \medskip

\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)  $. \medskip

\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}

\begin{proof}
[Solution idea.]Both parts of this exercise are known results about gcds and
lcms (known as the \emph{distributivity laws for gcd and lcm}), and can be
solved without any recourse to prime numbers and $p$-valuations (see, e.g.,
\cite[Second solution to Exercise 2.13.11]{19s} for such solutions). However,
by working \textquotedblleft one prime at a time\textquotedblright\ using
$p$-valuations (and Proposition \ref{prop.pval.gcd-lcm-k} in particular), they
become straightforward. Here is how (see \cite[First solution to Exercise
2.13.11]{19s} for details): \medskip

\textbf{(a)} We need to prove that the two numbers $\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 equal. Since these two numbers are nonnegative integers, it
suffices (by Corollary \ref{cor.pval.vp=vp} \textbf{(b)}) to show 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)  $ for every prime $p$.

So let us do this now. Let $p$ be a prime. Let $x:=v_{p}\left(  a\right)  $
and $y:=v_{p}\left(  b\right)  $ and $z:=v_{p}\left(  c\right)  $. Note that
$x,y,z\in\mathbb{N}\cup\left\{  \infty\right\}  $. Now, Proposition
\ref{prop.pval.gcd-lcm-k} \textbf{(a)} 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
Proposition \ref{prop.pval.gcd-lcm-k} \textbf{(b)})}}}\right\} \\
&  =\min\left\{  \underbrace{v_{p}\left(  a\right)  }_{=x},\ \max\left\{
\underbrace{v_{p}\left(  b\right)  }_{=y},\underbrace{v_{p}\left(  c\right)
}_{=z}\right\}  \right\} \\
&  =\min\left\{  x,\ \max\left\{  y,z\right\}  \right\}  .
\end{align*}
On the other hand, Proposition \ref{prop.pval.gcd-lcm-k} \textbf{(b)} 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 Proposition
\ref{prop.pval.gcd-lcm-k} \textbf{(a)})}}},\ \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 Proposition
\ref{prop.pval.gcd-lcm-k} \textbf{(a)})}}}\right\} \\
&  =\max\left\{  \min\left\{  \underbrace{v_{p}\left(  a\right)  }%
_{=x},\underbrace{v_{p}\left(  b\right)  }_{=y}\right\}  ,\ \min\left\{
\underbrace{v_{p}\left(  a\right)  }_{=x},\underbrace{v_{p}\left(  c\right)
}_{=z}\right\}  \right\} \\
&  =\max\left\{  \min\left\{  x,y\right\}  ,\ \min\left\{  x,z\right\}
\right\}  .
\end{align*}
Our goal is to show that the left hand sides of these two equalities are
equal. Of course, it suffices to show that the right hand sides are equal,
i.e., that we have%
\begin{equation}
\min\left\{  x,\ \max\left\{  y,z\right\}  \right\}  =\max\left\{
\min\left\{  x,y\right\}  ,\ \min\left\{  x,z\right\}  \right\}  .
\label{sol.pval.e1.a.min=max}%
\end{equation}
(We note that the equality (\ref{sol.pval.e1.a.min=max}) is not merely
sufficient, but also necessary for Exercise \ref{exe.pval.e1} \textbf{(a)} to
hold, because $x,y,z$ can take any values in $\mathbb{N}\cup\left\{
\infty\right\}  $. Thus, there is no risk that we have run into a dead end here.)

How do we prove an equality like (\ref{sol.pval.e1.a.min=max})? The expert
answer would be \textquotedblleft this is a tropical polynomial
identity\textquotedblright\ (and such identities can be checked mechanically),
but in our case there is a much easier method: The three \textquotedblleft
numbers\textquotedblright\ $x,y,z\in\mathbb{N}\cup\left\{  \infty\right\}  $
(we are putting the word \textquotedblleft numbers\textquotedblright\ in scare
quotes because we allow $\infty$, but this does not cause any problems) must
be arranged in one of the six orders%
\begin{align*}
x  &  \leq y\leq z,\ \ \ \ \ \ \ \ \ \ x\leq z\leq y,\ \ \ \ \ \ \ \ \ \ y\leq
x\leq z,\\
y  &  \leq z\leq x,\ \ \ \ \ \ \ \ \ \ z\leq x\leq y,\ \ \ \ \ \ \ \ \ \ z\leq
y\leq x,
\end{align*}
which subdivides the problem into six possible cases; in each of these six
cases, we can explicitly compute and compare the two sides of
(\ref{sol.pval.e1.a.min=max}). Here is a table of the results:%
\[%
\begin{tabular}
[c]{|c||c|c|}\hline
case & $\min\left\{  x,\ \max\left\{  y,z\right\}  \right\}  $ & $\max\left\{
\min\left\{  x,y\right\}  ,\ \min\left\{  x,z\right\}  \right\}
$\\\hline\hline
$x\leq y\leq z$ & $x$ & $x$\\\hline
$x\leq z\leq y$ & $x$ & $x$\\\hline
$y\leq x\leq z$ & $x$ & $x$\\\hline
$y\leq z\leq x$ & $z$ & $z$\\\hline
$z\leq x\leq y$ & $x$ & $x$\\\hline
$z\leq y\leq x$ & $y$ & $y$\\\hline
\end{tabular}
\ \ \ .
\]
In each case, we see that $\min\left\{  x,\ \max\left\{  y,z\right\}
\right\}  $ and $\max\left\{  \min\left\{  x,y\right\}  ,\ \min\left\{
x,z\right\}  \right\}  $ simplify to the same result, so that
(\ref{sol.pval.e1.a.min=max}) follows. As explained above, this entails 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)  .
\]


Forget that we fixed $p$. We thus have shown 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)
\]
holds for each prime $p$. According to Corollary \ref{cor.pval.vp=vp}
\textbf{(b)}, this entails that we have $\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.pval.e1} \textbf{(a)} is solved.

(Incidentally, there is an alternative way of proving
(\ref{sol.pval.e1.a.min=max}), without analyzing all six cases. Indeed, we can
WLOG assume that $y\leq z$, since $y$ and $z$ play symmetric roles in
(\ref{sol.pval.e1.a.min=max}). Assuming this, we can easily see that
$\min\left\{  x,y\right\}  \leq\min\left\{  x,z\right\}  $, so that
$\max\left\{  \min\left\{  x,y\right\}  ,\ \min\left\{  x,z\right\}  \right\}
=\min\left\{  x,z\right\}  $. Thus, (\ref{sol.pval.e1.a.min=max}) rewrites as
$\min\left\{  x,\ \max\left\{  y,z\right\}  \right\}  =\min\left\{
x,z\right\}  $. However, this is clear, since $y\leq z$ also implies
$\max\left\{  y,z\right\}  =z$. This proof of (\ref{sol.pval.e1.a.min=max}) is
short and slick, but our above proof has the advantage of following a surefire strategy.)

\medskip

\textbf{(b)} This is analogous to our above solution to Exercise
\ref{exe.pval.e1} \textbf{(a)}, except that $\gcd$ and $\operatorname{lcm}$
trade places, as do $\min$ and $\max$. Instead of (\ref{sol.pval.e1.a.min=max}%
), we now need to prove the equality
\[
\max\left\{  x,\ \min\left\{  y,z\right\}  \right\}  =\min\left\{
\max\left\{  x,y\right\}  ,\ \max\left\{  x,z\right\}  \right\}  .
\]
We could again prove this by building a table; alternatively, we could obtain
this by applying (\ref{sol.pval.e1.a.min=max}) to $-x$, $-y$ and $-z$ instead
of $x$, $y$ and $z$ (because $\min\left\{  -u,-v\right\}  =-\max\left\{
u,v\right\}  $ and $\max\left\{  -u,-v\right\}  =-\min\left\{  u,v\right\}  $
for any reals $u,v$). (Now, of course, we need a symbol $-\infty$.) This
solves Exercise \ref{exe.pval.e1} \textbf{(b)}.
\end{proof}

The following exercise generalizes the fact that $\sqrt{2}$ is irrational (why?):

\begin{exercise}
\label{exe.pval.e2}Let $k$ be a positive integer. Let $w$ be a rational number
such that $w^{k}$ is an integer. Prove that $w$ is an integer.
\end{exercise}

\begin{proof}
[Solution idea.](See \cite[Exercise 9.3.2]{20f} for details.) If $w=0$, then
this is obvious. Thus, we WLOG assume that $w\neq0$.

The number $w$ is rational. Thus, we can write $w$ in the form $w=m/n$ for
some integers $m$ and $n$ with $n\neq0$. Consider these $m$ and $n$. Note that
$m=nw$ (since $w=m/n$) and thus $m\neq0$ (since $n\neq0$ and $w\neq0$).

From $w=m/n$, we obtain $w^{k}=\left(  m/n\right)  ^{k}=m^{k}/n^{k}$. Hence,
$m^{k}/n^{k}$ is an integer (since $w^{k}$ is an integer). Thus, $n^{k}\mid
m^{k}$.

However, Proposition \ref{prop.pval.n|m} (applied to $n^{k}$ and $m^{k}$
instead of $n$ and $m$) shows that $n^{k}\mid m^{k}$ if and only if each prime
$p$ satisfies $v_{p}\left(  n^{k}\right)  \leq v_{p}\left(  m^{k}\right)  $.
Since we have $n^{k}\mid m^{k}$, we thus conclude that%
\begin{equation}
\text{each prime }p\text{ satisfies }v_{p}\left(  n^{k}\right)  \leq
v_{p}\left(  m^{k}\right)  . \label{sol.pval.e2.1}%
\end{equation}


Now, let $p$ be a prime. Then, $v_{p}\left(  n\right)  $ and $v_{p}\left(
m\right)  $ are integers (since $n\neq0$ and $m\neq0$). Corollary
\ref{cor.pval.vp-pow} yields $v_{p}\left(  n^{k}\right)  =kv_{p}\left(
n\right)  $ and $v_{p}\left(  m^{k}\right)  =kv_{p}\left(  m\right)  $. Hence,%
\begin{align*}
kv_{p}\left(  n\right)   &  =v_{p}\left(  n^{k}\right)  \leq v_{p}\left(
m^{k}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by (\ref{sol.pval.e2.1}%
)}\right) \\
&  =kv_{p}\left(  m\right)  .
\end{align*}
Dividing this inequality by $k$, we obtain $v_{p}\left(  n\right)  \leq
v_{p}\left(  m\right)  $ (since $k$ is positive).

Forget that we fixed $p$. Thus, we have shown that each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $. According to
Proposition \ref{prop.pval.n|m}, this entails that $n\mid m$. Hence, $w$ is an
integer (since $w=m/n$). This solves Exercise \ref{exe.pval.e2}.
\end{proof}

\begin{exercise}
\label{exe.pval.e3}Let $n$ be a positive integer. \medskip

\textbf{(a)} Prove that
\[
\left(  \text{the number of positive divisors of }n\right)  =\prod_{p\text{
prime}}\left(  v_{p}\left(  n\right)  +1\right)  .
\]
(The product on the right hand side is infinite, but it is well-defined, since
only finitely many of its factors differ from $1$.) \medskip

\textbf{(b)} Prove that the number of positive divisors of $n$ is even if and
only if $n$ is not a perfect square.

(A \emph{perfect square} means the square of an integer.)
\end{exercise}

\begin{proof}
[Solution idea.]\textbf{(a)} (See \cite[Proposition 2.18.1 \textbf{(b)}]{19s}
for details.) Let $n=2^{\alpha}3^{\beta}5^{\gamma}\cdots$ be the canonical
factorization of $n$; thus, $\alpha=v_{2}\left(  n\right)  $ and $\beta
=v_{3}\left(  n\right)  $ and $\gamma=v_{5}\left(  n\right)  $ and so
on.\footnote{The pedantic reader should imagine that the Greek alphabet is
infinite, so that there is one letter for each prime.} Hence, $\prod_{p\text{
prime}}\left(  v_{p}\left(  n\right)  +1\right)  =\left(  \alpha+1\right)
\left(  \beta+1\right)  \left(  \gamma+1\right)  \cdots$. Thus, we must prove
that%
\begin{equation}
\left(  \text{the number of positive divisors of }n\right)  =\left(
\alpha+1\right)  \left(  \beta+1\right)  \left(  \gamma+1\right)  \cdots.
\label{sol.pval.e3.ppos}%
\end{equation}


Using Proposition \ref{prop.pval.n|m}, we can easily see that any positive
divisor of $n$ has the form $2^{\alpha^{\prime}}3^{\beta^{\prime}}%
5^{\gamma^{\prime}}\cdots$ for some sequence\footnote{We are using the
Cartesian product of infinitely many sets here. To recall: If $A_{1}%
,A_{2},A_{3},\ldots$ are infinitely many sets, then $A_{1}\times A_{2}\times
A_{3}\times\cdots$ means the set of all sequences $\left(  a_{1},a_{2}%
,a_{3},\ldots\right)  $ with $a_{1}\in A_{1}$ and $a_{2}\in A_{2}$ and
$a_{3}\in A_{3}$ and so on.}%
\[
\left(  \alpha^{\prime},\beta^{\prime},\gamma^{\prime},\ldots\right)
\in\left\{  0,1,\ldots,\alpha\right\}  \times\left\{  0,1,\ldots
,\beta\right\}  \times\left\{  0,1,\ldots,\gamma\right\}  \times\cdots
\]
(that is, for some $\alpha^{\prime}\in\left\{  0,1,\ldots,\alpha\right\}  $
and some $\beta^{\prime}\in\left\{  0,1,\ldots,\beta\right\}  $ and some
$\gamma^{\prime}\in\left\{  0,1,\ldots,\gamma\right\}  $ and so on). Moreover,
any choice of sequence
\[
\left(  \alpha^{\prime},\beta^{\prime},\gamma^{\prime},\ldots\right)
\in\left\{  0,1,\ldots,\alpha\right\}  \times\left\{  0,1,\ldots
,\beta\right\}  \times\left\{  0,1,\ldots,\gamma\right\}  \times\cdots
\]
gives a different positive divisor $2^{\alpha^{\prime}}3^{\beta^{\prime}%
}5^{\gamma^{\prime}}\cdots$ of $n$ (since the prime factorization of a
positive integer is unique). Thus, we have found a bijection\footnote{i.e.,
bijective map} from the set%
\[
\left\{  0,1,\ldots,\alpha\right\}  \times\left\{  0,1,\ldots,\beta\right\}
\times\left\{  0,1,\ldots,\gamma\right\}  \times\cdots
\]
to the set of all positive divisors of $n$. Therefore, the bijection
principle\footnote{The \emph{bijection principle} says that if there is a
bijection from a set $X$ to a set $Y$, then $\left\vert X\right\vert
=\left\vert Y\right\vert $.} yields%
\begin{align*}
&  \left(  \text{the number of positive divisors of }n\right) \\
&  =\left\vert \left\{  0,1,\ldots,\alpha\right\}  \times\left\{
0,1,\ldots,\beta\right\}  \times\left\{  0,1,\ldots,\gamma\right\}
\times\cdots\right\vert \\
&  =\underbrace{\left\vert \left\{  0,1,\ldots,\alpha\right\}  \right\vert
}_{=\alpha+1}\cdot\underbrace{\left\vert \left\{  0,1,\ldots,\beta\right\}
\right\vert }_{=\beta+1}\cdot\underbrace{\left\vert \left\{  0,1,\ldots
,\gamma\right\}  \right\vert }_{=\gamma+1}\cdot\cdots\\
&  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by the infinite product rule, which says}\\
\text{that }\left\vert A_{1}\times A_{2}\times A_{3}\times\cdots\right\vert
=\left\vert A_{1}\right\vert \cdot\left\vert A_{2}\right\vert \cdot\left\vert
A_{3}\right\vert \cdot\cdots\\
\text{for any sets }A_{1},A_{2},A_{3},\ldots
\end{array}
\right) \\
&  =\left(  \alpha+1\right)  \left(  \beta+1\right)  \left(  \gamma+1\right)
\cdots.
\end{align*}
This proves (\ref{sol.pval.e3.ppos}). Thus, Exercise \ref{exe.pval.e3}
\textbf{(a)} is solved. \medskip

\textbf{(b)} This can be proved in a nice combinatorial way (see
\cite[solution to Exercise 3.8.3]{20f}), but let us derive it from part
\textbf{(a)} instead. Indeed, we have the following chain of logical
equivalences:%
\begin{align*}
&  \ \left(  \text{the number of positive divisors of }n\text{ is even}\right)
\\
&  \Longleftrightarrow\ \left(  \prod_{p\text{ prime}}\left(  v_{p}\left(
n\right)  +1\right)  \text{ is even}\right)  \ \ \ \ \ \ \ \ \ \ \left(
\text{by Exercise \ref{exe.pval.e3} \textbf{(a)}}\right) \\
&  \Longleftrightarrow\ \left(  v_{p}\left(  n\right)  +1\text{ is even for at
least one prime }p\right) \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since a product of integers is even if and only if}\\
\text{at least one of its factors is even}%
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  v_{p}\left(  n\right)  \text{ is odd for at
least one prime }p\right) \\
&  \Longleftrightarrow\ \left(  n\text{ is not a perfect square}\right)  .
\end{align*}
The last \textquotedblleft$\Longleftrightarrow$\textquotedblright\ arrow here
might need some justification. It is easier to prove the contrapositive --
i.e., to prove the equivalence%
\[
\left(  v_{p}\left(  n\right)  \text{ is even for all primes }p\right)
\Longleftrightarrow\left(  n\text{ is a perfect square}\right)  .
\]
The \textquotedblleft$\Longrightarrow$\textquotedblright\ direction of this
equivalence follows from Theorem \ref{thm.pval.can-fac} \textbf{(d)}, whereas
the \textquotedblleft$\Longleftarrow$\textquotedblright\ direction follows
from Corollary \ref{cor.pval.vp-pow}. (Convince yourself of all of this!)
\end{proof}

In the next exercise, we will use the notation $\left[  j\right]  $ for the
set $\left\{  1,2,\ldots,j\right\}  $ whenever $j\in\mathbb{N}$.

\begin{exercise}
\label{exe.pval.e4}Let $n$ and $u$ be positive integers. Let $a_{1}%
,a_{2},\ldots,a_{u}$ be any integers. Set $a_{u+1}=a_{1}$. Assume that%
\[
a_{i}\mid a_{i+1}^{n}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  u\right]
.
\]
Set $m=n^{u-1}+n^{u-2}+\cdots+n^{0}$. Prove that%
\[
a_{1}a_{2}\cdots a_{u}\mid\left(  a_{1}+a_{2}+\cdots+a_{u}\right)  ^{m}.
\]

\end{exercise}

\begin{proof}
[Solution idea.]In view of Proposition \ref{prop.pval.n|m}, it suffices to
show that each prime $p$ satisfies%
\[
v_{p}\left(  a_{1}a_{2}\cdots a_{u}\right)  \leq v_{p}\left(  \left(
a_{1}+a_{2}+\cdots+a_{u}\right)  ^{m}\right)  .
\]


So let $p$ be a prime. Let%
\[
k_{i}:=v_{p}\left(  a_{i}\right)  \ \ \ \ \ \ \ \ \ \ \text{for each }%
i\in\left[  u+1\right]  .
\]


Note that $k_{u+1}=k_{1}$, since $a_{u+1}=a_{1}$.

We WLOG assume that the smallest of the $u$ \textquotedblleft
numbers\textquotedblright\footnote{The word \textquotedblleft
numbers\textquotedblright\ is in scare quotes, since some of them can be
$\infty$.} $k_{1},k_{2},\ldots,k_{u}$ is $k_{u}$. (This is a valid WLOG
assumption, since we can cyclically rotate our $u$ integers $a_{1}%
,a_{2},\ldots,a_{u}$ without changing the exercise\footnote{i.e., replace
$a_{1},a_{2},\ldots,a_{u-1},a_{u}$ by $a_{2},a_{3},\ldots,a_{u},a_{1}$,
respectively}; and when we do rotate them, their $p$-valuations $k_{1}%
,k_{2},\ldots,k_{u}$ are rotated along with them.)

For each $i\in\left[  u\right]  $, we have $a_{i}\mid a_{i+1}^{n}$ (by
assumption) and thus (by Proposition \ref{prop.pval.n|m} again) $v_{p}\left(
a_{i}\right)  \leq v_{p}\left(  a_{i+1}^{n}\right)  =nv_{p}\left(
a_{i+1}\right)  $ (by Corollary \ref{cor.pval.vp-pow}). In other words,
\begin{equation}
k_{i}\leq nk_{i+1}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left[  u\right]
\label{sol.chip.abelkonkabc2.kleqnk}%
\end{equation}
(since $k_{i}=v_{p}\left(  a_{i}\right)  $ and $k_{i+1}=v_{p}\left(
a_{i+1}\right)  $). This quickly entails%
\begin{equation}
k_{u-i}\leq n^{i}k_{u}\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left\{
0,1,\ldots,u-1\right\}  \label{sol.chip.abelkonkabc2.kleqnik}%
\end{equation}
(indeed, check this by induction on $i$). Now, Corollary
\ref{cor.pval.vp-ringk} yields%
\begin{align}
v_{p}\left(  a_{1}a_{2}\cdots a_{u}\right)   &  =v_{p}\left(  a_{1}\right)
+v_{p}\left(  a_{2}\right)  +\cdots+v_{p}\left(  a_{u}\right)  =k_{1}%
+k_{2}+\cdots+k_{u}=\sum_{i=0}^{u-1}\underbrace{k_{u-i}}_{\substack{\leq
n^{i}k_{u}\\\text{(by (\ref{sol.chip.abelkonkabc2.kleqnik}))}}}\nonumber\\
&  \leq\sum_{i=0}^{u-1}n^{i}k_{u}=\underbrace{\left(  n^{u-1}+n^{u-2}%
+\cdots+n^{0}\right)  }_{=m}k_{u}\nonumber\\
&  =mk_{u}. \label{sol.chip.abelkonkabc2.leftleq}%
\end{align}


On the other hand, we claim that $v_{p}\left(  \left(  a_{1}+a_{2}%
+\cdots+a_{u}\right)  ^{m}\right)  \geq mk_{u}$. The easiest way to prove this
is probably the following: Each $i\in\left[  u\right]  $ satisfies
$v_{p}\left(  a_{i}\right)  =k_{i}\geq k_{u}$ (since $k_{u}$ is the smallest
of the $u$ numbers $k_{1},k_{2},\ldots,k_{u}$). In other words, each of the
$u$ integers $a_{1},a_{2},\ldots,a_{u}$ has $p$-valuation $\geq k_{u}$, and
thus is divisible by $p^{k_{u}}$. Hence, the sum $a_{1}+a_{2}+\cdots+a_{u}$ of
these $u$ integers is also divisible by $p^{k_{u}}$. Thus, $v_{p}\left(
a_{1}+a_{2}+\cdots+a_{u}\right)  \geq k_{u}$. Now, Corollary
\ref{cor.pval.vp-pow} yields%
\[
v_{p}\left(  \left(  a_{1}+a_{2}+\cdots+a_{u}\right)  ^{m}\right)
=m\underbrace{v_{p}\left(  a_{1}+a_{2}+\cdots+a_{u}\right)  }_{\geq k_{u}}\geq
mk_{u}.
\]
Combining this with (\ref{sol.chip.abelkonkabc2.leftleq}), we obtain
$v_{p}\left(  a_{1}a_{2}\cdots a_{u}\right)  \leq v_{p}\left(  \left(
a_{1}+a_{2}+\cdots+a_{u}\right)  ^{m}\right)  $, which is precisely what we
wanted to prove.
\end{proof}

The $p$-valuation of a factorial is particularly useful, as factorials often
end up involved in divisibilities. Here is an \textquotedblleft
explicit\textquotedblright\ formula (\cite[Theorem 9.3.25]{20f}, or, in an
equivalent form, \cite[Exercise 2.17.2 \textbf{(c)}]{19s}):\footnote{Recall:
If $r$ is any real number, then $\left\lfloor r\right\rfloor $ is defined to
be the largest integer that is $\leq r$. This integer $\left\lfloor
r\right\rfloor $ is called the \emph{floor} of $r$. Equivalently,
$\left\lfloor r\right\rfloor $ can be described as the unique integer $z$
satisfying $z\leq r<z+1$. For instance, $\left\lfloor 2.2\right\rfloor
=\left\lfloor 2.8\right\rfloor =\left\lfloor 2\right\rfloor =2$ and
$\left\lfloor -3.1\right\rfloor =\left\lfloor -\pi\right\rfloor =\left\lfloor
-4\right\rfloor =-4$.}

\begin{theorem}
[de Polignac's formula]\label{thm.pval.de-polignac}Let $p$ be a prime. Let
$n\in\mathbb{N}$. Then,
\[
v_{p}\left(  n!\right)  =\sum_{i\geq1}\left\lfloor \dfrac{n}{p^{i}%
}\right\rfloor .
\]
(The summation sign \textquotedblleft$\sum_{i\geq1}$\textquotedblright\ is
shorthand for \textquotedblleft$\sum_{i\in\left\{  1,2,3,\ldots\right\}  }%
$\textquotedblright. The sum $\sum_{i\geq1}\left\lfloor \dfrac{n}{p^{i}%
}\right\rfloor $ in this equality is well-defined, since it has only finitely
many nonzero addends.)
\end{theorem}

\begin{example}
Applying Theorem \ref{thm.pval.de-polignac} to $n=42$ and $p=5$, we obtain%
\begin{align*}
v_{5}\left(  42!\right)   &  =\sum_{i\geq1}\left\lfloor \dfrac{42}{5^{i}%
}\right\rfloor =\underbrace{\left\lfloor \dfrac{42}{5^{1}}\right\rfloor
}_{=\left\lfloor 8.4\right\rfloor =8}+\underbrace{\left\lfloor \dfrac
{42}{5^{2}}\right\rfloor }_{=\left\lfloor 1.68\right\rfloor =1}%
+\underbrace{\left\lfloor \dfrac{42}{5^{3}}\right\rfloor }_{=\left\lfloor
0.336\right\rfloor =0}+\underbrace{\left\lfloor \dfrac{42}{5^{4}}\right\rfloor
}_{=0}+\underbrace{\left\lfloor \dfrac{42}{5^{5}}\right\rfloor }_{=0}+\cdots\\
&  =8+1+0+0+0+\cdots=9.
\end{align*}

\end{example}

Theorem \ref{thm.pval.de-polignac} is known as \emph{de Polignac's formula} or
\emph{Legendre's formula}. Here is an outline of a proof (first in an informal
way, then formalized):

\begin{proof}
[Proof of Theorem \ref{thm.pval.de-polignac} (sketched).]Classically, this is
shown by expanding $n!$ as the product $1\cdot2\cdot\cdots\cdot n$ and
counting \textquotedblleft how many $p$s come from each factor of this
product\textquotedblright. To wit, precisely $\left\lfloor n/p\right\rfloor $
factors of the product $1\cdot2\cdot\cdots\cdot n$ are multiples of $p$
(namely, $p,2p,3p,\ldots,\left\lfloor n/p\right\rfloor p$), so that the
product is divisible by $p^{\left\lfloor n/p\right\rfloor }$. Thus, its
$p$-valuation is at least $\left\lfloor n/p\right\rfloor $. However, this
undercounts the $p$-valuation of this product, since some of the multiples of
$p$ are actually multiples of $p^{2}$, and thus contribute $2$ rather than $1$
to its $p$-valuation\footnote{We are tacitly using Corollary
\ref{cor.pval.vp-ringk} here, which lets us compute the $p$-valuation of a
product by adding together the $p$-valuations of its factors.}. Thus, we need
to refine our tally $\left\lfloor n/p\right\rfloor $ by adding the number of
multiples of $p^{2}$ that appear in this product. This number is $\left\lfloor
n/p^{2}\right\rfloor $. Thus, the $p$-valuation of our product is at least
$\left\lfloor n/p\right\rfloor +\left\lfloor n/p^{2}\right\rfloor $. But we
are still undercounting the $p$-valuation, since some of the multiples of
$p^{2}$ are actually multiples of $p^{3}$ and thus contribute $3$ rather than
$2$. So we need to refine our tally again, and this process goes on
indefinitely until all possible powers of $p$ are dealt with. As a result, we
conclude that the $p$-valuation of the product $1\cdot2\cdot\cdots\cdot n$ is%
\[
\left\lfloor n/p\right\rfloor +\left\lfloor n/p^{2}\right\rfloor +\left\lfloor
n/p^{3}\right\rfloor +\cdots=\sum_{i\geq1}\left\lfloor \dfrac{n}{p^{i}%
}\right\rfloor .
\]
But this is precisely the claim of Theorem \ref{thm.pval.de-polignac}.
\medskip

This argument can be made more formal by using a certain neat piece of
notation known as the \emph{Iverson bracket notation}. To wit, if
$\mathcal{A}$ is any logical statement, then we define the \emph{truth value}
of $\mathcal{A}$ to be the integer%
\[
\left[  \mathcal{A}\right]  :=%
\begin{cases}
1, & \text{if }\mathcal{A}\text{ is true};\\
0, & \text{if }\mathcal{A}\text{ is false}.
\end{cases}
\]
For example, $\left[  2+2=4\right]  =1$ but $\left[  2+2=5\right]  =0$.

Now, it is easy to see that each positive integer $k$ satisfies%
\begin{equation}
\left\lfloor \dfrac{n}{k}\right\rfloor =\sum_{m=1}^{n}\left[  k\mid m\right]
. \label{pf.thm.pval.de-polignac.lem1}%
\end{equation}
(Indeed, the right hand side of this equality is a sum of $0$'s and $1$'s, and
it has a $1$ for each $m\in\left\{  1,2,\ldots,n\right\}  $ that is a multiple
of $k$. Thus, the total value of this sum is the number of multiples of $k$
that belong to $\left\{  1,2,\ldots,n\right\}  $. But this number is easily
seen to be $\left\lfloor \dfrac{n}{k}\right\rfloor $, which is the left hand side.)

On the other hand, each positive integer $m$ satisfies%
\begin{equation}
v_{p}\left(  m\right)  =\sum_{i\geq1}\left[  p^{i}\mid m\right]  .
\label{pf.thm.pval.de-polignac.lem2}%
\end{equation}
(Indeed, the right hand side is a sum of $0$'s and $1$'s, and it has a $1$ for
each $i\in\left\{  1,2,3,\ldots\right\}  $ that satisfies $p^{i}\mid m$.
However, the number of such $i$'s is $v_{p}\left(  m\right)  $, because these
$i$'s are precisely $1,2,\ldots,v_{p}\left(  m\right)  $.)

Now, all that remains to be done is a simple computation: From $n!=1\cdot
2\cdot\cdots\cdot n$, we obtain%
\begin{align*}
v_{p}\left(  n!\right)   &  =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)
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Corollary \ref{cor.pval.vp-ringk}}\right)
\\
&  =\sum_{m=1}^{n}\underbrace{v_{p}\left(  m\right)  }_{\substack{=\sum
_{i\geq1}\left[  p^{i}\mid m\right]  \\\text{(by
(\ref{pf.thm.pval.de-polignac.lem2}))}}}=\underbrace{\sum_{m=1}^{n}%
\ \ \sum_{i\geq1}}_{=\sum_{i\geq1}\ \ \sum_{m=1}^{n}}\left[  p^{i}\mid
m\right]  =\sum_{i\geq1}\ \ \underbrace{\sum_{m=1}^{n}\left[  p^{i}\mid
m\right]  }_{\substack{=\left\lfloor \dfrac{n}{p^{i}}\right\rfloor \\\text{(by
(\ref{pf.thm.pval.de-polignac.lem1}), applied to }k=p^{i}\text{)}}%
}=\sum_{i\geq1}\left\lfloor \dfrac{n}{p^{i}}\right\rfloor .
\end{align*}
This proves Theorem \ref{thm.pval.de-polignac}.
\end{proof}

Here is one of many applications of de Polignac's formula (see \cite[\S 9.3]%
{20f} for more):

\begin{exercise}
\label{exe.pval.e5}Let $n,a,b\in\mathbb{N}$. \medskip

\textbf{(a)} Prove that $\dfrac{\left(  na\right)  !\left(  nb\right)
!}{a!b!\left(  a+b\right)  !^{n-1}}$ is an integer. \medskip

\textbf{(b)} Assume that $n>0$ and $\left(  a,b\right)  \neq\left(
0,0\right)  $. Prove that the integer $\dfrac{\left(  na\right)  !\left(
nb\right)  !}{a!b!\left(  a+b\right)  !^{n-1}}$ is divisible by $n$.
\end{exercise}

\begin{proof}
[Solution idea.]\textbf{(a)} We assume that $n>0$. (The proof in the case when
$n=0$ is similar, with minor changes.\footnote{Alternatively, it is not hard
to solve Exercise \ref{exe.pval.e5} \textbf{(a)} in the case when $n=0$
directly, using binomial coefficients. Namely, assume that $n=0$. Recall that
$\dbinom{p}{q}=\dfrac{p!}{q!\left(  p-q\right)  !}$ for any $p\in\mathbb{N}$
and $q\in\left\{  0,1,\ldots,p\right\}  $. Applying this to $p=a+b$ and $q=a$,
we obtain $\dbinom{a+b}{a}=\dfrac{\left(  a+b\right)  !}{a!\left(  \left(
a+b\right)  -a\right)  !}=\dfrac{\left(  a+b\right)  !}{a!b!}$. On the other
hand, from $n=0$, we obtain%
\begin{align}
\dfrac{\left(  na\right)  !\left(  nb\right)  !}{a!b!\left(  a+b\right)
!^{n-1}}  &  =\dfrac{\left(  0a\right)  !\left(  0b\right)  !}{a!b!\left(
a+b\right)  !^{0-1}}=\dfrac{1\cdot1}{a!b!\left(  a+b\right)  !^{-1}%
}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left(  0a\right)  !=0!=1\text{
and }\left(  0b\right)  !=0!=1\text{ and }0-1=-1\right) \nonumber\\
&  =\dfrac{\left(  a+b\right)  !}{a!b!}=\dbinom{a+b}{a}.
\label{sol.pval.e5.n=0.fn1.1}%
\end{align}
However, it is known that $\dbinom{p}{q}$ is an integer whenever
$p\in\mathbb{N}$ and $q\in\mathbb{N}$. Applying this to $p=a+b$ and $q=a$, we
conclude that $\dbinom{a+b}{a}$ is an integer. In view of
(\ref{sol.pval.e5.n=0.fn1.1}), this rewrites as follows: $\dfrac{\left(
na\right)  !\left(  nb\right)  !}{a!b!\left(  a+b\right)  !^{n-1}}$ is an
integer. Hence, Exercise \ref{exe.pval.e5} \textbf{(a)} is solved in the case
when $n=0$.}) From $n>0$, we obtain $n\geq1$, so that $n-1\in\mathbb{N}$.
Hence, $\left(  a+b\right)  !^{n-1}$ is an integer.

We must show that $\dfrac{\left(  na\right)  !\left(  nb\right)
!}{a!b!\left(  a+b\right)  !^{n-1}}$ is an integer. In other words, we must
show that $a!b!\left(  a+b\right)  !^{n-1}\mid\left(  na\right)  !\left(
nb\right)  !$. Because of Proposition \ref{prop.pval.n|m} (applied to
$a!b!\left(  a+b\right)  !^{n-1}$ and $\left(  na\right)  !\left(  nb\right)
!$ instead of $n$ and $m$), this will follow if we can show that each prime
$p$ satisfies
\begin{equation}
v_{p}\left(  a!b!\left(  a+b\right)  !^{n-1}\right)  \leq v_{p}\left(  \left(
na\right)  !\left(  nb\right)  !\right)  . \label{sol.pval.e5.a.p-goal}%
\end{equation}
Thus, we shall now focus on proving (\ref{sol.pval.e5.a.p-goal}).

So let $p$ be a prime. Applying Corollary \ref{cor.pval.vp-pow} and Corollary
\ref{cor.pval.vp-ringk}, we find%
\begin{align}
&  v_{p}\left(  a!b!\left(  a+b\right)  !^{n-1}\right) \nonumber\\
&  =v_{p}\left(  a!\right)  +v_{p}\left(  b!\right)  +\left(  n-1\right)
v_{p}\left(  \left(  a+b\right)  !\right) \nonumber\\
&  =\sum_{i\geq1}\left\lfloor \dfrac{a}{p^{i}}\right\rfloor +\sum_{i\geq
1}\left\lfloor \dfrac{b}{p^{i}}\right\rfloor +\left(  n-1\right)  \sum
_{i\geq1}\left\lfloor \dfrac{a+b}{p^{i}}\right\rfloor
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.pval.de-polignac}%
}\right) \nonumber\\
&  =\sum_{i\geq1}\left(  \left\lfloor \dfrac{a}{p^{i}}\right\rfloor
+\left\lfloor \dfrac{b}{p^{i}}\right\rfloor +\left(  n-1\right)  \left\lfloor
\dfrac{a+b}{p^{i}}\right\rfloor \right)  \label{sol.pval.e5.a.1}%
\end{align}
and%
\begin{align}
&  v_{p}\left(  \left(  na\right)  !\left(  nb\right)  !\right) \nonumber\\
&  =v_{p}\left(  \left(  na\right)  !\right)  +v_{p}\left(  \left(  nb\right)
!\right)  =\sum_{i\geq1}\left\lfloor \dfrac{na}{p^{i}}\right\rfloor
+\sum_{i\geq1}\left\lfloor \dfrac{nb}{p^{i}}\right\rfloor
\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem \ref{thm.pval.de-polignac}%
}\right) \nonumber\\
&  =\sum_{i\geq1}\left(  \left\lfloor \dfrac{na}{p^{i}}\right\rfloor
+\left\lfloor \dfrac{nb}{p^{i}}\right\rfloor \right)  .
\label{sol.pval.e5.a.2}%
\end{align}
Hence, it will suffice to show that%
\begin{equation}
\left\lfloor \dfrac{a}{p^{i}}\right\rfloor +\left\lfloor \dfrac{b}{p^{i}%
}\right\rfloor +\left(  n-1\right)  \left\lfloor \dfrac{a+b}{p^{i}%
}\right\rfloor \leq\left\lfloor \dfrac{na}{p^{i}}\right\rfloor +\left\lfloor
\dfrac{nb}{p^{i}}\right\rfloor
\label{prop.sol.ent.prime.de-polignac.mp.2.goal2}%
\end{equation}
for every positive integer $i$ (because once this is proved, we can obtain
(\ref{sol.pval.e5.a.p-goal}) by summing
(\ref{prop.sol.ent.prime.de-polignac.mp.2.goal2}) over all $i\in\left\{
1,2,3,\ldots\right\}  $).

In order to prove (\ref{prop.sol.ent.prime.de-polignac.mp.2.goal2}), we will
show the following lemma:

\begin{lemma}
\label{lem.floor.nx+ny-vs-n-1.1}Let $x,y\in\mathbb{R}$ and $n\in\mathbb{N}$.
Then,%
\begin{equation}
\left\lfloor x\right\rfloor +\left\lfloor y\right\rfloor +\left(  n-1\right)
\left\lfloor x+y\right\rfloor \leq\left\lfloor nx\right\rfloor +\left\lfloor
ny\right\rfloor . \label{eq.lem.floor.nx+ny-vs-n-1.1.clm}%
\end{equation}

\end{lemma}

\begin{proof}
[Proof of Lemma \ref{lem.floor.nx+ny-vs-n-1.1}.]We recall the following easy
property of the floor function: If $r\in\mathbb{R}$ and $k\in\mathbb{Z}$, then%
\begin{equation}
\left\lfloor r+k\right\rfloor =\left\lfloor r\right\rfloor +k.
\label{pf.lem.floor.nx+ny-vs-n-1.1.move}%
\end{equation}
(Convince yourself that this is true!)

Now, let $k\in\mathbb{Z}$ be arbitrary. Let us see what happens to the two
sides of the inequality (\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}) if we replace
$x$ by $x+k$. Indeed, the left hand side becomes%
\begin{align*}
&  \left\lfloor x+k\right\rfloor +\left\lfloor y\right\rfloor +\left(
n-1\right)  \left\lfloor \underbrace{\left(  x+k\right)  +y}_{=x+y+k}%
\right\rfloor \\
&  =\underbrace{\left\lfloor x+k\right\rfloor }_{\substack{=\left\lfloor
x\right\rfloor +k\\\text{(by (\ref{pf.lem.floor.nx+ny-vs-n-1.1.move}), applied
to }r=x\text{)}}}+\left\lfloor y\right\rfloor +\left(  n-1\right)
\underbrace{\left\lfloor x+y+k\right\rfloor }_{\substack{=\left\lfloor
x+y\right\rfloor +k\\\text{(by (\ref{pf.lem.floor.nx+ny-vs-n-1.1.move}),
applied to }r=x+y\text{)}}}\\
&  =\left\lfloor x\right\rfloor +k+\left\lfloor y\right\rfloor +\left(
n-1\right)  \left(  \left\lfloor x+y\right\rfloor +k\right) \\
&  =\left(  \left\lfloor x\right\rfloor +\left\lfloor y\right\rfloor +\left(
n-1\right)  \left\lfloor x+y\right\rfloor \right)  +nk;
\end{align*}
in other words, the left hand side increases by $nk$. On the other hand, the
right hand side of (\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}) becomes%
\begin{align*}
\left\lfloor \underbrace{n\left(  x+k\right)  }_{=nx+nk}\right\rfloor
+\left\lfloor ny\right\rfloor  &  =\underbrace{\left\lfloor nx+nk\right\rfloor
}_{\substack{=\left\lfloor nx\right\rfloor +nk\\\text{(by
(\ref{pf.lem.floor.nx+ny-vs-n-1.1.move}), applied to }nx\text{ and
}nk\\\text{instead of }r\text{ and }k\text{)}}}+\left\lfloor ny\right\rfloor
\\
&  =\left\lfloor nx\right\rfloor +nk+\left\lfloor ny\right\rfloor =\left(
\left\lfloor nx\right\rfloor +\left\lfloor ny\right\rfloor \right)  +nk;
\end{align*}
in other words, the right hand side also increases by $nk$. Thus, if we
replace $x$ by $x+k$, then both sides of
(\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}) increase by one and the same amount
(namely, by $nk$). Clearly, this increase does not change the validity of the
inequality (\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}). Thus, we can replace $x$
by $x+k$ without changing the validity of the inequality
(\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}). Hence, for the rest of the proof of
(\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}), we can WLOG assume that $0\leq x<1$,
because we can always achieve this situation by replacing $x$ by $x+k$ for an
appropriate $k\in\mathbb{Z}$ (namely, for $k=-\left\lfloor x\right\rfloor $).
Thus, let us WLOG assume that $0\leq x<1$. For similar reasons, we can WLOG
assume that $0\leq y<1$. Let us assume this as well.

From $0\leq x<1$, we obtain $\left\lfloor x\right\rfloor =0$. Similarly,
$\left\lfloor y\right\rfloor =0$. Thus, the inequality that we must prove --
namely, (\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}) -- simplifies to%
\begin{equation}
\left(  n-1\right)  \left\lfloor x+y\right\rfloor \leq\left\lfloor
nx\right\rfloor +\left\lfloor ny\right\rfloor .
\label{eq.lem.floor.nx+ny-vs-n-1.1.clm2}%
\end{equation}


From $0\leq x$, we obtain $x\geq0$ and thus $nx\geq0$ (since $n\geq0$). Hence,
$\left\lfloor nx\right\rfloor \geq0$ (because each real number $r\geq0$
satisfies $\left\lfloor r\right\rfloor \geq0$). Similarly, $\left\lfloor
ny\right\rfloor \geq0$. Thus, the right hand side of
(\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm2}) is $\geq0$. Hence,
(\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm2}) clearly holds if $\left\lfloor
x+y\right\rfloor =0$. For the rest of this proof, we thus WLOG assume that
$\left\lfloor x+y\right\rfloor \neq0$.

From $0\leq x<1$ and $0\leq y<1$, we obtain $0\leq x+y<2$. Thus, $\left\lfloor
x+y\right\rfloor $ is either $0$ or $1$. Since $\left\lfloor x+y\right\rfloor
\neq0$, we thus obtain $\left\lfloor x+y\right\rfloor =1$. Hence,
$1=\left\lfloor x+y\right\rfloor \leq x+y$ (since $\left\lfloor r\right\rfloor
\leq r$ for each $r\in\mathbb{R}$), and thus $x+y\geq1$.

However, it is well-known that $\left\lfloor r\right\rfloor >r-1$ for each
$r\in\mathbb{R}$. Applying this to $r=nx$, we obtain $\left\lfloor
nx\right\rfloor >nx-1$. Similarly, $\left\lfloor ny\right\rfloor >ny-1$.
Adding these two inequalities together, we obtain%
\[
\left\lfloor nx\right\rfloor +\left\lfloor ny\right\rfloor >\left(
nx-1\right)  +\left(  ny-1\right)  =n\underbrace{\left(  x+y\right)  }_{\geq
1}-2\geq n-2.
\]
Since $\left\lfloor nx\right\rfloor +\left\lfloor ny\right\rfloor $ and $n-2$
are integers, this entails $\left\lfloor nx\right\rfloor +\left\lfloor
ny\right\rfloor \geq\left(  n-2\right)  +1=n-1=\left(  n-1\right)
\left\lfloor x+y\right\rfloor $ (because $\left\lfloor x+y\right\rfloor =1$).
In other words, $\left(  n-1\right)  \left\lfloor x+y\right\rfloor
\leq\left\lfloor nx\right\rfloor +\left\lfloor ny\right\rfloor $. Thus, we
have proved (\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm2}). Since
(\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm2}) is an equivalent restatement of
(\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}), we have therefore proved
(\ref{eq.lem.floor.nx+ny-vs-n-1.1.clm}) as well. In other words, Lemma
\ref{lem.floor.nx+ny-vs-n-1.1} is proved.
\end{proof}

The above proof of Lemma \ref{lem.floor.nx+ny-vs-n-1.1} illustrates a useful
strategy (viz., transporting $x$ into the interval $\left[  0,1\right)  $ by
subtracting an appropriate integer).

Let us now return to solving Exercise \ref{exe.pval.e5} \textbf{(a)}. For each
positive integer $i$, we have%
\begin{align}
&  \left\lfloor \dfrac{a}{p^{i}}\right\rfloor +\left\lfloor \dfrac{b}{p^{i}%
}\right\rfloor +\left(  n-1\right)  \left\lfloor \dfrac{a+b}{p^{i}%
}\right\rfloor \nonumber\\
&  =\left\lfloor \dfrac{a}{p^{i}}\right\rfloor +\left\lfloor \dfrac{b}{p^{i}%
}\right\rfloor +\left(  n-1\right)  \left\lfloor \dfrac{a}{p^{i}}+\dfrac
{b}{p^{i}}\right\rfloor \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\dfrac
{a+b}{p^{i}}=\dfrac{a}{p^{i}}+\dfrac{b}{p^{i}}\right) \nonumber\\
&  \leq\left\lfloor n\cdot\dfrac{a}{p^{i}}\right\rfloor +\left\lfloor
n\cdot\dfrac{b}{p^{i}}\right\rfloor \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by Lemma \ref{lem.floor.nx+ny-vs-n-1.1},}\\
\text{applied to }x=\dfrac{a}{p^{i}}\text{ and }y=\dfrac{b}{p^{i}}%
\end{array}
\right) \nonumber\\
&  =\left\lfloor \dfrac{na}{p^{i}}\right\rfloor +\left\lfloor \dfrac{nb}%
{p^{i}}\right\rfloor . \label{sol.pval.e5.5}%
\end{align}
Thus, (\ref{prop.sol.ent.prime.de-polignac.mp.2.goal2}) is proven. As
explained above, this completes the proof of (\ref{sol.pval.e5.a.p-goal}).

Now, forget that we fixed $p$. We thus have shown that each prime $p$
satisfies (\ref{sol.pval.e5.a.p-goal}). According to Proposition
\ref{prop.pval.n|m} (applied to $a!b!\left(  a+b\right)  !^{n-1}$ and $\left(
na\right)  !\left(  nb\right)  !$ instead of $n$ and $m$), this entails that
$a!b!\left(  a+b\right)  !^{n-1}\mid\left(  na\right)  !\left(  nb\right)  !$.
Therefore, $\dfrac{\left(  na\right)  !\left(  nb\right)  !}{a!b!\left(
a+b\right)  !^{n-1}}$ is an integer. This solves Exercise \ref{exe.pval.e5}
\textbf{(a)}. \medskip

\textbf{(b)} Let $m:=\dfrac{\left(  na\right)  !\left(  nb\right)
!}{a!b!\left(  a+b\right)  !^{n-1}}$. We know from part \textbf{(a)} of this
exercise that $m$ is an integer. We must show that $m$ is divisible by $n$. In
other words, we must show that $n\mid m$. According to Proposition
\ref{prop.pval.n|m}, it suffices to show that each prime $p$ satisfies
$v_{p}\left(  n\right)  \leq v_{p}\left(  m\right)  $.

So let $p$ be a prime. Our goal is to show that $v_{p}\left(  n\right)  \leq
v_{p}\left(  m\right)  $. In other words, our goal is to show that
$v_{p}\left(  m\right)  \geq v_{p}\left(  n\right)  $.

From $m=\dfrac{\left(  na\right)  !\left(  nb\right)  !}{a!b!\left(
a+b\right)  !^{n-1}}$, we obtain $m\cdot a!b!\left(  a+b\right)
!^{n-1}=\left(  na\right)  !\left(  nb\right)  !$, so that%
\begin{align*}
&  v_{p}\left(  m\cdot a!b!\left(  a+b\right)  !^{n-1}\right) \\
&  =v_{p}\left(  \left(  na\right)  !\left(  nb\right)  !\right)  =\sum
_{i\geq1}\left(  \left\lfloor \dfrac{na}{p^{i}}\right\rfloor +\left\lfloor
\dfrac{nb}{p^{i}}\right\rfloor \right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.pval.e5.a.2})}\right)  .
\end{align*}
Therefore,%
\begin{align*}
&  \sum_{i\geq1}\left(  \left\lfloor \dfrac{na}{p^{i}}\right\rfloor
+\left\lfloor \dfrac{nb}{p^{i}}\right\rfloor \right) \\
&  =v_{p}\left(  m\cdot a!b!\left(  a+b\right)  !^{n-1}\right) \\
&  =v_{p}\left(  m\right)  +v_{p}\left(  a!b!\left(  a+b\right)
!^{n-1}\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.pval.vp-ring} \textbf{(a)}}\right) \\
&  =v_{p}\left(  m\right)  +\sum_{i\geq1}\left(  \left\lfloor \dfrac{a}{p^{i}%
}\right\rfloor +\left\lfloor \dfrac{b}{p^{i}}\right\rfloor +\left(
n-1\right)  \left\lfloor \dfrac{a+b}{p^{i}}\right\rfloor \right)
\end{align*}
(by (\ref{sol.pval.e5.a.1})). Solving this equation for $v_{p}\left(
m\right)  $, we obtain%
\begin{align}
&  v_{p}\left(  m\right) \nonumber\\
&  =\sum_{i\geq1}\left(  \left\lfloor \dfrac{na}{p^{i}}\right\rfloor
+\left\lfloor \dfrac{nb}{p^{i}}\right\rfloor \right)  -\sum_{i\geq1}\left(
\left\lfloor \dfrac{a}{p^{i}}\right\rfloor +\left\lfloor \dfrac{b}{p^{i}%
}\right\rfloor +\left(  n-1\right)  \left\lfloor \dfrac{a+b}{p^{i}%
}\right\rfloor \right) \nonumber\\
&  =\sum_{i\geq1}\left(  \left\lfloor \dfrac{na}{p^{i}}\right\rfloor
+\left\lfloor \dfrac{nb}{p^{i}}\right\rfloor -\left(  \left\lfloor \dfrac
{a}{p^{i}}\right\rfloor +\left\lfloor \dfrac{b}{p^{i}}\right\rfloor +\left(
n-1\right)  \left\lfloor \dfrac{a+b}{p^{i}}\right\rfloor \right)  \right)  .
\label{sol.pval.e5.b.vpm=}%
\end{align}
Thus, we need to show that the sum on the right hand side is $\geq
v_{p}\left(  n\right)  $ (since our goal is to show that $v_{p}\left(
m\right)  \geq v_{p}\left(  n\right)  $). The inequality (\ref{sol.pval.e5.5})
shows that each addend in this sum is $\geq0$; thus, it will suffice to show
that at least $v_{p}\left(  n\right)  $ many of these addends are $\geq1$ each.

This is what we shall now do. To be specific, we set $h:=\min\left\{
v_{p}\left(  a\right)  ,v_{p}\left(  b\right)  \right\}  $; this is a
nonnegative integer (since $\left(  a,b\right)  \neq\left(  0,0\right)  $
entails that at least one of $v_{p}\left(  a\right)  $ and $v_{p}\left(
b\right)  $ belongs to $\mathbb{N}$). We will now show that each $i\in\left\{
h+1,h+2,\ldots,h+v_{p}\left(  n\right)  \right\}  $ satisfies
\begin{equation}
\left\lfloor \dfrac{na}{p^{i}}\right\rfloor +\left\lfloor \dfrac{nb}{p^{i}%
}\right\rfloor -\left(  \left\lfloor \dfrac{a}{p^{i}}\right\rfloor
+\left\lfloor \dfrac{b}{p^{i}}\right\rfloor +\left(  n-1\right)  \left\lfloor
\dfrac{a+b}{p^{i}}\right\rfloor \right)  \geq1. \label{sol.pval.e5.b.goal1}%
\end{equation}


[\textit{Proof of (\ref{sol.pval.e5.b.goal1}):} Let $i\in\left\{
h+1,h+2,\ldots,h+v_{p}\left(  n\right)  \right\}  $. Thus, $h<i\leq
h+v_{p}\left(  n\right)  $.

We have $h=\min\left\{  v_{p}\left(  a\right)  ,v_{p}\left(  b\right)
\right\}  \leq v_{p}\left(  a\right)  $ and
\[
i\leq\underbrace{h}_{\leq v_{p}\left(  a\right)  }+v_{p}\left(  n\right)  \leq
v_{p}\left(  a\right)  +v_{p}\left(  n\right)  =v_{p}\left(  n\right)
+v_{p}\left(  a\right)  =v_{p}\left(  na\right)
\]
(since Theorem \ref{thm.pval.vp-ring} \textbf{(a)} yields $v_{p}\left(
na\right)  =v_{p}\left(  n\right)  +v_{p}\left(  a\right)  $). In other words,
$v_{p}\left(  na\right)  \geq i$. However, Lemma \ref{lem.pval.vp-def}
(applied to $na$ instead of $n$) yields that $p^{i}\mid na$ if and only if
$v_{p}\left(  na\right)  \geq i$. Hence, $p^{i}\mid na$ (since $v_{p}\left(
na\right)  \geq i$). Thus, $\dfrac{na}{p^{i}}$ is an integer, so that
$\left\lfloor \dfrac{na}{p^{i}}\right\rfloor =\dfrac{na}{p^{i}}$ (since
$\left\lfloor r\right\rfloor =r$ for every integer $r$). Similarly,
$\left\lfloor \dfrac{nb}{p^{i}}\right\rfloor =\dfrac{nb}{p^{i}}$.

We note that $a$ and $b$ play symmetric roles in our claim. Thus, we can WLOG
assume that $v_{p}\left(  a\right)  \leq v_{p}\left(  b\right)  $ (since
otherwise, we can just swap $a$ with $b$). Hence, $h=\min\left\{  v_{p}\left(
a\right)  ,v_{p}\left(  b\right)  \right\}  =v_{p}\left(  a\right)  $ (since
$v_{p}\left(  a\right)  \leq v_{p}\left(  b\right)  $). Hence, the inequality
$h<i$ (which we know to hold) rewrites as $v_{p}\left(  a\right)  <i$. In
other words, we don't have $v_{p}\left(  a\right)  \geq i$. However, Lemma
\ref{lem.pval.vp-def} (applied to $a$ instead of $n$) yields that $p^{i}\mid
a$ if and only if $v_{p}\left(  a\right)  \geq i$. Hence, we don't have
$p^{i}\mid a$ (since we don't have $v_{p}\left(  a\right)  \geq i$). In other
words, $\dfrac{a}{p^{i}}$ is not an integer. Thus, $\left\lfloor \dfrac
{a}{p^{i}}\right\rfloor <\dfrac{a}{p^{i}}$ (because if $r\in\mathbb{R}$ is not
an integer, then $\left\lfloor r\right\rfloor <r$).

Also, recall that any $r\in\mathbb{R}$ satisfies $\left\lfloor r\right\rfloor
\leq r$. Hence, $\left\lfloor \dfrac{b}{p^{i}}\right\rfloor \leq\dfrac
{b}{p^{i}}$ and $\left\lfloor \dfrac{a+b}{p^{i}}\right\rfloor \leq\dfrac
{a+b}{p^{i}}$. We can multiply the latter inequality by $n-1$ (indeed,
$n-1\geq0$, because $n$ is a positive integer), and thus obtain $\left(
n-1\right)  \left\lfloor \dfrac{a+b}{p^{i}}\right\rfloor \leq\left(
n-1\right)  \dfrac{a+b}{p^{i}}$.

Now, using all the equalities and inequalities we have proved so far, we see
that%
\begin{align*}
&  \underbrace{\left\lfloor \dfrac{na}{p^{i}}\right\rfloor }_{=\dfrac
{na}{p^{i}}}+\underbrace{\left\lfloor \dfrac{nb}{p^{i}}\right\rfloor
}_{=\dfrac{nb}{p^{i}}}-\left(  \underbrace{\left\lfloor \dfrac{a}{p^{i}%
}\right\rfloor }_{<\dfrac{a}{p^{i}}}+\underbrace{\left\lfloor \dfrac{b}{p^{i}%
}\right\rfloor }_{\leq\dfrac{b}{p^{i}}}+\underbrace{\left(  n-1\right)
\left\lfloor \dfrac{a+b}{p^{i}}\right\rfloor }_{\leq\left(  n-1\right)
\dfrac{a+b}{p^{i}}}\right) \\
&  >\dfrac{na}{p^{i}}+\dfrac{nb}{p^{i}}-\left(  \dfrac{a}{p^{i}}+\dfrac
{b}{p^{i}}+\left(  n-1\right)  \dfrac{a+b}{p^{i}}\right)  =0.
\end{align*}
Since $\left\lfloor \dfrac{na}{p^{i}}\right\rfloor +\left\lfloor \dfrac
{nb}{p^{i}}\right\rfloor -\left(  \left\lfloor \dfrac{a}{p^{i}}\right\rfloor
+\left\lfloor \dfrac{b}{p^{i}}\right\rfloor +\left(  n-1\right)  \left\lfloor
\dfrac{a+b}{p^{i}}\right\rfloor \right)  $ is an integer, this entails%
\[
\left\lfloor \dfrac{na}{p^{i}}\right\rfloor +\left\lfloor \dfrac{nb}{p^{i}%
}\right\rfloor -\left(  \left\lfloor \dfrac{a}{p^{i}}\right\rfloor
+\left\lfloor \dfrac{b}{p^{i}}\right\rfloor +\left(  n-1\right)  \left\lfloor
\dfrac{a+b}{p^{i}}\right\rfloor \right)  \geq1.
\]
Thus, (\ref{sol.pval.e5.b.goal1}) is proved.] \medskip

Now, we are almost there: We know that all addends in the sum on the right
hand side of (\ref{sol.pval.e5.b.vpm=}) are nonnegative (by
(\ref{sol.pval.e5.5})), and we also know that at least $v_{p}\left(  n\right)
$ many of these addends are $\geq1$ each (indeed, (\ref{sol.pval.e5.b.goal1})
shows that the addends for $i\in\left\{  h+1,h+2,\ldots,h+v_{p}\left(
n\right)  \right\}  $ are $\geq1$ each). Thus, the entire sum is
$\geq\underbrace{1+1+\cdots+1}_{v_{p}\left(  n\right)  \text{ times}}%
=v_{p}\left(  n\right)  $. Hence, the left hand side of
(\ref{sol.pval.e5.b.vpm=}) is also $\geq v_{p}\left(  n\right)  $. In other
words, we have $v_{p}\left(  m\right)  \geq v_{p}\left(  n\right)  $. But
proving this inequality was precisely our goal. Thus, we have solved Exercise
\ref{exe.pval.e5} \textbf{(b)}.
\end{proof}

\subsection{Class problems}

The following problems are to be discussed during class.

\begin{exercise}
\label{exe.pval.c1}Let $n\in\mathbb{N}$. Let $a$ and $b$ be two coprime
positive integers. Assume that $ab$ is the $n$-th power of a positive integer.
Prove that $a$ and $b$ are $n$-th powers of positive integers.
\end{exercise}

\begin{exercise}
\label{exe.pval.c2}Let $a$ and $b$ be two integers. Let $i\in\mathbb{N}$ be
such that $2^{i}>\left\vert b\right\vert $. Assume that $a^{i}\mid b^{i+1}$.
Show that $a\mid b$.
\end{exercise}

\begin{exercise}
\label{exe.pval.c3}With how many $0$s does the base-$10$ representation of the
number $90!$ end?
\end{exercise}

\begin{exercise}
\label{exe.pval.c4}Let $a\in\mathbb{Z}$, and let $n$ be a positive integer.
Prove that%
\[
n!\mid a^{n-1}\prod_{i=1}^{n}\left(  a^{i}-1\right)  .
\]

\end{exercise}

\begin{exercise}
\label{exe.pval.c5}Let $p$ be a prime. Let $a$ and $b$ be two integers such
that $a\equiv b\not \equiv 0\operatorname{mod}p$. Let $n$ be a positive
integer. \medskip

\textbf{(a)} Prove that $v_{p}\left(  a^{n}-b^{n}\right)  \geq v_{p}\left(
a-b\right)  +v_{p}\left(  n\right)  $. \medskip

\textbf{(b)} Prove that $v_{p}\left(  a^{n}-b^{n}\right)  =v_{p}\left(
a-b\right)  +v_{p}\left(  n\right)  $ if $p\neq2$. \medskip

\textbf{(c)} Prove that $v_{p}\left(  a^{n}-b^{n}\right)  =v_{p}\left(
a-b\right)  +v_{p}\left(  n\right)  $ if $p=2$ and $a\equiv
b\operatorname{mod}4$. \medskip

\textbf{(d)} Find an example where $p=2$ and $a\equiv b\operatorname{mod}2$
and $v_{p}\left(  a^{n}-b^{n}\right)  >v_{p}\left(  a-b\right)  +v_{p}\left(
n\right)  $.
\end{exercise}

\subsection{Homework exercises}

Solve 3 of the 6 exercises below and upload your solutions on gradescope by
October 29.

\begin{exercise}
\label{exe.pval.h1}Let $a,b,c\in\mathbb{Z}$. Prove that:\medskip

\textbf{(a)} We have%
\[
\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)  .
\]


\textbf{(b)} We have%
\[
\operatorname{lcm}\left(  b,c\right)  \cdot\operatorname{lcm}\left(
c,a\right)  \cdot\operatorname{lcm}\left(  a,b\right)  =\operatorname{lcm}%
\left(  a,b,c\right)  \cdot\operatorname{lcm}\left(  bc,ca,ab\right)  .
\]


\textbf{(c)} Assume that $a,b,c$ are nonzero. Then,%
\[
\dfrac{\gcd\left(  bc,ca,ab\right)  }{\gcd\left(  a,b,c\right)  }%
=\dfrac{\operatorname{lcm}\left(  bc,ca,ab\right)  }{\operatorname{lcm}\left(
a,b,c\right)  }\in\mathbb{Z}.
\]

\end{exercise}

\begin{exercise}
\label{exe.pval.h2}Fix a prime $p$. Let $a$ and $b$ be two integers satisfying
$\gcd\left(  a,b\right)  =p$. What values can $\gcd\left(  a^{5}%
,b^{13}\right)  $ take?
\end{exercise}

\begin{exercise}
\label{exe.pval.h3}Let $n,a,b,c\in\mathbb{N}$ such that $n$ is odd. Prove
that
\[
\dfrac{\left(  na\right)  !\left(  nb\right)  !\left(  nc\right)
!}{a!b!c!\left(  \left(  b+c\right)  !\left(  c+a\right)  !\left(  a+b\right)
!\right)  ^{\left(  n-1\right)  /2}}%
\]
is an integer.
\end{exercise}

\begin{exercise}
\label{exe.pval.h4}Let $n\in\mathbb{N}$. Prove that%
\[
\left(  n+1\right)  \operatorname{lcm}\left(  \dbinom{n}{0},\dbinom{n}%
{1},\ldots,\dbinom{n}{n}\right)  =\operatorname{lcm}\left(  1,2,\ldots
,n+1\right)  .
\]

\end{exercise}

\begin{exercise}
\label{exe.pval.h5}Let $k$ and $n$ be any two positive integers. Prove that an
expression of the form%
\[
\pm\dfrac{1}{k}\pm\dfrac{1}{k+1}\pm\dfrac{1}{k+2}\pm\cdots\pm\dfrac{1}{k+n}%
\]
(where each $\pm$ sign is either a $+$ or a $-$ sign) will never be an
integer, no matter what the $\pm$ signs are.

[\textbf{Hint:} Show that one of the numbers $k,k+1,\ldots,k+n$ has a higher
$2$-valuation than all of the others.]
\end{exercise}

\begin{exercise}
\label{exe.pval.h6}Let $\left(  u_{1},u_{2},u_{3},\ldots\right)  $ be a
sequence of nonzero integers such that
\[
\text{every }a,b\in\left\{  1,2,3,\ldots\right\}  \text{ satisfy }\gcd\left(
u_{a},u_{b}\right)  =\left\vert u_{\gcd\left(  a,b\right)  }\right\vert .
\]
(We have seen such a sequence in Exercise 3.7.4; another example is the
Fibonacci sequence because of \cite[Exercise 3.7.2]{20f}.)

Prove that there exists a sequence $\left(  v_{1},v_{2},v_{3},\ldots\right)  $
of nonzero integers such that%
\[
\text{each }n\in\left\{  1,2,3,\ldots\right\}  \text{ satisfies }u_{n}%
=\prod_{d\mid n}v_{d}.
\]
Here, the symbol \textquotedblleft$\prod_{d\mid n}$\textquotedblright\ means a
product over all positive divisors $d$ of $n$. Thus, the equality $u_{n}%
=\prod_{d\mid n}v_{d}$ means%
\begin{align*}
u_{1}  &  =v_{1}\ \ \ \ \ \ \ \ \ \ \text{for }n=1;\\
u_{2}  &  =v_{1}v_{2}\ \ \ \ \ \ \ \ \ \ \text{for }n=2;\\
u_{3}  &  =v_{1}v_{3}\ \ \ \ \ \ \ \ \ \ \text{for }n=3;\\
u_{4}  &  =v_{1}v_{2}v_{4}\ \ \ \ \ \ \ \ \ \ \text{for }n=4;\\
u_{5}  &  =v_{1}v_{5}\ \ \ \ \ \ \ \ \ \ \text{for }n=5;\\
u_{6}  &  =v_{1}v_{2}v_{3}v_{6}\ \ \ \ \ \ \ \ \ \ \text{for }n=6;
\end{align*}
and so on.
\end{exercise}

\begin{exercise}
Prove that $\gcd\left(  a,b\right)  =\gcd\left(  a+b,\ \operatorname{lcm}%
\left(  a,b\right)  \right)  $ for any two integers $a$ and $b$.
\end{exercise}

\subsection{\label{sec.pval.app-pf}Appendix: Proof of Proposition
\ref{prop.pval.gcd-lcm-k}}

We shall now prove Proposition \ref{prop.pval.gcd-lcm-k}. First, we recall the
universal properties of gcds and lcms:

\begin{theorem}
[universal properties of gcd and lcm]\label{thm.pval.gcd-lcm-uprops}Let
$b_{1},b_{2},\ldots,b_{k}$ be integers. Let $m\in\mathbb{Z}$.

\textbf{(a)} 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)} 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)  .
\]

\end{theorem}

So Theorem \ref{thm.pval.gcd-lcm-uprops} \textbf{(a)} says that the common
divisors of $k$ integers $b_{1},b_{2},\ldots,b_{k}$ are precisely the divisors
of $\gcd\left(  b_{1},b_{2},\ldots,b_{k}\right)  $; meanwhile, Theorem
\ref{thm.pval.gcd-lcm-uprops} \textbf{(b)} says that the common multiples of
$k$ integers $b_{1},b_{2},\ldots,b_{k}$ are precisely the multiples of
$\operatorname{lcm}\left(  b_{1},b_{2},\ldots,b_{k}\right)  $.

Theorem \ref{thm.pval.gcd-lcm-uprops} \textbf{(a)} is proved in \cite[Theorem
2.9.21 \textbf{(a)}]{19s}. Theorem \ref{thm.pval.gcd-lcm-uprops} \textbf{(b)}
is proved in \cite[Theorem 2.11.9 \textbf{(a)}]{19s}.

\begin{proof}
[Proof of Proposition \ref{prop.pval.gcd-lcm-k} (sketched).]\textbf{(a)} We
WLOG assume that the $k$ integers $n_{1},n_{2},\ldots,n_{k}$ are not all equal
to $0$ (since otherwise, the claim boils down to $\infty=\min\left\{
\infty,\infty,\ldots,\infty\right\}  $). Thus, $\min\left\{  v_{p}\left(
n_{1}\right)  ,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)
\right\}  $ is a nonnegative integer (not $\infty$).

Let $g=\gcd\left(  n_{1},n_{2},\ldots,n_{k}\right)  $. Then, $g$ is a positive
integer (since $n_{1},n_{2},\ldots,n_{k}$ are not all equal to $0$). Hence,
$v_{p}\left(  g\right)  $ is a nonnegative integer (not $\infty$).

For each $i\in\left\{  1,2,\ldots,k\right\}  $, we have $g=\gcd\left(
n_{1},n_{2},\ldots,n_{k}\right)  \mid n_{i}$ (by the definition of the gcd)
and thus $v_{p}\left(  g\right)  \leq v_{p}\left(  n_{i}\right)  $ (by
Proposition \ref{prop.pval.n|m}, applied to $n=g$ and $m=n_{i}$). Hence,%
\begin{equation}
v_{p}\left(  g\right)  \leq\min\left\{  v_{p}\left(  n_{1}\right)
,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}
\label{pf.prop.pval.gcd-lcm-k.a.leq}%
\end{equation}
(since $\min\left\{  v_{p}\left(  n_{1}\right)  ,v_{p}\left(  n_{2}\right)
,\ldots,v_{p}\left(  n_{k}\right)  \right\}  =v_{p}\left(  n_{i}\right)  $ for
some $i\in\left\{  1,2,\ldots,k\right\}  $).

Now, assume (for the sake of contradiction) that the inequality
(\ref{pf.prop.pval.gcd-lcm-k.a.leq}) is strict (i.e., not an equality). Thus,%
\begin{equation}
v_{p}\left(  g\right)  <\min\left\{  v_{p}\left(  n_{1}\right)  ,v_{p}\left(
n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}  .
\label{pf.prop.pval.gcd-lcm-k.a.leqq}%
\end{equation}


Let $i\in\left\{  1,2,\ldots,k\right\}  $. Then,
(\ref{pf.prop.pval.gcd-lcm-k.a.leqq}) becomes%
\begin{align}
v_{p}\left(  g\right)   &  <\min\left\{  v_{p}\left(  n_{1}\right)
,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}
\nonumber\\
&  \leq v_{p}\left(  n_{i}\right)  . \label{pf.prop.pval.gcd-lcm-k.a.leqq2}%
\end{align}
However, $g=\gcd\left(  n_{1},n_{2},\ldots,n_{k}\right)  \mid n_{i}$ (by the
definition of the gcd), so that $\dfrac{n_{i}}{g}\in\mathbb{Z}$ (since $g$ is
a positive integer). Theorem \ref{thm.pval.vp-ring} \textbf{(a)} yields
$v_{p}\left(  g\cdot\dfrac{n_{i}}{g}\right)  =v_{p}\left(  g\right)
+v_{p}\left(  \dfrac{n_{i}}{g}\right)  $, so that%
\[
v_{p}\left(  \dfrac{n_{i}}{g}\right)  =v_{p}\left(  \underbrace{g\cdot
\dfrac{n_{i}}{g}}_{=n_{i}}\right)  -\underbrace{v_{p}\left(  g\right)
}_{\substack{<v_{p}\left(  n_{i}\right)  \\\text{(by
(\ref{pf.prop.pval.gcd-lcm-k.a.leqq2}))}}}>v_{p}\left(  n_{i}\right)
-v_{p}\left(  n_{i}\right)  =0.
\]
Thus, we don't have $v_{p}\left(  \dfrac{n_{i}}{g}\right)  =0$. However,
Corollary \ref{cor.pval.vp-0} (applied to $n=\dfrac{n_{i}}{g}$) yields that
$v_{p}\left(  \dfrac{n_{i}}{g}\right)  =0$ if and only if $p\nmid\dfrac{n_{i}%
}{g}$. Hence, we don't have $p\nmid\dfrac{n_{i}}{g}$ (since we don't have
$v_{p}\left(  \dfrac{n_{i}}{g}\right)  =0$). In other words, we have
$p\mid\dfrac{n_{i}}{g}$. Hence, $\dfrac{n_{i}}{g}/p\in\mathbb{Z}$. In other
words, $\dfrac{n_{i}}{pg}\in\mathbb{Z}$ (since $\dfrac{n_{i}}{g}%
/p=\dfrac{n_{i}}{pg}$). In other words, $pg\mid n_{i}$.

Forget that we fixed $i$. We thus have shown that $pg\mid n_{i}$ for all
$i\in\left\{  1,2,\ldots,k\right\}  $. However, Theorem
\ref{thm.pval.gcd-lcm-uprops} \textbf{(a)} (applied to $b_{i}=n_{i}$ and
$m=pg$) shows that this is equivalent to having $pg\mid\gcd\left(  n_{1}%
,n_{2},\ldots,n_{k}\right)  $. Thus, we obtain $pg\mid\gcd\left(  n_{1}%
,n_{2},\ldots,n_{k}\right)  $. In view of $\gcd\left(  n_{1},n_{2}%
,\ldots,n_{k}\right)  =g$, this rewrites as $pg\mid g$. Hence, $\dfrac{g}%
{pg}\in\mathbb{Z}$. But this contradicts $\dfrac{g}{pg}=\dfrac{1}{p}%
\notin\mathbb{Z}$. This contradiction shows that our assumption (viz., that
the inequality (\ref{pf.prop.pval.gcd-lcm-k.a.leq}) is strict) was false.
Hence, the inequality (\ref{pf.prop.pval.gcd-lcm-k.a.leq}) cannot be strict,
i.e., must be an equality. In other words, we have%
\[
v_{p}\left(  g\right)  =\min\left\{  v_{p}\left(  n_{1}\right)  ,v_{p}\left(
n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}  .
\]
In view of $g=\gcd\left(  n_{1},n_{2},\ldots,n_{k}\right)  $, this rewrites as%
\[
v_{p}\left(  \gcd\left(  n_{1},n_{2},\ldots,n_{k}\right)  \right)
=\min\left\{  v_{p}\left(  n_{1}\right)  ,v_{p}\left(  n_{2}\right)
,\ldots,v_{p}\left(  n_{k}\right)  \right\}  .
\]
Thus, Proposition \ref{prop.pval.gcd-lcm-k} \textbf{(a)} is proved. (A
different proof can be found in \cite[proof of Proposition 9.3.11]%
{20f}.)\medskip

\textbf{(b)} We WLOG assume that none of the $k$ integers $n_{1},n_{2}%
,\ldots,n_{k}$ equals $0$ (since otherwise, the claim boils down to
$\infty=\max S$ for a set $S$ that contains $\infty$). Thus, $\max\left\{
v_{p}\left(  n_{1}\right)  ,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(
n_{k}\right)  \right\}  $ is a nonnegative integer (not $\infty$).

Let $\ell=\operatorname{lcm}\left(  n_{1},n_{2},\ldots,n_{k}\right)  $. Then,
$\ell$ is a positive integer (since none of $n_{1},n_{2},\ldots,n_{k}$ equals
$0$). Hence, $v_{p}\left(  \ell\right)  $ is a nonnegative integer (not
$\infty$).

For each $i\in\left\{  1,2,\ldots,k\right\}  $, we have
\begin{equation}
n_{i}\mid\ell\label{pf.prop.pval.gcd-lcm-k.b.nidl}%
\end{equation}
(because the definition of an lcm yields $n_{i}\mid\operatorname{lcm}\left(
n_{1},n_{2},\ldots,n_{k}\right)  =\ell$) and thus $v_{p}\left(  n_{i}\right)
\leq v_{p}\left(  \ell\right)  $ (by Proposition \ref{prop.pval.n|m}, applied
to $n=n_{i}$ and $m=\ell$). In other words, for each $i\in\left\{
1,2,\ldots,k\right\}  $, we have $v_{p}\left(  \ell\right)  \geq v_{p}\left(
n_{i}\right)  $. Hence,%
\begin{equation}
v_{p}\left(  \ell\right)  \geq\max\left\{  v_{p}\left(  n_{1}\right)
,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}
\label{pf.prop.pval.gcd-lcm-k.b.geq}%
\end{equation}
(since $\max\left\{  v_{p}\left(  n_{1}\right)  ,v_{p}\left(  n_{2}\right)
,\ldots,v_{p}\left(  n_{k}\right)  \right\}  =v_{p}\left(  n_{i}\right)  $ for
some $i\in\left\{  1,2,\ldots,k\right\}  $).

Now, assume (for the sake of contradiction) that the inequality
(\ref{pf.prop.pval.gcd-lcm-k.b.geq}) is strict (i.e., not an equality). Thus,%
\begin{equation}
v_{p}\left(  \ell\right)  >\max\left\{  v_{p}\left(  n_{1}\right)
,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}  .
\label{pf.prop.pval.gcd-lcm-k.b.geqq}%
\end{equation}
Hence, $v_{p}\left(  \ell\right)  >\max\left\{  v_{p}\left(  n_{1}\right)
,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}
\geq0$. Thus, we don't have $v_{p}\left(  \ell\right)  =0$. However, Corollary
\ref{cor.pval.vp-0} (applied to $n=\ell$) yields that $v_{p}\left(
\ell\right)  =0$ if and only if $p\nmid\ell$. Hence, we don't have $p\nmid
\ell$ (since we don't have $v_{p}\left(  \ell\right)  =0$). In other words, we
have $p\mid\ell$. Hence, $\ell/p\in\mathbb{Z}$.

Let $i\in\left\{  1,2,\ldots,k\right\}  $. Then,
(\ref{pf.prop.pval.gcd-lcm-k.b.geqq}) becomes%
\begin{align}
v_{p}\left(  \ell\right)   &  >\max\left\{  v_{p}\left(  n_{1}\right)
,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}
\nonumber\\
&  \geq v_{p}\left(  n_{i}\right)  . \label{pf.prop.pval.gcd-lcm-k.b.geqqi}%
\end{align}


Furthermore, $n_{i}\mid\ell$ (by (\ref{pf.prop.pval.gcd-lcm-k.b.nidl})), so
that $\dfrac{\ell}{n_{i}}\in\mathbb{Z}$ (since $n_{i}\neq0$ (because none of
$n_{1},n_{2},\ldots,n_{k}$ equals $0$)). Theorem \ref{thm.pval.vp-ring}
\textbf{(a)} yields $v_{p}\left(  n_{i}\cdot\dfrac{\ell}{n_{i}}\right)
=v_{p}\left(  n_{i}\right)  +v_{p}\left(  \dfrac{\ell}{n_{i}}\right)  $, so
that%
\[
v_{p}\left(  \dfrac{\ell}{n_{i}}\right)  =v_{p}\left(  \underbrace{n_{i}%
\cdot\dfrac{\ell}{n_{i}}}_{=\ell}\right)  -v_{p}\left(  n_{i}\right)
=\underbrace{v_{p}\left(  \ell\right)  }_{\substack{>v_{p}\left(
n_{i}\right)  \\\text{(by (\ref{pf.prop.pval.gcd-lcm-k.b.geqqi}))}}%
}-v_{p}\left(  n_{i}\right)  >v_{p}\left(  n_{i}\right)  -v_{p}\left(
n_{i}\right)  =0.
\]
Thus, we don't have $v_{p}\left(  \dfrac{\ell}{n_{i}}\right)  =0$. However,
Corollary \ref{cor.pval.vp-0} (applied to $n=\dfrac{\ell}{n_{i}}$) yields that
$v_{p}\left(  \dfrac{\ell}{n_{i}}\right)  =0$ if and only if $p\nmid
\dfrac{\ell}{n_{i}}$. Hence, we don't have $p\nmid\dfrac{\ell}{n_{i}}$ (since
we don't have $v_{p}\left(  \dfrac{\ell}{n_{i}}\right)  =0$). In other words,
we have $p\mid\dfrac{\ell}{n_{i}}$. Hence, $\dfrac{\ell}{n_{i}}/p\in
\mathbb{Z}$. In other words, $\dfrac{\ell/p}{n_{i}}\in\mathbb{Z}$ (since
$\dfrac{\ell}{n_{i}}/p=\dfrac{\ell/p}{n_{i}}$). In other words, $n_{i}\mid
\ell/p$ (since $\ell/p\in\mathbb{Z}$).

Forget that we fixed $i$. We thus have shown that $n_{i}\mid\ell/p$ for all
$i\in\left\{  1,2,\ldots,k\right\}  $. However, Theorem
\ref{thm.pval.gcd-lcm-uprops} \textbf{(b)} (applied to $b_{i}=n_{i}$ and
$m=\ell/p$) shows that this is equivalent to $\operatorname{lcm}\left(
n_{1},n_{2},\ldots,n_{k}\right)  \mid\ell/p$ (since $\ell/p\in\mathbb{Z}$).
Thus, we obtain \newline$\operatorname{lcm}\left(  n_{1},n_{2},\ldots
,n_{k}\right)  \mid\ell/p$. In view of $\operatorname{lcm}\left(  n_{1}%
,n_{2},\ldots,n_{k}\right)  =\ell$, this rewrites as $\ell\mid\ell/p$. Hence,
$\dfrac{\ell/p}{\ell}\in\mathbb{Z}$ (since $\ell$ is positive). But this
contradicts $\dfrac{\ell/p}{\ell}=\dfrac{1}{p}\notin\mathbb{Z}$. This
contradiction shows that our assumption (viz., that the inequality
(\ref{pf.prop.pval.gcd-lcm-k.b.geq}) is strict) was false. Hence, the
inequality (\ref{pf.prop.pval.gcd-lcm-k.b.geq}) cannot be strict, i.e., must
be an equality. In other words, we have%
\[
v_{p}\left(  \ell\right)  =\max\left\{  v_{p}\left(  n_{1}\right)
,v_{p}\left(  n_{2}\right)  ,\ldots,v_{p}\left(  n_{k}\right)  \right\}  .
\]
In view of $\ell=\operatorname{lcm}\left(  n_{1},n_{2},\ldots,n_{k}\right)  $,
this rewrites as%
\[
v_{p}\left(  \operatorname{lcm}\left(  n_{1},n_{2},\ldots,n_{k}\right)
\right)  =\max\left\{  v_{p}\left(  n_{1}\right)  ,v_{p}\left(  n_{2}\right)
,\ldots,v_{p}\left(  n_{k}\right)  \right\}  .
\]
Thus, Proposition \ref{prop.pval.gcd-lcm-k} \textbf{(b)} is proved.
\end{proof}

\begin{thebibliography}{99999999}                                                                                         %


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

\bibitem[Grinbe20]{20f}Darij Grinberg, \textit{Math 235: Mathematical Problem
Solving}, 10 August 2021.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/t/20f/mps.pdf}
\end{thebibliography}


\end{document}