\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, December 08, 2022 16:23:22}
%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 }}
\definecolor{darkgreen}{rgb}{0,.5,0}
\newtheoremstyle{plainsl}
{8pt plus 2pt minus 4pt}
{8pt plus 2pt minus 4pt}
{\slshape}
{0pt}
{\bfseries}
{.}
{5pt plus 1pt minus 1pt}
{}
\theoremstyle{plainsl}
\ihead{Lecture 16, version \today}
\ohead{page \thepage}
\cfoot{}
\begin{document}
\section*{Math 222 Fall 2022, Lecture 16: Binomial coefficients}

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

\setcounter{section}{1}

\section{Binomial coefficients (cont'd)}

\setcounter{subsection}{3}

\subsection{Counting maps}

We now return to the problem of counting maps. This time, we will focus on
maps with special properties.

\subsubsection{All maps}

In Theorem 1.5.6 (Lecture 11), we showed that $\left(  \text{\# of maps from
}A\text{ to }B\right)  =\left\vert B\right\vert ^{\left\vert A\right\vert }$
for any two finite sets $A$ and $B$. In other words:

\begin{theorem}
\label{thm.count.maps-all}Let $m,n\in\mathbb{N}$. Let $A$ be an $m$-element
set. Let $B$ be an $n$-element set. Then,%
\[
\left(  \text{\# of maps from }A\text{ to }B\right)  =n^{m}.
\]

\end{theorem}

\subsubsection{Injective maps}

Recall that a map is injective if and only if it sends distinct elements to
distinct values.

How many injective maps are there from a set $A$ to a set $B$ ? To state the
answer, we introduce a new notation:

\begin{definition}
\label{def.fall-factorial}Let $n\in\mathbb{R}$ and $k\in\mathbb{N}$. Then, the
\textbf{falling factorial} $n^{\underline{k}}$ is defined by%
\[
n^{\underline{k}}=n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-k+1\right)  =\prod_{i=0}^{k-1}\left(  n-i\right)  .
\]

\end{definition}

The falling factorial is also known as the \textbf{lower factorial} or the
\textbf{descending factorial}. Here are some simple properties:

\begin{proposition}
\label{prop.fall-factorial.props}Let $n\in\mathbb{R}$. Then:

\textbf{(a)} We have $n^{\underline{0}}=1$.

\textbf{(b)} We have $n^{\underline{1}}=n$.

\textbf{(c)} We have $n^{\underline{k}}=k!\cdot\dbinom{n}{k}$ for any
$k\in\mathbb{N}$.

\textbf{(d)} If $n\in\mathbb{N}$, then $n^{\underline{n}}=n!$.

\textbf{(e)} If $n\in\mathbb{N}$, and if $k\in\mathbb{N}$ satisfies $k>n$,
then $n^{\underline{k}}=0$.

\textbf{(f)} We have $n^{\underline{k}}\cdot\left(  n-k\right)
=n^{\underline{k+1}}$ for any $k\in\mathbb{N}$.
\end{proposition}

\begin{proof}
All of these are easy. (See Proposition 2.4.3 in the 2019 notes for details.)
\end{proof}

Now, we can count injective maps:

\begin{theorem}
\label{thm.count.maps-inj}Let $m,n\in\mathbb{N}$. Let $A$ be an $m$-element
set. Let $B$ be an $n$-element set. Then,%
\[
\left(  \text{\# of injective maps from }A\text{ to }B\right)
=n^{\underline{m}}.
\]

\end{theorem}

\begin{proof}
[Informal proof of Theorem \ref{thm.count.maps-inj}.]Let $a_{1},a_{2}%
,\ldots,a_{m}$ be the $m$ elements of $A$ (listed without repetition). Then, a
map $f:A\rightarrow B$ is uniquely determined by its values $f\left(
a_{1}\right)  ,f\left(  a_{2}\right)  ,\ldots,f\left(  a_{m}\right)  $, and
can be constructed by choosing these values arbitrarily, one by one. For this
map $f$ to be injective, these values have to be distinct. Thus, when choosing
its values, we need to ensure that%
\begin{align*}
f\left(  a_{1}\right)   &  \in B;\\
f\left(  a_{2}\right)   &  \in B\setminus\left\{  f\left(  a_{1}\right)
\right\}  ;\\
f\left(  a_{3}\right)   &  \in B\setminus\left\{  f\left(  a_{1}\right)
,f\left(  a_{2}\right)  \right\}  ;\\
f\left(  a_{4}\right)   &  \in B\setminus\left\{  f\left(  a_{1}\right)
,f\left(  a_{2}\right)  ,f\left(  a_{3}\right)  \right\}  ;\\
&  \ldots.
\end{align*}
This means that we can construct an injective map $f:A\rightarrow B$ by
choosing its $m$ values $f\left(  a_{1}\right)  ,f\left(  a_{2}\right)
,\ldots,f\left(  a_{m}\right)  $ one by one. How many options do we have in
this $m$-step procedure?

\begin{itemize}
\item For $f\left(  a_{1}\right)  $, we have $n$ options, since all $n$
elements of $B$ qualify.

\item For $f\left(  a_{2}\right)  $, we have $n-1$ options, since all $n$
elements of $B$ except for the already-chosen value $f\left(  a_{1}\right)  $ qualify.

\item For $f\left(  a_{3}\right)  $, we have $n-2$ options, since all $n$
elements of $B$ except for the two already-chosen values $f\left(
a_{1}\right)  $ and $f\left(  a_{2}\right)  $ qualify (and since these two
values $f\left(  a_{1}\right)  $ and $f\left(  a_{2}\right)  $ are distinct).

\item For $f\left(  a_{4}\right)  $, we have $n-3$ options, since all $n$
elements of $B$ except for the three already-chosen values $f\left(
a_{1}\right)  $, $f\left(  a_{2}\right)  $ and $f\left(  a_{3}\right)  $
qualify (and again since these three values are distinct).

\item $\cdots$.
\end{itemize}

In total, we thus have $n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(
n-m+1\right)  $ many possibilities. Thus, by the dependent product rule, we
get%
\[
\left(  \text{\# of injective maps }f:A\rightarrow B\right)  =n\left(
n-1\right)  \left(  n-2\right)  \cdots\left(  n-m+1\right)  =n^{\underline{m}%
}.
\]
This proves Theorem \ref{thm.count.maps-inj}.
\end{proof}

\bigskip

How can we make this proof rigorous? We could formalize the dependent product
rule and the above $m$-step procedure for constructing an injective map
$f:A\rightarrow B$, but it is easier to proceed differently, using induction
to \textquotedblleft pack\textquotedblright\ the first $m-1$ steps of the
$m$-step procedure into a single big step. This leads to the following more
formal proof:

\begin{proof}
[Formal proof of Theorem \ref{thm.count.maps-inj} (sketched).]Forget that we
fixed $m$, $n$, $A$ and $B$. If $A$ and $B$ are any two sets, then we let
$\operatorname*{Inj}\left(  A,B\right)  $ denote the set of all injective maps
from $A$ to $B$. Thus, we must prove that%
\begin{equation}
\left\vert \operatorname*{Inj}\left(  A,B\right)  \right\vert \overset{?}{=}%
n^{\underline{m}} \label{pf.thm.count.maps-inj.goal}%
\end{equation}
for any $m,n\in\mathbb{N}$ and any $m$-element set $A$ and any $n$-element set
$B$.

We shall prove (\ref{pf.thm.count.maps-inj.goal}) by induction on $m$:

\textit{Base case:} The equality (\ref{pf.thm.count.maps-inj.goal}) holds for
$m=0$. (Indeed, there is only one map from $\varnothing$ to $B$, and this map
is injective; thus, $\left\vert \operatorname*{Inj}\left(  \varnothing
,B\right)  \right\vert =1=n^{\underline{0}}$.)

\textit{Induction step:} Let $m$ be a positive integer. Let us assume that
(\ref{pf.thm.count.maps-inj.goal}) holds for $m-1$ instead of $m$. Let us now
prove (\ref{pf.thm.count.maps-inj.goal}) for $m$.

Thus, let $A$ be an $m$-element set, and let $B$ be an $n$-element set. We
want to prove that
\[
\left\vert \operatorname*{Inj}\left(  A,B\right)  \right\vert \overset{?}{=}%
n^{\underline{m}}.
\]


The set $A$ is nonempty, since its size is $\left\vert A\right\vert =m>0$. So
we can pick an element $a\in A$. Let us pick one and keep it fixed from now on.

Then, $A\setminus\left\{  a\right\}  $ is an $\left(  m-1\right)  $-element
set. Hence, by the induction hypothesis, we have%
\[
\left\vert \operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,\ B\right)  \right\vert =n^{\underline{m-1}}.
\]
It remains to connect $\operatorname*{Inj}\left(  A,B\right)  $ with
$\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}  ,\ B\right)  $.

The easiest way to do so is by restriction: For any map $f:A\rightarrow B$, we
can consider its \textbf{restriction} $f_{0}$ to the subset $A\setminus
\left\{  a\right\}  $. This restriction is simply the map that sends each
$x\in A\setminus\left\{  a\right\}  $ to $f\left(  x\right)  $. In other
words, the restriction $f_{0}$ is obtained from $f$ by \textquotedblleft
forgetting\textquotedblright\ the value $f\left(  a\right)  $.

For example,
\begin{align*}
\text{if }f  &  =%
%TCIMACRO{\TeXButton{tikz two eggs}{\begin{tikzpicture}
%\filldraw[fill=yellow!20!white] (0, 4) ellipse (1 and 1.7);
%\node(Aa) at (0, 5) {$a$};
%\node(Ab) at (0, 4) {$b$};
%\node(Ac) at (0, 3) {$c$};
%\filldraw[fill=yellow!20!white] (3, 3.5) ellipse (1 and 2.2);
%\node(Aname) at (0, 2) {$A$};
%\node(B1) at (3, 5) {$1$};
%\node(B2) at (3, 4) {$2$};
%\node(B3) at (3, 3) {$3$};
%\node(B4) at (3, 2) {$4$};
%\node(Bname) at (3, 1) {$B$};
%\draw[->, very thick, darkgreen] (Aa) -- (B2);
%\draw[->, very thick, darkgreen] (Ab) -- (B1);
%\draw[->, very thick, darkgreen] (Ac) -- (B4);
%\node(phinameR) at (1.5, 5) {$\color{darkgreen}{f}$};
%\end{tikzpicture}}}%
%BeginExpansion
\begin{tikzpicture}
\filldraw[fill=yellow!20!white] (0, 4) ellipse (1 and 1.7);
\node(Aa) at (0, 5) {$a$};
\node(Ab) at (0, 4) {$b$};
\node(Ac) at (0, 3) {$c$};
\filldraw[fill=yellow!20!white] (3, 3.5) ellipse (1 and 2.2);
\node(Aname) at (0, 2) {$A$};
\node(B1) at (3, 5) {$1$};
\node(B2) at (3, 4) {$2$};
\node(B3) at (3, 3) {$3$};
\node(B4) at (3, 2) {$4$};
\node(Bname) at (3, 1) {$B$};
\draw[->, very thick, darkgreen] (Aa) -- (B2);
\draw[->, very thick, darkgreen] (Ab) -- (B1);
\draw[->, very thick, darkgreen] (Ac) -- (B4);
\node(phinameR) at (1.5, 5) {$\color{darkgreen}{f}$};
\end{tikzpicture}%
%EndExpansion
\text{,}\\
& \\
\text{then }f_{0}  &  =%
%TCIMACRO{\TeXButton{tikz two eggs}{\begin{tikzpicture}
%\filldraw[fill=yellow!20!white] (0, 3.5) ellipse (1 and 1.3);
%\node(Ab) at (0, 4) {$b$};
%\node(Ac) at (0, 3) {$c$};
%\filldraw[fill=yellow!20!white] (3, 3.5) ellipse (1 and 2.2);
%\node(Aname) at (0, 1.9) {$A \setminus\left\{a\right\}$};
%\node(B1) at (3, 5) {$1$};
%\node(B2) at (3, 4) {$2$};
%\node(B3) at (3, 3) {$3$};
%\node(B4) at (3, 2) {$4$};
%\node(Bname) at (3, 1) {$B$};
%\draw[->, very thick, darkgreen] (Ab) -- (B1);
%\draw[->, very thick, darkgreen] (Ac) -- (B4);
%\node(phinameR) at (1.5, 5) {$\color{darkgreen}{f_0}$};
%\end{tikzpicture}}}%
%BeginExpansion
\begin{tikzpicture}
\filldraw[fill=yellow!20!white] (0, 3.5) ellipse (1 and 1.3);
\node(Ab) at (0, 4) {$b$};
\node(Ac) at (0, 3) {$c$};
\filldraw[fill=yellow!20!white] (3, 3.5) ellipse (1 and 2.2);
\node(Aname) at (0, 1.9) {$A \setminus\left\{a\right\}$};
\node(B1) at (3, 5) {$1$};
\node(B2) at (3, 4) {$2$};
\node(B3) at (3, 3) {$3$};
\node(B4) at (3, 2) {$4$};
\node(Bname) at (3, 1) {$B$};
\draw[->, very thick, darkgreen] (Ab) -- (B1);
\draw[->, very thick, darkgreen] (Ac) -- (B4);
\node(phinameR) at (1.5, 5) {$\color{darkgreen}{f_0}$};
\end{tikzpicture}%
%EndExpansion
\text{.}%
\end{align*}


Clearly, if a map $f:A\rightarrow B$ is injective, then so is its restriction
$f_{0}$. In other words, for every $f\in\operatorname*{Inj}\left(  A,B\right)
$, we have $f_{0}\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,\ B\right)  $.

This allows us to \textquotedblleft classify\textquotedblright\ maps
$f\in\operatorname*{Inj}\left(  A,B\right)  $ according to their restriction.
In particular, by the sum rule,%
\begin{align}
&  \left(  \text{\# of all }f\in\operatorname*{Inj}\left(  A,B\right)  \right)
\nonumber\\
&  =\sum_{g\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,\ B\right)  }\left(  \text{\# of all }f\in\operatorname*{Inj}\left(
A,B\right)  \text{ such that }f_{0}=g\right)  .
\label{pf.thm.count.maps-inj.4}%
\end{align}


We shall now try to compute the addends of the sum on the RHS.

Indeed, fix an injective map $g\in\operatorname*{Inj}\left(  A\setminus
\left\{  a\right\}  ,\ B\right)  $. How many injective maps $f\in
\operatorname*{Inj}\left(  A,B\right)  $ have restriction $f_{0}=g$ ?

We let $\operatorname{Im}g$ be the set of all values of $g$. This is also
known as the \textbf{image} (or \textbf{range}) of the map $g$, and can also
be denoted $g\left(  A\setminus\left\{  a\right\}  \right)  $. Since the map
$g$ is injective, all its values are distinct, so that it has exactly $m-1$
many values (since $\left\vert A\setminus\left\{  a\right\}  \right\vert
=m-1$). In other words, $\left\vert \operatorname{Im}g\right\vert =m-1$. Since
$\operatorname{Im}g$ is a subset of $B$, we have $\left\vert B\setminus
\operatorname{Im}g\right\vert =\underbrace{\left\vert B\right\vert }%
_{=n}-\underbrace{\left\vert \operatorname{Im}g\right\vert }_{=m-1}=n-\left(
m-1\right)  =n-m+1$.

Clearly, a map $f\in\operatorname*{Inj}\left(  A,B\right)  $ has restriction
$f_{0}=g$ if and only if its values on all elements of $A\setminus\left\{
a\right\}  $ coincide with the corresponding values of $g$. Thus, the only
freedom we have when we choose such a map is the freedom of choosing its
remaining value $f\left(  a\right)  $. In order for $f$ to be injective, this
value $f\left(  a\right)  $ must be distinct from all the existing values,
i.e., distinct from all the values of $g$. In other words, this value
$f\left(  a\right)  $ must come from the set $B\setminus\operatorname{Im}g$.
This leaves us $n-m+1$ options, since $\left\vert B\setminus\operatorname{Im}%
g\right\vert =n-m+1$.

Thus, we have convinced ourselves that an injective map $f\in
\operatorname*{Inj}\left(  A,B\right)  $ that has restriction $f_{0}=g$ can be
chosen in $n-m+1$ many ways. Hence,
\begin{equation}
\left(  \text{\# of all }f\in\operatorname*{Inj}\left(  A,B\right)  \text{
such that }f_{0}=g\right)  =n-m+1.\label{pf.thm.count.maps-inj.5}%
\end{equation}
(If you want this argument formalized further, you can rephrase it as an
application of the bijection principle\footnote{Namely: We argue that the map%
\begin{align*}
\left\{  f\in\operatorname*{Inj}\left(  A,B\right)  \ \mid\ f_{0}=g\right\}
&  \rightarrow B\setminus\operatorname{Im}g,\\
f &  \mapsto f\left(  a\right)
\end{align*}
(that is, the map that assigns to each injective map $f\in\operatorname*{Inj}%
\left(  A,B\right)  $ satisfying $f_{0}=g$ its value $f\left(  a\right)  $) is
a bijection. (The proof of this is elementary set-theoretical reasoning and
can be found in \S 2.4.2 of the 2019 notes.) Thus, the bijection principle
yields
\[
\left\vert \left\{  f\in\operatorname*{Inj}\left(  A,B\right)  \ \mid
\ f_{0}=g\right\}  \right\vert =\left\vert B\setminus\operatorname{Im}%
g\right\vert =n-m+1.
\]
In other words, $\left(  \text{\# of all }f\in\operatorname*{Inj}\left(
A,B\right)  \text{ such that }f_{0}=g\right)  =n-m+1$. This proves
(\ref{pf.thm.count.maps-inj.5}).}.)

We have proved (\ref{pf.thm.count.maps-inj.5}) for every $g\in
\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}  ,\ B\right)  $.
Therefore, (\ref{pf.thm.count.maps-inj.4}) becomes%
\begin{align*}
&  \left(  \text{\# of all }f\in\operatorname*{Inj}\left(  A,B\right)  \right)
\\
&  =\sum_{g\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,\ B\right)  }\underbrace{\left(  \text{\# of all }f\in\operatorname*{Inj}%
\left(  A,B\right)  \text{ such that }f_{0}=g\right)  }%
_{\substack{=n-m+1\\\text{(by (\ref{pf.thm.count.maps-inj.5}))}}}\\
&  =\sum_{g\in\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}
,\ B\right)  }\left(  n-m+1\right)  =\underbrace{\left\vert
\operatorname*{Inj}\left(  A\setminus\left\{  a\right\}  ,\ B\right)
\right\vert }_{\substack{=n^{\underline{m-1}}\\=n\left(  n-1\right)  \left(
n-2\right)  \cdots\left(  n-m+2\right)  }}\cdot\left(  n-m+1\right) \\
&  =n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(  n-m+2\right)
\cdot\left(  n-m+1\right) \\
&  =n\left(  n-1\right)  \left(  n-2\right)  \cdots\left(  n-m+1\right)
=n^{\underline{m}}.
\end{align*}
In other words, $\left\vert \operatorname*{Inj}\left(  A,B\right)  \right\vert
=n^{\underline{m}}$. This completes the induction step, and thus
(\ref{pf.thm.count.maps-inj.goal}) is proved. As we explained above, this
proves Theorem \ref{thm.count.maps-inj}.
\end{proof}

\subsubsection{The pigeonhole principles}

The \textbf{pigeonhole principles} are two fundamental facts about maps
between finite sets. We shall state them without proof here, since they are
common-sense. (A skeptical reader can find proofs in \S 2.4.3 of the 2019
notes.) We begin with the \textbf{pigeonhole principle for injections}:

\begin{theorem}
[Pigeonhole Principle for Injections]\label{thm.pigeon.inj}Let $A$ and $B$ be
two finite sets. Let $f:A\rightarrow B$ be an injective map. Then:

\textbf{(a)} We have $\left\vert A\right\vert \leq\left\vert B\right\vert $.

\textbf{(b)} If $\left\vert A\right\vert =\left\vert B\right\vert $, then $f$
is bijective.
\end{theorem}

Somewhat informally, this can be restated as follows:

\begin{statement}
\textbf{(a)} If $m$ pigeons are distributed in $n$ pigeonholes, and no two
pigeons share a hole\footnote{i.e., the map that sends each pigeon to its hole
is injective}, then $m\leq n$.

\textbf{(b)} If $n$ pigeons are distributed in $n$ pigeonholes, and no two
pigeons share a hole, then each hole has a pigeon in it\footnote{i.e., the map
that sends each pigeon to its hole is surjective}.
\end{statement}

Next comes a \textquotedblleft dual\textquotedblright\ variant of Theorem
\ref{thm.pigeon.inj} -- the \textbf{pigeonhole principle for surjections}:

\begin{theorem}
[Pigeonhole Principle for Surjections]\label{thm.pigeon.surj}Let $A$ and $B$
be two finite sets. Let $f:A\rightarrow B$ be a surjective map. Then:

\textbf{(a)} We have $\left\vert A\right\vert \geq\left\vert B\right\vert $.

\textbf{(b)} If $\left\vert A\right\vert =\left\vert B\right\vert $, then $f$
is bijective.
\end{theorem}

Somewhat informally, this can be restated as follows:

\begin{statement}
\textbf{(a)} If $m$ pigeons are distributed in $n$ pigeonholes, and no hole is
empty, then $m\geq n$.

\textbf{(b)} If $n$ pigeons are distributed in $n$ pigeonholes, and no hole is
empty, then no two pigeons share a hole.
\end{statement}

\begin{remark}
If we allow the sets $A$ and $B$ to be infinite, then parts \textbf{(a)} of
both pigeonhole principles (Theorem \ref{thm.pigeon.inj} and Theorem
\ref{thm.pigeon.surj}) remain valid (as long as we understand $\left\vert
A\right\vert $ and $\left\vert B\right\vert $ to be cardinalities), but parts
\textbf{(b)} both become false. (See Remark 2.4.8 in the 2019 notes for counterexamples.)
\end{remark}

The pigeonhole principles might look like the most trivial results in
mathematics, but they have a number of surprising applications. See
\cite[Chapter 6]{20f}, \cite{21f-2}, \cite[Chapter 1]{Bona17}, \cite[Chapter
4]{Engel}, \cite[Chapter 20]{AndDos} or \cite[\S 1.3]{GelAnd} for some
applications (or search for \textquotedblleft Pigeonhole
Principle\textquotedblright\ anywhere on the internet).

\subsubsection{Permutations}

Theorem 1.7.2 in Lecture 12 says that if $X$ is an $n$-element set (for
$n\in\mathbb{N}$), then%
\[
\left(  \text{\# of permutations of }X\right)  =n!.
\]
We can now formally prove this:

\begin{proof}
[Proof of Theorem 1.7.2.]The set $X$ is finite. Thus, by the Pigeonhole
Principle for Injections, every injective map $f:X\rightarrow X$ is bijective,
thus is a permutation of $X$. Conversely, every permutation of $X$ is
bijective, thus injective. Therefore,%
\[
\left\{  \text{permutations of }X\right\}  =\left\{  \text{injective maps from
}X\text{ to }X\right\}  .
\]
Hence,%
\begin{align*}
\left(  \text{\# of permutations of }X\right)   &  =\left(  \text{\# of
injective maps from }X\text{ to }X\right) \\
&  =n^{\underline{n}}\ \ \ \ \ \ \ \ \ \ \left(  \text{by Theorem
\ref{thm.count.maps-inj}}\right) \\
&  =n!\ \ \ \ \ \ \ \ \ \ \left(  \text{by Proposition
\ref{prop.fall-factorial.props} \textbf{(d)}}\right)  ,
\end{align*}
qed.
\end{proof}

\subsubsection{Surjective maps}

So much for counting injective maps. Counting surjective maps is harder. The
numbers will not have an explicit formula as nice as $n^{m}$ or
$n^{\underline{m}}$, so let us give them a name:

\begin{definition}
Let $m\in\mathbb{N}$ and $n\in\mathbb{N}$. Then, $\operatorname*{sur}\left(
m,n\right)  $ shall mean the \# of surjective maps from $\left[  m\right]  $
to $\left[  n\right]  $.
\end{definition}

For instance, $\operatorname*{sur}\left(  3,2\right)  =6$, because the
surjective maps from $\left[  3\right]  $ to $\left[  2\right]  $ (written in
one-line notation) are%
\[
\left(  1,1,2\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,2,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  1,2,2\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
2,1,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  2,1,2\right)
,\ \ \ \ \ \ \ \ \ \ \left(  2,2,1\right)  .
\]
(We have previously defined one-line notation only for permutations of
$\left[  n\right]  $, but we can similarly define it for maps from $\left[
m\right]  $ to $\left[  n\right]  $.)

We begin our study of surjective maps with a quasi-obvious fact:

\begin{proposition}
\label{prop.count.maps-surj}Let $m,n\in\mathbb{N}$. Let $A$ be an $m$-element
set. Let $B$ be an $n$-element set. Then,%
\[
\left(  \text{\# of surjective maps from }A\text{ to }B\right)
=\operatorname*{sur}\left(  m,n\right)  .
\]

\end{proposition}

\begin{proof}
Apply the isomorphism principle. (That is, we relabel the elements of $A$ as
$1,2,\ldots,m$, and we relabel the elements of $B$ as $1,2,\ldots,n$. The \#
of surjective maps from $A$ to $B$ clearly does not change when we do this.
Hence, the \# of surjective maps from $A$ to $B$ equals the \# of surjective
maps from $\left[  m\right]  $ to $\left[  n\right]  $; but the latter \# is
$\operatorname*{sur}\left(  m,n\right)  $.)
\end{proof}

\bigskip

The problem of computing $\operatorname*{sur}\left(  m,n\right)  $ is not that
easy, so we approach it by first finding some particular values (again using
the Iverson bracket notation):

\begin{proposition}
\textbf{(a)} We have $\operatorname*{sur}\left(  m,0\right)  =\left[
m=0\right]  $ for all $m\in\mathbb{N}$.

\textbf{(b)} We have $\operatorname*{sur}\left(  m,1\right)  =\left[
m\neq0\right]  =1-\left[  m=0\right]  $ for all $m\in\mathbb{N}$.

\textbf{(c)} We have $\operatorname*{sur}\left(  m,2\right)  =2^{m}-2+\left[
m=0\right]  $ for all $m\in\mathbb{N}$.

\textbf{(d)} We have $\operatorname*{sur}\left(  0,n\right)  =\left[
n=0\right]  $ for all $n\in\mathbb{N}$.

\textbf{(e)} We have $\operatorname*{sur}\left(  1,n\right)  =\left[
n=1\right]  $ for all $n\in\mathbb{N}$.

\textbf{(f)} We have $\operatorname*{sur}\left(  m,n\right)  =0$ whenever
$m<n$.
\end{proposition}

\begin{proof}
Try it yourself (and make sure your reasoning accounts for the empty set!).
For a detailed proof, see Proposition 2.4.12 in the 2019 notes.
\end{proof}

\begin{thebibliography}{99999999}                                                                                         %


\bibitem[20f]{20f}Darij Grinberg, \textit{Math 235: Mathematical Problem
Solving}, 25 December 2021.\newline\url{http://www.cip.ifi.lmu.de/~grinberg/t/20f/mps.pdf}

\bibitem[21f-2]{21f-2}Darij Grinberg, \textit{Math 235 Fall 2021, Worksheet 2:
The Pigeonhole Principles}, 5 October 2021.\newline\url{http://www.cip.ifi.lmu.de/~grinberg/t/21f/lec2.pdf}

\bibitem[AndDos10]{AndDos}\href{https://bookstore.ams.org/xyz-13}{Titu
Andreescu, Gabriel Dospinescu, \textit{Problems from the Book}, 2nd edition,
XYZ Press 2010}.

\bibitem[Bona17]{Bona17}\href{https://doi.org/10.1142/10258}{Mikl\'{o}s
B\'{o}na, \textit{A walk through combinatorics : an introduction to
enumeration and graph theory}, World Scientific 2017}.

\bibitem[Engel98]{Engel}%
\href{https://mathematicalolympiads.files.wordpress.com/2012/08/75427434-problem-books-in-mathematics-problem-solving-strategies.pdf}{Arthur
Engel, \textit{Problem-Solving Strategies}, Springer 1998}.

\bibitem[GelAnd17]{GelAnd}%
\href{https://doi.org/10.1007/978-3-319-58988-6}{R\u{a}zvan Gelca, Titu
Andreescu, \textit{Putnam and Beyond}, 2nd edition, Springer 2017}.
\end{thebibliography}


\end{document}